當前位置: 首頁>>代碼示例>>PHP>>正文


PHP MY_Controller::MY_Controller方法代碼示例

本文整理匯總了PHP中MY_Controller::MY_Controller方法的典型用法代碼示例。如果您正苦於以下問題:PHP MY_Controller::MY_Controller方法的具體用法?PHP MY_Controller::MY_Controller怎麽用?PHP MY_Controller::MY_Controller使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MY_Controller的用法示例。


在下文中一共展示了MY_Controller::MY_Controller方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: AdminProType

 function AdminProType()
 {
     parent::MY_Controller();
     if (!$this->auth->isImport()) {
         showError('您無此頁麵操作權限', '/');
     }
 }
開發者ID:zhaojianhui129,項目名稱:implement2016,代碼行數:7,代碼來源:AdminProType.php

示例2: array

 function Admin_Controller()
 {
     parent::MY_Controller();
     $allow_access = FALSE;
     // These pages get past permission checks
     $ignored_pages = array('admin/login', 'admin/logout');
     // Check if the current page is to be ignored
     $current_page = $this->uri->segment(1, '') . '/' . $this->uri->segment(2, '');
     $is_ignored_page = in_array($current_page, $ignored_pages);
     // Check the user is an admin
     $is_admin = $this->user_lib->check_role('admin');
     // Login: If not logged in and its not an ignored page, force login
     if (!$this->data->user && !$is_ignored_page) {
         redirect('admin/login');
     } else {
         $allow_access = TRUE;
     }
     // We are looking at the index page. Show it if they have ANY admin access at all
     if (in_array($current_page, array('admin/', 'admin/index')) && $this->permissions_m->hasAdminAccess($this->data->user->role)) {
         $allow_access = TRUE;
     } elseif (!$is_admin && !$is_ignored_page) {
         // Check if the current user can view that page
         $location = array('module' => $this->module, 'controller' => $this->controller, 'method' => $this->method);
         $allow_access = $this->permissions_m->checkRuleByRole($this->data->user->role, $location);
     }
     // Show error and exit if the user does not have sufficient permissions
     if (!$allow_access) {
         show_error('You do not have sufficient permissions to view this page.');
         exit;
     }
     $this->data->toolbar = $this->modules_m->getModuleToolbar($this->module);
     $this->layout->layout_file = 'admin/layout.php';
     //$this->output->enable_profiler(TRUE);
 }
開發者ID:bema2004sw,項目名稱:pyrocms,代碼行數:34,代碼來源:MY_Controller.php

示例3: Comodos

 function Comodos()
 {
     parent::MY_Controller();
     //	Controller internal name
     //		Must be the same as file name (case sensitive!)
     $this->name = 'comodos';
     //	Loads model
     $this->load->model('comodos_model');
     //	links model to controler
     $this->addPersistent(&$this->comodos_model);
     //	Defines the grid properites
     $this->presentation->defineListView('846', '600', 'Cômodos');
     //	Defines the 'Edit window' properties
     $this->presentation->defineEditorWindow(400, 370, 'Editar cômodo', array('labelAlign' => 'right', 'labelPad' => 5));
     //	Defines the 'Search window' properties
     $this->presentation->defineSearchWindow(400, 250, 'Procurar por cômodo');
     //	Creates a new page on editor window
     $this->presentation->addPage('Base info');
     //	Defines a field from model
     $field = new PresentationField();
     $field->name = 'nomeComodo';
     $field->title = 'Cômodo';
     $field->titleGrid = 'Cômodo';
     $field->widthGrid = 100;
     //	Adds a field object to presentation object
     $this->presentation->setField($field);
     $field = new PresentationField();
     $field->name = 'descricao';
     $field->title = 'Descrição';
     $field->titleGrid = 'Descrição';
     $field->widthGrid = 200;
     $this->presentation->setField($field);
     $this->presentation->addPage('Job info');
     $this->renderer->listViewPageSize = 50;
 }
