issue 2369 add the layout list.

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11367 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
devjin 2012-09-19 06:05:49 +00:00
parent 68e87187fb
commit ce154f8056
3 changed files with 46 additions and 0 deletions

View file

@ -38,6 +38,8 @@
<action name="procLayoutAdminUserLayoutImport" type="controller" standalone="true" ruleset="userLayoutImport" />
<action name="procLayoutAdminCopyLayout" type="controller" standalone="true" />
<action name="getLayoutInstanceListForJSONP" type="model" />
</actions>
<menus>
<menu name="installedLayout">

View file

@ -41,6 +41,49 @@
return $output->data;
}
/**
* Get the list layout instance with thumbnail link. for setting design.
*
* @return void
*/
public function getLayoutInstanceListForJSONP()
{
$siteSrl = Context::get('site_srl');
$layoutType = Context::get('layout_type');
$layoutList = $this->getLayoutInstanceList($siteSrl, $layoutType);
$thumbs = array();
foreach($layoutList as $key => $val)
{
if($thumbs[$val->layouts])
{
$val->thumbnail = $thumbs[$val->layouts];
continue;
}
$token = explode('|@|', $val->layout);
if(count($token) == 2)
{
$thumbnailPath = sprintf('./themes/%s/layouts/%s/thumbnail.png' , $token[0], $token[1]);
}
else
{
$thumbnailPath = sprintf('./layouts/%s/thumbnail.png' , $val->layout);
}
if(is_readable($thumbnailPath))
{
$val->thumbnail = $thumbnailPath;
}
else
{
$val->thumbnail = sprintf('./modules/layout/tpl/images/noThumbnail.jpg');
}
$thumbs[$val->layout] = $val->thumbnail;
}
$this->add('layout_list', $layoutList);
}
/**
* Get layout instance list
* @param int $siteSrl
@ -108,6 +151,7 @@
return $output->data;
}
/**
* Get one of layout information created in the DB
* Return DB info + XML info of the generated layout

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB