mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-21 04:09:55 +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
|
|
@ -19,6 +19,7 @@
|
|||
<action name="dispLayoutAdminCopyLayout" type="view" />
|
||||
|
||||
<action name="getLayoutAdminSetInfoView" type="model" />
|
||||
<action name="getLayoutAdminSetHTMLCSS" type="model" />
|
||||
|
||||
<action name="dispLayoutPreview" type="view" />
|
||||
<action name="dispLayoutPreviewWithModule" type="view" />
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
13
modules/layout/tpl/js/layout_admin_set_html.js
Normal file
13
modules/layout/tpl/js/layout_admin_set_html.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
function initHtmlCSSView()
|
||||
{
|
||||
var $ = jQuery;
|
||||
$('.uploaded_image').css('cursor', 'pointer');
|
||||
$('.uploaded_image_path').hide();
|
||||
$('.uploaded_image').bind('click', function(e){
|
||||
var path = $(this).find('.uploaded_image_path').html();
|
||||
var html = '<div class="x_well selected_image_path">' + path + '</div>';
|
||||
|
||||
$('.selected_image_path').remove();
|
||||
$('.uploaded_image_list').after(html);
|
||||
});
|
||||
}
|
||||
84
modules/layout/tpl/layout_html_css_view.html
Normal file
84
modules/layout/tpl/layout_html_css_view.html
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
<section class="section">
|
||||
<h1>{$lang->layout_image_repository}</h1>
|
||||
<p>{nl2br($lang->about_layout_image_repository)}</p>
|
||||
|
||||
<ul class="x_thumbnails uploaded_image_list">
|
||||
<li loop="$layout_image_list => $no, $file" class="x_span2">
|
||||
{@$ext=substr(strrchr($file,'.'),1)}
|
||||
<div class="x_thumbnail a uploaded_image">
|
||||
<script cond="$ext == 'swf' || $ext == 'flv'">
|
||||
//<![CDATA[
|
||||
displayMultimedia('{getUrl('')}{$layout_image_path}{$file}', '100px', '100px');
|
||||
//]]>
|
||||
</script>
|
||||
<img cond="$ext != 'swf' && $ext != 'flv'" src="{getUrl('')}{$layout_image_path}{$file}" />
|
||||
<div class="x_caption">
|
||||
<p class="uploaded_image_path">{$layout_image_path}{$file}</p>
|
||||
<form action="./" method="post" style="margin:0;padding:0">
|
||||
<input type="hidden" name="module" value="layout" />
|
||||
<input type="hidden" name="act" value="procLayoutAdminUserImageDelete" />
|
||||
<input type="hidden" name="layout_srl" value="{$layout_srl}" />
|
||||
<input type="hidden" name="filename" value="{$file}" />
|
||||
|
||||
<input class="x_btn x_btn-mini x_btn-danger" type="submit" value="{$lang->cmd_delete}" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<form ruleset="imageUpload" action="./" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="module" value="layout" />
|
||||
<input type="hidden" name="act" value="procLayoutAdminUserImageUpload" />
|
||||
<input type="hidden" name="layout_srl" value="{$layout_srl}" />
|
||||
|
||||
<div class="x_control-group">
|
||||
<input type="file" name="user_layout_image" value="" />
|
||||
<span class="x_help-block">{$lang->msg_layout_image_target}</span>
|
||||
</div>
|
||||
<div class="x_clearfix btnArea">
|
||||
<div class="x_pull-right">
|
||||
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<block cond="$selected_layout->type == 'faceoff'">
|
||||
<section class="section">
|
||||
<h1>{$lang->faceoff_export}</h1>
|
||||
<p>{nl2br($lang->about_faceoff_export)}</p>
|
||||
<p>
|
||||
<a class="x_btn" href="{getUrl('', 'act', 'procLayoutAdminUserLayoutExport', 'layout_srl', $layout_srl)}">{$lang->layout_btn_export}</a>
|
||||
</p>
|
||||
</section>
|
||||
</block>
|
||||
|
||||
<form id="fo_layout" class="form" ruleset="codeUpdate" action="./" method="post">
|
||||
<input type="hidden" name="module" value="layout" />
|
||||
<input type="hidden" name="layout_srl" value="{$layout_srl}" />
|
||||
<input type="hidden" name="act" value="procLayoutAdminCodeUpdate" />
|
||||
|
||||
<section class="section">
|
||||
<h1>HTML</h1>
|
||||
<textarea name="code" rows="8" cols="42" style="width:100%;height:300px;font-size:11px;">{$layout_code}</textarea>
|
||||
<div class="x_btn-group">
|
||||
<a loop="$widget_list => $widget" class="x_btn x_btn-mini" href="{getUrl('','module','admin','act','dispWidgetAdminGenerateCode','selected_widget',$widget->widget)}" target="_blank">{$widget->title}</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<h1>CSS</h1>
|
||||
<textarea name="code_css" rows="8" cols="42" style="width:100%;height:300px;font-size:11px;">{$layout_code_css}</textarea>
|
||||
</section>
|
||||
|
||||
<div class="x_clearfix btnArea">
|
||||
<span class="x_pull-left">
|
||||
<button type="submit" class="x_btn" name="mode" value="reset">{$lang->cmd_reset}</button>
|
||||
</span>
|
||||
<span class="x_pull-right">
|
||||
<button type="submit" class="x_btn x_btn-primary" name="mode" value="save">{$lang->cmd_save}</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue