mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 13:02:15 +09:00
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:
parent
cec308eef1
commit
59b001578f
10 changed files with 2950 additions and 2865 deletions
|
|
@ -7,7 +7,8 @@
|
|||
* @package /modules/menu
|
||||
* @version 0.1
|
||||
*/
|
||||
class menuAdminController extends menu {
|
||||
class menuAdminController extends menu
|
||||
{
|
||||
/**
|
||||
* menu number
|
||||
* @var int
|
||||
|
|
@ -58,7 +59,8 @@
|
|||
* Add a menu
|
||||
* @return void|object
|
||||
*/
|
||||
function procMenuAdminInsert() {
|
||||
function procMenuAdminInsert()
|
||||
{
|
||||
// List variables
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
|
|
@ -81,7 +83,8 @@
|
|||
* Change the menu title
|
||||
* @return void|object
|
||||
*/
|
||||
function procMenuAdminUpdate() {
|
||||
function procMenuAdminUpdate()
|
||||
{
|
||||
// List variables
|
||||
$args->title = Context::get('title');
|
||||
$args->menu_srl = Context::get('menu_srl');
|
||||
|
|
@ -99,7 +102,8 @@
|
|||
* Delete menu process method
|
||||
* @return void|Object
|
||||
*/
|
||||
function procMenuAdminDelete() {
|
||||
function procMenuAdminDelete()
|
||||
{
|
||||
$menu_srl = Context::get('menu_srl');
|
||||
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
|
|
@ -122,7 +126,8 @@
|
|||
* Delete menu_item and xml cache files
|
||||
* @return Object
|
||||
*/
|
||||
function deleteMenu($menu_srl) {
|
||||
function deleteMenu($menu_srl)
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
|
@ -172,8 +177,10 @@
|
|||
|
||||
// Delete cache files
|
||||
$cache_list = FileHandler::readDir("./files/cache/menu","",false,true);
|
||||
if(count($cache_list)) {
|
||||
foreach($cache_list as $cache_file) {
|
||||
if(count($cache_list))
|
||||
{
|
||||
foreach($cache_list as $cache_file)
|
||||
{
|
||||
$pos = strpos($cache_file, $menu_srl.'.');
|
||||
if($pos>0)FileHandler::removeFile($cache_file);
|
||||
}
|
||||
|
|
@ -187,7 +194,6 @@
|
|||
return new Object(0,'success_deleted');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add an item to the menu, simple version
|
||||
* @return void
|
||||
|
|
@ -589,7 +595,8 @@
|
|||
* Delete menu item(menu of the menu)
|
||||
* @return void|Object
|
||||
*/
|
||||
function procMenuAdminDeleteItem() {
|
||||
function procMenuAdminDeleteItem()
|
||||
{
|
||||
// List variables
|
||||
$args = Context::getRequestVars();
|
||||
|
||||
|
|
@ -1052,13 +1059,15 @@
|
|||
{
|
||||
foreach($this->itemKeyList as $srl)
|
||||
{
|
||||
if (!$this->checked[$srl]){
|
||||
if(!$this->checked[$srl])
|
||||
{
|
||||
unset($target);
|
||||
$this->checked[$srl] = 1;
|
||||
$target->node = $srl;
|
||||
$target->child= array();
|
||||
|
||||
while(count($this->map[$srl])){
|
||||
while(count($this->map[$srl]))
|
||||
{
|
||||
$this->_setParent($srl, array_shift($this->map[$srl]), $target);
|
||||
}
|
||||
$result[] = $target;
|
||||
|
|
@ -1100,7 +1109,8 @@
|
|||
$child_node->child = array();
|
||||
$target->child[] = $child_node;
|
||||
|
||||
while(count($this->map[$child_srl])){
|
||||
while(count($this->map[$child_srl]))
|
||||
{
|
||||
$this->_setParent($child_srl, array_shift($this->map[$child_srl]), $child_node);
|
||||
}
|
||||
//return $target;
|
||||
|
|
@ -1142,15 +1152,19 @@
|
|||
$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
|
||||
if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
|
||||
// Move the menu location(change the order menu appears)
|
||||
if($mode == 'move') {
|
||||
if($mode == 'move')
|
||||
{
|
||||
$args->parent_srl = $parent_srl;
|
||||
$args->menu_srl = $menu_srl;
|
||||
|
||||
if($source_srl) {
|
||||
if($source_srl)
|
||||
{
|
||||
$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
|
||||
if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request');
|
||||
$args->listorder = $source_item->listorder-1;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = executeQuery('menu.getMaxListorder', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
$args->listorder = (int)$output->data->listorder;
|
||||
|
|
@ -1191,7 +1205,9 @@
|
|||
}
|
||||
}
|
||||
// Add a child
|
||||
} elseif($mode == 'insert') {
|
||||
}
|
||||
elseif($mode == 'insert')
|
||||
{
|
||||
$args->menu_item_srl = $target_srl;
|
||||
$args->parent_srl = $parent_srl;
|
||||
$args->listorder = -1*getNextSequence();
|
||||
|
|
@ -1210,7 +1226,8 @@
|
|||
* It looks unnecessary at this moment however no need to eliminate the feature. Just leave it.
|
||||
* @return void
|
||||
*/
|
||||
function procMenuAdminMakeXmlFile() {
|
||||
function procMenuAdminMakeXmlFile()
|
||||
{
|
||||
// Check input value
|
||||
$menu_srl = Context::get('menu_srl');
|
||||
// Get information of the menu
|
||||
|
|
@ -1228,16 +1245,20 @@
|
|||
* Register a menu image button
|
||||
* @return void
|
||||
*/
|
||||
function procMenuAdminUploadButton() {
|
||||
function procMenuAdminUploadButton()
|
||||
{
|
||||
$menu_srl = Context::get('menu_srl');
|
||||
$menu_item_srl = Context::get('menu_item_srl');
|
||||
$target = Context::get('target');
|
||||
$target_file = Context::get($target);
|
||||
// Error occurs when the target is neither a uploaded file nor a valid file
|
||||
if(!$menu_srl || !$menu_item_srl || !$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)/i',$target_file['name'])) {
|
||||
if(!$menu_srl || !$menu_item_srl || !$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)/i',$target_file['name']))
|
||||
{
|
||||
Context::set('error_messge', Context::getLang('msg_invalid_request'));
|
||||
// Move the file to a specific director if the uploaded file meets requirement
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmp_arr = explode('.',$target_file['name']);
|
||||
$ext = $tmp_arr[count($tmp_arr)-1];
|
||||
|
||||
|
|
@ -1250,7 +1271,6 @@
|
|||
Context::set('filename', $filename);
|
||||
}
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('menu_file_uploaded');
|
||||
}
|
||||
|
|
@ -1259,7 +1279,8 @@
|
|||
* Remove the menu image button
|
||||
* @return void
|
||||
*/
|
||||
function procMenuAdminDeleteButton() {
|
||||
function procMenuAdminDeleteButton()
|
||||
{
|
||||
$menu_srl = Context::get('menu_srl');
|
||||
$menu_item_srl = Context::get('menu_item_srl');
|
||||
$target = Context::get('target');
|
||||
|
|
@ -1273,7 +1294,8 @@
|
|||
* Get all act list for admin menu
|
||||
* @return void
|
||||
*/
|
||||
function procMenuAdminAllActList() {
|
||||
function procMenuAdminAllActList()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$installed_module_list = $oModuleModel->getModulesXmlInfo();
|
||||
if(is_array($installed_module_list))
|
||||
|
|
@ -1344,12 +1366,14 @@
|
|||
$oMenuModel = &getAdminModel('menu');
|
||||
$item_info = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
|
||||
// Update if exists
|
||||
if($item_info->menu_item_srl == $args->menu_item_srl) {
|
||||
if($item_info->menu_item_srl == $args->menu_item_srl)
|
||||
{
|
||||
$output = executeQuery('menu.updateMenuItem', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
// Insert if not exist
|
||||
else {
|
||||
else
|
||||
{
|
||||
$args->listorder = -1*$args->menu_item_srl;
|
||||
$output = executeQuery('menu.insertMenuItem', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -1452,7 +1476,8 @@
|
|||
* @param int $menu_srl
|
||||
* @return string
|
||||
*/
|
||||
function makeXmlFile($menu_srl) {
|
||||
function makeXmlFile($menu_srl)
|
||||
{
|
||||
// Return if there is no information when creating the xml file
|
||||
if(!$menu_srl) return;
|
||||
// Get menu informaton
|
||||
|
|
@ -1461,7 +1486,8 @@
|
|||
if(!$output->toBool() || !$output->data) return $output;
|
||||
$site_srl = (int)$output->data->site_srl;
|
||||
|
||||
if($site_srl) {
|
||||
if($site_srl)
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$columnList = array('sites.domain');
|
||||
$site_info = $oModuleModel->getSiteInfo($site_srl, $columnList);
|
||||
|
|
@ -1477,7 +1503,8 @@
|
|||
$php_file = sprintf("./files/cache/menu/%s.php", $menu_srl);
|
||||
// If no data found, generate an XML file without node data
|
||||
$list = $output->data;
|
||||
if(!$list) {
|
||||
if(!$list)
|
||||
{
|
||||
$xml_buff = "<root />";
|
||||
FileHandler::writeFile($xml_file, $xml_buff);
|
||||
FileHandler::writeFile($php_file, '<?php if(!defined("__ZBXE__")) exit(); ?>');
|
||||
|
|
@ -1487,7 +1514,8 @@
|
|||
if(!is_array($list)) $list = array($list);
|
||||
// Create a tree for loop
|
||||
$list_count = count($list);
|
||||
for($i=0;$i<$list_count;$i++) {
|
||||
for($i=0;$i<$list_count;$i++)
|
||||
{
|
||||
$node = $list[$i];
|
||||
$menu_item_srl = $node->menu_item_srl;
|
||||
$parent_srl = $node->parent_srl;
|
||||
|
|
@ -1567,28 +1595,33 @@
|
|||
* @param string $domain
|
||||
* @return string
|
||||
*/
|
||||
function getXmlTree($source_node, $tree, $site_srl, $domain) {
|
||||
function getXmlTree($source_node, $tree, $site_srl, $domain)
|
||||
{
|
||||
if(!$source_node) return;
|
||||
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
|
||||
foreach($source_node as $menu_item_srl => $node) {
|
||||
foreach($source_node as $menu_item_srl => $node)
|
||||
{
|
||||
$child_buff = "";
|
||||
// Get data of the child nodes
|
||||
if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
|
||||
// List variables
|
||||
$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
|
||||
foreach($names as $key => $val) {
|
||||
foreach($names as $key => $val)
|
||||
{
|
||||
$name_arr_str .= sprintf('"%s"=>"%s",',$key, str_replace('\\','\\\\',htmlspecialchars($val)));
|
||||
}
|
||||
$name_str = sprintf('$_names = array(%s); print $_names[$lang_type];', $name_arr_str);
|
||||
|
||||
$url = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->url);
|
||||
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url)) {
|
||||
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
|
||||
{
|
||||
$href = getSiteUrl($domain, '','mid',$node->url);
|
||||
$pos = strpos($href, $_SERVER['HTTP_HOST']);
|
||||
if($pos !== false) $href = substr($href, $pos+strlen($_SERVER['HTTP_HOST']));
|
||||
} else $href = $url;
|
||||
}
|
||||
else $href = $url;
|
||||
$is_shortcut = $node->is_shortcut;
|
||||
$open_window = $node->open_window;
|
||||
$expand = $node->expand;
|
||||
|
|
@ -1605,13 +1638,16 @@
|
|||
|
||||
$group_srls = $node->group_srls;
|
||||
|
||||
if($normal_btn) {
|
||||
if($normal_btn)
|
||||
{
|
||||
if(preg_match('/\.png$/',$normal_btn)) $classname = 'class="iePngFix"';
|
||||
else $classname = '';
|
||||
if($hover_btn) $hover_str = sprintf('onmouseover="this.src=\'%s\'"', $hover_btn); else $hover_str = '';
|
||||
if($active_btn) $active_str = sprintf('onmousedown="this.src=\'%s\'"', $active_btn); else $active_str = '';
|
||||
$link = sprintf('<img src="%s" onmouseout="this.src=\'%s\'" alt="<?php print htmlspecialchars($_names[$lang_type]) ?>" %s %s %s />', $normal_btn, $normal_btn, $hover_str, $active_str, $classname);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$link = '<?php print $_names[$lang_type]; ?>';
|
||||
}
|
||||
// If the value of node->group_srls exists
|
||||
|
|
@ -1655,20 +1691,23 @@
|
|||
* @param string $domain
|
||||
* @return array
|
||||
*/
|
||||
function getPhpCacheCode($source_node, $tree, $site_srl, $domain) {
|
||||
function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
|
||||
{
|
||||
$output = array("buff"=>"", "url_list"=>array());
|
||||
if(!$source_node) return $output;
|
||||
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
|
||||
foreach($source_node as $menu_item_srl => $node) {
|
||||
foreach($source_node as $menu_item_srl => $node)
|
||||
{
|
||||
// Get data from child nodes if exist.
|
||||
if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
|
||||
else $child_output = array("buff"=>"", "url_list"=>array());
|
||||
// List variables
|
||||
$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
|
||||
unset($name_arr_str);
|
||||
foreach($names as $key => $val) {
|
||||
foreach($names as $key => $val)
|
||||
{
|
||||
$name_arr_str .= sprintf('"%s"=>"%s",',$key, str_replace(array('\\','"'),array('\\\\','"'),$val));
|
||||
}
|
||||
$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
|
||||
|
|
@ -1681,11 +1720,13 @@
|
|||
// List variables
|
||||
$href = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->href);
|
||||
$url = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->url);
|
||||
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url)) {
|
||||
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
|
||||
{
|
||||
$href = getSiteUrl($domain, '','mid',$node->url);
|
||||
$pos = strpos($href, $_SERVER['HTTP_HOST']);
|
||||
if($pos !== false) $href = substr($href, $pos+strlen($_SERVER['HTTP_HOST']));
|
||||
} else $href = $url;
|
||||
}
|
||||
else $href = $url;
|
||||
$is_shortcut = $node->is_shortcut;
|
||||
$open_window = $node->open_window;
|
||||
$normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->normal_btn);
|
||||
|
|
@ -1715,7 +1756,8 @@
|
|||
|
||||
$group_srls = $node->group_srls;
|
||||
|
||||
if($normal_btn) {
|
||||
if($normal_btn)
|
||||
{
|
||||
if(preg_match('/\.png$/',$normal_btn)) $classname = 'class=\"iePngFix\"';
|
||||
else $classname = '';
|
||||
if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
|
||||
|
|
@ -1723,7 +1765,9 @@
|
|||
$link = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s %s %s />"', $normal_btn, $normal_btn, $node->menu_item_srl, $hover_str, $active_str, $classname);
|
||||
if($active_btn) $link_active = sprintf('"<img src=\"%s\" alt=\"".$_menu_names[%d][$lang_type]."\" %s />"', $active_btn, $node->menu_item_srl, $classname);
|
||||
else $link_active = $link;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$link_active = $link = sprintf('$_menu_names[%d][$lang_type]', $node->menu_item_srl);
|
||||
}
|
||||
// Create properties (check if it belongs to the menu node by url_list. It looks a trick but fast and powerful)
|
||||
|
|
@ -1766,7 +1810,8 @@
|
|||
* @param int $layout_srl
|
||||
* @param array $menu_srl_list
|
||||
*/
|
||||
function updateMenuLayout($layout_srl, $menu_srl_list) {
|
||||
function updateMenuLayout($layout_srl, $menu_srl_list)
|
||||
{
|
||||
if(!count($menu_srl_list)) return;
|
||||
// Delete the value of menu_srls
|
||||
$args->menu_srls = implode(',',$menu_srl_list);
|
||||
|
|
@ -1775,7 +1820,8 @@
|
|||
|
||||
$args->layout_srl = $layout_srl;
|
||||
// Mapping menu_srls, layout_srl
|
||||
for($i=0;$i<count($menu_srl_list);$i++) {
|
||||
for($i=0;$i<count($menu_srl_list);$i++)
|
||||
{
|
||||
$args->menu_srl = $menu_srl_list[$i];
|
||||
$output = executeQuery('menu.insertMenuLayout', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -1898,4 +1944,5 @@
|
|||
return $this->homeMenuCacheFile;
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file menu.admin.controller.php */
|
||||
/* Location: ./modules/menu/menu.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -7,14 +7,16 @@
|
|||
* @package /modules/menu
|
||||
* @version 0.1
|
||||
*/
|
||||
class menuAdminModel extends menu {
|
||||
class menuAdminModel extends menu
|
||||
{
|
||||
private $menuSrlWithinHome = 0;
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -22,8 +24,10 @@
|
|||
* @param object $obj
|
||||
* @return object
|
||||
*/
|
||||
function getMenuList($obj) {
|
||||
if(!$obj->site_srl) {
|
||||
function getMenuList($obj)
|
||||
{
|
||||
if(!$obj->site_srl)
|
||||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$obj->site_srl = (int)$site_module_info->site_srl;
|
||||
}
|
||||
|
|
@ -45,8 +49,10 @@
|
|||
* @param int $site_srl
|
||||
* @return array
|
||||
*/
|
||||
function getMenus($site_srl = null) {
|
||||
if(!isset($site_srl)) {
|
||||
function getMenus($site_srl = null)
|
||||
{
|
||||
if(!isset($site_srl))
|
||||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = (int)$site_module_info->site_srl;
|
||||
}
|
||||
|
|
@ -65,7 +71,8 @@
|
|||
* @param int $menu_srl
|
||||
* @return object
|
||||
*/
|
||||
function getMenu($menu_srl) {
|
||||
function getMenu($menu_srl)
|
||||
{
|
||||
// Get information from the DB
|
||||
$args->menu_srl = $menu_srl;
|
||||
$output = executeQuery('menu.getMenu', $args);
|
||||
|
|
@ -83,7 +90,8 @@
|
|||
* @param string $title
|
||||
* @return object
|
||||
*/
|
||||
function getMenuByTitle($title) {
|
||||
function getMenuByTitle($title)
|
||||
{
|
||||
// Get information from the DB
|
||||
$args->title = $title;
|
||||
$output = executeQuery('menu.getMenuByTitle', $args);
|
||||
|
|
@ -106,7 +114,8 @@
|
|||
* @param int $menu_item_srl
|
||||
* @return object
|
||||
*/
|
||||
function getMenuItemInfo($menu_item_srl) {
|
||||
function getMenuItemInfo($menu_item_srl)
|
||||
{
|
||||
// Get the menu information if menu_item_srl exists
|
||||
$args->menu_item_srl = $menu_item_srl;
|
||||
$output = executeQuery('menu.getMenuItem', $args);
|
||||
|
|
@ -116,7 +125,8 @@
|
|||
else $node->group_srls = array();
|
||||
|
||||
$tmp_name = unserialize($node->name);
|
||||
if($tmp_name && count($tmp_name) ) {
|
||||
if($tmp_name && count($tmp_name))
|
||||
{
|
||||
$selected_lang = array();
|
||||
$rand_name = $tmp_name[Context::getLangType()];
|
||||
if(!$rand_name) $rand_name = array_shift($tmp_name);
|
||||
|
|
@ -145,7 +155,8 @@
|
|||
if(!$moduleInfo) $menuItem->moduleType = 'url';
|
||||
else
|
||||
{
|
||||
if($moduleInfo->mid == $menuItem->url) {
|
||||
if($moduleInfo->mid == $menuItem->url)
|
||||
{
|
||||
$menuItem->moduleType = $moduleInfo->module;
|
||||
$menuItem->pageType = $moduleInfo->page_type;
|
||||
$menuItem->layoutSrl = $moduleInfo->layout_srl;
|
||||
|
|
@ -182,7 +193,8 @@
|
|||
{
|
||||
|
||||
$groupList[$value->group_srl]->group_srl = $value->group_srl;
|
||||
if(substr($value->title,0,12)=='$user_lang->') {
|
||||
if(substr($value->title,0,12)=='$user_lang->')
|
||||
{
|
||||
$tmp = $oModuleAdminModel->getLangCode(0, $value->title);
|
||||
$groupList[$value->group_srl]->title = $tmp[Context::getLangType()];
|
||||
}
|
||||
|
|
@ -223,8 +235,10 @@
|
|||
* @param int $site_srl
|
||||
* @return array
|
||||
*/
|
||||
function getMenuItemNames($source_name, $site_srl = null) {
|
||||
if(!$site_srl) {
|
||||
function getMenuItemNames($source_name, $site_srl = null)
|
||||
{
|
||||
if(!$site_srl)
|
||||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = (int)$site_module_info->site_srl;
|
||||
}
|
||||
|
|
@ -238,7 +252,8 @@
|
|||
* Return html after compiling tpl on the server in order to add menu information on the admin page
|
||||
* @return void
|
||||
*/
|
||||
function getMenuAdminTplInfo() {
|
||||
function getMenuAdminTplInfo()
|
||||
{
|
||||
// Get information on the menu for the parameter settings
|
||||
$menu_item_srl = Context::get('menu_item_srl');
|
||||
$parent_srl = Context::get('parent_srl');
|
||||
|
|
@ -247,7 +262,8 @@
|
|||
$group_list = $oMemberModel->getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
// Add a sub-menu if there is parent_srl but not menu_item_srl
|
||||
if(!$menu_item_srl && $parent_srl) {
|
||||
if(!$menu_item_srl && $parent_srl)
|
||||
{
|
||||
// Get information of the parent menu
|
||||
$parent_info = $this->getMenuItemInfo($parent_srl);
|
||||
// Default parameter settings for a new menu
|
||||
|
|
@ -255,11 +271,14 @@
|
|||
$item_info->parent_srl = $parent_srl;
|
||||
$item_info->parent_menu_name = $parent_info->name;
|
||||
// In case of modifying the existing menu or addting a new menu to the root
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get information of the menu if menu_item_srl exists
|
||||
if($menu_item_srl) $item_info = $this->getMenuItemInfo($menu_item_srl);
|
||||
// Get only menu_item_srl if no values found, considering it as adding a new menu
|
||||
if(!$item_info->menu_item_srl) {
|
||||
if(!$item_info->menu_item_srl)
|
||||
{
|
||||
$item_info->menu_item_srl = getNextSequence();
|
||||
}
|
||||
}
|
||||
|
|
@ -548,9 +567,10 @@
|
|||
{
|
||||
foreach($menu['list'] AS $key=>$value)
|
||||
{
|
||||
$this->_menuInfoSetting($menu['list'][$key], &$start_module, $isMenuFixed, $menuSrl);
|
||||
$this->_menuInfoSetting($menu['list'][$key], $start_module, $isMenuFixed, $menuSrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file menu.admin.model.php */
|
||||
/* Location: ./modules/menu/menu.admin.model.php */
|
||||
|
|
|
|||
|
|
@ -7,14 +7,16 @@
|
|||
* @package /modules/menu
|
||||
* @version 0.1
|
||||
*/
|
||||
class menuAdminView extends menu {
|
||||
class menuAdminView extends menu
|
||||
{
|
||||
var $tmpMenu = null;
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
function init()
|
||||
{
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
|
|
@ -22,7 +24,8 @@
|
|||
* The first page of the menu admin
|
||||
* @return void
|
||||
*/
|
||||
function dispMenuAdminContent() {
|
||||
function dispMenuAdminContent()
|
||||
{
|
||||
// Get a list of registered menus
|
||||
$obj->page = Context::get('page');
|
||||
$obj->sort_index = 'listorder';
|
||||
|
|
@ -49,11 +52,13 @@
|
|||
* Page to insert a menu
|
||||
* @return void
|
||||
*/
|
||||
function dispMenuAdminInsert() {
|
||||
function dispMenuAdminInsert()
|
||||
{
|
||||
// Set the menu with menu information
|
||||
$menu_srl = Context::get('menu_srl');
|
||||
|
||||
if($menu_srl) {
|
||||
if($menu_srl)
|
||||
{
|
||||
// Get information of the menu
|
||||
$oMenuModel = &getAdminModel('menu');
|
||||
$menu_info = $oMenuModel->getMenu($menu_srl);
|
||||
|
|
@ -67,7 +72,8 @@
|
|||
* Menu admin page
|
||||
* @return void
|
||||
*/
|
||||
function dispMenuAdminManagement() {
|
||||
function dispMenuAdminManagement()
|
||||
{
|
||||
// Get information of the menu
|
||||
$menu_srl = Context::get('menu_srl');
|
||||
|
||||
|
|
@ -87,13 +93,13 @@
|
|||
$this->setTemplateFile('menu_management');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display a mid list to be able to select on the menu
|
||||
* Perphaps this method not use
|
||||
* @return void
|
||||
*/
|
||||
function dispMenuAdminMidList() {
|
||||
function dispMenuAdminMidList()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
// Get a list of module categories
|
||||
$module_category = $oModuleModel->getModuleCategories();
|
||||
|
|
@ -321,4 +327,5 @@
|
|||
return $arrangedMenuItemList;
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file menu.admin.view.php */
|
||||
/* Location: ./modules/menu/menu.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -7,12 +7,14 @@
|
|||
* @package /modules/menu
|
||||
* @version 0.1
|
||||
*/
|
||||
class menu extends ModuleObject {
|
||||
class menu extends ModuleObject
|
||||
{
|
||||
/**
|
||||
* Implement if additional tasks are necessary when installing
|
||||
* @return Object
|
||||
*/
|
||||
function moduleInstall() {
|
||||
function moduleInstall()
|
||||
{
|
||||
// Create a directory to use menu
|
||||
FileHandler::makeDir('./files/cache/menu');
|
||||
|
||||
|
|
@ -23,7 +25,8 @@
|
|||
* A method to check if successfully installed
|
||||
* @return bool
|
||||
*/
|
||||
function checkUpdate() {
|
||||
function checkUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
// 2009. 02. 11 menu added to the table site_srl
|
||||
if(!$oDB->isColumnExists('menu', 'site_srl')) return true;
|
||||
|
|
@ -38,11 +41,6 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute update
|
||||
* @return Object
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute update
|
||||
* @return Object
|
||||
|
|
@ -50,12 +48,14 @@
|
|||
function moduleUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
// 2009. 02. 11 menu added to the table site_srl
|
||||
if(!$oDB->isColumnExists('menu', '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")) {
|
||||
if(!$oDB->isIndexExists("menu","idx_title"))
|
||||
{
|
||||
$oDB->addIndex('menu', 'idx_title', array('title'));
|
||||
}
|
||||
|
||||
|
|
@ -97,17 +97,20 @@
|
|||
* Re-generate the cache file
|
||||
* @return void
|
||||
*/
|
||||
function recompileCache() {
|
||||
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) {
|
||||
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 */
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@
|
|||
* @package /modules/menu
|
||||
* @version 0.1
|
||||
*/
|
||||
class menuMobile extends moduleObject {
|
||||
class menuMobile extends moduleObject
|
||||
{
|
||||
/**
|
||||
* Result data list
|
||||
* @var array
|
||||
|
|
@ -36,7 +37,8 @@ class menuMobile extends moduleObject {
|
|||
* Display menu
|
||||
* @return void
|
||||
*/
|
||||
function dispMenuMenu() {
|
||||
function dispMenuMenu()
|
||||
{
|
||||
$menu_srl = Context::get('menu_srl');
|
||||
$oAdminModel =& getAdminModel('menu');
|
||||
$menu_info = $oAdminModel->getMenu($menu_srl);
|
||||
|
|
@ -50,7 +52,7 @@ class menuMobile extends moduleObject {
|
|||
|
||||
$this->setTemplatePath(sprintf("%stpl/",$this->module_path));
|
||||
$this->setTemplateFile('menu.html');
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file menu.mobile.php */
|
||||
/* Location: ./modules/menu/menu.mobile.php */
|
||||
|
|
|
|||
|
|
@ -3,20 +3,21 @@
|
|||
* @class messageAdminController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief admin controller class of message module
|
||||
**/
|
||||
|
||||
class messageAdminController extends message {
|
||||
|
||||
*/
|
||||
class messageAdminController extends message
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configuration
|
||||
**/
|
||||
function procMessageAdminInsertConfig() {
|
||||
*/
|
||||
function procMessageAdminInsertConfig()
|
||||
{
|
||||
// Get information
|
||||
$args = Context::gets('skin', 'mskin');
|
||||
// Create a module Controller object
|
||||
|
|
@ -30,4 +31,5 @@
|
|||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file message.admin.controller.php */
|
||||
/* Location: ./modules/message/message.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -3,20 +3,21 @@
|
|||
* @class messageAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief admin view class of the message module
|
||||
**/
|
||||
|
||||
class messageAdminView extends message {
|
||||
|
||||
*/
|
||||
class messageAdminView extends message
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configuration
|
||||
**/
|
||||
function dispMessageAdminConfig() {
|
||||
*/
|
||||
function dispMessageAdminConfig()
|
||||
{
|
||||
// Get a list of skins(themes)
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
|
|
@ -33,13 +34,12 @@
|
|||
// Set a template file
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
|
||||
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('skin_list..title', 'mskin_list..title');
|
||||
|
||||
$this->setTemplateFile('config');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
/* End of file message.admin.view.php */
|
||||
/* Location: ./modules/message/message.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -3,20 +3,20 @@
|
|||
* @class message
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief high class of message module
|
||||
**/
|
||||
|
||||
class message extends ModuleObject {
|
||||
|
||||
*/
|
||||
class message extends ModuleObject
|
||||
{
|
||||
/**
|
||||
* @brief Implement if additional tasks are necessary when installing
|
||||
**/
|
||||
function moduleInstall() {
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief a method to check if successfully installed
|
||||
**/
|
||||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
/**
|
||||
* @brief Execute update
|
||||
**/
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
|
|
@ -61,8 +61,10 @@
|
|||
|
||||
/**
|
||||
* @brief Re-generate the cache file
|
||||
**/
|
||||
function recompileCache() {
|
||||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file message.class.php */
|
||||
/* Location: ./modules/message/message.class.php */
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
<?php
|
||||
require_once(_XE_PATH_.'modules/message/message.view.php');
|
||||
|
||||
class messageMobile extends messageView {
|
||||
|
||||
class messageMobile extends messageView
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Message output
|
||||
**/
|
||||
function dispMessage() {
|
||||
function dispMessage()
|
||||
{
|
||||
// Get configurations (using module model object)
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('message');
|
||||
|
|
@ -25,7 +26,8 @@
|
|||
Context::set('member_config', $member_config);
|
||||
// Set a flag to check if the https connection is made when using SSL and create https url
|
||||
$ssl_mode = false;
|
||||
if($member_config->enable_ssl == 'Y') {
|
||||
if($member_config->enable_ssl == 'Y')
|
||||
{
|
||||
if(preg_match('/^https:\/\//i',Context::getRequestUri())) $ssl_mode = true;
|
||||
}
|
||||
Context::set('ssl_mode',$ssl_mode);
|
||||
|
|
@ -38,6 +40,6 @@
|
|||
$this->setTemplatePath($template_path);
|
||||
$this->setTemplateFile('system_message');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
/* End of file message.mobile.php */
|
||||
/* Location: ./modules/message/message.mobile.php */
|
||||
|
|
|
|||
|
|
@ -3,21 +3,19 @@
|
|||
* @class messageView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief view class of the message module
|
||||
**/
|
||||
|
||||
class messageView extends message {
|
||||
|
||||
*/
|
||||
class messageView extends message
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Display messages
|
||||
**/
|
||||
*/
|
||||
function dispMessage()
|
||||
{
|
||||
// Get configurations (using module model object)
|
||||
|
|
@ -50,7 +48,8 @@ class messageView extends message {
|
|||
Context::set('member_config', $member_config);
|
||||
// Set a flag to check if the https connection is made when using SSL and create https url
|
||||
$ssl_mode = false;
|
||||
if($member_config->enable_ssl == 'Y') {
|
||||
if($member_config->enable_ssl == 'Y')
|
||||
{
|
||||
if(preg_match('/^https:\/\//i',Context::getRequestUri())) $ssl_mode = true;
|
||||
}
|
||||
Context::set('ssl_mode',$ssl_mode);
|
||||
|
|
@ -60,4 +59,5 @@ class messageView extends message {
|
|||
$this->setTemplateFile('system_message');
|
||||
}
|
||||
}
|
||||
?>
|
||||
/* End of file message.view.php */
|
||||
/* Location: ./modules/message/message.view.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue