mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-13 16:34:52 +09:00
Implement moduleModel::getAllDomains()
This commit is contained in:
parent
94c45958c4
commit
37a0aa0f13
3 changed files with 22 additions and 11 deletions
|
|
@ -19,8 +19,7 @@ class module extends ModuleObject
|
|||
$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"), true);
|
||||
|
||||
// Insert new domain
|
||||
$output = executeQuery('module.getDomains');
|
||||
if(!$output->data || !$output->data->index_module_srl)
|
||||
if(!getModel('module')->getSiteInfo(0))
|
||||
{
|
||||
$current_url = Rhymix\Framework\Url::getCurrentUrl();
|
||||
$domain = new stdClass();
|
||||
|
|
@ -93,12 +92,7 @@ class module extends ModuleObject
|
|||
}
|
||||
|
||||
// Check domains
|
||||
if (!$oDB->isTableExists('domains'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
$output = $oDB->executeQuery('module.getDomains', new stdClass);
|
||||
if (!$output->data)
|
||||
if (!$oDB->isTableExists('domains') || !getModel('module')->getSiteInfo(0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -314,8 +308,7 @@ class module extends ModuleObject
|
|||
}
|
||||
|
||||
// Migrate domains
|
||||
$output = @executeQuery('module.getDomains');
|
||||
if (!$output->data)
|
||||
if (!getModel('module')->getSiteInfo(0))
|
||||
{
|
||||
$this->migrateDomains();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,24 @@ class moduleModel extends module
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get all domains
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getAllDomains($count = 20, $page = 1)
|
||||
{
|
||||
$args = new stdClass;
|
||||
$args->list_count = $count;
|
||||
$args->page = $page;
|
||||
$output = executeQueryArray('module.getDomains', $args);
|
||||
foreach ($output->data as &$domain)
|
||||
{
|
||||
$domain->settings = $domain->settings ? json_decode($domain->settings) : new stdClass;
|
||||
}
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get site information
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<column name="*" />
|
||||
</columns>
|
||||
<navigation>
|
||||
<index var="sort_index" default="domain_srl" order="desc" />
|
||||
<index var="sort_index" default="domain_srl" order="asc" />
|
||||
<list_count var="list_count" default="20" />
|
||||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue