issue 2662 message, menu

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12252 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2012-11-19 06:43:28 +00:00
parent cec308eef1
commit 59b001578f
10 changed files with 2950 additions and 2865 deletions

View file

@ -1,113 +1,116 @@
<?php
/**
* menu class
* high class of the menu module
*
* @author NHN (developers@xpressengine.com)
* @package /modules/menu
* @version 0.1
*/
class menu extends ModuleObject
{
/**
* menu class
* high class of the menu module
*
* @author NHN (developers@xpressengine.com)
* @package /modules/menu
* @version 0.1
* Implement if additional tasks are necessary when installing
* @return Object
*/
class menu extends ModuleObject {
/**
* Implement if additional tasks are necessary when installing
* @return Object
*/
function moduleInstall() {
// Create a directory to use menu
FileHandler::makeDir('./files/cache/menu');
function moduleInstall()
{
// Create a directory to use menu
FileHandler::makeDir('./files/cache/menu');
return new Object();
}
return new Object();
}
/**
* A method to check if successfully installed
* @return bool
*/
function checkUpdate() {
$oDB = &DB::getInstance();
// 2009. 02. 11 menu added to the table site_srl
if(!$oDB->isColumnExists('menu', 'site_srl')) return true;
/**
* A method to check if successfully installed
* @return bool
*/
function checkUpdate()
{
$oDB = &DB::getInstance();
// 2009. 02. 11 menu added to the table site_srl
if(!$oDB->isColumnExists('menu', 'site_srl')) return true;
// 2012. 02. 01 title index check
if(!$oDB->isIndexExists("menu", "idx_title")) return true;
// 2012. 02. 01 title index check
if(!$oDB->isIndexExists("menu", "idx_title")) return true;
if(!$oDB->isColumnExists('menu_item', 'is_shortcut'))
if(!$oDB->isColumnExists('menu_item', 'is_shortcut'))
{
return TRUE;
}
return false;
}
/**
* Execute update
* @return Object
*/
function moduleUpdate() {
$oDB = &DB::getInstance();
// 2009. 02. 11 menu added to the table site_srl
if(!$oDB->isColumnExists('menu', 'site_srl'))
{
$oDB->addColumn('menu','site_srl','number',11,0,true);
}
// 2012. 02. 01 title index check
if(!$oDB->isIndexExists("menu","idx_title"))
{
$oDB->addIndex('menu', 'idx_title', array('title'));
}
if(!$oDB->isColumnExists('menu_item', 'is_shortcut'))
{
$oDB->addColumn('menu_item', 'is_shortcut', 'char', 1, 'N');
// check empty url and change shortcut type
$oMenuAdminModel = &getAdminModel('menu');
$output = $oMenuAdminModel->getMenus();
if(is_array($output))
{
return TRUE;
}
return false;
}
/**
* Execute update
* @return Object
}
/**
* Execute update
* @return Object
*/
function moduleUpdate() {
$oDB = &DB::getInstance();
// 2009. 02. 11 menu added to the table site_srl
if(!$oDB->isColumnExists('menu', 'site_srl')) {
$oDB->addColumn('menu','site_srl','number',11,0,true);
}
// 2012. 02. 01 title index check
if(!$oDB->isIndexExists("menu","idx_title")) {
$oDB->addIndex('menu', 'idx_title', array('title'));
}
if(!$oDB->isColumnExists('menu_item', 'is_shortcut'))
{
$oDB->addColumn('menu_item', 'is_shortcut', 'char', 1, 'N');
// check empty url and change shortcut type
$oMenuAdminModel = &getAdminModel('menu');
$output = $oMenuAdminModel->getMenus();
if(is_array($output))
foreach($output AS $key=>$value)
{
foreach($output AS $key=>$value)
unset($args);
$args->menu_srl = $value->menu_srl;
$output2 = executeQueryArray('menu.getMenuItems', $args);
if(is_array($output2->data))
{
unset($args);
$args->menu_srl = $value->menu_srl;
$output2 = executeQueryArray('menu.getMenuItems', $args);
if(is_array($output2->data))
foreach($output2->data AS $key2=>$value2)
{
foreach($output2->data AS $key2=>$value2)
if($value2->is_shortcut == 'N' && !$value2->url)
{
if($value2->is_shortcut == 'N' && !$value2->url)
{
$value2->is_shortcut = 'Y';
$value2->is_shortcut = 'Y';
$output3 = executeQuery('menu.updateMenuItem', $value2);
}
$output3 = executeQuery('menu.updateMenuItem', $value2);
}
}
}
}
}
}
return new Object(0, 'success_updated');
}
return new Object(0, 'success_updated');
}
/**
* Re-generate the cache file
* @return void
*/
function recompileCache() {
$oMenuAdminController = &getAdminController('menu');
// Wanted list of all the blog module
$output = executeQueryArray("menu.getMenus");
$list = $output->data;
if(!count($list)) return;
// The menu module is used in the re-create all the menu list
foreach($list as $menu_item) {
$menu_srl = $menu_item->menu_srl;
$oMenuAdminController->makeXmlFile($menu_srl);
}
}
}
?>
/**
* Re-generate the cache file
* @return void
*/
function recompileCache()
{
$oMenuAdminController = &getAdminController('menu');
// Wanted list of all the blog module
$output = executeQueryArray("menu.getMenus");
$list = $output->data;
if(!count($list)) return;
// The menu module is used in the re-create all the menu list
foreach($list as $menu_item)
{
$menu_srl = $menu_item->menu_srl;
$oMenuAdminController->makeXmlFile($menu_srl);
}
}
}
/* End of file menu.class.php */
/* Location: ./modules/menu/menu.class.php */