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


PHP modules类代码示例

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


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

示例1: setUp

 protected function setUp()
 {
     global $CI, $modules, $communication;
     $CI =& get_instance();
     $CI->load->library('users/auth');
     $CI->auth->login("user", "pass", 1);
     $modules = new modules();
     $communication = $modules->load('communication/content');
     $communication->load->model('communication/communication_model');
 }
开发者ID:atlanticsoft,项目名称:codeigniter2_hmvc_bonfire_codeception_phpunit,代码行数:10,代码来源:CommunicationTest.php

示例2: mid

 public function mid()
 {
     if ($this->module_alias) {
         $method = $this->uri->segment(4, 'index');
         echo modules::run($this->module_alias . '/' . $method);
     }
 }
开发者ID:vitalik199415,项目名称:ozar,代码行数:7,代码来源:moduleinfo.php

示例3: index

 function index()
 {
     // $enemigos= $this->load->module('enemigos');
     // $load['enemigos']= $enemigos->listar();
     $load['enemigos'] = modules::run('enemigos/enemigos/listar', 'Amigos');
     $this->load->view('saludo', $load);
 }
开发者ID:kalroot,项目名称:celula-cms,代码行数:7,代码来源:saludo.php

示例4: __construct

 function __construct()
 {
     parent::__construct();
     $this->load->library('session');
     $this->load->helper('url');
     $user_id = $this->session->userdata('user_id');
     if (!$user_id) {
         redirect('sessions/login');
     }
     if (!isset(self::$is_loaded)) {
         self::$is_loaded = TRUE;
         $this->load->config('mcb_menu/mcb_menu');
         modules::run('mcb_menu/check_permission', $this->uri->uri_string(), $this->session->userdata('global_admin'));
         $this->load->database();
         $this->load->helper(array('uri', 'mcb_currency', 'mcb_invoice', 'mcb_date', 'mcb_icon', 'mcb_custom', 'mcb_app', 'mcb_invoice_amount', 'mcb_invoice_item', 'mcb_invoice_payment', 'mcb_numbers'));
         $this->load->model(array('mcb_modules/mdl_mcb_modules', 'mcb_data/mdl_mcb_data', 'mcb_data/mdl_mcb_userdata'));
         $this->mdl_mcb_modules->set_module_data();
         $this->mdl_mcb_data->set_session_data();
         $this->mdl_mcb_userdata->set_session_data($user_id);
         $this->mdl_mcb_modules->load_custom_languages();
         $this->load->language('mcb', $this->mdl_mcb_data->setting('default_language'));
         $this->load->model('fields/mdl_fields');
         $this->load->library(array('form_validation', 'redir'));
         $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
         if ($this->mdl_mcb_data->setting('enable_profiler')) {
             $this->output->enable_profiler();
         }
     }
 }
开发者ID:adamendvy89,项目名称:pandawa,代码行数:29,代码来源:Admin_Controller.php

示例5: load

 public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
 {
     // first we need to check if this is called before CI_controller
     // if yes, well just use default
     if (!class_exists('CI_controller')) {
         return parent::load($file, $use_sections, $fail_gracefully);
     }
     if (in_array($file, $this->is_loaded, TRUE)) {
         return $this->item($file);
     }
     $_module = Modules::$current;
     if ($path = modules::find($file, $_module, 'config')) {
         // this file expected contain $config var
         include $path;
         if (!isset($config) or !is_array($config)) {
             show_error("{$path} does not contain a valid config array");
         }
         log_message('debug', "File loaded: {$path}");
         $current_config =& $this->config;
         if ($use_sections === TRUE) {
             if (isset($current_config[$file])) {
                 $current_config[$file] = array_merge($current_config[$file], $config);
             } else {
                 $current_config[$file] = $config;
             }
         } else {
             $current_config = array_merge($current_config, $config);
         }
         $this->is_loaded[] = $file;
         unset($config);
         return $this->item($file);
     }
     return parent::load($file, $use_sections, $fail_gracefully);
 }
