mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
issue 2559 add function that getModuleInfoByMenuItemSrl.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11617 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e8dc9e135f
commit
37ed9f9d3a
2 changed files with 80 additions and 0 deletions
|
|
@ -182,6 +182,67 @@
|
|||
return $this->addModuleExtraVars($module_info);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get module info by menu_item_srl.
|
||||
*
|
||||
* @params int $menu_item_srl
|
||||
*
|
||||
* @return Object $moduleInfo
|
||||
**/
|
||||
public function getModuleInfoByMenuItemSrl($menu_item_srl = 0)
|
||||
{
|
||||
$menuItemSrl = Context::get('menu_item_srl');
|
||||
$menuItemSrl = (!$menuItemSrl) ? $menu_item_srl : $menuItemSrl;
|
||||
|
||||
if(!$menuItemSrl)
|
||||
{
|
||||
$this->stop(-1, 'msg_invalid_request');
|
||||
return;
|
||||
}
|
||||
|
||||
$args->menu_item_srl = $menuItemSrl;
|
||||
|
||||
$output = executeQuery('module.getModuleInfoByMenuItemSrl', $args);
|
||||
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$moduleInfo = $output->data;
|
||||
$mid = $moduleInfo->mid;
|
||||
$site_srl = $moduleInfo->site_srl;
|
||||
|
||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$mid.'_'.$site_srl;
|
||||
$module_srl = $oCacheHandler->get($cache_key);
|
||||
if($module_srl){
|
||||
$cache_key = 'object_module_info:'.$module_srl;
|
||||
$coutput = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
}
|
||||
|
||||
if(!$coutput)
|
||||
{
|
||||
if($oCacheHandler->isSupport()) {
|
||||
$cache_key = 'object:'.$mid.'_'.$site_srl;
|
||||
$oCacheHandler->put($cache_key,$output->data->module_srl);
|
||||
$cache_key = 'object_module_info:'.$output->data->module_srl;
|
||||
$oCacheHandler->put($cache_key,$output);
|
||||
}
|
||||
}
|
||||
|
||||
$moduleInfo->is_layout_fix = ($moduleInfo->layout_srl == -1000) ? 'N' : 'Y';
|
||||
|
||||
$moduleInfo = $this->addModuleExtraVars($moduleInfo);
|
||||
|
||||
$this->add('module_info_by_menu_item_srl', $moduleInfo);
|
||||
|
||||
return $moduleInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get module information corresponding to module_srl
|
||||
**/
|
||||
|
|
@ -261,6 +322,7 @@
|
|||
$target_module_info[$key]->{$k} = $v;
|
||||
}
|
||||
}
|
||||
|
||||
if(is_array($module_info)) return $target_module_info;
|
||||
return $target_module_info[0];
|
||||
}
|
||||
|
|
|
|||
18
modules/module/queries/getModuleInfoByMenuItemSrl.xml
Normal file
18
modules/module/queries/getModuleInfoByMenuItemSrl.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<query id="getModuleInfoByMenuItemSrl" action="select">
|
||||
<tables>
|
||||
<table name="modules" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<query operation="equal" column="mid" notnull="notnull" alias="getMidByMenuSrl">
|
||||
<tables>
|
||||
<table name="menu_item" alias="menu_item"/>
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="url" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="menu_item.menu_item_srl" var="menu_item_srl" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
</conditions>
|
||||
</query>
|
||||
Loading…
Add table
Add a link
Reference in a new issue