issue 160 when new menu add in sitemap.

get module list by created module instance


git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9247 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-09-21 04:35:45 +00:00
parent 28c8c97343
commit ad8da09158
4 changed files with 38 additions and 4 deletions

View file

@ -227,12 +227,36 @@
**/ **/
function getModuleListInSitemap() function getModuleListInSitemap()
{ {
// after trigger $oModuleModel = &getModel('module');
$columnList = array('module');
$moduleList = array('page'); $moduleList = array('page');
$output = $oModuleModel->getModuleListByInstance($columnList);
if(is_array($output->data))
{
foreach($output->data AS $key=>$value)
{
array_push($moduleList, $value->module);
}
}
// after trigger
$output = ModuleHandler::triggerCall('menu.getModuleListInSitemap', 'after', $moduleList); $output = ModuleHandler::triggerCall('menu.getModuleListInSitemap', 'after', $moduleList);
if(!$output->toBool()) return $output; if(!$output->toBool()) return $output;
return $moduleList; $moduleList = array_unique($moduleList);
$moduleInfoList = array();
if(is_array($moduleList))
{
foreach($moduleList AS $key=>$value)
{
$moduleInfo = $oModuleModel->getModuleInfoXml($value);
$moduleInfoList[$value] = $moduleInfo;
}
}
return $moduleInfoList;
} }
} }
?> ?>

View file

@ -56,7 +56,8 @@ $('form.siteMap')
else else
{ {
inputCType[1].checked = true; inputCType[1].checked = true;
editForm.find('input[name=select_menu_url]').val(menuItem.url); editForm.find('select[name=module_type]').val(moduleType);
editForm.find('select[name=select_menu_url]').val(menuItem.url);
} }
typeCheck(); typeCheck();
getModuleList(); getModuleList();

View file

@ -98,7 +98,7 @@ xe.lang.confirm_delete = "{$lang->confirm_delete}";
<p class="q"><label for="kModule">{$lang->select_module}</label></p> <p class="q"><label for="kModule">{$lang->select_module}</label></p>
<p class="a"> <p class="a">
<select style="width:290px" id="kModule" name="module_type"> <select style="width:290px" id="kModule" name="module_type">
<option loop="$module_list=>$key,$value" value="{$value}">{$value}</option> <option loop="$module_list=>$key,$value" value="{$key}">{$value->title}</option>
</select> </select>
</p> </p>
</li> </li>

View file

@ -1514,6 +1514,15 @@
$this->add('results', $list); $this->add('results', $list);
} }
/**
* @brief already instance created module list
**/
function getModuleListByInstance($columnList = array())
{
$output = executeQueryArray('module.getModuleListByInstance', $args, $columnList);
return $output;
}
function getLangByLangcode() function getLangByLangcode()
{ {
$langCode = Context::get('langCode'); $langCode = Context::get('langCode');