/** * compile less */ private static function compile_less() { $return_message = ''; $configs = \Config::get('less.less_source_files'); foreach ($configs as $config) { \Asset::less($config, array(), null, false, true); $return_message .= 'Compile ' . $config . PHP_EOL; } return $return_message; }
public function action_index() { if (!Sentry::user()->has_access('users_index')) { Session::set_flash('error', 'You DO NOT have access to the user list'); Response::redirect(''); } $this->template->less = Asset::less(array('customic.less')); $this->template->js .= Asset::js(array('mylibs/jquery.dataTables.js', 'mylibs/jquery-fallr-1.2.js')); $this->template->css = Asset::css(array('sprite.tables.css')); $data['users'] = Sentry::user()->all(); $this->template->js .= Asset::js(array('script.js')); $this->template->h2 = 'List of users'; $this->template->title = 'User » Index'; $this->template->content = View::forge('users/index', $data); }
public function before() { // check right accesses if (!Sentry::user()->has_access('customers_index')) { self::no_access(); } // inherit parent parent::before(); $this->languages = array(); if (Sentry::user()->has_access('customers_en')) { array_push($this->languages, 'en'); } if (Sentry::user()->has_access('customers_ru')) { array_push($this->languages, 'ru'); } if (Sentry::user()->has_access('customers_cn')) { array_push($this->languages, 'cn'); } if (Sentry::user()->has_access('customers_tw')) { array_push($this->languages, 'tw'); } View::set_global('language', $this->languages); // assets $this->template->js = Asset::js(array('mylibs/jquery.chosen.js', 'mylibs/jquery.ba-resize.js', 'mylibs/jquery.easing.1.3.js', 'mylibs/jquery.ui.touch-punch.js', '/mylibs/jquery.jgrowl.js', 'mylibs/jquery-fallr-1.2.js', 'script.js', 'mylibs/jquery.dataTables.1.9.4.min.js', 'mylibs/dataTables/jquery.jeditable.js', 'mylibs/dataTables/jquery.dataTables.editable.js', 'mylibs/dataTables/ColVis.js', 'mylibs/dataTables/ZeroClipboard.js', 'mylibs/dataTables/TableTools.min.js', 'mylibs/dataTables/FixedHeader.min.js', 'libs/date.js', 'datatables.configuration.js')); $this->template->css = Asset::css(array('external/jquery-ui-1.8.16.custom.css', 'ColVis.css', 'TableTools.css', 'sprite.tables.css')); $this->template->less = Asset::less(array('customic.less')); // set the global to get the table url, name, clean name // View::set_global('current_table',$this->current_table(Request::active()->action)); // $this->current_table = $this->current_table(Request::active()->action); if (!empty(Request::active()->method_params)) { View::set_global('current_table', $this->current_table(Request::active()->method_params[0])); $this->current_table = $this->current_table(Request::active()->method_params[0]); } else { View::set_global('current_table', $this->current_table(Request::active()->action)); $this->current_table = $this->current_table(Request::active()->action); } $this->template->h2 = $this->current_table['cleanName']; }
protected static function setup_assets() { if (!is_dev_env()) { return; } if (IS_API) { return; } $configs = \Config::get('less.less_source_files'); foreach ($configs as $config) { //compile less Asset::less($config); } }