* fix bug #755.
This commit is contained in:
@@ -1030,6 +1030,31 @@ class treeModel extends model
|
||||
return empty($module) ? 0 : $module->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get modules name.
|
||||
*
|
||||
* @param array $moduleIdList
|
||||
* @param bool $allPath
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getModulesName($moduleIdList, $allPath = true)
|
||||
{
|
||||
if(!$allPath) return $this->dao->select('id, name')->from(TABLE_MODULE)->where('id')->in($moduleIdList)->fetchPairs('id', 'name');
|
||||
|
||||
$modules = $this->dao->select('id, name, path')->from(TABLE_MODULE)->where('id')->in($moduleIdList)->fetchAll('path');
|
||||
$allModules = $this->dao->select('id, name')->from(TABLE_MODULE)->where('id')->in(join(array_keys($modules)))->fetchPairs('id', 'name');
|
||||
$modulePairs = array();
|
||||
foreach($modules as $module)
|
||||
{
|
||||
$paths = explode(',', trim($module->path, ','));
|
||||
$moduleName = '';
|
||||
foreach($paths as $path) $moduleName .= '/' . $allModules[$path];
|
||||
$modulePairs[$module->id] = $moduleName;
|
||||
}
|
||||
return $modulePairs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update modules' order.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user