• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Modules类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: install

 public function install()
 {
     $mod = new Modules();
     $mod->getModuleByName('roles');
     $perms = array('create roles', 'update roles', 'delete roles', 'manage roles');
     $perm_ids = FabriqModules::register_perms($mod->id, $perms);
     global $db;
     $sql = "CREATE TABLE IF NOT EXISTS `fabmod_roles_roles` (\n\t\t\t`id` INT(11) NOT NULL AUTO_INCREMENT,\n\t\t\t`role` VARCHAR(100) NOT NULL,\n\t\t\t`enabled` TINYINT(1) NOT NULL DEFAULT 1,\n\t\t\t`created` DATETIME NOT NULL,\n\t\t\t`updated` DATETIME NOT NULL,\n\t\t\tPRIMARY KEY (`id`)\n\t\t) ENGINE=INNODB;";
     $db->query($sql);
     $sql = "CREATE TABLE IF NOT EXISTS `fabmod_roles_moduleperms` (\n\t\t\t`id` INT(11) NOT NULL AUTO_INCREMENT,\n\t\t\t`permission` INT(11) NOT NULL,\n\t\t\t`role` INT(11) NOT NULL,\n\t\t\t`created` DATETIME NOT NULL,\n\t\t\t`updated` DATETIME NOT NULL,\n\t\t\tPRIMARY KEY (`id`),\n\t\t\tCONSTRAINT `fk_moduleperms_permission` FOREIGN KEY (`permission`) REFERENCES fabmods_perms(id) ON DELETE CASCADE,\n\t\t\tCONSTRAINT `fk_moduleperms_role` FOREIGN KEY (`role`) REFERENCES fabmod_roles_roles(id) ON DELETE CASCADE\n\t\t) ENGINE=INNODB;";
     $db->query($sql);
     // create base roles
     $role = FabriqModules::new_model('roles', 'Roles');
     $role->role = "unauthenticated";
     $role->enabled = 1;
     $role->id = $role->create();
     $role = FabriqModules::new_model('roles', 'Roles');
     $role->role = "authenticated";
     $role->enabled = 1;
     $role->id = $role->create();
     $role = FabriqModules::new_model('roles', 'Roles');
     $role->role = "administrator";
     $role->enabled = 1;
     $role->id = $role->create();
     // map paths
     $pathmap =& FabriqModules::module('pathmap');
     $pathmap->register_path('fabriqadmin/roles/manage', 'roles', 'index', 'module');
     $pathmap->register_path('fabriqadmin/roles/create', 'roles', 'create', 'module');
     $pathmap->register_path('fabriqadmin/roles/perms', 'roles', 'perms', 'module');
     // set module as installed
     $mod->installed = 1;
     $mod->update();
 }
开发者ID:ralivue,项目名称:fabriqframework,代码行数:33,代码来源:roles.install.php


