15 private $adminMenuName =
'__ADMINMENU_V17__';
18 return $this->adminMenuName;
39 $version_update_id = implode(
'.', array(__CLASS__,
__XE_VERSION__,
'updated'));
42 if(!$oDB->isColumnExists(
"admin_favorite",
"type"))
62 $version_update_id = implode(
'.', array(__CLASS__,
__XE_VERSION__,
'updated'));
65 if(!$oDB->isColumnExists(
"admin_favorite",
"type"))
68 $output = $oAdminAdminModel->getFavoriteList();
69 $favoriteList =
$output->get(
'favoriteList');
71 $oDB->dropColumn(
'admin_favorite',
'admin_favorite_srl');
72 $oDB->addColumn(
'admin_favorite',
"admin_favorite_srl",
"number", 11, 0);
73 $oDB->addColumn(
'admin_favorite',
"type",
"varchar", 30,
'module');
74 if(is_array($favoriteList))
77 $oAdminAdminController->_deleteAllFavorite();
78 foreach($favoriteList AS $key => $value)
80 $oAdminAdminController->_insertFavorite($value->site_srl, $value->module);
105 $output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName);
110 $output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName);
122 $this->_oldAdminmenuDelete();
124 $returnObj =
new stdClass();
125 $returnObj->menu_srl =
$output->menu_srl;
139 $args =
new stdClass();
140 $args->title = $this->adminMenuName;
148 $gnbList = array(
'dashboard',
'menu',
'user',
'content',
'configuration',
'advanced');
149 foreach($gnbList AS $key => $value)
152 $args =
new stdClass();
153 $args->menu_srl = $menuSrl;
155 $args->name =
'{$lang->menu_gnb[\'' . $value .
'\']}
';
156 if($value == 'dashboard
')
164 $args->listorder = -1 * $args->menu_item_srl;
165 $output = executeQuery('menu.insertMenuItem
', $args);
168 $oMenuAdminModel = getAdminModel('menu');
169 $columnList = array('menu_item_srl
', 'name
');
170 $output = $oMenuAdminModel->getMenuItems($menuSrl, 0, $columnList);
171 if(is_array($output->data))
173 foreach($output->data AS $key => $value)
175 preg_match('/\{
\$lang->menu_gnb\[(.*?)\]\}/i
', $value->name, $m);
176 $gnbDBList[$m[1]] = $value->menu_item_srl;
181 $gnbModuleList = array(
184 'subMenu
' => array('siteMap
', 'siteDesign
'),
188 'subMenu
' => array('userList
', 'userSetting
', 'userGroup
'),
200 'subMenu
' => array('file'),
204 'subMenu
' => array('poll'),
208 'subMenu
' => array('rss'),
212 'subMenu
' => array('multilingual
'),
220 'subMenu
' => array('trash'),
224 'subMenu
' => array('easyInstall
'),
228 'subMenu
' => array('installedLayout
'),
232 'subMenu
' => array('installedModule
'),
236 'subMenu
' => array('installedWidget
'),
240 'subMenu
' => array('installedAddon
'),
244 'subMenu
' => array('editor'),
248 'subMenu
' => array('spamFilter
'),
252 'subMenu
' => array('adminConfigurationGeneral
', 'adminConfigurationFtp
', 'adminMenuSetup
'),
256 'subMenu
' => array('fileUpload
'),
260 'subMenu
' => array('filebox
'),
264 'subMenu
' => array('point')
268 $oMemberModel = getModel('member');
269 $output = $oMemberModel->getAdminGroup(array('group_srl
'));
270 $adminGroupSrl = $output->group_srl;
272 // gnb sub item create
273 // common argument setting
274 $args = new stdClass();
275 $args->menu_srl = $menuSrl;
276 $args->open_window = 'N
';
278 $args->normal_btn = '';
279 $args->hover_btn = '';
280 $args->active_btn = '';
281 $args->group_srls = $adminGroupSrl;
282 $oModuleModel = getModel('module');
284 foreach($gnbModuleList AS $key => $value)
286 if(is_array($value['subMenu
']))
288 $moduleActionInfo = $oModuleModel->getModuleActionXml($value['module']);
289 foreach($value['subMenu
'] AS $key2 => $value2)
291 $gnbKey = "'" . $this->_getGnbKey($value2) . "'";
294 $args->menu_item_srl = getNextSequence();
295 $args->parent_srl = $gnbDBList[$gnbKey];
296 $args->name = '{
$lang->menu_gnb_sub[\
'' . $value2 .
'\']}
';
297 $args->url = 'index.php?
module=
admin&act=
' . $moduleActionInfo->menu->{$value2}->index;
298 $args->listorder = -1 * $args->menu_item_srl;
299 $output = executeQuery('menu.insertMenuItem
', $args);
304 $oMenuAdminConroller = getAdminController('menu');
305 $oMenuAdminConroller->makeXmlFile($menuSrl);
307 // does not recreate lang cache sometimes
308 FileHandler::RemoveFilesInDir('./files/cache/lang
');
309 FileHandler::RemoveFilesInDir('./files/cache/
menu/admin_lang
');
316 function _getGnbKey($menuName)
342 case 'installedLayout
':
343 case 'installedModule
':
344 case 'installedWidget
':
345 case 'installedAddon
':
349 case 'adminConfigurationGeneral
':
350 case 'adminConfigurationFtp
':
351 case 'adminMenuSetup
':
354 return 'configuration
';
365 function _getOldGnbKey($menuName)
389 case 'installedLayout
':
390 case 'installedModule
':
391 case 'installedWidget
':
392 case 'installedAddon
':
397 case 'adminConfigurationGeneral
':
398 case 'adminConfigurationFtp
':
399 case 'adminMenuSetup
':
402 return 'configuration
';
405 return 'user_added_menu
';
409 private function _oldAdminmenuDelete()
411 $oMenuAdminModel = getAdminModel('menu');
413 $output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName);
414 $newAdminmenuSrl = $output->menu_srl;
415 $output = $oMenuAdminModel->getMenuItems($newAdminmenuSrl, 0);
416 $newAdminParentMenuList = array();
417 if(is_array($output->data))
419 foreach($output->data AS $key => $value)
421 $tmp = explode('\
'', $value->name);
422 $newAdminParentMenuList[$tmp[1]] = $value;
428 $output = $oMenuAdminModel->getMenuByTitle(
'__XE_ADMIN__');
434 $output = $oMenuAdminModel->getMenuItems($menuSrl);
437 $parentMenu = array();
438 foreach(
$output->data AS $key => $menuItem)
440 if($menuItem->parent_srl == 0)
442 $tmp = explode(
'\'', $menuItem->name);
443 $parentMenuKey = $tmp[1];
444 $parentMenu[$menuItem->menu_item_srl] = $parentMenuKey;
448 $isUserAddedMenuMoved = FALSE;
449 foreach(
$output->data AS $key => $menuItem)
451 if($menuItem->parent_srl != 0)
453 $tmp = explode(
'\'', $menuItem->name);
457 if($result ==
'user_added_menu')
465 if($parentMenu[$menuItem->parent_srl] ==
'extensions')
467 $newParentItem = $newAdminParentMenuList[
'advanced'];
471 $newParentItem = $newAdminParentMenuList[$parentMenu[$menuItem->parent_srl]];
473 $menuItem->menu_srl = $newParentItem->menu_srl;
474 $menuItem->parent_srl = $newParentItem->menu_item_srl;
477 $isUserAddedMenuMoved = TRUE;
482 if($isUserAddedMenuMoved)
490 $output = $oMenuAdminModel->getMenuListByTitle(
'__XE_ADMIN__');
493 foreach(
$output AS $key=>$value)
getController($module_name)
The parent class of the spamfilter module.
set($key, $val, $set_to_get_vars=0)
The parent class of the point module.
widget to display content
getAdminModel($module_name)
getInstance($db_type=NULL)
document the module's high class {
high class of the editor odule
getAdminController($module_name)
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
The parent class of the poll module.
high class of the module module
if(isset($_REQUEST['encode'])) if(isset($_REQUEST['decode'])) $lang