當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。