mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Issue 2310: Make getAllSites query accesible to all modules
git-svn-id: http://xe-core.googlecode.com/svn/branches/luminous@11108 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e53766e265
commit
5142ab64f8
1 changed files with 46 additions and 33 deletions
|
|
@ -462,41 +462,54 @@
|
|||
*/
|
||||
function getSiteAllList()
|
||||
{
|
||||
if(Context::get('domain')) $args->domain = Context::get('domain');
|
||||
$columnList = array('domain', 'site_srl');
|
||||
|
||||
$siteList = array();
|
||||
$output = executeQueryArray('admin.getSiteAllList', $args, $columnList);
|
||||
if($output->toBool()) $siteList = $output->data;
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
foreach($siteList as $key => $value)
|
||||
{
|
||||
$args->site_srl = $value->site_srl;
|
||||
$list = $oModuleModel->getModuleSrlList($args);
|
||||
|
||||
if(!is_array($list))
|
||||
{
|
||||
$list = array($list);
|
||||
}
|
||||
|
||||
foreach($list as $k => $v)
|
||||
{
|
||||
if(!is_dir('./modules/' . $v->module))
|
||||
{
|
||||
unset($list[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!count($list))
|
||||
{
|
||||
unset($siteList[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->add('site_list', $siteList);
|
||||
if(Context::get('domain')) $domain = Context::get('domain');
|
||||
$siteList = $this->getAllSitesThatHaveModules($domain);
|
||||
$this->add('site_list', $siteList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all sites that contain modules
|
||||
* For each site domain and site_srl are retrieved
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getAllSitesThatHaveModules($domain = null)
|
||||
{
|
||||
$args = new stdClass();
|
||||
if($domain) $args->domain = $domain;
|
||||
$columnList = array('domain', 'site_srl');
|
||||
|
||||
$siteList = array();
|
||||
$output = executeQueryArray('admin.getSiteAllList', $args, $columnList);
|
||||
if($output->toBool()) $siteList = $output->data;
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
foreach($siteList as $key => $value)
|
||||
{
|
||||
$args->site_srl = $value->site_srl;
|
||||
$list = $oModuleModel->getModuleSrlList($args);
|
||||
|
||||
if(!is_array($list))
|
||||
{
|
||||
$list = array($list);
|
||||
}
|
||||
|
||||
foreach($list as $k => $v)
|
||||
{
|
||||
if(!is_dir('./modules/' . $v->module))
|
||||
{
|
||||
unset($list[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!count($list))
|
||||
{
|
||||
unset($siteList[$key]);
|
||||
}
|
||||
}
|
||||
return $siteList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return site count
|
||||
* @param string $date
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue