当前位置: 首页>>代码示例>>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;未经允许,请勿转载。