-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension.php
332 lines (285 loc) · 8.8 KB
/
extension.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<?php
/**
* Part of the Platform application.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file. It is also available at
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
*
* @package Platform
* @version 2.0.0
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011 - 2013, Cartalyst LLC
* @link http://cartalyst.com
*/
use Cartalyst\Extensions\ExtensionInterface;
use Illuminate\Foundation\Application;
return [
/*
|--------------------------------------------------------------------------
| Name
|--------------------------------------------------------------------------
|
| This is your extension name and it is only required for
| presentational purposes.
|
*/
'name' => 'Channels',
/*
|--------------------------------------------------------------------------
| Slug
|--------------------------------------------------------------------------
|
| This is your extension unique identifier and should not be changed as
| it will be recognized as a new extension.
|
| Ideally, this should match the folder structure within the extensions
| folder, but this is completely optional.
|
|
*/
'slug' => 'makbash/channels',
/*
|--------------------------------------------------------------------------
| Author
|--------------------------------------------------------------------------
|
| Because everybody deserves credit for their work, right?
|
*/
'author' => 'Mustafa Akbaş',
/*
|--------------------------------------------------------------------------
| Description
|--------------------------------------------------------------------------
|
| One or two sentences describing the extension for users to view when
| they are installing the extension.
|
*/
'description' => 'Kanallar',
/*
|--------------------------------------------------------------------------
| Version
|--------------------------------------------------------------------------
|
| Version should be a string that can be used with version_compare().
| This is how the extensions versions are compared.
|
*/
'version' => '0.1.0',
/*
|--------------------------------------------------------------------------
| Requirements
|--------------------------------------------------------------------------
|
| List here all the extensions that this extension requires to work.
| This is used in conjunction with composer, so you should put the
| same extension dependencies on your main composer.json require
| key, so that they get resolved using composer, however you
| can use without composer, at which point you'll have to
| ensure that the required extensions are available.
|
*/
'require' => array(
'platform/admin',
'platform/attributes',
),
/*
|--------------------------------------------------------------------------
| Autoload Logic
|--------------------------------------------------------------------------
|
| You can define here your extension autoloading logic, it may either
| be 'composer', 'platform' or a 'Closure'.
|
| If composer is defined, your composer.json file specifies the autoloading
| logic.
|
| If platform is defined, your extension receives convetion autoloading
| based on the Platform standards.
|
| If a Closure is defined, it should take two parameters as defined
| bellow:
|
| object \Composer\Autoload\ClassLoader $loader
| object \Illuminate\Foundation\Application $app
|
| Supported: "composer", "platform", "Closure"
|
*/
'autoload' => 'composer',
/*
|--------------------------------------------------------------------------
| Register Callback
|--------------------------------------------------------------------------
|
| Closure that is called when the extension is registered. This can do
| all the needed custom logic upon registering.
|
| The closure parameters are:
|
| object \Cartalyst\Extensions\ExtensionInterface $extension
| object \Illuminate\Foundation\Application $app
|
*/
'register' => function(ExtensionInterface $extension, Application $app)
{
},
/*
|--------------------------------------------------------------------------
| Boot Callback
|--------------------------------------------------------------------------
|
| Closure that is called when the extension is booted. This can do
| all the needed custom logic upon booting.
|
| The closure parameters are:
|
| object \Cartalyst\Extensions\ExtensionInterface $extension
| object \Illuminate\Foundation\Application $app
|
*/
'boot' => function(ExtensionInterface $extension, Application $app)
{
},
/*
|--------------------------------------------------------------------------
| Routes
|--------------------------------------------------------------------------
|
| Closure that is called when the extension is started. You can register
| any custom routing logic here.
|
| The closure parameters are:
|
| object \Cartalyst\Extensions\ExtensionInterface $extension
| object \Illuminate\Foundation\Application $app
|
*/
'routes' => function(ExtensionInterface $extension, Application $app)
{
Route::group(['prefix' => admin_uri().'/channels'], function()
{
Route::get('/', 'Makbash\Channels\Controllers\Admin\ChannelsController@index');
});
},
/*
|--------------------------------------------------------------------------
| Database Seeds
|--------------------------------------------------------------------------
|
| Platform provides a very simple way to seed your database with test
| data using seed classes. All seed classes should be stored on the
| `database/seeds` directory within your extension folder.
|
| The order you register your seed classes on the array below
| matters, as they will be ran in the exact same order.
|
| The seeds array should follow the following structure:
|
| Vendor\Namespace\Database\Seeds\FooSeeder
| Vendor\Namespace\Database\Seeds\BarSeeder
|
*/
'seeds' => [
],
/*
|--------------------------------------------------------------------------
| Permissions
|--------------------------------------------------------------------------
|
| List of permissions this extension has. These are shown in the user
| management area to build a graphical interface where permissions
| may be selected.
|
| The admin controllers state that permissions should follow the following
| structure:
|
| Vendor\Namespace\Controller@method
|
| For example:
|
| Platform\Users\Controllers\Admin\UsersController@index
|
| These are automatically generated for controller routes however you are
| free to add your own permissions and check against them at any time.
|
| When writing permissions, if you put a 'key' => 'value' pair, the 'value'
| will be the label for the permission which is displayed when editing
| permissions.
|
*/
'permissions' => function()
{
return [
'Makbash\Channels\Controllers\Admin\ChannelsController@index' => 'List Channels',
];
},
/*
|--------------------------------------------------------------------------
| Widgets
|--------------------------------------------------------------------------
|
| Closure that is called when the extension is started. You can register
| all your custom widgets here. Of course, Platform will guess the
| widget class for you, this is just for custom widgets or if you
| do not wish to make a new class for a very small widget.
|
*/
'widgets' => function()
{
},
/*
|--------------------------------------------------------------------------
| Settings
|--------------------------------------------------------------------------
|
| Register any settings for your extension. You can also configure
| the namespace and group that a setting belongs to.
|
*/
'settings' => function()
{
},
/*
|--------------------------------------------------------------------------
| Menus
|--------------------------------------------------------------------------
|
| You may specify the default various menu hierarchy for your extension.
| You can provide a recursive array of menu children and their children.
| These will be created upon installation, synchronized upon upgrading
| and removed upon uninstallation.
|
| Menu children are automatically put at the end of the menu for extensions
| installed through the Operations extension.
|
| The default order (for extensions installed initially) can be
| found by editing app/config/platform.php.
|
*/
'menus' => [
'admin' => [
[
'slug' => 'admin-makbash-channels',
'name' => 'Channels',
'class' => 'fa fa-circle-o',
'uri' => 'channels',
],
],
'main' => [
[
'slug' => 'main-makbash-channels',
'name' => 'Channels',
'class' => 'fa fa-circle-o',
'uri' => 'channels',
],
],
],
];