mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
issue 2371, Auto create layout instance
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11219 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
4ab49a0f7f
commit
293ccb13af
1 changed files with 45 additions and 0 deletions
|
|
@ -60,6 +60,51 @@
|
|||
$args->layout_type = $layoutType;
|
||||
$args->layout = $layout;
|
||||
$output = executeQueryArray('layout.getLayoutList', $args, $columnList);
|
||||
|
||||
// Create instance name list
|
||||
$instanceList = array();
|
||||
if(is_array($output->data))
|
||||
{
|
||||
foreach($output->data as $iInfo)
|
||||
{
|
||||
$instanceList[] = $iInfo->layout;
|
||||
}
|
||||
}
|
||||
|
||||
// Create downloaded name list
|
||||
$downloadedList = array();
|
||||
$titleList = array();
|
||||
$_downloadedList = $this->getDownloadedLayoutList($layoutType);
|
||||
if(is_array($_downloadedList))
|
||||
{
|
||||
foreach($_downloadedList as $dLayoutInfo)
|
||||
{
|
||||
$downloadedList[] = $dLayoutInfo->layout;
|
||||
$titleList[$dLayoutInfo->layout] = $dLayoutInfo->title;
|
||||
}
|
||||
}
|
||||
|
||||
// Get downloaded name list have no instance
|
||||
$noInstanceList = array_diff($downloadedList, $instanceList);
|
||||
foreach($noInstanceList as $layoutName)
|
||||
{
|
||||
$insertArgs = new stdClass();
|
||||
$insertArgs->site_srl = $siteSrl;
|
||||
$insertArgs->layout_srl = getNextSequence();
|
||||
$insertArgs->layout = $layoutName;
|
||||
$insertArgs->title = $titleList[$layoutName];
|
||||
$insertArgs->layout_type = $layoutType;
|
||||
|
||||
$oLayoutAdminController = getAdminController('layout');
|
||||
$oLayoutAdminController->insertLayout($insertArgs);
|
||||
}
|
||||
|
||||
// If create layout instance, reload instance list
|
||||
if(count($noInstanceList))
|
||||
{
|
||||
$output = executeQueryArray('layout.getLayoutList', $args, $columnList);
|
||||
}
|
||||
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue