public function localize() { if ($this->field === TableConst::COLUMN_ACTIONS) { return Language::get('table.' . TableConst::COLUMN_ACTIONS); } return Language::get(Platform::getModule() . '.table.' . $this->field); }
public function load() { $items = Config::get(Platform::getPackageName() . '::navigation'); foreach ($items as $slug => $url) { $this->item($slug, $url); } }
public function localize() { if ($this->slug === Form::MAIN) { return Language::get('ui.main_panel'); } else { return Language::get(Platform::getModule() . '.panels.' . $this->slug); } }
public function namespaced($key, $custom = false) { if ($custom) { return self::NS . '::' . $key; } else { return Platform::getPackageName() . '::' . $key; } }
public function __construct(Repository $source = null) { if (!isset($source)) { $driver = 'Spescina\\PlatformCore\\Repositories\\' . ucfirst(Config::get(Platform::getPackageName() . '::database.driver')); $source = new $driver(); } $this->source = $source; $this->setTable($this->table); }
private function set($column, $sort, $module = null) { $this->column = $column; $this->sort = $sort; if ($module) { $this->module = $module; } else { $this->module = Platform::getModule(); } }
public function url() { if (isset($this->options['url'])) { return $this->options['url']; } $id = array_key_exists('id', $this->options) ? $this->options['id'] : null; $queryString = array_key_exists('queryString', $this->options) ? $this->options['queryString'] : null; $url = URL::route('module', array(Platform::getModule(), $this->type, $id)); if (count($queryString)) { $url .= '?' . http_build_query($queryString); } return $url; }
<?php /* |-------------------------------------------------------------------------- | Application Response Macros |-------------------------------------------------------------------------- */ use Spescina\PlatformCore\Components\Action\Action as ActionConst; use Spescina\PlatformCore\Facades\Platform; Response::macro('showForm', function ($objId = null, $withInput = false) { $response = Redirect::route('module', array(Platform::getModule(), ActionConst::ACTION_SHOWFORM, $objId)); if ($withInput) { $response->withInput(); } return $response; }); Response::macro('listing', function () { return Redirect::route('module', array(Platform::getModule(), ActionConst::ACTION_LISTING)); });
public function localize($section) { return Language::get(Platform::getModule() . '.section.' . $section); }
<?php /* |-------------------------------------------------------------------------- | Application & Route Filters |-------------------------------------------------------------------------- | | Below you will find the "before" and "after" events for the application | which may be used to do any work before or after a request into your | application. Here you may also register your custom route filters. | */ use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Route; use Spescina\PlatformCore\Facades\Platform; App::before(function ($request) { Route::match(array('GET', 'POST'), '{model}/{action?}/{id?}', array('as' => 'module', function ($module, $action = 'listing', $id = null) { return Platform::runModule($module, $action, $id); }))->where(array('model' => '[a-z]+', 'action' => '[a-z]+', 'id' => '[0-9]+')); }); Route::filter('platform-core', function () { });
public function localize($label) { $key = Platform::getModule() . '.form._labels_.' . $this->slug . '.' . $label; return Language::get($key); }
public function localize() { return Language::get(Platform::getModule() . '.form.' . $this->slug); }
public function applicable() { return $this->module === Platform::getModule(); }
protected function doListing() { Page::toolbar()->add('add', array('action' => 'form', 'label' => 'add')); return View::make(Platform::getPackageName() . '::listing'); }
private function paginate($query) { $paging = Config::get(Platform::getPackageName() . '::table.pagination'); return $query->paginate($paging); }
public function load() { $this->item('root'); $this->item(Platform::getModule()); }