changed make admin menu logic, added reset admin menu function

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9071 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2011-09-07 02:19:04 +00:00
parent e4d9b43320
commit 986053ac4d
6 changed files with 40 additions and 20 deletions

View file

@ -17,6 +17,19 @@
if($logged_info->is_admin!='Y') return $this->stop("msg_is_not_administrator");
}
function procAdminMenuReset(){
$menuSrl = Context::get('menu_srl');
if (!$menuSrl) return $this->stop('msg_invalid_request');
$oMenuAdminController = &getAdminController('menu');
$output = $oMenuAdminController->deleteMenu($menuSrl);
if (!$output->toBool()) return $output;
FileHandler::removeDir('./files/cache/menu/admin_lang/');
$this->setRedirectUrl(Context::get('error_return_url'));
}
/**
* @brief Regenerate all cache files
* @return none

View file

@ -302,7 +302,7 @@
function getAdminMenuLang()
{
$currentLang = Context::getLangType();
$cacheFile = sprintf('./files/cache/menu/adminMenu.%s.lang.php', $currentLang);
$cacheFile = sprintf('./files/cache/menu/admin_lang/adminMenu.%s.lang.php', $currentLang);
// Update if no cache file exists or it is older than xml file
if(!is_readable($cacheFile))

View file

@ -8,12 +8,27 @@
class adminAdminView extends admin {
var $layout_list;
var $xeMenuTitle;
/**
* @brief Initilization
* @return none
**/
function init() {
// admin menu check
$this->xeMenuTitle = '__XE_ADMIN__';
$oMenuAdminModel = &getAdminModel('menu');
$output = $oMenuAdminModel->getMenuByTitle($this->xeMenuTitle);
if(!$output->menu_srl)
{
parent::_createXeAdminMenu();
}
else if(!is_readable($output->php_file))
{
$oMenuAdminController = &getAdminController('menu');
$oMenuAdminController->makeXmlFile($output->menu_srl);
}
// forbit access if the user is not an administrator
$oMemberModel = &getModel('member');
@ -60,7 +75,6 @@
if(is_readable($menu_info->php_file))
include $menu_info->php_file;
else {
header('location:'.getNotEncodedUrl('', 'module', 'admin'));
return;
}

View file

@ -2,14 +2,12 @@
/**
* @class admin
* @author NHN (developers@xpressengine.com)
* @brief base class of admin module
* @brief base class of admin module
**/
class admin extends ModuleObject {
var $xeMenuTitle;
/**
* @brief install admin module
* @brief install admin module
* @return new Object
**/
function moduleInstall() {
@ -20,20 +18,11 @@
* @brief if update is necessary it returns true
**/
function checkUpdate() {
$this->xeMenuTitle = '__XE_ADMIN__';
$oMenuAdminModel = &getAdminModel('menu');
$output = $oMenuAdminModel->getMenuByTitle($this->xeMenuTitle);
if(!$output->menu_srl)
{
$this->_createXeAdminMenu();
}
return false;
}
/**
* @brief update module
* @brief update module
* @return new Object
**/
function moduleUpdate() {

View file

@ -9,14 +9,15 @@
<action name="dispAdminSetup" type="view" standalone="true" menu_name="adminMenuSetup" menu_index="true" />
<action name="procAdminRemoveIcons" type="controller" standalone="true" />
<action name="procAdminRecompileCacheFile" type="controller" standalone="true" />
<action name="procAdminRecompileCacheFile" type="controller" standalone="true" />
<action name="procAdminLogout" type="controller" standalone="true" />
<action name="procAdminInsertThemeInfo" type="controller" standalone="true" ruleset="insertThemeInfo" />
<action name="procAdminToggleFavorite" type="controller" ruleset="toggleFavorite" />
<action name="procAdminEnviromentGatheringAgreement" type="controller" standalone="true" />
<action name="procAdminUpdateConfig" type="controller" standalone="true" />
<action name="procAdminDeleteLogo" type="controller" standalone="true" />
<action name="procAdminMenuReset" type="controller" />
<action name="getAdminFTPList" type="model" standalone="true" />
<action name="getSiteAllList" type="model" standalone="true" />
</actions>

View file

@ -13,7 +13,7 @@
<p class="q"><label for="adminLogo">관리자 페이지 로고</label></p>
<p class="a">
<!--@if($config_object->adminLogo)-->
<img src="{getUrl('').$config_object->adminLogo}" />
<img src="{getUrl('').$config_object->adminLogo}" />
<button type="submit" value="procAdminDeleteLogo" name="act" class="text">{$lang->cmd_delete}</button>
<!--@else-->
<img src="{getUrl('')}{$gnb_title_info->adminLogo}" />
@ -47,7 +47,10 @@
</ul>
</li>
</ul>
<p class="btnArea"><span class="btn small"><button value="procMenuAdminArrangeItem" name="act" type="submit">{$lang->cmd_save}</button></span></p>
<p class="btnArea">
<span class="btn small" style="float: left;"><button value="procAdminMenuReset" name="act" type="submit">{$lang->cmd_reset}</button></span>
<span class="btn small"><button value="procMenuAdminArrangeItem" name="act" type="submit">{$lang->cmd_save}</button></span>
</p>
</div>
</fieldset>
</form>