当前位置: 首页>>代码示例>>PHP>>正文


PHP Assets::adminJs方法代码示例

本文整理汇总了PHP中Assets::adminJs方法的典型用法代码示例。如果您正苦于以下问题:PHP Assets::adminJs方法的具体用法?PHP Assets::adminJs怎么用?PHP Assets::adminJs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Assets的用法示例。


在下文中一共展示了Assets::adminJs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 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');
         }
     }
 }
开发者ID:karlomikus,项目名称:CometCI,代码行数:25,代码来源:Backend_Controller.php

示例2: edit

 public function edit($id = 0)
 {
     $this->load->helper('form');
     $this->load->helper('htmlpurifier');
     $this->load->library('form_validation');
     $this->template->append_metadata(Assets::adminJs('ckeditor', 'js/ckeditor'));
     $this->form_validation->set_rules('name', 'Name', 'required|trim|htmlspecialchars|min_length[4]|xss_clean');
     $this->form_validation->set_rules('slug', 'Page slug', 'required|max_length[30]|min_length[3]|is_unique[pages.slug]');
     $this->form_validation->set_rules('access', 'Access level', 'required');
     $this->form_validation->set_rules('navigation', 'Navigation link name', 'trim|required|min_length[4]|htmlspecialchars|max_length[20]|xss_clean');
     $this->form_validation->set_rules('content', 'Content', 'required');
     if ($this->form_validation->run() == TRUE) {
         $navLink = $this->input->post('navigation');
         $oldSlug = $this->pages_m->get($id)->slug;
         $slug = makePageSlug($this->input->post('slug'));
         $data = array('name' => $this->input->post('name'), 'description' => html_purify($this->input->post('description'), 'description'), 'slug' => $slug, 'content' => html_purify($this->input->post('content'), 'wysiwyg'), 'navigation' => $navLink, 'layout' => $this->input->post('layout'), 'date' => date('Y-m-d H:i'), 'access' => $this->input->post('access'));
         $this->pages_m->update($id, $data);
         // Edit navigation link
         $this->load->model('navigation/navigation_m');
         $this->navigation_m->delete_by(array('link' => $oldSlug));
         $dataNav = array('name' => $navLink, 'link' => $slug, 'type' => 'uri');
         $this->navigation_m->insert($dataNav);
         redirect('admin/pages');
     } else {
         $this->template->set('title', 'Edit page')->set('data', $this->pages_m->as_array()->get($id))->set('layouts', $this->template->get_theme_layouts($this->setting->theme))->build('admin/form');
     }
 }
开发者ID:karlomikus,项目名称:CometCI,代码行数:27,代码来源:admin.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     $this->template->append_metadata(Assets::adminJs('picker', 'js/pickdate'));
     $this->template->append_metadata(Assets::adminJs('picker.time', 'js/pickdate'));
     $this->template->append_metadata(Assets::adminJs('picker.date', 'js/pickdate'));
     $this->template->append_metadata(Assets::adminJs('legacy', 'js/pickdate'));
     $this->load->model('events_m');
 }
开发者ID:karlomikus,项目名称:CometCI,代码行数:9,代码来源:admin.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     // Add missing javascript
     $this->template->append_metadata(Assets::adminJs('ckeditor', 'js/ckeditor'));
     $this->template->append_metadata(Assets::adminJs('picker', 'js/pickdate'));
     $this->template->append_metadata(Assets::adminJs('picker.time', 'js/pickdate'));
     $this->template->append_metadata(Assets::adminJs('picker.date', 'js/pickdate'));
     $this->template->append_metadata(Assets::adminJs('legacy', 'js/pickdate'));
     $this->load->model('matches_m');
 }
开发者ID:karlomikus,项目名称:CometCI,代码行数:11,代码来源:admin.php

示例5: __construct

 public function __construct()
 {
     parent::__construct();
     $this->template->append_metadata(Assets::adminJs('ckeditor', 'js/ckeditor'));
     $this->load->model('posts_m');
 }
开发者ID:karlomikus,项目名称:CometCI,代码行数:6,代码来源:admin.php


注:本文中的Assets::adminJs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。