本文整理汇总了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('您无此页面操作权限', '/');
}
}
示例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);
}
示例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;
}
示例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');
}
示例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');
}
示例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;
}
示例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));
}
示例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;
}
示例9: Settings
function Settings()
{
parent::MY_Controller();
$this->load->library('validation');
$this->load->helper(array('logo', 'file', 'form', 'path'));
$this->load->model('settings_model');
}
示例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);
}
示例11: Classes
function Classes()
{
parent::MY_Controller();
$this->load->model('redux_auth_model');
$this->load->model('post');
$this->load->model('educlass');
}
示例12: Supplement
function Supplement()
{
parent::MY_Controller();
$this->navbarFocus = 'Supplement';
$this->fundTypeConf = array(1 => '单店基金', 2 => '城市提升');
$this->levelConf = array(1 => '普通补报', 2 => '特殊补报');
}
示例13: Clients
function Clients()
{
parent::MY_Controller();
$this->load->helper('date');
$this->load->library('validation');
$this->load->model('clients_model');
}
示例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);
}
示例15: SinglePOffline
function SinglePOffline()
{
parent::MY_Controller();
//设置导航选中
$this->navbarFocus = 'SingleBudget';
//$this->theme = 'bootstrap';
}