示例2: displayAccessWarning

 public function displayAccessWarning()
 {
     if (Yii::app()->isCommonSSL) {
         return;
     }
     $access_warning_cookie = Yii::app()->request->cookies['access_warning'];
     if ($access_warning_cookie === null || $access_warning_cookie->value !== 'false') {
         $objModule = Modules::model()->LoadByName('wsaccesswarning');
         if (!$objModule) {
             Yii::import('ext.wsaccesswarning.models.*');
             $arrDefaultConfig = $this->getAdminModel()->getDefaultConfiguration();
             $objModule = new Modules();
             $objModule->module = 'wsaccesswarning';
             $objModule->category = 'extension';
             $objModule->name = 'Site Access Warning';
             $objModule->version = 1;
             $objModule->active = 0;
             $objModule->configuration = serialize($arrDefaultConfig);
             $objModule->save();
         }
         if ($objModule->active) {
             $arrConfig = $objModule->GetConfigValues();
             $globalScript = sprintf("var accessWarningMessage = %s;", json_encode($this->_transformMessageForDisplay($arrConfig['message'])));
             // No HTML tags are allowed in the button caption so we encode to HTML entities.
             $globalScript .= sprintf("var accessWarningButtonCaption = %s;", json_encode(CHtml::encode($arrConfig['button_caption'])));
             $assets = Yii::app()->getAssetManager()->publish(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets');
             $cs = Yii::app()->getClientScript();
             $cs->registerScript('_', $globalScript, CClientScript::POS_HEAD);
             $cs->registerCssFile($assets . '/css/wsaccesswarning.css');
             $cs->registerScriptFile($assets . '/thirdparty/carhartl-jquery-cookie/jquery.cookie.js');
             $cs->registerScriptFile($assets . '/js/wsaccesswarning.js');
         }
     }
 }
开发者ID:uiDeveloper116,项目名称:webstore,代码行数:34,代码来源:wsaccesswarning.php


示例3: indexAction

 function indexAction()
 {
     $config_table = new Config();
     $modules_table = new Modules("core");
     $request = new Bolts_Request($this->getRequest());
     if ($request->has('modid')) {
         $modid = $request->modid;
     } else {
         $modid = 'bolts';
     }
     if ($this->_request->isPost()) {
         //we are posting
         $config_params = $this->_request->getParams();
         foreach ($config_params as $ckey => $value) {
             $data = array('value' => $value);
             $config_table->update($data, "ckey = '" . $ckey . "' and module='" . $modid . "'");
         }
         $this->view->success = $this->_T('Configuration Updated.');
         $config_table->cache();
         $params = array();
         $this->_Bolts_plugin->doAction($this->_mca . '_post_save', $params);
         // ACTION HOOK
     }
     $config = $config_table->fetchAll($config_table->select()->where('module = ?', $modid));
     if (count($config) > 0) {
         $config = $config->toArray();
         sort($config);
         $this->view->config = $config;
     }
     $modules = $modules_table->getEnabledModules();
     sort($modules);
     $this->view->modules = $modules;
     $this->view->current = $modid;
     $this->view->modid = $modid;
 }
开发者ID:jaybill,项目名称:Bolts,代码行数:35,代码来源:ConfigController.php


示例4: sort

 /**
  * @param Modules $modules
  * @return Modules
  */
 public function sort(Modules $modules)
 {
     $this->result = [];
     $this->initial = $modules->getArrayCopy();
     $this->run();
     return new Modules($this->result);
 }
开发者ID:raphhh,项目名称:samurai,代码行数:11,代码来源:ModulesSorter.php


示例5: __construct

 /**
  * Class Constructor
  *
  * @param  Config  $configs  Konfigurasi
  */
 public function __construct(Config $conf = null)
 {
     // Menerapkan konfigurasi
     $this->conf = $conf;
     // Menerapkan konfigurasi (@link http://php.net/manual/en/function.ob-get-level.php)
     $this->buffer = ob_get_level();
     self::$instance =& $this;
     // Default konfigurasi $baseurl
     if ($this->conf('baseurl') == '' && isset($_SERVER['HTTP_HOST'])) {
         $this->conf('baseurl', '//' . $_SERVER['HTTP_HOST'] . '/');
     }
     session_name($this->conf('basename'));
     session_start();
     // Inisiasi routing container
     $this->add('routes', function ($c) {
         return [];
     });
     // Inisiasi uri container
     $this->add('uri', function ($c) {
         return new Uri();
     });
     // Inisiasi modules container
     $this->add('modules', function ($c, $name) {
         $modules = new Modules($name);
         // Menyimpan sementara semua modules yang ada dalam cache
         $c->add($name, $modules->all());
         return $modules;
     });
 }
开发者ID:FaddliLWibowo,项目名称:tokonlen,代码行数:34,代码来源:App.php


示例6: uninstall

 public function uninstall()
 {
     $mod = new Modules();
     $mod->getModuleByName('blog');
     // remove perms
     FabriqModules::remove_perms($mod->id);
     // remove paths
     $pathmap =& FabriqModules::module('pathmap');
     $pathmap->remove_path('blog');
     $pathmap->remove_path('blog/create');
     $pathmap->remove_path('blog/update/!#');
     $pathmap->remove_path('blog/destroy/!#');
     $pathmap->remove_path('blog/show/!#');
     // delete database table
     global $db;
     $sql = "DROP TABLE `fabmod_blog_blogs`;";
     $db->query($sql);
     // uninstall any terms
     if (FabriqModules::enabled('taxonomy')) {
         FabriqModules::module('taxonomy')->uninstallMaps('fabmod_blog_blogs');
     }
     // set module as not installed
     $mod->installed = 0;
     $mod->update();
 }
开发者ID:ralivue,项目名称:fabriqmodules-blog,代码行数:25,代码来源:blog.install.php


示例7: perms

 public function perms()
 {
     if ($this->requiresPermission('manage roles', $this->name)) {
         Fabriq::title('Admin | Manage permissions');
         FabriqModules::add_css('roles', 'roles');
         $perms = new Perms();
         $perms->getAll();
         $modules = new Modules();
         $modules->getEnabled();
         $roles = FabriqModules::new_model('roles', 'Roles');
         $roles->getRoles();
         $modulePerms = FabriqModules::new_model('roles', 'ModulePerms');
         $modulePerms->getAll();
         $permissions = array();
         foreach ($perms as $perm) {
             $permissions[$perm->id] = array();
             foreach ($roles as $role) {
                 if (isset($modulePerms->perms[$perm->id][$role->id])) {
                     $permissions[$perm->id][$role->id] = 1;
                 } else {
                     $permissions[$perm->id][$role->id] = 0;
                 }
             }
         }
         if (isset($_POST['submit'])) {
             foreach ($perms as $perm) {
                 foreach ($roles as $role) {
                     if (isset($_POST['permission'][$perm->id][$role->id])) {
                         $permissions[$perm->id][$role->id] = 1;
                         // add to database if it's not already set
                         if (!isset($modulePerms->perms[$perm->id][$role->id])) {
                             $p = FabriqModules::new_model('roles', 'ModulePerms');
                             $p->permission = $perm->id;
                             $p->role = $role->id;
                             $p->id = $p->create();
                             $modulePerms->perms[$perm->id][$role->id] = $modulePerms->count();
                             $modulePerms->add($p);
                         }
                     } else {
                         $permissions[$perm->id][$role->id] = 0;
                         // remove from database if it is already set
                         if (isset($modulePerms->perms[$perm->id][$role->id])) {
                             $p = FabriqModules::new_model('roles', 'ModulePerms');
                             $p->find($modulePerms[$modulePerms->perms[$perm->id][$role->id]]->id);
                             $p->destroy();
                             $modulePerms->remove($modulePerms->perms[$perm->id][$role->id]);
                             $modulePerms->reindex();
                         }
                     }
                 }
             }
             Messaging::message('Permissions have been updated.', 'success');
         }
         FabriqModules::set_var($this->name, 'perms', $perms);
         FabriqModules::set_var($this->name, 'modules', $modules);
         FabriqModules::set_var($this->name, 'roles', $roles);
         FabriqModules::set_var($this->name, 'permissions', $permissions);
     }
 }
开发者ID:ralivue,项目名称:fabriqframework,代码行数:59,代码来源:roles.module.php


示例8: autorisation

function autorisation($nomplugin)
{
    $module = new Modules();
    if ($module->charger($nomplugin) && $module->actif && $module->est_autorise()) {
        return 1;
    }
    exit;
}
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:8,代码来源:authplugins.php


示例9: update_2_1_8

 public function update_2_1_8()
 {
     // update the module version number
     $mod = new Modules();
     $mod->getModuleByName('users');
     $mod->versioninstalled = '2.1.8';
     $mod->update();
 }
开发者ID:ralivue,项目名称:fabriqframework,代码行数:8,代码来源:sitemenus.install.php


示例10: uninstall

 public function uninstall()
 {
     $mod = new Modules();
     $mod->getModuleByName('googleanalytics');
     // set module as not installed
     $mod->installed = 0;
     $mod->update();
 }
开发者ID:ralivue,项目名称:fabriqmodules-googleanalytics,代码行数:8,代码来源:googleanalytics.install.php


示例11: update_1_5_1

 public function update_1_5_1()
 {
     // update the module version number
     $mod = new Modules();
     $mod->getModuleByName('users');
     $mod->versioninstalled = '1.5.1';
     $mod->update();
 }
开发者ID:ralivue,项目名称:fabriqframework,代码行数:8,代码来源:users.install.php


示例12: update_2_1_3

 public function update_2_1_3()
 {
     // update the module version number
     $mod = new Modules();
     $mod->getModuleByName('pathmap');
     $mod->versioninstalled = '2.1.3';
     $mod->update();
 }
开发者ID:ralivue,项目名称:fabriqframework,代码行数:8,代码来源:pathmap.install.php


示例13: getAllLinkPages

 public function getAllLinkPages()
 {
     $data = array();
     $modules = new Modules();
     $criteria = new CDbCriteria();
     $criteria->select = 'page_id, module_id';
     foreach ($this->findAll($criteria) as $value) {
         $data[$value->page_id] = $modules->findByPk($value->module_id)->name;
     }
     return $data;
 }
开发者ID:arduanov,项目名称:eco,代码行数:11,代码来源:ModulesInPages.php


示例14: port

function port($type = 0, $_pays = false, $_cpostal = "")
{
    if ($_SESSION['navig']->commande->transport == "" && !$type) {
        return -1;
    }
    if ($_SESSION['navig']->adresse != 0) {
        $chadr = 1;
    } else {
        $chadr = 0;
    }
    $modules = new Modules();
    if (!$type) {
        $modules->charger_id($_SESSION['navig']->commande->transport);
    } else {
        $modules->charger_id($type);
    }
    if ($modules->type != Modules::TRANSPORT || !$modules->actif) {
        return -1;
    }
    $p = new Pays();
    if ($chadr) {
        $adr = new adresse();
        $adr->charger($_SESSION['navig']->adresse);
        $p->charger($adr->pays);
        $cpostal = $adr->cpostal;
    } else {
        $p->charger($_SESSION['navig']->client->pays);
        $cpostal = $_SESSION['navig']->client->cpostal;
    }
    // Prise en compte des infos passée, si aucune des infos précédentes n'est pertinente.
    if (empty($p->id) && $_pays) {
        $p->charger($_pays);
    }
    if (empty($cpostal) && $_cpostal != "") {
        $cpostal = $_cpostal;
    }
    $zone = new Zone();
    $zone->charger($p->zone);
    try {
        $port = ActionsModules::instance()->instancier($modules->nom);
        $port->nbart = $_SESSION['navig']->panier->nbart();
        $port->poids = $_SESSION['navig']->panier->poids();
        $port->total = $_SESSION['navig']->panier->total();
        $port->zone = $p->zone;
        $port->pays = $p->id;
        $port->unitetr = $zone->unite;
        $port->cpostal = $cpostal;
        $frais = $port->calcule();
        ActionsModules::instance()->appel_module("port", $frais);
        return $frais;
    } catch (exception $e) {
        return -1;
    }
}
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:54,代码来源:port.php


示例15: update_2_3_1

 public function update_2_3_1()
 {
     // update the path(s) for the fabriqupdate module to point to the proper actions
     $pathmap =& FabriqModules::module('pathmap');
     $pathmap->remove_path('fabriqupdates');
     $pathmap->register_path('fabriqupdates', 'fabriqinstall', 'fetchUpdates', 'module');
     // update the module version number
     $mod = new Modules();
     $mod->getModuleByName('fabriqinstall');
     $mod->versioninstalled = '2.3.1';
     $mod->update();
 }
开发者ID:ralivue,项目名称:fabriqframework,代码行数:12,代码来源:fabriqinstall.install.php


示例16: init

 public function init($app)
 {
     $mdl = new Modules($this->c);
     $this->modulesLocations = $mdl->getLocations();
     ob_start();
     foreach ($this->modulesLocations as $module) {
         require $module->Path . $module->Controller;
     }
     foreach ($this->modulesLocations as $module) {
         include_once $module->Path . $module->Routes;
     }
     return ob_get_clean();
 }
开发者ID:amitkhare,项目名称:slim-hmvc,代码行数:13,代码来源:AutoloadHMVC.php


示例17: indexAction

 function indexAction()
 {
     // retrieve the ID of the requested page
     $pageID = $this->view->pageID = $this->_getParam('ID');
     $pageDetails = new PagesIndex();
     $pageDetailsSelect = $pageDetails->select();
     $pageDetailsSelect->where('PI_PageID = ?', $pageID)->where('PI_LanguageID = ?', $this->_defaultEditLanguage);
     $pageDetailsData = $pageDetails->fetchRow($pageDetailsSelect)->toArray();
     $this->view->assign("pageTitle", $pageDetailsData["PI_PageTitle"]);
     $authData = $this->view->user;
     $authID = $authData['EU_ID'];
     if (Cible_FunctionsAdministrators::checkAdministratorPageAccess($authID, $pageID, "data")) {
         $authData = $this->view->user;
         $authID = $authData['EU_ID'];
         if (Cible_FunctionsAdministrators::checkAdministratorPageAccess($authID, $pageID, "structure")) {
             $this->view->assign('hasAccessToStructure', true);
         }
         // Retrieve the page view layout
         $page = new Pages();
         $page_select = $page->select()->setIntegrityCheck(false);
         $page_select->from('Pages')->join('Views', 'Pages.P_ViewID = Views.V_ID')->where('P_ID = ?', $pageID);
         $page_info = Cible_FunctionsPages::getPageViewDetails($pageID);
         $template_file = 'index/' . $page_info['V_Path'];
         $_zone_count = $page_info['V_ZoneCount'];
         // make a request to get all the blocks to be displayed
         $blocks = new Blocks();
         $select = $blocks->select()->setIntegrityCheck(false);
         $select->from('Blocks')->join('Modules', 'Modules.M_ID = Blocks.B_ModuleID')->join('Pages', 'Blocks.B_PageID = P_ID')->join('BlocksIndex', 'Blocks.B_ID = BlocksIndex.BI_BlockID')->where('Blocks.B_PageID = ?', $pageID)->where('BlocksIndex.BI_LanguageID = ?', Zend_Registry::get('languageID'))->order('Blocks.B_Position ASC');
         //Send the results to the view
         $rows = $blocks->fetchAll($select);
         $_blocks = array();
         foreach ($rows as $row) {
             // create the placeholder object if not already defined
             if (!isset($_blocks[$row['B_ZoneID']])) {
                 $_blocks[$row['B_ZoneID']] = array();
             }
             $_blocks[$row['B_ZoneID']][] = $row->toArray();
         }
         $this->view->assign('template_file', $template_file);
         $this->view->assign('zone_count', $_zone_count);
         $this->view->assign('blocks', $_blocks);
         // Load the modules in the view
         $Modules = new Modules();
         $modules = $Modules->fetchAll();
         $this->view->assign('modules', $modules->toArray());
     } else {
         $this->view->assign('template_file', "");
         $this->view->assign('error_message_permission', $this->view->getCibleText('error_message_permission'));
     }
 }
开发者ID:anunay,项目名称:stentors,代码行数:50,代码来源:IndexController.php


示例18: setRangeObject

 /**
  * Sets the range object and checks whether the calendar is available.
  *
  * @param string $range_id The id of a course, institute or user.
  * @throws AccessDeniedException
  */
 private function setRangeObject($range_id)
 {
     $this->range_object = get_object_by_range_id($range_id);
     if (!is_object($this->range_object)) {
         throw new AccessDeniedException();
     }
     $range_map = array('User' => Calendar::RANGE_USER, 'Course' => Calendar::RANGE_SEM, 'Institute' => Calendar::RANGE_INST);
     $this->range = $range_map[get_class($this->range_object)];
     if ($this->range == Calendar::RANGE_INST || $this->range == Calendar::RANGE_SEM) {
         $modules = new Modules();
         if (!$modules->getStatus('calendar', $this->range_object->getId())) {
             throw new AccessDeniedException();
         }
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:21,代码来源:SingleCalendar.php


示例19: create

 function create()
 {
     // Modules::run('secure_tings/ni_met');
     $update_id = $this->uri->segment(3);
     $data = array();
     $this->load->model('mdl_jobcard');
     $this->load->model('spareparts/mdl_spareparts');
     if (!isset($update_id)) {
         $update_id = $this->input->post('update_id', $id);
         $data['maequipment'] = $this->mdl_spareparts->getequip();
     }
     if (is_numeric($update_id)) {
         $data = $this->get_data_from_db($update_id);
         $data['update_id'] = $update_id;
         $data['maequipment'] = $this->mdl_spareparts->getequip();
         $this->session->set_flashdata('Umsg', '<div id="alert-message" class="alert alert-warning text-center">Please Check the Reason for Failure and Tests Administered Sections before Updating !</div>');
     } else {
         $data = $this->get_data_from_post();
         $data['maequipment'] = $this->mdl_spareparts->getequip();
     }
     $data['section'] = "Maintenance";
     $data['subtitle'] = "Job Card";
     $data['page_title'] = "Cold Chain Maintenance Job Card";
     $data['module'] = "jobcard";
     $data['view_file'] = "create_jobcard_form";
     $data['user_object'] = $this->get_user_object();
     $data['main_title'] = $this->get_title();
     echo Modules::run('template/' . $this->redirect($this->session->userdata['logged_in']['user_group']), $data);
 }
开发者ID:Otienoh,项目名称:dvikenya,代码行数:29,代码来源:jobcard.php


示例20: _dialog

 function _dialog($page)
 {
     if (in_array($page, array('edit'))) {
         $this->response->dialog(array('body' => Modules::run('exp_field/' . $page)));
     }
     $this->response->send();
 }
开发者ID:abdulghanni,项目名称:_zohobiz_,代码行数:7,代码来源:exp_field_ajax.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ModulesHelper类代码示例发布时间:2022-05-23
下一篇:
PHP ModuleUser_EntityUser类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap