本文整理汇总了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');
}
示例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'));
}
示例3: disable
public function disable()
{
parent::disable();
Configuration::updateValue('VATNUMBER_MANAGEMENT', 0);
}
示例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();
}
示例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;
}
示例6: disable
public function disable($forceAll = false)
{
parent::disable($forceAll);
}
示例7: disable
public function disable($force_all = false)
{
parent::disable($force_all);
$this->logMessage('Module has been disabled', 'INFO');
}
示例8: disable
public function disable($forceAll = false)
{
if (version_compare(_PS_VERSION_, '1.5.5.0', '>=')) {
$this->_clearCache('*');
}
return parent::disable($forceAll);
}