開發者ID:8496tar,項目名稱:hidrometria_individual,代碼行數:35,代碼來源:comodos.php

示例4: Report

 function Report()
 {
     parent::MY_Controller();
     $this->fundList = array(1 => '專營店營銷基金', 2 => '區域營銷基金', 3 => '車展基金', 4 => '巡展基金', 5 => '專項基金');
     $this->reportList = array(1 => array(1 => '項目費用總表', 2 => '線下廣宣傳播明細表', 3 => '線下營銷活動明細表'), 2 => array(1 => '項目費用總表', 2 => '線下廣宣傳播明細表', 3 => '線下營銷活動明細表'), 3 => array(1 => '項目費用總表', 2 => '項目費用明細表'), 4 => array(1 => '項目費用總表', 2 => '項目費用明細表'), 5 => array(1 => '項目費用總表', 2 => '線下廣宣傳播明細表', 3 => '線下營銷活動明細表'));
     $this->load->model('timeUnitModel');
 }
開發者ID:zhaojianhui129,項目名稱:qirmp2016,代碼行數:7,代碼來源:Report.php

示例5: lang

 function Public_Controller()
 {
     parent::MY_Controller();
     $this->benchmark->mark('public_controller_start');
     // Check the frontend hasnt been disabled by an admin
     if (!$this->settings->item('frontend_enabled')) {
         $error = $this->settings->item('unavailable_message') ? $this->settings->item('unavailable_message') : lang('cms_fatal_error');
         show_error($error);
     }
     // -- Navigation menu -----------------------------------
     $this->load->model('pages/pages_m');
     // Set the theme view folder
     $this->template->set_theme($this->settings->item('default_theme'));
     $this->asset->set_theme($this->settings->item('default_theme'));
     $this->template->set_layout('layout');
     $this->template->append_metadata(js('jquery/jquery.js'))->append_metadata(js('jquery/jquery.fancybox.js'))->append_metadata(css('jquery/jquery.fancybox.css'))->append_metadata(js('front.js'));
     // Make sure whatever page the user loads it by, its telling search robots the correct formatted URL
     $this->template->set_metadata('canonical', site_url($this->uri->uri_string()), 'link');
     // If there is a news module, link to its RSS feed in the head
     if (module_exists('news')) {
         $this->template->append_metadata('<link rel="alternate" type="application/rss+xml" title="' . $this->settings->item('site_name') . '" href="' . site_url('news/rss/all|rss') . '" />');
     }
     // Enable profiler on local box
     if (ENV == 'local' && $this->input->get('_debug')) {
         $this->output->enable_profiler(TRUE);
     }
     // Frontend data
     $this->load->library('variables/variables');
     $this->load->vars('variable', $this->variables->get());
     $this->benchmark->mark('public_controller_end');
 }
開發者ID:netfreak,項目名稱:pyrocms,代碼行數:31,代碼來源:Public_Controller.php

示例6: __construct

 public function __construct()
 {
     parent::MY_Controller();
     /* User Data */
     $query = $this->db->query("SELECT * FROM `user` WHERE `id` = '{$this->userID}'");
     $result = $query->result_array();
     $this->data["user_data"] = $result[0];
     /* Employee Data */
     $query = $this->db->query("SELECT * FROM `employees_hired` WHERE `uid` = '{$this->userID}' AND `type` = 'Doctor'");
     $doctor = $query->num_rows();
     $query = $this->db->query("SELECT * FROM `employees_hired` WHERE `uid` = '{$this->userID}' AND `type` = 'Nurse'");
     $nurse = $query->num_rows();
     $query = $this->db->query("SELECT * FROM `employees_hired` WHERE `uid` = '{$this->userID}' AND `type` = 'Janitor'");
     $janitor = $query->num_rows();
     $query = $this->db->query("SELECT * FROM `employees_hired` WHERE `uid` = '{$this->userID}' AND `type` = 'Receptionist'");
     $receptionist = $query->num_rows();
     $this->data["user_data"]["employee"] = array("Doctor" => $doctor, "Nurse" => $nurse, "Janitor" => $janitor, "Receptionist" => $receptionist);
     /* Building Data */
     $query = $this->db->query("SELECT * FROM `buildings_built` WHERE `uid` = '{$this->userID}'");
     $result = $query->result_array();
     foreach ($result as $value) {
         $completed[$value['bid']]++;
     }
     $this->data["user_data"]["building"] = $completed;
 }
開發者ID:remybreuils,項目名稱:Hospital-Entrepreneur,代碼行數:25,代碼來源:gettingstarted.php

示例7:

 function __construct()
 {
     parent::MY_Controller();
     $this->session->set_userdata(array(config_item('session_admin') . 'menu_current' => 1));
     $this->load->library('login_manager');
     $this->checkRole(array(1));
 }
開發者ID:lxthien,項目名稱:batdongsan,代碼行數:7,代碼來源:adminmenus.php

示例8: PresentationField

 function Setor_tipos()
 {
     parent::MY_Controller();
     $this->name = "setor_tipos";
     $this->data['title'] = "Gerencie tipos de setor";
     $this->load->model("setor_tipos_model");
     $this->addPersistent(&$this->setor_tipos_model);
     $this->presentation->defineListView("846", "600", "Tipos de setores");
     $this->presentation->defineEditorWindow(400, 250, "Editar setor");
     $this->presentation->defineSearchWindow(400, 250, "Procurando em setores");
     $this->presentation->addPage("Gerenciando tipos de setor");
     $field = new PresentationField();
     $field->name = "setor";
     $field->title = "Nome do Setor";
     $field->titleGrid = "Nome do Setor";
     $field->widthGrid = 100;
     $this->presentation->setField($field);
     $field = new PresentationField();
     $field->name = "desc";
     $field->title = "Descrição";
     $field->titleGrid = "Descrição";
     $field->widthGrid = 100;
     $this->presentation->setField($field);
     $this->renderer->listViewPageSize = 50;
 }
開發者ID:8496tar,項目名稱:hidrometria_individual,代碼行數:25,代碼來源:setor_tipos.php

示例9: Settings

 function Settings()
 {
     parent::MY_Controller();
     $this->load->library('validation');
     $this->load->helper(array('logo', 'file', 'form', 'path'));
     $this->load->model('settings_model');
 }
開發者ID:skarcha,項目名稱:BambooInvoice,代碼行數:7,代碼來源:settings.php

示例10: sprintf

 function Public_Controller()
 {
     parent::MY_Controller();
     // Check the frontend hasnt been disabled by an admin
     if (!$this->settings->item('frontend_enabled')) {
         $error = $this->settings->item('unavailable_message') ? $this->settings->item('unavailable_message') : 'Fatal error, is CMS installed?';
         show_error($error);
     }
     // start language string handling
     $this->lang->load('main');
     $this->data->naviHead = $this->lang->line('navigation_headline');
     $this->data->loggedInWelcome = sprintf($this->lang->line('logged_in_welcome'), @$this->data->user->first_name . ' ' . @$this->data->user->last_name);
     $this->data->logoutLabel = $this->lang->line('logout_label');
     $this->data->editProfileLabel = $this->lang->line('edit_profile_label');
     $this->data->settingsLabel = $this->lang->line('settings_label');
     $this->data->cpTitle = $this->lang->line('cp_title');
     $this->data->breadcrumbBaseLabel = $this->lang->line('breadcrumb_base_label');
     // stop language string handling
     // -- Navigation menu -----------------------------------
     $this->load->module_model('pages', 'pages_m');
     $this->load->module_model('navigation', 'navigation_m');
     $this->data->navigation = $this->cache->model('navigation_m', 'frontendNavigation', array(), $this->settings->item('navigation_cache'));
     // Set the theme view folder
     $this->data->theme_view_folder = '../themes/' . $this->settings->item('default_theme') . '/views/';
     $this->layout->layout_file = $this->data->theme_view_folder . 'layout.php';
     // Make sure whatever page the user loads it by, its telling search robots the correct formatted URL
     $this->layout->set_metadata('canonical', site_url($this->uri->uri_string()), 'link');
     // If there is a news module, link to its RSS feed in the head
     if (is_module('news')) {
         $this->layout->extra_head('<link rel="alternate" type="application/rss+xml" title="' . $this->settings->item('site_name') . '" href="' . site_url('news/rss/all|rss') . '" />');
     }
     //$this->output->enable_profiler(TRUE);
 }
