mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 16:22:41 +09:00
issue 2585 add a layout html/css view.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11700 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
3160451de0
commit
8100737bc3
4 changed files with 169 additions and 0 deletions
|
|
@ -64,4 +64,75 @@ class layoutAdminModel extends layout {
|
|||
|
||||
$this->add('html', $script.$html);
|
||||
}
|
||||
|
||||
public function getLayoutAdminSetHTMLCSS()
|
||||
{
|
||||
// Set the layout with its information
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
// Get layout information
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($layout_srl);
|
||||
// Error appears if there is no layout information is registered
|
||||
if(!$layout_info)
|
||||
{
|
||||
return $this->dispLayoutAdminInstalledList();
|
||||
}
|
||||
|
||||
// Get Layout Code
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_file = $oLayoutModel->getUserLayoutHtml($layout_info->layout_srl);
|
||||
|
||||
if(!file_exists($layout_file))
|
||||
{
|
||||
// If faceoff
|
||||
if($oLayoutModel->useDefaultLayout($layout_info->layout_srl))
|
||||
{
|
||||
$layout_file = $oLayoutModel->getDefaultLayoutHtml($layout_info->layout);
|
||||
}
|
||||
else
|
||||
{
|
||||
$layout_file = sprintf('%s%s', $layout_info->path, 'layout.html');
|
||||
}
|
||||
}
|
||||
|
||||
$layout_css_file = $oLayoutModel->getUserLayoutCss($layout_info->layout_srl);
|
||||
if(file_exists($layout_css_file))
|
||||
{
|
||||
$layout_code_css = FileHandler::readFile($layout_css_file);
|
||||
Context::set('layout_code_css', $layout_code_css);
|
||||
}
|
||||
|
||||
$layout_code = FileHandler::readFile($layout_file);
|
||||
Context::set('layout_code', $layout_code);
|
||||
|
||||
// set User Images
|
||||
$layout_image_list = $oLayoutModel->getUserLayoutImageList($layout_info->layout_srl);
|
||||
Context::set('layout_image_list', $layout_image_list);
|
||||
|
||||
$layout_image_path = $oLayoutModel->getUserLayoutImagePath($layout_info->layout_srl);
|
||||
Context::set('layout_image_path', $layout_image_path);
|
||||
// Set widget list
|
||||
$oWidgetModel = &getModel('widget');
|
||||
$widget_list = $oWidgetModel->getDownloadedWidgetList();
|
||||
Context::set('widget_list', $widget_list);
|
||||
|
||||
|
||||
$security = new Security($layout_info);
|
||||
$layout_info = $security->encodeHTML('.', '.author..');
|
||||
Context::set('selected_layout', $layout_info);
|
||||
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('layout_list..');
|
||||
$security->encodeHTML('layout_list..author..');
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('layout_code_css', 'layout_code', 'widget_list..title');
|
||||
|
||||
$script = '<script src="/xe1.7/modules/layout/tpl/js/layout_admin_set_html.js"></script>';
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$html = $oTemplate->compile($this->module_path.'tpl/', 'layout_html_css_view');
|
||||
|
||||
$this->add('html', $script.$html);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue