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


PHP Module::getInstalled方法代码示例

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


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

示例1: indexAction

 function indexAction()
 {
     $this->view->setTitle('Настройка доступа к разделам сайта');
     $defaultConfig = $this->module->config['access']['accessTree'];
     $modules = Module::getInstalled(\App::$cur->primary);
     $this->view->page(['data' => compact('modules', 'defaultConfig')]);
 }
开发者ID:krvd,项目名称:cms-Inji,代码行数:7,代码来源:AccessController.php

示例2: scanModules

 function scanModules()
 {
     $modules = Module::getInstalled(App::$primary);
     $map = [];
     foreach ($modules as $module) {
         $map[$module] = App::$cur->{$module}->sitemap();
         if (!$map[$module]) {
             unset($map[$module]);
         }
     }
     return $map;
 }
开发者ID:krvd,项目名称:cms-Inji,代码行数:12,代码来源:Sitemap.php

示例3: configureAction

 public function configureAction()
 {
     $appOptions = Apps\App::get(filter_input(INPUT_GET, 'item_pk', FILTER_SANITIZE_NUMBER_INT));
     $app = new App();
     $app->name = $appOptions->name;
     $app->system = true;
     $app->staticPath = "/" . $appOptions->dir . "/static";
     $app->templatesPath = "/" . $appOptions->dir . "/static/templates";
     $app->path = INJI_PROGRAM_DIR . '/' . $appOptions->dir;
     $app->type = 'app';
     $app->installed = true;
     $app->params = [];
     $app->config = Config::app($app);
     $modules = Module::getInstalled($app, $app);
     $inputs = [];
     foreach ($modules as $module) {
         $info = Module::getInfo($module);
         if (!empty($info['configure'])) {
             $config = Config::module($module, false, $app);
             foreach ($info['configure'] as $optionName => $params) {
                 if (filter_input(INPUT_POST, $optionName)) {
                     $config[$optionName] = filter_input(INPUT_POST, $optionName);
                     Config::save('module', $config, $module, $app);
                 }
                 $input = [];
                 $input['name'] = $optionName;
                 $input['type'] = $params['type'];
                 $input['label'] = $params['label'];
                 $input['options']['value'] = !empty($config[$optionName]) ? $config[$optionName] : '';
                 $input['options']['values'] = ['' => 'Не выбрано'];
                 $input['options']['values'] += $params['model']::getList(['forSelect' => true, 'key' => $params['col']]);
                 $inputs[] = $input;
             }
         }
     }
     if (!empty($_POST)) {
         Tools::redirect('/setup');
     }
     $this->view->page(['data' => compact('inputs')]);
 }
开发者ID:krvd,项目名称:cms-Inji,代码行数:40,代码来源:AppsController.php

示例4: array_flip

<h1>Установка модулей</h1>
<form>
    <?php 
$config = Config::app(App::$primary ? App::$primary : App::$cur);
$modules = array_flip(Module::getInstalled(App::$cur));
$systemModules = array_slice(scandir(INJI_SYSTEM_DIR . '/modules'), 2);
foreach ($systemModules as $module) {
    $info = Module::getInfo($module);
    if (!$info || isset($modules[$module])) {
        continue;
    }
    ?>
        <div class ="form-group">
            <div class="checkbox">
                <label>
                    <input type ="checkbox" name ="modules[]" value ="<?php 
    echo $module;
    ?>
" /> <?php 
    echo $info['name'];
    ?>
                </label>
            </div>
        </div>
        <?php 
}
?>
    <button class="btn btn-primary">Установить</button>
</form>
开发者ID:krvd,项目名称:cms-Inji,代码行数:29,代码来源:install.php

示例5: install

 public function install($module, $params = [])
 {
     $installed = Module::getInstalled(App::$primary);
     if (in_array($module, $installed)) {
         return true;
     }
     $info = Module::getInfo($module);
     if (!empty($info['requires'])) {
         foreach ($info['requires'] as $requireModuleName) {
             $this->install($requireModuleName);
         }
     }
     $config = Config::app();
     $type = 'modules';
     $path = INJI_SYSTEM_DIR . '/modules/';
     $location = 'modules';
     $config[$location][] = $module;
     if (!empty($info['autoload'])) {
         $config['autoloadModules'][] = $module;
     }
     if (!empty($info['menu'])) {
         foreach ($info['menu'] as $appType => $items) {
             $this->addInMenu($items, $appType);
         }
     }
     Config::save('app', $config, null, App::$primary);
     if (file_exists($path . $module . '/install_script.php')) {
         $installFunction = (include $path . $module . '/install_script.php');
         $installFunction(1, $params);
     }
 }
开发者ID:krvd,项目名称:cms-Inji,代码行数:31,代码来源:Modules.php

示例6: foreach

<?php

$table = new Ui\Table();
$table->name = 'Установленные модули';
$table->addButton(['href' => '/admin/modules/create', 'text' => 'Создать']);
$table->addButton(['href' => '/admin/modules/install', 'text' => 'Установить']);
$table->setCols(['Модуль', 'Панель администратора', 'Публичная часть', 'Управление', 'По умолчанию']);
$default = !empty(App::$primary->config['defaultModule']) ? App::$primary->config['defaultModule'] : '';
foreach (Module::getInstalled(App::$cur) as $module) {
    $info = Module::getInfo($module);
    $table->addRow([empty($info['name']) ? $module : $info['name'], '', '', "<a class = 'btn btn-primary btn-xs' href = '/admin/modules/editor/{$module}'>Редактировать</a>", $default == $module ? 'По умолчанию' : "<a class = 'btn btn-primary btn-xs' href = '/admin/modules/setDefault/{$module}'>Установить по умолчанию</a>"]);
}
$table->draw();
开发者ID:krvd,项目名称:cms-Inji,代码行数:13,代码来源:index.php

示例7: getExtensions

 /**
  * Return extensions for type
  * 
  * @param string $extensionType
  * @param string $request
  * @return array
  */
 public function getExtensions($extensionType, $request)
 {
     $extensions = [];
     $modules = Module::getInstalled(App::$cur);
     $method = 'get' . ucfirst($extensionType);
     foreach ($modules as $module) {
         $extensions = array_merge($extensions, $this->{$method}($request, false, "/extensions/{$this->moduleName}/" . $extensionType, $module));
     }
     return $extensions;
 }
开发者ID:krvd,项目名称:cms-Inji,代码行数:17,代码来源:Module.php


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