예제 #1
0
 /**
  * Init function
  *
  * @param int $id
  */
 public function init($id = null)
 {
     $this->data['moduleId'] = \Input::get('module_id') ?: $id;
     $this->data['nextAutoIncrement'] = AdminController::getNextAutoIncrement('fields');
     $this->data['folders'] = Folder::get();
     if (is_numeric($this->data['moduleId'])) {
         $this->data['module'] = Module::find($id);
         $this->data['fields'] = $this->data['module']->fields;
         $this->data['fieldsJson'] = $this->data['fields']->toJson();
         $this->data['isFolder'] = isset($this->data['module']->is_folder) && $this->data['module']->is_folder == 1;
     }
 }
예제 #2
0
<?php

/**
 * Routes
 */
Route::group(array('before' => 'is_admin'), function () {
    // Route that handles Ajax requests made by jstree plugin
    Route::controller('admin/jstree/{table?}', '\\Orangehill\\Photon\\JsTreeController');
    // Route that feeds jstree plugin with initial settings
    Route::controller('admin/jstree-settings', '\\Orangehill\\Photon\\JsTreeSettingsController');
    // Route that feeds jstree plugin with initial settings
    Route::controller('admin/settings/{id?}', '\\Orangehill\\Photon\\SettingsController');
    // Testing route
    Route::any('admin/test', '\\Orangehill\\Photon\\TestController@index');
    // Creator REST controller
    Route::controller('/admin/creator', '\\Orangehill\\Photon\\CreatorController');
    // DB info controller
    Route::controller('/admin/dbinfo', '\\Orangehill\\Photon\\DbinfoController');
    Route::post('admin/{module}', '\\Orangehill\\Photon\\ModuleController@createEntry');
    Route::get('admin/{module}', '\\Orangehill\\Photon\\ModuleController@moduleIndex');
    Route::controller('admin/resource/media/{tableName}/{fieldName}/{entryId}/{resourceName}', '\\Orangehill\\Photon\\ResourceController');
    Route::controller('admin/{module}/{id}', '\\Orangehill\\Photon\\ModuleController');
    // Main admin resource controller
    Route::controller('admin', '\\Orangehill\\Photon\\AdminController');
});
// View Composers
View::composer('photon::common.main-menu', function ($view) {
    // Get main menu items
    $view->with('mainMenu', \Orangehill\Photon\AdminController::getMainMenu());
});