开发者ID:egig,项目名称:CodeIgniter-HMVC-Support,代码行数:34,代码来源:Config.php

示例6: render

    public function render($label_template = '{title}', $back_url = NULL)
    {
        if (empty($this->mItems)) {
            return '<p>No records are found.</p>';
        } else {
            $html = modules::run('adminlte/widget/box_open', 'Sort Order', 'primary');
            // Render form with alert message
            $html .= '<form action="' . current_full_url() . '" method="POST">';
            $html .= $this->CI->system_message->render();
            $html .= '<p>Drag and drop below items to sort them in ascending order:</p>';
            // Generate item list by CodeIgniter Template Parser
            $template = '<ul class="sortable list-group">
				{items}
				<li class="list-group-item">
					<strong>' . $label_template . '</strong>
					<input type="hidden" name="' . $this->mPostName . '[]" value="{id}" />
				</li>
				{/items}
			</ul>';
            $data = array('items' => $this->mItems);
            $html .= $this->CI->parser->parse_string($template, $data, TRUE);
            if ($back_url != NULL) {
                $html .= modules::run('adminlte/widget/btn', 'Back', $back_url, 'reply', 'bg-purple') . ' ';
            }
            $html .= modules::run('adminlte/widget/btn_submit', 'Save');
            $html .= '</form>';
            $html .= modules::run('adminlte/widget/box_close');
            return $html;
        }
    }
开发者ID:ppatons,项目名称:ci_bootstrap_3,代码行数:30,代码来源:Sortable.php

示例7: modload

 public function modload()
 {
     modules::init_module('cs_levels', self::MOD_VERSION, self::MOD_AUTHOR, 'chanserv', 'default');
     // these are standard in module constructors
     chanserv::add_help('cs_levels', 'help', &chanserv::$help->CS_HELP_LEVELS_1);
     // add the help
     if (ircd::$halfop) {
         chanserv::add_help('cs_levels', 'help levels', &chanserv::$help->CS_HELP_LEVELS_ALL);
     } else {
         chanserv::add_help('cs_levels', 'help levels', &chanserv::$help->CS_HELP_LEVELS_ALL2);
     }
     // if we have halfop enabled the help we add is different.
     chanserv::add_command('levels', 'cs_levels', 'levels_command');
     // add the command
     self::$flags = '+-kvhoaqsrftFb';
     // string of valid flags
     if (!ircd::$halfop) {
         self::$flags = str_replace('h', '', self::$flags);
     }
     // if halfop isnt enabled, remove h and H
     if (!ircd::$protect) {
         self::$flags = str_replace('a', '', self::$flags);
     }
     // same for protect
     if (!ircd::$owner) {
         self::$flags = str_replace('q', '', self::$flags);
     }
     // and finally, owner
 }
开发者ID:rickihastings,项目名称:acorairc,代码行数:29,代码来源:levels.cs.php

示例8: load

 public function load($langfile, $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '')
 {
     // first we need to check if this is called before CI_controller
     // if yes, well just use default
     if (!class_exists('CI_controller')) {
         return parent::load($file, $use_sections, $fail_gracefully);
     }
     if (is_array($langfile)) {
         foreach ($langfile as $_lang) {
             $this->load($_lang);
         }
         return $this->language;
     }
     $deft_lang = get_instance()->config->item('language');
     $idiom or $idiom = $deft_lang;
     if (in_array($langfile . '_lang.php', $this->is_loaded, TRUE)) {
         return $this->language;
     }
     $_module = get_instance()->router->fetch_module();
     if ($path = modules::find($langfile . '_lang', $_module, 'language/' . $idiom)) {
         include $path;
         if (!isset($lang) or !is_array($lang)) {
             show_error("{$path} does not contain a valid lang array");
         }
         if ($return) {
             return $lang;
         }
         $this->language = array_merge($this->language, $lang);
         $this->is_loaded[] = $langfile . '_lang.php';
         unset($lang);
         return $this->language;
     }
     return parent::load($langfile, $idiom, $return, $add_suffix, $alt_path);
 }
