public function parseAssets($rowset, $characterID, $containerID) { //echo "Working on container: $containerID <br>"; foreach ($rowset as $item) { if ($item->count() > 0) { //echo "Triggered next nest. Count = {$rowset->count()} <br>"; $this->parseAssets($item->rowset->row, $characterID, $item->attributes()->itemID); } if (isset($item->attributes()->locationID)) { $locationName = $this->getLocationName($item->attributes()->locationID); } $invType = Invtypes::Model()->findByPk($item->attributes()->typeID); $asset = new Assets(); $asset->characterID = $characterID; $asset->itemID = $item->attributes()->itemID; $asset->locationID = $item->attributes()->locationID; $asset->typeID = $item->attributes()->typeID; $asset->quantity = $item->attributes()->quantity; $asset->flag = $item->attributes()->flag; $asset->singleton = $item->attributes()->singleton; $asset->containerID = $containerID; $asset->locationName = $locationName; $asset->typeName = $invType->typeName; $asset->groupID = $invType->groupID; try { $asset->save(); //echo "Item: {$asset->itemID} {$asset->typeName} Character: {$asset->characterID} Container: {$asset->containerID} <br>"; } catch (Exception $e) { //echo "ERROR: Item {$asset->itemID} <br>"; //echo "Item: {$asset->itemID} {$asset->typeName} Character: {$asset->characterID} Container: {$asset->containerID} <br>"; //$message = $e->getMessage(); //echo "Exception: $message <br>"; } } }
/** * @return array */ public function getFunctions() { $options = ['is_safe' => ['html']]; return [new \Twig_SimpleFunction('test', function () { $this->assets->addCss('@plugin/test/assets/test.css'); echo "TEST."; }, $options)]; }
function resource($file, $level = '', $display = 'url', $params = '') { include_once APPPATH . 'libraries/Assets.php'; $assets = new Assets(); if ($display === 'url') { return $assets->url($file, $level); } elseif ($display === 'file') { return $assets->load($file, $level, $params); } else { return $assets->url($file, $level); } }
public function show($options = array(), $data) { // dump($data);die; $name = $data['field_name']; $path = site_url("admin/" . $data['options']->path . "/ajax_execute/order_box"); $js = <<<EOT \t\t\t\$(".order_box").change(function(){ \t\t\t\tdata_send = { \t\t\t\t\t"field_name" : \$(this).attr("order_box_field"), \t\t\t\t\t"pk"\t\t: \$(this).attr("order_box_pk"), \t\t\t\t\t"pk_val"\t : \$(this).attr("order_box_id"), \t\t\t\t\t"value"\t : \$(this).val() \t\t\t\t}; \t\t\t\t\$.getJSON('{$path}', data_send, function(data) { \t\t\t\t\t // alert(JSON.stringify(data)); \t\t\t\t}); \t\t\t}); \t\t\t\t\t EOT; Assets::add_js($js, "inline", true); // dump($data);die; return "<input class='order_box' name='' value='{$data['value']}' order_box_id='{$data['pk']}' min='0' max='99' order_box_pk='{$data['pk_name']}' order_box_field='{$data['field_name']}' type='number' style='max-width: 30px;' />"; }
public function test_inline() { $assets = Assets::factory('test_name')->process(FALSE)->css('test.css')->js('test.js'); $inline = $assets->inline(); $this->assertContains('.test { display: block; }', $inline); $this->assertContains('var test;', $inline); }
function enqueue_manage_post_assets() { $WP = \EzFilter\getWpObject(); $post_types = $WP->getSettings('post_types'); if (!in_array($WP->typenow, $post_types)) { return false; } $assetsToEnqueue = array(); $remove_default = $WP->removeDefaultFilter(); $post_type_settings = $WP->getSettings($WP->typenow); $post_type_settings = isset($post_type_settings['config']) ? $post_type_settings['config'] : array(); if (in_array('date_range', $post_type_settings)) { $assetsToEnqueue['css'][$WP->plugin_domain . "-post-css"] = $WP->plugin_domain . "-post-css"; $assetsToEnqueue['css']['jquery-style'] = 'jquery-style'; $assetsToEnqueue['js']['jquery'] = 'jquery'; $assetsToEnqueue['js']['jquery-ui-core'] = 'jquery-ui-core'; $assetsToEnqueue['js']['jquery-ui-datepicker'] = 'jquery-ui-datepicker'; $assetsToEnqueue['js'][$WP->plugin_domain . "-post-js"] = $WP->plugin_domain . "-post-js"; } if ($remove_default) { $assetsToEnqueue['css'][$WP->plugin_domain . "-post-css"] = $WP->plugin_domain . "-post-css"; $assetsToEnqueue['js']['jquery'] = 'jquery'; $assetsToEnqueue['js'][$WP->plugin_domain . "-post-js"] = $WP->plugin_domain . "-post-js"; } Assets::enqueue_assets($assetsToEnqueue); return true; }
function viewAction() { $clearArray = array('flags'); $this->filter($clearArray); if (empty($this->params)) { $today = date("d.m.Y"); $this->params['dates'] = $today . '-' . $today; } $pagination = new Pagination(array('action' => $this->action, 'controller' => $this->controller, 'params' => $this->params, 'ajax' => true)); $models = AFActiveDataProvider::models('ProspectEmail', $this->params, $pagination); $dataProvider = $models->getAll(); $filterFields = $models->getoutFilterFields($clearArray, array('dates')); // set ajax table if (AF::isAjaxRequestModels()) { $this->view->includeFile('_table', array('application', 'views', 'emails'), array('access' => $this->access, 'controller' => $this->controller, 'dataProvider' => $dataProvider, 'pagination' => $pagination, 'filterFields' => $filterFields)); die; } $campaigns = Campaign::model()->cache()->findAllInArray(); $templates = Template::model()->cache()->findAllInArray(); $flags = ProspectEmail::getEmailFlags(); /* $campaignsFilter = $models->getFilterCampaigns(); $templatesFilter = $models->getFilterTemplates(); $flagsFilter = $models->getFilterFlags(); */ Assets::css('jquery-ui'); Assets::js('jquery-ui'); Assets::js('dateRange/jquery.daterange'); Assets::js('ajax_table'); Assets::js('af_input_field'); $this->addToPageTitle(__('prospect_emails')); $this->render('view', array('dataProvider' => $dataProvider, 'pagination' => $pagination, 'models' => $models, 'filterFields' => $filterFields, 'campaigns' => $campaigns, 'templates' => $templates, 'flags' => $flags)); }
public function index(array $params = []) { Assets::addCSS('svgtree-0.3.0.min.css'); Assets::addCSS('main.css'); Assets::addJS('jsrender.min.js'); Assets::addJS('db.js'); Assets::addJS('main.js'); Assets::addJS('search.js'); Assets::addJS('svgtree-0.3.0.min.js'); Assets::addJS('trees.js'); $this->SearchModel = $this->loader->loadModel('Search'); if (isset($_POST['words'])) { $words = json_decode($_POST['words']); $results = $this->SearchModel->searchFromKeywords($words); $response = []; // if we have some results to handle if ($results) { // count values $results = array_count_values($results); // sort by count arsort($results); // keep only sorted links id $results = array_keys($results); foreach ($results as $linkId) { $link = $this->SearchModel->getLink($linkId); if ($link) { $response[] = $link; } } } echo json_encode($response); exit; } $this->loader->loadView('index', $this->data, true); }
function updateAction() { $model = new Domain(); // Uncomment the following line if AJAX validation is needed $this->performAjaxValidation($model); if (AF::isAjaxRequest() && isset($_POST['model']) && $_POST['model'] == 'Domain') { $model->fillFromArray($_POST, false); if ($model->save()) { Message::echoJsonSuccess(__('domain_updated')); } else { Message::echoJsonError(__('domain_not_updated')); } die; } $id = AF::get($this->params, 'id', FALSE); if (!$id) { throw new AFHttpException(0, 'no_id'); } if (!$model->cache()->findByPk($id)) { throw new AFHttpException(0, 'incorrect_id'); } Assets::js('jquery.form'); $this->addToPageTitle(__('update_domain')); $this->render('update', array('model' => $model)); }
function welcomeAction() { $filterFields = array(); $dataProvider = array(); if ($this->access->actionAccess('dashboard')) { if (!isset($this->params['dates'])) { //$dataFrom=mktime(0, 0, 0, date("m"), date("d")-1, date("Y")); $fromDate = date("d.m.Y"); $this->params['dates'] = $fromDate . '-' . $fromDate; } $models = AFActiveDataProvider::models('Order', $this->params); $dataProvider = $models->dashboard(); $filterFields = $models->getoutFilterFields(array(), array('dates')); // set ajax table if (AF::isAjaxRequestModels()) { $this->view->includeFile('_dashboard', array('application', 'views', 'home'), array('access' => $this->access, 'controller' => $this->controller, 'dataProvider' => $dataProvider, 'filterFields' => $filterFields)); die; } Assets::css('jquery-ui'); Assets::js('jquery-ui'); Assets::js('dateRange/jquery.daterange'); Assets::js('ajax_table'); Assets::js('//www.google.com/jsapi'); } $this->addToPageTitle(__('welcome')); $this->render('welcome', array('dataProvider' => $dataProvider, 'filterFields' => $filterFields)); }
public function create_form($fields_data = false) { $this->table_structure = $this->get_table_structure(); Assets::add_js("jasny-bootstrap.min.js"); Assets::add_js("modernizr-2.5.3.js"); Assets::add_css("jasny-bootstrap.min.css"); $hiddens = array(); //hiddens only on update if ($fields_data !== FALSE) { $primary_key = $this->get_primary_key(); $hiddens = array($primary_key => $fields_data->{$primary_key}); } $form = ""; $form .= form_open_multipart($this->ci->uri->uri_string(), 'class="form-horizontal" name="form_upload"', $hiddens); foreach ($this->table_structure as $field_info) { if ($this->can_show_input($field_info)) { $form .= $this->generate_input($field_info, $fields_data); } } // AFTER CREATE THE FORM, WE WILL INSERT HERE THE COMPONENTS if (isset($this->config->components)) { foreach ($this->config->components as $component_name => $component_configurations) { $component_configurations = $this->get_default_config($component_configurations); $component_lib = $this->ci->load->library("components/{$component_name}", $component_configurations); $form .= $component_lib->generate(); } } $cancel_link = anchor(SITE_AREA . $this->get_path(), "Cancelar", "class='btn btn-warning'"); $form .= "\n\t\t <fieldset>\n\t\t <div class='form-actions'>\n\t\t <br/>\n\t\t <input type='submit' name='save' class='btn btn-success' value='Salvar' />\n\t\t <input type='submit' name='save' class='btn btn-success' value='Salvar e continuar' />\n\t\t <!--<input type='submit' name='draft' class='btn btn-primary' value='Rascunho' />-->\n\t\t {$cancel_link}\n\t\t </div>\n\t\t </fieldset>\n\t\t"; $form .= form_close(); return $form; }
/** * Create an instance of this class by using a plain PHP array. * * @param array $conf an array containing the configuration * settings * @param string $path the path to the config file that was used * (NULL if instantiated via constructor) */ function __construct($conf = array(), $path = NULL) { global $ABSOLUTE_PATH_STUDIP; $defaults = array('assets_root' => "{$ABSOLUTE_PATH_STUDIP}assets", 'package_path' => "{$ABSOLUTE_PATH_STUDIP}assets/squeezed", 'package_url' => \Assets::url('squeezed'), 'javascripts' => array(), 'compress' => true, 'compressor_options' => array()); $this->settings = array_merge($defaults, $conf); $this->settings['config_path'] = $path ?: __FILE__; }
function updateAction() { $model = new Affiliate(); $this->performAjaxValidation($model); // Uncomment the following line if AJAX validation is needed if (isset($_POST['ajax'])) { $model->fillFromArray($_POST, FALSE); $model->user_id_updated = $this->user->user_id; $model->updated = 'NOW():sql'; $model->model_uset_id = $this->user->user_id; if ($model->save()) { Message::echoJsonSuccess(__('affiliate_updated')); } else { Message::echoJsonError(__('affiliate_no_updated')); } die; } $id = AF::get($this->params, 'id', FALSE); if (!$id) { throw new AFHttpException(0, 'no_id'); } if (!$model->cache()->findByPk($id)) { throw new AFHttpException(0, 'incorrect_id'); } $pagination = new Pagination(array('action' => $this->action, 'controller' => $this->controller, 'params' => $this->params)); Assets::js('jquery.form'); $this->addToPageTitle('Update affiliate'); $this->render('update', array('model' => $model, 'pagination' => $pagination)); }
function viewAction() { $clearArray = array('action', 'section'); $this->filter($clearArray); if (!isset($this->params['dates'])) { //$dataFrom=mktime(0, 0, 0, date("m"), date("d"), date("Y")-2); //$fromDate = date("d.m.Y", $dataFrom); $today = date("d.m.Y"); $this->params['dates'] = $today . '-' . $today; } $pagination = new Pagination(array('action' => $this->action, 'controller' => $this->controller, 'params' => $this->params, 'ajax' => true)); $models = AFActiveDataProvider::models('Log', $this->params, $pagination); $dataProvider = $models->getAll(); $filterFields = $models->getoutFilterFields($clearArray, array('dates')); // set ajax table if (AF::isAjaxRequestModels()) { $this->view->includeFile('_table', array('application', 'views', 'logs'), array('access' => $this->access, 'controller' => $this->controller, 'dataProvider' => $dataProvider, 'pagination' => $pagination, 'filterFields' => $filterFields)); die; } $this->addToPageTitle('Logs'); Assets::css('jquery-ui'); Assets::js('jquery-ui'); Assets::js('dateRange/jquery.daterange'); Assets::js('ajax_table'); Assets::js('af_input_field'); $this->render('view', array('dataProvider' => $dataProvider, 'pagination' => $pagination, 'models' => $models, 'filterFields' => $filterFields)); }
public function actionStoreValue() { $id = $_GET['id']; $asset = Assets::Model()->findByPk($id); $this->storeSingleAssetValue($asset->typeID); $this->renderPartial('storeValue'); }
public function after() { View::set_global('title', $this->title); View::set_global('keywords', $this->keywords); View::set_global('meta_title', $this->meta_title); View::set_global('meta_description', $this->meta_description); View::set_global('og_title', $this->og_title); View::set_global('og_image', $this->og_image); View::set_global('og_description', $this->og_description); View::set_global('twitter_title', $this->twitter_title); View::set_global('twitter_image', $this->twitter_image); View::set_global('twitter_description', $this->twitter_description); View::set_global('asets', $this->_assets->render()); View::set_global('breadcrumbs', $this->_breadcrumbs); parent::after(); }
public function __construct() { parent::__construct(); // Set default javascript $this->template->append_metadata(Assets::adminJs('main', 'js')); // Show login page $current_page = $this->uri->segment(1, '') . '/' . $this->uri->segment(2, 'index'); if (!$this->ion_auth->logged_in()) { if ($current_page != 'admin/login') { redirect('admin/login'); } } //Set theme for backend $this->template->set_partial('sidebar', 'admin/sidebar')->set_partial('head', 'admin/head')->enable_parser(FALSE)->set_layout('main', 'admin'); // Check access $currentModule = $this->router->fetch_module(); $accessGranted = $this->ion_auth->check_access(get_module_id($currentModule), 'admin'); if ($this->ion_auth->logged_in() && !$accessGranted) { // Allow access to dashboard $this->session->set_flashdata('access_error', 'You don\'t have access to this module!'); if ($current_page != 'admin/index') { redirect('admin'); } } }
function st_vc_about_icon($attr, $content = false) { $data = shortcode_atts(array('st_icon' => '', 'st_name' => '', 'st_description' => '', 'st_link' => '', 'st_pos_icon' => 'top', 'st_color_icon' => '', 'st_size_icon' => 'box-icon-sm', 'st_text_align' => 'text-center', 'st_border' => '', 'st_to_color' => 'black'), $attr, 'st_about_icon'); extract($data); $icons_center = ''; if ($st_text_align == 'text-center') { $icons_center = 'box-icon-center'; } $class_bg_color = Assets::build_css("background: " . $st_color_icon . ""); if (!empty($st_border)) { $class_bg_color = Assets::build_css("border-color: " . $st_color_icon . "!important;\r\n color: " . $st_color_icon . "!important;"); } if (empty($st_link)) { $title = '<h4 class="thumb-title">' . $st_name . '</h4>'; } else { $title = ' <h5 class="thumb-title"> <a href="' . $st_link . '" class="text-darken">' . $st_name . '</a> </h5>'; } $txt = ' <div class="thumb ' . $st_text_align . '"> <header class="thumb-header pull-' . $st_pos_icon . ' st-thumb-header"> <i class="fa ' . $st_icon . ' ' . $st_size_icon . ' box-icon-' . $st_pos_icon . ' ' . $icons_center . ' round ' . $class_bg_color . ' animate-icon-top-to-bottom ' . $st_border . ' box-icon-to-' . $st_to_color . ' "></i> </header> <div class="thumb-caption pull-' . $st_pos_icon . ' st-thumb-caption"> ' . $title . ' <p class="thumb-desc">' . $st_description . '</p> </div> </div> '; return $txt; }
public function index() { $offset = $this->uri->segment(4); Assets::add_js($this->load->view('settings/users_js', null, true), 'inline'); $total_users = $this->user_model->count_all(); $this->pager['base_url'] = site_url(SITE_AREA . '/settings/users/index'); $this->pager['total_rows'] = $total_users; $this->pager['per_page'] = $this->limit; $this->pager['uri_segment'] = 4; $this->pagination->initialize($this->pager); // Was a filter set? if ($this->input->post('filter_submit') && $this->input->post('filter_by_role_id')) { $role_id = $this->input->post('filter_by_role_id'); $this->db->where('role_id', $role_id); Template::set('filter', $role_id); } if (config_item('auth.use_usernames')) { $this->db->order_by('username', 'asc'); } else { $this->db->order_by('email', 'asc'); } Template::set('users', $this->user_model->limit($this->limit, $offset)->find_all()); Template::set('total_users', $total_users); Template::set('deleted_users', $this->user_model->count_all(true)); Template::set('roles', $this->role_model->select('role_id, role_name, default')->find_all()); Template::set('user_count', $this->user_model->count_all()); Template::set('login_attempts', $this->user_model->get_login_attempts($this->limit)); $this->load->helper('ui/ui'); Template::set('toolbar_title', lang('us_user_management')); Template::render(); }
public function render() { $asset = Assets::get(); $this->addData(['css' => $asset->Css(), 'js' => $asset->Js(), 'internalCss' => $asset->InternalCss(), 'jsReady' => $asset->OnLoadJs()]); $tpl = Template::get()->loadTemplate($this->template); return $tpl->render($this->data); }
/** * Create a Groups object. * * @return void */ public function create() { $this->load->config('address'); $this->load->helper('address'); if (isset($_POST['save'])) { if ($insert_id = $this->save_groups()) { log_activity($this->auth->user_id(), lang('groups_act_create_record') . ': ' . $insert_id . ' : ' . $this->input->ip_address(), 'groups'); Template::set_message(lang('groups_create_success'), 'success'); redirect('/'); } // Not validation error if (!empty($this->groups_model->error)) { Template::set_message(lang('groups_create_failure') . $this->groups_model->error, 'error'); } } if ($this->siteSettings['auth.password_show_labels'] == 1) { Assets::add_js($this->load->view('users_js', array('settings' => $this->siteSettings), true), 'inline'); } // Generate password hint messages. $this->user_model->password_hints(); $result = array(); $group_type_options = $this->group_types_model->get_group_types_list(); array_unshift($group_type_options, "Select"); Template::set('group_type_options', $group_type_options); Template::set('toolbar_title', lang('groups_action_create')); Template::set_view('content/create', $result); Template::render(); }
/** * Constructor * * @return void */ public function __construct() { parent::__construct(); $this->load->model('botan_structure/botan_structure_model'); $this->lang->load('botan_structure'); Assets::add_module_js('botan_structure', 'botan_structure.js'); }
function st_vc_icon($attr, $content = false) { $data = shortcode_atts(array('st_tooltip' => '', 'st_pos_tooltip' => 'none', 'st_icon' => '', 'st_color_icon' => '', 'st_to_color' => '', 'st_size_icon' => 'box-icon-sm', 'st_round' => '', 'st_border' => '', 'st_animation' => '', 'st_aligment' => 'box-icon-none'), $attr, 'st_about_icon'); extract($data); $class_bg_color = Assets::build_css("background: " . $st_color_icon . ""); $class_bg_to_color = Assets::build_css("background: " . $st_to_color . ";\r\n border-color: " . $st_to_color . ";\r\n ", ":hover"); if ($st_animation == "border-rise") { $class__ = Assets::build_css("box-shadow: 0 0 0 2px " . $st_to_color . " ", ":after"); $class_bg_to_color = $class_bg_to_color . " " . $class__; } if (!empty($st_border)) { $class_bg_color = Assets::build_css("border-color: " . $st_color_icon . ";\r\n color: " . $st_color_icon . ";"); } if (!$st_pos_tooltip or $st_pos_tooltip != 'none') { $html_tooltip = 'data-placement="' . $st_pos_tooltip . '" title="" rel="tooltip" data-original-title="' . $st_tooltip . '"'; } else { $html_tooltip = ""; } if (!empty($st_animation)) { $animate = "animate-icon-" . $st_animation; } else { $animate = ""; } $txt = '<i class="fa ' . $st_icon . ' ' . $st_size_icon . ' ' . $st_border . ' ' . $st_aligment . ' ' . $class_bg_color . ' ' . $st_round . ' ' . $class_bg_to_color . ' ' . $animate . ' " ' . $html_tooltip . '> </i>'; return $txt; }
/** * Constructor * * @return void */ public function __construct() { parent::__construct(); $this->load->model('comments/comments_model'); $this->lang->load('comments'); Assets::add_module_js('comments', 'comments.js'); }
/** * Constructor * * @return void */ public function __construct() { parent::__construct(); $this->auth->restrict($this->permissionSiteReportsView); $this->auth->restrict($this->permissionViewActivities); $this->lang->load('activities/activities'); $this->lang->load('datatable'); $this->load->model('activities/activity_model'); Assets::add_js(array('bootstrap', 'jquery.dataTables', 'bootstrap-dataTables')); Assets::add_js($this->load->view('reports/activities_js', null, true), 'inline'); Assets::add_css(array('datatable', 'bootstrap-dataTables')); // Check the permissions, store the results. $this->hasPermissionDeleteOwn = $this->auth->has_permission($this->permissionDeleteOwn); $this->hasPermissionViewDate = $this->auth->has_permission($this->permissionViewDate); $this->hasPermissionViewModule = $this->auth->has_permission($this->permissionViewModule); $this->hasPermissionViewOwn = $this->auth->has_permission($this->permissionViewOwn); $this->hasPermissionViewUser = $this->auth->has_permission($this->permissionViewUser); if ($this->hasPermissionViewUser || $this->hasPermissionViewModule || $this->hasPermissionViewDate) { Template::set_block('sub_nav', 'reports/_sub_nav'); } Template::set('toolbar_title', lang('activities_title')); Template::set('hasPermissionDeleteOwn', $this->hasPermissionDeleteOwn); Template::set('hasPermissionViewDate', $this->hasPermissionViewDate); Template::set('hasPermissionViewModule', $this->hasPermissionViewModule); Template::set('hasPermissionViewOwn', $this->hasPermissionViewOwn); Template::set('hasPermissionViewUser', $this->hasPermissionViewUser); }
/** * show map * * @param string $id * @return void * @author Andy Bennett */ public function index($id = 1) { $db = new Database(); $m = ORM::factory('imagemap', $id); if (!$m->loaded) { Kohana::show_404('Imagemap ' . $id, 'common/error_404'); return; } Assets::instance()->add_javascript('/cache/js/photonotes'); Assets::instance()->add_css('/cache/css/photonotes'); Assets::instance()->add_css('/cache/css/photonotes_client'); $pages_array = strstr(APPPATH, 'backend_') === FALSE ? array() : imagemap_helper::get_pages(); $pages = json_encode($pages_array); // Build the Image object $image = array(); $image['img'] = $m->upload->id . $m->upload->file_ext; $image['alt'] = $m->title; // Load the view as an object $view = new View('imagemap'); // Add variable data to the view $view->image = $image; $view->notes = $m->imagenotes; $view->admin = true; //APPENV == 'backend'; // Are the image maps editable? $view->id = $id; // Needed for reporting changes back to the backend via ajax $view->pages = $pages; // Send the array of pages through to the view // Render the View $view->render(TRUE); }
function updateAction() { $model = new Shipcat(); // Uncomment the following line if AJAX validation is needed $this->performAjaxValidation($model); if (isset($_POST['model']) && $_POST['model'] == 'Shipcat') { if (isset($_POST['ajax'])) { $model->fillFromArray($_POST, FALSE); $model->user_id_updated = $this->user->user_id; $model->updated = 'NOW():sql'; $model->model_uset_id = $this->user->user_id; if ($model->save()) { Message::echoJsonSuccess(__('shipcat_updated')); } else { Message::echoJsonError(__('shipcat_no_updated')); } die; } $model->save(); $this->redirect(); die; } $id = AF::get($this->params, 'id', FALSE); if (!$id) { throw new AFHttpException(0, 'no_id'); } if (!$model->fillFromDbPk($id)) { throw new AFHttpException(0, 'incorrect_id'); } Assets::js('jquery.form'); $this->addToPageTitle('Update shipcat'); $this->render('update', array('model' => $model)); }
public function action_index() { Assets::package('jquery-ui'); $cur_ds_id = (int) Arr::get($this->request->query(), 'ds_id', Cookie::get('ds_id')); $tree = Datasource_Data_Manager::get_tree(); $cur_ds_id = Datasource_Data_Manager::exists($cur_ds_id) ? $cur_ds_id : Datasource_Data_Manager::$first_section; $ds = $this->section($cur_ds_id); $this->template->content = View::factory('datasource/content', array('content' => View::factory('datasource/data/index'), 'menu' => View::factory('datasource/data/menu', array('tree' => $tree, 'folders' => Datasource_Folder::get_all())))); $this->template->footer = NULL; $this->template->breadcrumbs = NULL; if ($ds instanceof Datasource_Section) { $this->set_title($ds->name); $limit = (int) Arr::get($this->request->query(), 'limit', Cookie::get('limit')); Cookie::set('ds_id', $cur_ds_id); $keyword = $this->request->query('keyword'); if (!empty($limit)) { Cookie::set('limit', $limit); $this->section()->headline()->limit($limit); } $this->template->content->content->headline = $this->section()->headline()->render(); $this->template->content->content->toolbar = View::factory('datasource/' . $ds->type() . '/toolbar', array('keyword' => $keyword)); $this->template->set_global(array('datasource' => $ds)); $this->template_js_params['DS_ID'] = $this->_section->id(); $this->template_js_params['DS_TYPE'] = $this->_section->type(); } else { $this->template->content->content = NULL; } }
/** * Constructor * * @return void */ public function __construct() { parent::__construct(); $this->load->library('form_validation'); $this->lang->load('faq'); Assets::add_module_js('faq', 'faq.js'); }
/** * Constructor * * @return void */ public function __construct() { parent::__construct(); $this->load->model('botanicules/botanicules_model'); $this->lang->load('botanicules'); Assets::add_module_js('botanicules', 'botanicules.js'); }