開發者ID:BenneX,項目名稱:pyrocms,代碼行數:33,代碼來源:Public_Controller.php

示例11: Classes

 function Classes()
 {
     parent::MY_Controller();
     $this->load->model('redux_auth_model');
     $this->load->model('post');
     $this->load->model('educlass');
 }
開發者ID:jakedahn,項目名稱:InspirationBits,代碼行數:7,代碼來源:classes.php

示例12: Supplement

 function Supplement()
 {
     parent::MY_Controller();
     $this->navbarFocus = 'Supplement';
     $this->fundTypeConf = array(1 => '單店基金', 2 => '城市提升');
     $this->levelConf = array(1 => '普通補報', 2 => '特殊補報');
 }
開發者ID:zhaojianhui129,項目名稱:rmp2016,代碼行數:7,代碼來源:Supplement.php

示例13: Clients

 function Clients()
 {
     parent::MY_Controller();
     $this->load->helper('date');
     $this->load->library('validation');
     $this->load->model('clients_model');
 }
開發者ID:SkMamtajuddin,項目名稱:bamboo-invoice,代碼行數:7,代碼來源:clients.php

示例14: lang

 function Public_Controller()
 {
     parent::MY_Controller();
     // Check the frontend hasnt been disabled by an admin
     if (!$this->settings->item('frontend_enabled')) {
         $error = $this->settings->item('unavailable_message') ? $this->settings->item('unavailable_message') : lang('cms_fatal_error');
         show_error($error);
     }
     $this->lang->load('main');
     // -- Navigation menu -----------------------------------
     $this->load->module_model('pages', 'pages_m');
     $this->load->module_model('navigation', 'navigation_m');
     $this->data->navigation = $this->cache->model('navigation_m', 'frontendNavigation', array(), $this->settings->item('navigation_cache'));
     // Set the theme view folder
     $this->layout->theme($this->settings->item('default_theme'));
     // If the GET variable isbasic exists, do not use a wrapper
     if ($this->input->get('_is_basic')) {
         $this->layout->wrapper(FALSE);
     } else {
         $this->layout->wrapper('layouts/default');
     }
     // Make sure whatever page the user loads it by, its telling search robots the correct formatted URL
     $this->layout->set_metadata('canonical', site_url($this->uri->uri_string()), 'link');
     // If there is a news module, link to its RSS feed in the head
     if (is_module('news')) {
         $this->layout->extra_head('<link rel="alternate" type="application/rss+xml" title="' . $this->settings->item('site_name') . '" href="' . site_url('news/rss/all|rss') . '" />');
     }
     //$this->output->enable_profiler(TRUE);
 }
開發者ID:Turv,項目名稱:pyrocms,代碼行數:29,代碼來源:Public_Controller.php

示例15: SinglePOffline

 function SinglePOffline()
 {
     parent::MY_Controller();
     //設置導航選中
     $this->navbarFocus = 'SingleBudget';
     //$this->theme = 'bootstrap';
 }
開發者ID:zhaojianhui129,項目名稱:rmp2016,代碼行數:7,代碼來源:SinglePOffline.php


注:本文中的MY_Controller::MY_Controller方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。