Display module that is setted 'have_instance' on easyinstall server at add menu

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12292 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-11-23 07:59:17 +00:00
parent 76c448d62e
commit 30ba6b7835
9 changed files with 55 additions and 2 deletions

View file

@ -329,9 +329,29 @@ class menuAdminModel extends menu
$output = ModuleHandler::triggerCall('menu.getModuleListInSitemap', 'after', $moduleList);
if(!$output->toBool()) return $output;
$moduleList = array_unique($moduleList);
$localModuleList = array_unique($moduleList);
$oAutoinstallModel = getModel('autoinstall');
// get have instance
$remotePackageList = $oAutoinstallModel->getHaveInstance(array('path'));
$remoteModuleList = array();
foreach($remotePackageList as $package)
{
if(strpos($package->path, './modules/') !== 0) continue;
$pathInfo = explode('/', $package->path);
$remoteModuleList[] = $pathInfo[2];
}
// all module list
$allModuleList = FileHandler::readDir('./modules', '/^([a-zA-Z0-9_-]+)$/');
// union have instance and all module list
$haveInstance = array_intersect($remoteModuleList, $allModuleList);
// union
$moduleList = array_unique(array_merge($localModuleList, $haveInstance));
$moduleInfoList = array();
Context::loadLang('modules/page/lang');