mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-24 21:59:55 +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
|
|
@ -18,6 +18,8 @@
|
|||
<action name="dispLayoutAdminEdit" type="view" menu_name="installedLayout" />
|
||||
<action name="dispLayoutAdminCopyLayout" type="view" />
|
||||
|
||||
<action name="getLayoutAdminSetInfoView" type="model" />
|
||||
|
||||
<action name="dispLayoutPreview" type="view" />
|
||||
<action name="dispLayoutPreviewWithModule" type="view" />
|
||||
|
||||
|
|
|
|||
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);
|
||||
}
|
||||
}
|
||||
147
modules/layout/tpl/layout_info_view.html
Normal file
147
modules/layout/tpl/layout_info_view.html
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
<form id="config_form" ruleset="updateLayout" action="./" class="form" enctype="multipart/form-data" method="post">
|
||||
<input type="hidden" name="module" value="layout" />
|
||||
<input type="hidden" name="act" value="procLayoutAdminUpdate" />
|
||||
<input type="hidden" name="layout_srl" value="{$layout_srl}" />
|
||||
<input type="hidden" name="layout" value="{$selected_layout->layout}" />
|
||||
<input type="hidden" name="_layout_type" value="{$selected_layout->layout_type}" />
|
||||
<!--// For submit config. Do not delete this division. -->
|
||||
<div></div>
|
||||
</form>
|
||||
|
||||
<div id="layout_config" class="x_form-horizontal">
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->layout}</label>
|
||||
<div class="x_controls">
|
||||
{$selected_layout->title} ver {$selected_layout->version} ({$selected_layout->layout})
|
||||
</div>
|
||||
</div>
|
||||
<div cond="$selected_layout->path" class="x_control-group">
|
||||
<label class="x_control-label">{$lang->path}</label>
|
||||
<div class="x_controls">
|
||||
{$selected_layout->path}
|
||||
</div>
|
||||
</div>
|
||||
<div cond="$selected_layout->description" class="x_control-group">
|
||||
<label class="x_control-label">{$lang->description}</label>
|
||||
<div class="x_controls">
|
||||
{$selected_layout->description}
|
||||
</div>
|
||||
</div>
|
||||
<div cond="$selected_layout->author->homepage" class="x_control-group">
|
||||
<label class="x_control-label">{$lang->author}</label>
|
||||
<div class="x_controls">
|
||||
<a href="{$selected_layout->author->homepage}" target="_blank">{$selected_layout->author->name}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="title">{$lang->title} <em>*</em></label>
|
||||
<div class="x_controls">
|
||||
<input type="text" id="title" name="title" value="{$selected_layout->layout_title}" />
|
||||
<span class="x_help-block">{$lang->about_title}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="header_script">{$lang->header_script}</label>
|
||||
<div class="x_controls">
|
||||
<textarea name="header_script" id="header_script" rows="8" cols="42">{$selected_layout->header_script}</textarea>
|
||||
<span class="x_help-block">{$lang->about_header_script}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<block loop="$selected_layout->extra_var => $name, $var">
|
||||
<block cond="!$not_first && !$var->group"><section class="section"></block>
|
||||
<block cond="$group != $var->group">
|
||||
<block cond="$not_first"></section></block>
|
||||
<section class="section">
|
||||
<h1>{$var->group}</h1>
|
||||
{@$group = $var->group}
|
||||
</block>
|
||||
{@$not_first = true}
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="{$name}">{$var->title}</label>
|
||||
<div class="x_controls">
|
||||
<div cond="$var->type == 'text'" class="multiLangEdit">
|
||||
<input type="text" name="{$name}" id="{$name}" class="lang_code" value="<!--@if(strpos($var->value, "$user_lang->") !== false)-->{htmlspecialchars($var->value)}<!--@else-->{$var->value}<!--@end-->" />
|
||||
</div>
|
||||
|
||||
<div cond="$var->type == 'textarea'" class="multiLangEdit">
|
||||
{@$use_multilang_textarea = true}
|
||||
<textarea name="{$name}" rows="8" cols="42" class="lang_code"><!--@if(strpos($var->value, "$user_lang->") !== false)-->{htmlspecialchars($var->value)}<!--@else-->{$var->value}<!--@end--></textarea>
|
||||
</div>
|
||||
|
||||
<block cond="$var->type == 'image'">
|
||||
<input type="hidden" name="{$name}" id="file_{$name}" value="{$var->value}" />
|
||||
<div id="preview_{$name}" class="x_thumbnail" style="<!--@if(!$var->value)-->display:none;<!--@end-->max-width:250px;margin-bottom:20px;">
|
||||
<img src="../../../{$var->value}"|cond="$var->value" alt="" style="max-width:250px;" />
|
||||
<div class="x_caption">
|
||||
<input class="x_btn x_btn-danger x_btn-mini" type="button" value="{$lang->cmd_delete}" onclick="deleteImage('{$name}')" />
|
||||
</div>
|
||||
</div>
|
||||
<form action="./" enctype="multipart/form-data" method="post" target="hiddenIframe" class="imageUpload">
|
||||
<input type="hidden" name="module" value="layout" />
|
||||
<input type="hidden" name="act" value="procLayoutAdminConfigImageUpload" />
|
||||
<input type="hidden" name="layout_srl" value="{$layout_srl}" />
|
||||
<input type="hidden" name="name" value="{$name}" />
|
||||
<p>
|
||||
<input type="file" name="img" id="file_select_{$name}" value="" />
|
||||
<input class="x_btn x_btn-mini x_btn-primary" type="submit" value="{$lang->cmd_submit}" />
|
||||
</p>
|
||||
</form>
|
||||
</block>
|
||||
|
||||
<select cond="$var->type == 'select'" name="{$name}" id="{$name}" style="width:220px;">
|
||||
<option loop="$var->options => $key, $val" value="{$key}" selected="selected"|cond="$key == $var->value">{$val->val}</option>
|
||||
</select>
|
||||
|
||||
<block cond="$var->type == 'checkbox'">
|
||||
<block loop="$var->options => $key, $val">
|
||||
<label class="x_inline"><input type="checkbox" name="{$name}[]" value="{$key}" checked="checked"|cond="@in_array($key, $var->value)" /> {$val->val}</label>
|
||||
</block>
|
||||
</block>
|
||||
|
||||
<block cond="$var->type == 'radio'">
|
||||
<div class="x_thumbnails">
|
||||
<block loop="$var->options => $key, $val">
|
||||
<div class="x_span2 <!--@if($val->thumbnail)-->x_thumbnail<!--@end-->">
|
||||
<img src="../../../{$val->thumbnail}" cond="$val->thumbnail" alt="{$val->val}" />
|
||||
<div class="x_caption">
|
||||
<label><input type="radio" name="{$name}" value="{$key}" checked="checked"|cond="$key == $var->value" /> {$val->val}</label>
|
||||
</div>
|
||||
</div>
|
||||
</block>
|
||||
</div>
|
||||
</block>
|
||||
<span class="x_help-block">{$var->description}</span>
|
||||
</div>
|
||||
</div>
|
||||
</block>
|
||||
</ul>
|
||||
|
||||
<section class="section">
|
||||
<h1 cond="$selected_layout->menu">{$lang->menu}</h1>
|
||||
<div cond="$selected_layout->menu" class="x_form-horizontal">
|
||||
<div loop="$selected_layout->menu => $menu_name, $menu_info" class="x_control-group">
|
||||
<label class="x_control-label" for="{$menu_name}">{$menu_info->title}({$menu_name})</label>
|
||||
<div class="x_controls">
|
||||
<select name="{$menu_name}" id="{$menu_name}" style="width:220px">
|
||||
<option value="0">{$lang->cmd_select}</option>
|
||||
<option loop="$menu_list => $key, $val" value="{$val->menu_srl}" selected="selected"|cond="$val->menu_srl == $menu_info->menu_srl">{$val->title}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->not_apply_menu}</label>
|
||||
<div class="x_controls">
|
||||
<label class="x_inline"><input type="checkbox" name="apply_layout" id="apply_layout" value="Y" /> {$lang->about_not_apply_menu}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="x_clearfix btnArea">
|
||||
<span class="x_btn-group x_pull-right">
|
||||
<input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_save}" onclick="doSubmitConfig()"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<iframe name="hiddenIframe" src="about:blank" width="1000px" height="1000px" frameborder="0" style="position:absolute;top:-9999px;left:-9999px"></iframe>
|
||||
Loading…
Add table
Add a link
Reference in a new issue