开发者ID:egig,项目名称:CodeIgniter-HMVC-Support,代码行数:34,代码来源:Lang.php

示例9: show

 private function show($view, $user_data)
 {
     $this->load->helper('form');
     $view_data['user'] = $user_data;
     $view_data['status'] = array(0 => lang('user.status0'), 1 => lang('user.status1'));
     $view_data['permissions'] = modules::run('permission/get_permissions_dropdown');
     return $this->load->view($view . '.php', $view_data, true);
 }
开发者ID:jabouzi,项目名称:jazz,代码行数:8,代码来源:user.php

示例10: blog_category

 public function blog_category()
 {
     $crud = $this->generate_crud('demo_blog_categories');
     $crud->columns('title');
     $this->mTitle .= 'Blog Categories';
     $this->mViewData['crud_note'] = modules::run('adminlte/widget/btn', 'Sort Order', 'demo/blog_category_sortable');
     $this->render_crud();
 }
开发者ID:Antu-Rozario,项目名称:ci_bootstrap_3,代码行数:8,代码来源:Demo.php

示例11: modload

 public function modload()
 {
     modules::init_module('ns_help', self::MOD_VERSION, self::MOD_AUTHOR, 'nickserv', 'static');
     // these are standard in module constructors
     nickserv::add_help_fix('ns_help', 'prefix', 'help', &nickserv::$help->NS_HELP_PREFIX);
     nickserv::add_help_fix('ns_help', 'suffix', 'help', &nickserv::$help->NS_HELP_SUFFIX);
     // add teh help docs
 }
开发者ID:rickihastings,项目名称:acorairc,代码行数:8,代码来源:help.ns.php

示例12: _custom_save

 function _custom_save()
 {
     foreach ($this->mdl_mcb_modules->custom_modules as $module) {
         if ($module->module_enabled and isset($module->module_config['settings_save'])) {
             modules::run($module->module_config['settings_save']);
         }
     }
 }
开发者ID:roxio,项目名称:MyClientBase-SB,代码行数:8,代码来源:settings.php

示例13: show_widgets

 function show_widgets()
 {
     foreach ($this->mdl_mcb_modules->custom_modules as $module) {
         if ($module->module_enabled and isset($module->module_config['dashboard_widget'])) {
             echo modules::run($module->module_config['dashboard_widget']);
         }
     }
 }
开发者ID:roxio,项目名称:MyClientBase-SB,代码行数:8,代码来源:dashboard.php

示例14: login

 function login()
 {
     $data['title'] = "Login";
     //validate form input
     $this->form_validation->set_rules('identity', 'Identity', 'required');
     $this->form_validation->set_rules('password', 'Password', 'required');
     if ($this->form_validation->run() == true) {
         //cek pertama login pengguna dengan loading M_user di tb_pengguna
         if ($this->ion_auth->cek_first($this->input->post('identity'), $this->input->post('password')) == TRUE) {
             //buat akun dengan email dan password ini
             //load M_user
             $this->load->model('M_user');
             $pengguna = $this->M_user->get_user_by_email($this->input->post('identity'));
             $username = $pengguna->username;
             $email = $pengguna->email;
             $password = $pengguna->password;
             $additional_data = array('pengguna_id' => $pengguna->pengguna_id);
             //kalo sudah ada pengguna_id di tb_auth_user
             //maka cukup update datanya saja....
             $auth_user = $this->M_user->get_user_by_pengguna_id_auth_user($pengguna->pengguna_id);
             if ($auth_user == TRUE) {
                 if ($auth_user->email != $pengguna->email) {
                     $this->ion_auth->update($auth_user->id, $data);
                 }
             } else {
                 $this->session->set_userdata('email', $pengguna->email);
                 //go to login pertama pengelola
                 modules::run('redirection');
             }
             //then form masukkan kordinat dilengkapi dengan nama profil sekolah.
         } else {
             //check to see if the user is logging in
             //check for "remember me"
             $remember = (bool) $this->input->post('remember');
             if ($this->ion_auth->login($this->input->post('identity'), $this->input->post('password'), $remember)) {
                 //if the login is successful
                 //redirect them back to the home page
                 $this->session->set_flashdata('message', $this->ion_auth->messages());
                 modules::run('redirection/cek_group');
                 // redirect('admin', 'refresh');
             } else {
                 //if the login was un-successful
                 //redirect them back to the login page
                 $this->session->set_flashdata('message', $this->ion_auth->errors());
                 redirect('auth/login', 'refresh');
                 //use redirects instead of loading views for compatibility with MY_Controller libraries
             }
         }
     } else {
         //the user is not logging in so display the login page
         //set the flash data error message if there is one
         $data['message'] = validation_errors() ? validation_errors() : $this->session->flashdata('message');
         $data['identity'] = array('name' => 'identity', 'id' => 'identity', 'type' => 'text', 'value' => $this->form_validation->set_value('identity'));
         $data['password'] = array('name' => 'password', 'id' => 'password', 'type' => 'password');
         $this->template->set('title', 'Login Form');
         $this->template->load($this->_template . 'login', 'content/V_login', $data);
     }
 }
开发者ID:rhendy7,项目名称:juara,代码行数:58,代码来源:auth.php

示例15: rehash_command

 public static function rehash_command($nick, $ircdata = array())
 {
     $parser = new parser(CONFPATH . 'services.conf');
     // load the parser
     $total_modules_exceptions = array();
     $mod_info = array('cs' => 'chanserv', 'ns' => 'nickserv', 'os' => 'operserv', 'core' => 'core');
     foreach ($mod_info as $short => $full) {
         $category_name = $full . '_modules';
         foreach (core::$config->{$category_name} as $id => $module) {
             $total_modules[$short . '_' . $module] = array('type' => $short, 'file' => $module . '.' . $short . '.php');
         }
     }
     // merge all the arrays to check that the loaded and excluded modules are all correct
     foreach (modules::$list as $name => $details) {
         if (!isset($total_modules[$name]) && $details['extra'] != 'static') {
             if (is_callable(array($name, 'modunload'), true) && method_exists($name, 'modunload')) {
                 modules::$list[$name]['class']->modunload();
             }
             // if the module has an unload method, call it now before we destroy the class.
             unset(modules::$list[$name]);
             modules::_unset_docs($name);
             // destory relevant data to the module
             core::alog(core::$config->operserv->nick . ': unloaded module ' . $name);
             ircd::globops(core::$config->operserv->nick, 'unloaded module ' . $name);
             // unset the module
             core::alog('rehash_command(): ' . $name . ' unloaded from rehash', 'BASIC');
             // log what we need to log.
         }
         // the module is loaded and should be unloaded
     }
     // go through each set module and unset the now exempt modules
     foreach ($total_modules as $name => $details) {
         if (!isset(modules::$list[$name])) {
             if (!class_exists($name)) {
                 modules::load_module($name, $details['file']);
                 // load the module
             } else {
                 if (!(modules::$list[$name]['class'] = new $name())) {
                     core::alog('load_module(): unable to start: ' . $name . ' (boot error)', 'BASIC');
                     return false;
                 }
             }
             core::alog(core::$config->operserv->nick . ': loaded module ' . $name);
             ircd::globops(core::$config->operserv->nick, 'loaded module ' . $name);
             // load it up
             core::alog('rehash_command(): ' . $name . ' loaded from rehash', 'BASIC');
             // log what we need to log.
             modules::$list[$name]['class']->modload();
             // onload handler.
         }
     }
     // go through every module
     // load the ones that are new.
     core::alog(core::$config->operserv->nick . ': Successfully reloaded configuration.');
     ircd::globops(core::$config->operserv->nick, $nick . ' performed a REHASH');
     core::alog('rehash_command(): sucessful rehash', 'BASIC');
     // log what we need to log.
 }
开发者ID:rickihastings,项目名称:acorairc,代码行数:58,代码来源:rehash.os.php


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