mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-03 17:22:20 +09:00
issue 2584 add layout info view.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11691 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
0fed27db7c
commit
22aea44f77
3 changed files with 216 additions and 0 deletions
67
modules/layout/layout.admin.model.php
Normal file
67
modules/layout/layout.admin.model.php
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
/**
|
||||
* @class layoutAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* admin view class of the layout module
|
||||
**/
|
||||
|
||||
class layoutAdminModel extends layout {
|
||||
|
||||
/**
|
||||
* init
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* get layout setting view.
|
||||
* @return void
|
||||
*/
|
||||
public function getLayoutAdminSetInfoView()
|
||||
{
|
||||
$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->stop('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Get a menu list
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
$menu_list = $oMenuAdminModel->getMenus();
|
||||
Context::set('menu_list', $menu_list);
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('menu_list..');
|
||||
|
||||
$security = new Security($layout_info);
|
||||
$layout_info = $security->encodeHTML('.', 'author..', 'extra_var..');
|
||||
|
||||
$layout_info->description = nl2br(trim($layout_info->description));
|
||||
if (!is_object($layout_info->extra_var))
|
||||
{
|
||||
$layout_info->extra_var = new StdClass();
|
||||
}
|
||||
|
||||
foreach($layout_info->extra_var as $var_name => $val)
|
||||
{
|
||||
if (isset($layout_info->{$var_name}->description))
|
||||
{
|
||||
$layout_info->{$var_name}->description = nl2br(trim($val->description));
|
||||
}
|
||||
}
|
||||
Context::set('selected_layout', $layout_info);
|
||||
|
||||
$script = '<script src="/xe1.7/modules/layout/tpl/js/layout_modify.js"></script>';
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$html = $oTemplate->compile($this->module_path.'tpl/', 'layout_info_view');
|
||||
|
||||
$this->add('html', $script.$html);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue