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


PHP Module::disable方法代码示例

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


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

示例1: disable

 /**
  * Disables a module.
  *
  * @param $slug
  *
  * @return \Illuminate\Http\Response
  */
 public function disable($slug)
 {
     Audit::log(Auth::user()->id, trans('admin/modules/general.audit-log.category'), trans('admin/modules/general.audit-log.msg-disable', ['slug' => $slug]));
     $module = \Module::where('slug', $slug)->first();
     if ($module) {
         if (\Module::isInitialized($slug)) {
             if (\Module::isEnabled($slug)) {
                 \Module::disable($slug);
                 Flash::success(trans('admin/modules/general.status.disabled', ['name' => $module['name']]));
             } else {
                 Flash::warning(trans('admin/modules/general.status.not-enabled', ['name' => $module['name']]));
             }
         } else {
             Flash::warning(trans('admin/modules/general.status.not-initialized', ['name' => $module['name']]));
         }
     } else {
         Flash::error(trans('admin/modules/general.status.not-found', ['slug' => $slug]));
     }
     Flash::success(trans('admin/modules/general.status.disabled'));
     return redirect('/admin/modules');
 }
开发者ID:sroutier,项目名称:laravel-5.1-enterprise-starter-kit,代码行数:28,代码来源:ModulesController.php

示例2: __call

 /**
  * Enables or Disables selected modules, cheat way to combine the
  * two very similar methods, saves code.
  *
  * @param string $name
  * @param array $args
  * @return mixed
  */
 public function __call($name, $args)
 {
     switch (substr($name, 0, -7)) {
         case 'enmod':
             $op = 'enable';
             break;
         case 'dismod':
             $op = 'disable';
             break;
         default:
             throw new Module_ControllerNoExist();
     }
     $this->setOutputType(self::_OT_CONFIG);
     if (!$this->_acl->check('module_manager_' . $op . '_modules')) {
         throw new Module_NoPermission();
     } else {
         if (!$this->_input->checkToken()) {
             $this->_event->error(Input::csrfMsg());
         } else {
             // Get all modules that need to be enabled/disabled
             try {
                 $modules = $this->_input->post('modules');
                 $count = 0;
                 foreach ($modules as $module) {
                     try {
                         $tmpModule = new Module($module);
                         // Check if user has global permission to do so
                         $aclResource = $module . '_global';
                         if (!$this->_acl->resourceExists($aclResource) || !$this->_acl->check($aclResource)) {
                             throw new Module_NoPermission();
                         }
                         if ($op == 'enable') {
                             $tmpModule->enable();
                             ++$count;
                         } else {
                             if (in_array($tmpModule->name, array($this->getDetail('name'), 'session'))) {
                                 // User is trying to disabled this module, that can't really happen
                                 $this->_event->error(sprintf(t('Sorry, you can not disable the module "%1$s"'), $tmpModule->name));
                             } else {
                                 $tmpModule->disable();
                                 ++$count;
                             }
                         }
                     } catch (Module_NoExist $e) {
                     }
                 }
                 if ($count > 0) {
                     if ($op == 'enable') {
                         $msg = count($modules) > 1 ? t('Enabled selected modules') : sprintf(t('Enabled module "%1$s"'), $tmpModule->name);
                     } else {
                         $msg = count($modules) > 1 ? t('Disabled selected modules') : sprintf(t('Disabled module "%1$s"'), $tmpModule->name);
                     }
                     $this->_event->success($msg);
                 }
             } catch (Input_KeyNoExist $e) {
                 $this->_event->error(t('No modules selected'));
             }
         }
     }
     return zula_redirect($this->_router->makeUrl('module_manager', 'config'));
 }
开发者ID:jinshana,项目名称:tangocms,代码行数:69,代码来源:config.php

示例3: disable

 public function disable()
 {
     parent::disable();
     Configuration::updateValue('VATNUMBER_MANAGEMENT', 0);
 }
开发者ID:greench,项目名称:prestashop,代码行数:5,代码来源:vatnumber.php

示例4: disable

 /**
  * @brief Disable the module
  *
  * When disabling the module, we need to edit the settings to also disable the theme swtich.
  * When enabling it, the settings will be rewritten automatically with the performances system.
  *
  */
 public function disable()
 {
     Configuration::updateValue('PS_MOBILE_MODULE_ENABLED', 0);
     $this->editSettings(false);
     return parent::disable();
 }
开发者ID:rtajmahal,项目名称:PrestaShop-modules,代码行数:13,代码来源:mobile_theme.php

示例5: disable

 public function disable($force_all = false)
 {
     $is_adv_api_disabled = (bool) Configuration::updateValue('PS_ADVANCED_PAYMENT_API', false);
     $is_adv_api_disabled &= (bool) Configuration::updateValue('PS_ATCP_SHIPWRAP', false);
     return parent::disable() && $is_adv_api_disabled;
 }
开发者ID:Luca01,项目名称:advancedeucompliance,代码行数:6,代码来源:advancedeucompliance.php

示例6: disable

 public function disable($forceAll = false)
 {
     parent::disable($forceAll);
 }
开发者ID:arozanski,项目名称:simpleresponsivetheme,代码行数:4,代码来源:responsiveslider.php

示例7: disable

 public function disable($force_all = false)
 {
     parent::disable($force_all);
     $this->logMessage('Module has been disabled', 'INFO');
 }
开发者ID:jenia0jenia,项目名称:otk,代码行数:5,代码来源:veplatform.php

示例8: disable

 public function disable($forceAll = false)
 {
     if (version_compare(_PS_VERSION_, '1.5.5.0', '>=')) {
         $this->_clearCache('*');
     }
     return parent::disable($forceAll);
 }
开发者ID:Eximagen,项目名称:3m,代码行数:7,代码来源:magicscroll.php


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