本文整理匯總了PHP中C::WriteCustomConfig方法的典型用法代碼示例。如果您正苦於以下問題:PHP C::WriteCustomConfig方法的具體用法?PHP C::WriteCustomConfig怎麽用?PHP C::WriteCustomConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類C
的用法示例。
在下文中一共展示了C::WriteCustomConfig方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Deactivate
/**
* Деактивация плагина
* @return bool
*/
public function Deactivate()
{
$aMenuList = C::Get('menu.data.user.list');
unset($aMenuList['plugin_menutest_my_menu']);
C::WriteCustomConfig(array('menu.data.user.list' => $aMenuList));
C::ResetCustomConfig('menu.data.user.list.plugin_menutest_my_menu');
return TRUE;
}
示例2: _eventMenuReset
protected function _eventMenuReset()
{
// * Получаем тип
$sMenuId = $this->GetParam(1);
if (!($oMenu = E::ModuleMenu()->GetMenu($sMenuId))) {
return parent::EventNotFound();
}
Config::ResetCustomConfig("menu.data.{$sMenuId}");
// Это подменю, удалим его
if (strpos($oMenu->getId(), 'submenu_') === 0) {
$aMenus = Config::Get('menu.data');
$bFound = false;
foreach ($aMenus as $k => $v) {
foreach ($v['list'] as $sItemKey => $aItemData) {
if (isset($aItemData['submenu']) && $aItemData['submenu'] == $sMenuId) {
$sMenuListKey = 'menu.data.' . $k;
$aMenu = C::Get($sMenuListKey);
if ($aMenu && isset($aMenu['list'][$sItemKey]['submenu'])) {
$aMenu['list'][$sItemKey]['submenu'] = '';
C::WriteCustomConfig(array($sMenuListKey => $aMenu), false);
$bFound = true;
break;
}
}
}
if ($bFound) {
break;
}
}
R::Location("admin/settings-menumanager/");
}
R::Location("admin/settings-menumanager/edit/{$sMenuId}");
return FALSE;
}