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

PHP Module类代码示例

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

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



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

示例1: getControllerActions

 /**
  * For listing the Module Role table data
  * @author        Praveen Singh
  * @method        getModuleRoleData
  * @param         $id
  * @return        one row of Module Role table 
  * @since         version 0.0.1
  * @version       0.2.9
  */
 function getControllerActions($controllerID)
 {
     App::import("Model", "Module");
     $model = new Module();
     $datas = $model->find("all", array('conditions' => array('Module.parent_id' => $controllerID)));
     return $datas;
 }
开发者ID:praveensingh25000,项目名称:Bivid,代码行数:16,代码来源:CommonHelper.php


示例2: canBeAdded

 /**
  * @param Module $module
  * @return bool
  */
 private function canBeAdded($module)
 {
     if ($module->getDependencies()->count()) {
         return $this->areAllAlreadyPresent($module->getDependencies());
     }
     return true;
 }
开发者ID:raphhh,项目名称:samurai,代码行数:11,代码来源:ModulesSorter.php


示例3: getViewHelperConfig

 /**
  * @test
  * @covers Cocur\Slugify\Bridge\ZF2\Module::getViewHelperConfig()
  */
 public function getViewHelperConfig()
 {
     $vhConfig = $this->module->getViewHelperConfig();
     $this->assertTrue(is_array($vhConfig));
     $this->assertArrayHasKey('factories', $vhConfig);
     $this->assertArrayHasKey('slugify', $vhConfig['factories']);
 }
开发者ID:LamaDelRay,项目名称:test_symf,代码行数:11,代码来源:ModuleTest.php


示例4: linkmanage_creatNav

function linkmanage_creatNav($nav_name)
{
    global $zbp, $sysMenu;
    $n = linkmanageGetNav();
    if (preg_match("/{$nav_name}/", $sysMenu)) {
        $zbp->ShowHint('bad', 'ID与系统导航冲突!请更改');
    } elseif (isset($n['data'][$nav_name])) {
        $zbp->ShowHint('bad', 'ID已存在!请更改');
    } else {
        $n['data'][$nav_name] = array('id' => $nav_name, 'name' => GetVars('name', 'POST'), 'location' => '');
        $n['num'] = count($n['data']);
        $zbp->Config('linkmanage')->Nav = json_encode($n);
        $zbp->Config('linkmanage')->{$nav_name} = '{}';
        //排序值
        $zbp->SaveConfig('linkmanage');
        //创建模块
        if (!isset($zbp->modulesbyfilename[$nav_name])) {
            $t = new Module();
            $t->Name = '菜单:' . GetVars('name', 'POST');
            $t->FileName = $nav_name;
            $t->Source = 'plugin_' . $nav_name;
            $t->SidebarID = 0;
            $t->Content = '';
            $t->HtmlID = $nav_name;
            $t->Type = 'ul';
            $t->Save();
        }
        Redirect('main.php?id=' . $nav_name);
    }
}
开发者ID:zblogcn,项目名称:zblogphp,代码行数:30,代码来源:function.php


示例5: GetModulesDataArray

 public function GetModulesDataArray()
 {
     $counter = 0;
     $modulesData = array();
     $database = Mysql::getConnection();
     $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "modules ORDER BY moduleName ASC;");
     while ($row = $data->fetch_array()) {
         $moduleId = $row["moduleId"];
         $module = new Module();
         $module->GetInfo($moduleId);
         $modulesData[$counter]["moduleId"] = $module->moduleId;
         $modulesData[$counter]["moduleName"] = $module->moduleName;
         $modulesData[$counter]["moduleVersion"] = $module->moduleVersion;
         $modulesData[$counter]["moduleAuthor"] = $module->moduleAuthor;
         $modulesData[$counter]["moduleDescription"] = $module->moduleDescription;
         $modulesData[$counter]["moduleType"] = $module->moduleType;
         $modulesData[$counter]["modulePriority"] = $module->modulePriority;
         $modulesData[$counter]["moduleAutoStart"] = $module->moduleAutoStart;
         $modulesData[$counter]["moduleStatus"] = $module->moduleStatus;
         $modulesData[$counter]["moduleStyles"] = $module->moduleStyles;
         $modulesData[$counter]["moduleIcon"] = $module->moduleIcon;
         $modulesData[$counter]["moduleAdmin"] = $module->moduleAdmin;
         $modulesData[$counter]["moduleAdminMenu"] = $module->moduleAdminMenu;
         $counter++;
     }
     return $modulesData;
 }
开发者ID:tommmic,项目名称:inne,代码行数:27,代码来源:class-module.php


示例6: __construct

 /**
  * Constructor. Should not be called directly using new Module('name').
  * Use $this->pack_module or $this->init_module (inside other module).
  *
  * @param string $type Module name with submodule class delimited with hash
  * @param Module|null $parent Parent module
  * @param mixed $name Unique instance name. If null, then it will be generated
  * @param bool $clear_vars Clear module variables
  *
  * @throws Exception Exception is thrown, when instance id cannot be generated.
  */
 public final function __construct($type, $parent, $name, $clear_vars)
 {
     $submodule_delimiter = strpos($type, '#');
     $this->type_with_submodule = $main_module = $type;
     if ($submodule_delimiter !== false) {
         $main_module = substr($type, 0, $submodule_delimiter);
     }
     parent::__construct($main_module);
     if ($parent) {
         $this->parent =& $parent;
         if (isset($name)) {
             $this->instance = (string) preg_replace('/[^A-Z0-9\\_]+/i', '_', $name);
         } else {
             $this->instance = $parent->get_new_child_instance_id($this->type_with_submodule);
         }
         $parent->register_child($this);
     } elseif (isset($name)) {
         $this->instance = (string) $name;
     }
     $this->path = null;
     if (!isset($this->instance)) {
         throw new Exception('No instance name or parent specified.');
     }
     $this->children_count_display = 0;
     if ($clear_vars) {
         $this->clear_module_variables();
         $this->clear_child_vars = true;
     }
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:40,代码来源:module.php


示例7: getModulesByDirct

 public static function getModulesByDirct($type)
 {
     $_modules = array();
     $result = opendir(_TM_MODULES_DIR . $type);
     while ($dir = readdir($result)) {
         if (Validate::isModuleName($dir) && is_dir(_TM_MODULES_DIR . $type . '/' . $dir)) {
             include _TM_MODULES_DIR . $type . '/' . $dir . '/config.php';
             if (!($mod = Module::existsModule($dir))) {
                 $module = new Module();
                 $module->alias = pSQL($dir);
                 $module->name = pSQL($_modules[$type][$dir]['name']);
                 $module->type = pSQL($type);
                 $module->description = pSQL($_modules[$type][$dir]['description']);
                 $module->active = 0;
                 $module->add();
                 $_modules[$type][$dir]['id'] = $module->id;
             } else {
                 $_modules[$type][$dir]['id'] = $mod['id_module'];
                 $_modules[$type][$dir]['active'] = $mod['active'];
                 $_modules[$type][$dir]['type'] = $mod['type'];
             }
         }
     }
     return $_modules[$type];
 }
开发者ID:yiuked,项目名称:tmcart,代码行数:25,代码来源:Module.php


示例8: limit

function limit()
{
    $CI =& get_instance();
    $module = new Module();
    $module->get_by_module($CI->router->fetch_class());
    return $module->listperpage ? $module->listperpage : 20;
}
开发者ID:unisexx,项目名称:thaigcd2015,代码行数:7,代码来源:MY_html_helper.php


示例9: setProjectDefaults

    /**
     * Sets project defaults such as ACL rules, additional content,
     * load order of modules etc.
     *
     * @return null
     */
    protected function setProjectDefaults()
    {
        $guestInherit = $adminInherit = array('group_root');
        foreach ($this->_acl->getRoleTree('group_guest', true) as $role) {
            array_unshift($guestInherit, $role['name']);
        }
        foreach ($this->_acl->getRoleTree('group_admin', true) as $role) {
            array_unshift($adminInherit, $role['name']);
        }
        $aclResources = array('layout_controller_456' => $guestInherit, 'layout_controller_974' => $guestInherit, 'layout_controller_110' => $guestInherit, 'layout_controller_119' => $guestInherit, 'layout_controller_168' => $guestInherit, 'layout_controller_409' => $adminInherit, 'layout_controller_909' => $adminInherit, 'layout_controller_425' => $adminInherit, 'layout_controller_551' => $adminInherit);
        foreach ($aclResources as $resource => $roles) {
            $this->_acl->allowOnly($resource, $roles);
        }
        // Setup module load order
        if (Module::exists('comments')) {
            $comments = new Module('comments');
            $comments->setLoadOrder(1);
            # Should force it below Shareable by default
        }
        if (Module::exists('contact')) {
            // Set the contact form email to be the same as the initial user
            try {
                $this->_sql->exec('UPDATE {PREFIX}mod_contact
										SET email = (SELECT email FROM {PREFIX}users WHERE id = 2)');
            } catch (Exception $e) {
            }
        }
    }
开发者ID:jinshana,项目名称:tangocms,代码行数:34,代码来源:modules.php


示例10: testgetServiceConfig

 /**
  * @covers RcmSocialButtons\Module
  */
 public function testgetServiceConfig()
 {
     $config = $this->unit->getServiceConfig();
     $sm = $this->getServiceManagerMock($config['factories']);
     foreach (array_keys($config['factories']) as &$serviceName) {
         $this->assertTrue(get_class($sm->get($serviceName)) == $serviceName);
     }
 }
开发者ID:reliv,项目名称:rcm-plugins,代码行数:11,代码来源:ModuleTest.php


示例11: test_end_to_end

 function test_end_to_end()
 {
     $module = new Module('foo');
     $record = $module->retrieve('/dummy/test/single');
     $this->assertEqual('/dummy/test/single', $record['url']);
     $this->assertEqual('single', $record['title']);
     $this->assertEqual('dummy', $record['module']->name);
 }
开发者ID:bufvc,项目名称:bufvc-potnia-framework,代码行数:8,代码来源:testModuleResolver.php


示例12: addStudentGroupToNewStudent

 private function addStudentGroupToNewStudent($userId)
 {
     $group = new Module();
     $studentGroup = "estudante";
     $group->addGroupToUser($studentGroup, $userId);
     $guestGroup = "convidado";
     $group->deleteGroupOfUser($guestGroup, $userId);
 }
开发者ID:kailIII,项目名称:SiGA,代码行数:8,代码来源:course.php


示例13: form

 function form($id = FALSE)
 {
     $data['level'] = new Level($id);
     $data['level']->auth = json_decode($data['level']->auth);
     $modules = new Module();
     $data['modules'] = $modules->get();
     $this->template->append_metadata(js_checkbox());
     $this->template->build('admin/level_form', $data);
 }
开发者ID:unisexx,项目名称:thaigcd2015,代码行数:9,代码来源:levels.php


示例14: index

 public function index()
 {
     $semester = new Semester();
     $current_semester = $semester->getCurrentSemester();
     $group = new Module();
     $edit = $group->checkUserGroup('administrador');
     $data = array('current_semester' => $current_semester, 'edit' => $edit);
     $this->load->template('settings/index', $data);
 }
开发者ID:kailIII,项目名称:SiGA,代码行数:9,代码来源:settings.php


示例15: factory

 public static function factory($id = NULL, $connection = 'default')
 {
     $module = new Module($connection);
     if (NULL === $id) {
         return $module;
     }
     $mod = new Module($connection);
     return $mod->load($id);
 }
开发者ID:hayate,项目名称:UnoCMS,代码行数:9,代码来源:Module.php


示例16: getClassNamespace

 /**
  * Get class namespace.
  *
  * @param Module $module
  *
  * @return string
  */
 public function getClassNamespace($module)
 {
     $extra = str_replace($this->getClass(), '', $this->argument($this->argumentName));
     $extra = str_replace('/', '\\', $extra);
     $namespace = Modules::config('namespace');
     $namespace .= '\\' . $module->getStudlyName();
     $namespace .= '\\' . $this->getDefaultNamespace();
     $namespace .= '\\' . $extra;
     return rtrim($namespace, '\\');
 }
开发者ID:zedx,项目名称:core,代码行数:17,代码来源:GeneratorCommand.php


示例17: addModuleToList

 /**
  * @param string $toplevelidentifier The canonicalized absolute pathname of the module, excluding any extension
  * @param string $code Code extracted from the module file
  * @return string Unique (but not canonicalized) identifier for the module
  */
 private function addModuleToList($toplevelidentifier, &$code)
 {
     $identifiermanager = $this->identifiermanager;
     $identifier = $identifiermanager->getFlattenedIdentifier($toplevelidentifier);
     $module = new Module($code);
     $module->setModificationTime(filemtime($identifiermanager->getRealpath($toplevelidentifier)));
     $module->setUniqueIdentifier($identifier);
     $this->modules[$toplevelidentifier] = $module;
     return $identifier;
 }
开发者ID:simaranjit,项目名称:fmanager,代码行数:15,代码来源:FileDependencyResolver.php


示例18: loadTemplateSafelyByGroup

/**
 * Load a given view if the logged user have the required group
 * @param $requiredGroup - String with the group required to access the asked view
 * @param $template - String with the view to be loaded
 * @param $data - Data to pass along the view
 */
function loadTemplateSafelyByGroup($requiredGroup, $template, $data = array())
{
    $group = new Module();
    $ci = get_instance();
    $userHasGroup = $group->checkUserGroup($requiredGroup);
    if ($userHasGroup) {
        $ci->load->template($template, $data);
    } else {
        logoutUser();
    }
}
开发者ID:kailIII,项目名称:SiGA,代码行数:17,代码来源:auth_helper.php


示例19: execute

 function execute($options)
 {
     global $parametersMod;
     if ($options->firstTimeThisMonth) {
         $this->db->deleteOld(720);
     }
     if ($options->firstTimeThisHour) {
         $queue = new Module();
         $queue->send();
     }
 }
开发者ID:notzen,项目名称:ImpressPages-CMS,代码行数:11,代码来源:cron.php


示例20: all

 /**
  * Get the permissions from all the enabled modules
  * @return array
  */
 public function all()
 {
     $permissions = [];
     foreach ($this->module->enabled() as $enabledModule) {
         $configuration = config(strtolower('asgard.' . $enabledModule->getName()) . '.permissions');
         if ($configuration) {
             $permissions[$enabledModule->getName()] = $configuration;
         }
     }
     return $permissions;
 }
开发者ID:ruscon,项目名称:Core,代码行数:15,代码来源:PermissionManager.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP ModuleAdminController类代码示例发布时间:2022-05-23
下一篇:
PHP Models类代码示例发布时间: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