merge from 1.5.3.2 (~r11225)

git-svn-id: http://xe-core.googlecode.com/svn/trunk@11226 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-09-13 06:14:45 +00:00
parent 54e3a72065
commit 77f5aa2671
313 changed files with 8058 additions and 14251 deletions

View file

@ -16,6 +16,7 @@
<action name="dispLayoutAdminInsert" type="view" menu_name="installedLayout" />
<action name="dispLayoutAdminModify" type="view" menu_name="installedLayout" />
<action name="dispLayoutAdminEdit" type="view" menu_name="installedLayout" />
<action name="dispLayoutAdminCopyLayout" type="view" />
<action name="dispLayoutPreview" type="view" />
@ -23,6 +24,8 @@
<action name="procLayoutAdminCodeUpdate" type="controller" ruleset="codeUpdate" />
<action name="procLayoutAdminUserImageUpload" type="controller" ruleset="imageUpload" />
<action name="procLayoutAdminUserImageDelete" type="controller" />
<action name="procLayoutAdminConfigImageUpload" type="controller" />
<action name="procLayoutAdminConfigImageDelete" type="controller" />
<action name="procLayoutAdminDelete" type="controller" ruleset="deleteLayout" />
<action name="procLayoutAdminInsert" type="controller" standalone="true" ruleset="insertLayout" />
@ -32,6 +35,7 @@
<action name="procLayoutAdminUserValueInsert" type="controller" standalone="true" />
<action name="procLayoutAdminUserLayoutExport" type="controller" standalone="true" />
<action name="procLayoutAdminUserLayoutImport" type="controller" standalone="true" ruleset="userLayoutImport" />
<action name="procLayoutAdminCopyLayout" type="controller" standalone="true" />
</actions>
<menus>

View file

@ -24,7 +24,10 @@
<value xml:lang="es"><![CDATA[Editar el Diseño]]></value>
<value xml:lang="tr"><![CDATA[Yerleşim Düzeni Düzenle]]></value>
<value xml:lang="vi"><![CDATA[Sửa giao diện]]></value>
</item>
<item name="cmd_layout_copy">
<value xml:lang="ko"><![CDATA[레이아웃 복사]]></value>
<value xml:lang="en"><![CDATA[Copy Layout]]></value>
</item>
<item name="layout_name">
<value xml:lang="ko"><![CDATA[레이아웃 이름]]></value>
@ -1068,4 +1071,12 @@
<value xml:lang="zh-TW"><![CDATA[從"已安裝版面"中建立新版面。 確認版面路徑是否上傳正確及修改版面相關設定。]]></value>
</item>
</item>
<item name="msg_empty_origin_layout">
<value xml:lang="ko"><![CDATA[원본 Layout이 없습니다.]]></value>
<value xml:lang="en"><![CDATA[Original layout is not exist]]></value>
</item>
<item name="msg_empty_target_layout">
<value xml:lang="ko"><![CDATA[복사할 Layout이 지정되어 있지 않습니다.]]></value>
<value xml:lang="en"><![CDATA[Target layout is not assigned]]></value>
</item>
</lang>

View file

@ -143,38 +143,36 @@
}
}
}
$tmpDir = sprintf('./files/attach/images/%s/tmp', $args->layout_srl);
// Separately handle if a type of extra_vars is an image
if($layout_info->extra_var) {
foreach($layout_info->extra_var as $name => $vars) {
if($vars->type!='image') continue;
$image_obj = $extra_vars->{$name};
$extra_vars->{$name} = $layout_info->extra_var->{$name}->value;
// Get a variable on a request to delete
$del_var = $extra_vars->{"del_".$name};
unset($extra_vars->{"del_".$name});
// Delete the old file if there is a request to delete or a new file is uploaded
if($del_var == 'Y' || $image_obj['tmp_name']) {
FileHandler::removeFile($extra_vars->{$name});
$extra_vars->{$name} = '';
if($del_var == 'Y' && !$image_obj['tmp_name']) continue;
}
// Ignore if the file is not successfully uploaded
if(!$image_obj['tmp_name'] || !is_uploaded_file($image_obj['tmp_name'])) continue;
// Ignore if the file is not an image (swf the paths ~)
if(!preg_match("/\.(jpg|jpeg|gif|png|swf)$/i", $image_obj['name'])) continue;
// Upload the file to a path
$path = sprintf("./files/attach/images/%s/", $args->layout_srl);
// Create a directory
if(!FileHandler::makeDir($path)) continue;
$fileName = $extra_vars->{$name};
if($vars->value == $fileName)
{
continue;
}
$filename = $path.$image_obj['name'];
// Move the file
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) continue;
FileHandler::removeFile($vars->value);
$extra_vars->{$name} = $filename;
if(!$fileName)
{
continue;
}
$pathInfo = pathinfo($fileName);
$tmpFileName = sprintf('%s/tmp/%s', $pathInfo['dirname'], $pathInfo['basename']);
if(!FileHandler::moveFile($tmpFileName, $fileName))
{
unset($extra_vars->{$name});
}
}
}
// Save header script into "config" of layout module
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
@ -188,8 +186,9 @@
$output = $this->updateLayout($args);
if(!$output->toBool()) return $output;
$this->setRedirectUrl(Context::get('error_return_url'));
return $output;
FileHandler::removeDir($tmpDir);
return $this->setRedirectUrl(Context::get('error_return_url'), $output);
}
/**
@ -606,6 +605,140 @@
$this->setRedirectUrl(Context::get('error_return_url'));
}
/**
* layout copy
* @return void
*/
function procLayoutAdminCopyLayout()
{
$sourceArgs = Context::getRequestVars();
if($sourceArgs->layout == 'faceoff')
{
return $this->stop('not supported');
}
if(!$sourceArgs->layout_srl)
{
return $this->stop('msg_empty_origin_layout');
}
if(!is_array($sourceArgs->title) || count($sourceArgs->title) == 0)
{
return $this->stop('msg_empty_target_layout');
}
$oLayoutModel = &getModel('layout');
$layout = $oLayoutModel->getLayout($sourceArgs->layout_srl);
$args->extra_vars = $oLayoutModel->getLayoutRawData($sourceArgs->layout_srl, array('extra_vars'));
$extra_vars = unserialize($args->extra_vars);
$oModuleController = &getController('module');
$layout_config->header_script = $extra_vars->header_script;
// Get information to create a layout
$args->site_srl = (int)$layout->site_srl;
$args->layout = $layout->layout;
$args->layout_type = $layout->type;
if(!$args->layout_type) $args->layout_type = "P";
$oDB = &DB::getInstance();
$oDB->begin();
if(is_array($sourceArgs->title))
{
foreach($sourceArgs->title AS $key=>$value)
{
if(!trim($value))
{
continue;
}
$args->layout_srl = getNextSequence();
$args->title = $value;
// for header script
$oModuleController->insertModulePartConfig('layout', $args->layout_srl, $layout_config);
// Insert into the DB
$output = $this->insertLayout($args);
if(!$output->toBool())
{
$oDB->rollback();
return $output;
}
// initiate if it is faceoff layout
$this->initLayout($args->layout_srl, $args->layout);
// update layout info
$output = $this->updateLayout($args);
if (!$output->toBool())
{
$oDB->rollback();
return $output;
}
$this->_copyLayoutFile($layout->layout_srl, $args->layout_srl);
}
}
$oDB->commit();
$this->setMessage('success_registed');
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
global $lang;
htmlHeader();
alertScript($lang->success_registed);
reload(true);
closePopupScript();
htmlFooter();
Context::close();
exit;
}
}
/**
* Layout file copy
* @param $sourceLayoutSrl origin layout number
* @param $targetLayoutSrl origin layout number
* @return void
*/
function _copyLayoutFile($sourceLayoutSrl, $targetLayoutSrl)
{
$oLayoutModel = &getModel('layout');
$sourceLayoutPath = FileHandler::getRealPath($oLayoutModel->getUserLayoutPath($sourceLayoutSrl));
$targetLayoutPath = FileHandler::getRealPath($oLayoutModel->getUserLayoutPath($targetLayoutSrl));
$sourceImagePath = $oLayoutModel->getUserLayoutImagePath($sourceLayoutSrl);
$targetImagePath = $oLayoutModel->getUserLayoutImagePath($targetLayoutSrl);
FileHandler::makeDir($targetImagePath);
$sourceFileList = $oLayoutModel->getUserLayoutFileList($sourceLayoutSrl);
foreach($sourceFileList as $key => $file)
{
if(is_readable($sourceLayoutPath.$file))
{
FileHandler::copyFile($sourceLayoutPath.$file, $targetLayoutPath.$file);
if($file == 'layout.html' || $file == 'layout.css')
{
$this->_changeFilepathInSource($targetLayoutPath.$file, $sourceImagePath, $targetImagePath);
}
}
}
}
/**
* Change resource file path in Layout file
* @param string $file
* @return void
*/
function _changeFilepathInSource($file, $source, $target)
{
$content = FileHandler::readFile($file);
$content = str_replace($source, $target, $content);
FileHandler::writeFile($file, $content);
}
/**
* import layout
* @param int $layout_srl
@ -635,5 +768,90 @@
// Remove uploaded file
FileHandler::removeFile($source_file);
}
/**
* Upload config image
*/
function procLayoutAdminConfigImageUpload()
{
$layoutSrl = Context::get('layout_srl');
$name = Context::get('name');
$img = Context::get('img');
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile("after_upload_config_image.html");
if(!$img['tmp_name'] || !is_uploaded_file($img['tmp_name']))
{
Context::set('msg', Context::getLang('upload failed'));
return;
}
if(!preg_match('/\.(jpg|jpeg|gif|png|swf)$/i', $img['name']))
{
Context::set('msg', Context::getLang('msg_layout_image_target'));
return;
}
$path = sprintf('./files/attach/images/%s/', $layoutSrl);
$tmpPath = $path . 'tmp/';
if(!FileHandler::makeDir($tmpPath))
{
Context::set('msg', Context::getLang('make directory failed'));
return;
}
$ext = substr(strrchr($img['name'],'.'),1);
$_fileName = md5(crypt(rand(1000000,900000), rand(0,100))).'.'.$ext;
$fileName = $path . $_fileName;
$tmpFileName = $tmpPath . $_fileName;
if(!move_uploaded_file($img['tmp_name'], $tmpFileName))
{
Context::set('msg', Context::getLang('move file failed'));
return;
}
Context::set('name', $name);
Context::set('fileName', $fileName);
Context::set('tmpFileName', $tmpFileName);
}
/**
* Delete config image
*/
function procLayoutAdminConfigImageDelete()
{
$layoutSrl = Context::get('layout_srl');
$name = Context::get('name');
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile("after_delete_config_image.html");
$oModel = &getModel('layout');
$layoutInfo = $oModel->getLayout($layoutSrl);
if($layoutInfo->extra_var_count)
{
foreach($layoutInfo->extra_var as $varId => $val)
{
$newLayoutInfo->{$varId} = $val->value;
}
}
unset($newLayoutInfo->{$name});
$args->layout_srl = $layoutSrl;
$args->extra_vars = serialize($newLayoutInfo);
$output = $this->updateLayout($args);
if(!$output->toBool())
{
Context::set('msg', Context::getLang($output->getMessage()));
return $output;
}
FileHandler::removeFile($layoutInfo->extra_var->{$name}->value);
Context::set('name', $name);
}
}
?>

View file

@ -149,7 +149,7 @@
//Security
$security = new Security();
$security->encodeHTML('layout_list..layout','layout_list..title');
$security->encodeHTML('layout_list..layout','layout_list..title');
// Get layout info
$layout = Context::get('layout');
@ -179,7 +179,7 @@
Context::set('selected_layout', $layout_info);
$this->setTemplateFile('layout_modify');
}
}
/**
* Insert Layout details
@ -457,5 +457,19 @@
$this->setTemplateFile('layout_image_list');
}
/**
* Copy layout instance
* @return void
*/
function dispLayoutAdminCopyLayout(){
$layoutSrl = Context::get('layout_srl');
$oLayoutModel = &getModel('layout');
$layout = $oLayoutModel->getLayout($layoutSrl);
Context::set('layout', $layout);
$this->setTemplateFile('copy_layout');
}
}
?>

View file

@ -35,6 +35,18 @@
if(!$oDB->isColumnExists('layouts', 'layout_type')) return true;
$args->layout = '.';
$output = executeQueryArray('layout.getLayoutDotList', $args);
if($output->data && count($output->data) > 0)
{
foreach($output->data as $layout)
{
$layout_path = explode('.', $layout->layout);
if(count($layout_path) != 2) continue;
if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/layouts/%s', $layout_path[0], $layout_path[1]))) return true;
}
}
return false;
}
@ -66,6 +78,22 @@
$oDB->addColumn('layouts','layout_type','char',1,'P',true);
}
$args->layout = '.';
$output = executeQueryArray('layout.getLayoutDotList', $args);
if($output->data && count($output->data) > 0)
{
foreach($output->data as $layout)
{
$layout_path = explode('.', $layout->layout);
if(count($layout_path) != 2) continue;
if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/layouts/%s', $layout_path[0], $layout_path[1])))
{
$args->layout = implode('|@|', $layout_path);
$args->layout_srl = $layout->layout_srl;
$output = executeQuery('layout.updateLayout', $args);
}
}
}
return new Object(0, 'success_updated');
}

View file

@ -97,6 +97,16 @@
return $layout_info;
}
function getLayoutRawData($layout_srl, $columnList = array())
{
$args->layout_srl = $layout_srl;
$output = executeQuery('layout.getLayout', $args, $columnList);
if(!$output->toBool())
return;
return $output->data->extra_vars;
}
/**
* Get a layout path
* @param string $layout_name
@ -104,7 +114,7 @@
* @return string path of layout
**/
function getLayoutPath($layout_name, $layout_type = "P") {
$layout_parse = explode('.', $layout_name);
$layout_parse = explode('|@|', $layout_name);
if (count($layout_parse) > 1){
$class_path = './themes/'.$layout_parse[0].'/layouts/'.$layout_parse[1].'/';
}else if($layout_name == 'faceoff'){
@ -472,7 +482,11 @@
$layout_config = $oModuleModel->getModulePartConfig('layout', $layout_srl);
$header_script = trim($layout_config->header_script);
if($header_script) $buff .= sprintf(' $layout_info->header_script = "%s"; ', str_replace('"','\\"',$header_script));
if($header_script)
{
$header_script = str_replace('"','\\"',$header_script);
$buff .= sprintf(' $layout_info->header_script = "%s"; ', str_replace('$','\$',$header_script));
}
$buff = '<?php if(!defined("__ZBXE__")) exit(); '.$buff.' ?>';
FileHandler::writeFile($cache_file, $buff);

View file

@ -0,0 +1,16 @@
<query id="getLayoutDotList" action="select">
<tables>
<table name="layouts" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="site_srl" var="site_srl" filter="number" default="0" notnull="notnull" />
<condition operation="equal" column="layout_type" var="layout_type" default="P" pipe="and" />
<condition operation="like" column="layout" var="layout" default="." pipe="and" />
</conditions>
<navigation>
<index var="sort_index" default="layout_srl" order="desc" />
</navigation>
</query>

View file

@ -4,7 +4,7 @@
<rule name="imageExtension" type="regex" test="/\.(gif|jpg|jpeg|gif|png|swf|flv)$/i" />
</customrules>
<fields>
<field name="user_layout_image" required="true" rule="imageExtension" />
<field name="user_layout_image['name']" required="true" rule="imageExtension" />
<field name="layout_srl" required="true" rule="number" />
</fields>
</ruleset>

View file

@ -0,0 +1,7 @@
<script type="text/javascript">
<!--@if($msg)-->
alert('{$msg}');
<!--@else-->
parent.afterDeleteConfigImage('{$name}');
<!--@end-->
</script>

View file

@ -0,0 +1,7 @@
<script type="text/javascript">
<!--@if($msg)-->
alert('{$msg}');
<!--@else-->
parent.afterUploadConfigImage('{$name}', '{$fileName}', '{$tmpFileName}');
<!--@end-->
</script>

View file

@ -0,0 +1,40 @@
<script type="text/javascript">
var addLang = '{$lang->cmd_insert}';
</script>
<load target="js/layout_admin.js" usecdn="true" />
<h1 class="h1">{$lang->cmd_layout_copy}</h1>
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form action="./" method="post">
<input type="hidden" name="layout" value="{$layout->layout}" />
<input type="hidden" name="act" value="procLayoutAdminCopyLayout" />
<input type="hidden" name="layout_srl" value="{$layout->layout_srl}" />
<div class="table">
<table width="100%" border="1" cellspacing="0">
<tr>
<th scope="row">{$lang->layout_name}</th>
<td>{$layout->title}</td>
</tr>
<tr>
<th scope="row">{$lang->title}</th>
<td>{$layout->layout_title}</td>
</tr>
</table>
</div>
<div class="table">
<table width="100%" border="1" cellspacing="0" id="inputTable">
<tr>
<th scope="col"><div>{$lang->title}<div></th>
<th scope="col"><div>{$lang->cmd_insert}</div></th>
</tr>
<tr>
<td><input type="text" name="title[]" size="50" /></td>
<td><span class="btn"><input type="button" value="{$lang->cmd_insert}" onclick="addLayoutCopyInputbox()" /></span></td>
</tr>
</table>
</div>
<div class="btnArea">
<span class="btn"><input type="submit" value="{$lang->cmd_save}" /></span>
</div>
</form>

View file

@ -1,5 +1,4 @@
<!--#include("header.html")-->
<!-- 레이아웃의 목록 -->
<div class="table">
<table width="100%" border="1" cellspacing="0">

View file

@ -49,6 +49,20 @@ function deleteFile(layout_srl,filename){
});
}
function addLayoutCopyInputbox()
{
var html = '<tr>';
html += '<td><input type="text" name="title[]" size="50" /></td>';
html += '<td><span class="btn"><input type="button" value="'+addLang+'" onclick="addLayoutCopyInputbox()" /></span></td>';
html += '</tr>';
var it = jQuery('#inputTable');
it.append(html);
it.find('SPAN.btn').hide();
it.find('TR:last-child SPAN.btn').show();
}
(function($){
/* preview layout */
@ -78,4 +92,4 @@ validator.cast('ADD_CALLBACK', ['update_layout_code', function(form) {
return false;
}]);
})(jQuery);
})(jQuery);

View file

@ -0,0 +1,34 @@
function doSubmitConfig()
{
var $forms = jQuery('#layout_config').find('input[name][type="hidden"], input[name][type="text"], input[name][type="checkbox"]:checked, select[name], textarea[name], input[name][type="radio"]:checked');
var $configForm = jQuery('#config_form');
var $container = $configForm.children('div');
$container.empty();
$forms.each(function($)
{
var $this = jQuery(this);
if($this.parents('.imageUpload').length) return;
var $input = jQuery('<input>').attr('type', 'hidden').attr('name', $this.attr('name')).val($this.val());
$container.append($input);
});
$configForm.submit();
}
function afterUploadConfigImage(name, fileName, tmpFileName)
{
jQuery('#preview_' + name + ' img').attr('src', tmpFileName);
jQuery('#preview_' + name).show();
jQuery('#file_select' + name).val('');
jQuery('#file_' + name).val(fileName);
}
function deleteImage(name)
{
jQuery('#preview_' + name + ' img').removeAttr('src');
jQuery('#preview_' + name).hide();
jQuery('#file_' + name).val('');
}

View file

@ -17,6 +17,7 @@
<th scope="col" class="nowr">{$lang->regdate}</th>
<th scope="col" class="nowr">{$lang->cmd_layout_management}</th>
<th scope="col" class="nowr">{$lang->cmd_layout_edit}</th>
<th scope="col" class="nowr">{$lang->cmd_copy}</th>
<th scope="col" class="nowr">{$lang->cmd_delete}</th>
</tr>
</thead>
@ -32,6 +33,7 @@
<td class="nowr">{zdate($item->regdate, "Y-m-d")}</td>
<td class="nowr"><a href="{getUrl('act', 'dispLayoutAdminModify', 'layout_srl', $item->layout_srl)}">{$lang->cmd_layout_management}</a></td>
<td class="nowr"><a href="{getUrl('act', 'dispLayoutAdminEdit', 'layout_srl', $item->layout_srl)}">{$lang->cmd_layout_edit}</a></td>
<td class="nowr"><a href="{getUrl('', 'module', 'layout', 'act', 'dispLayoutAdminCopyLayout', 'layout_srl', $item->layout_srl)}" onclick="popopen(this.href);return false;" title="{$lang->cmd_copy}">{$lang->cmd_copy}</a></td>
<td class="nowr">
<form class="layout_delete_form" ruleset="deleteLayout" action="./" method="post">
<input type="hidden" name="module" value="layout" />

View file

@ -1,10 +1,8 @@
<include target="header.html" />
<load target="js/adminList.js" usecdn="true" />
<script type="text/javascript">
xe.lang.confirm_delete = '{$lang->confirm_delete}';
</script>
<h2 class="h2">{$layout_info->title} ver {$layout_info->version} ({$layout_info->layout})</h2>
<div class="table even easyList">
<table width="100%" border="1" cellspacing="0">
@ -15,6 +13,7 @@
<th scope="col" class="nowr">{$lang->regdate}</th>
<th scope="col" class="nowr">{$lang->cmd_layout_management}</th>
<th scope="col" class="nowr">{$lang->cmd_layout_edit}</th>
<th scope="col" class="nowr">{$lang->cmd_copy}</th>
<th scope="col" class="nowr">{$lang->cmd_delete}</th>
</tr>
</thead>
@ -25,12 +24,12 @@
<td class="nowr">{zdate($layout->regdate, "Y-m-d")}</td>
<td class="nowr"><a href="{getUrl('act', 'dispLayoutAdminModify', 'layout_srl', $layout->layout_srl)}">{$lang->cmd_layout_management}</a></td>
<td class="nowr"><a href="{getUrl('act', 'dispLayoutAdminEdit', 'layout_srl', $layout->layout_srl)}">{$lang->cmd_layout_edit}</a></td>
<td class="nowr"><a href="{getUrl('', 'module', 'layout', 'act', 'dispLayoutAdminCopyLayout', 'layout_srl', $layout->layout_srl)}" onclick="popopen(this.href);return false;" title="{$lang->cmd_copy}">{$lang->cmd_copy}</a></td>
<td class="nowr">
<form class="layout_delete_form" ruleset="deleteLayout" action="./" method="post">
<input type="hidden" name="module" value="layout" />
<input type="hidden" name="act" value="procLayoutAdminDelete" />
<input type="hidden" name="layout_srl" value="{$layout->layout_srl}" />
<input class="text" type="submit" value="{$lang->cmd_delete}" />
</form>
</td>

View file

@ -1,16 +1,21 @@
<include target="header.html" />
<load target="js/layout_modify.js" />
<h2 cond="$act == 'dispLayoutAdminModify'" class="h2">{$selected_layout->layout_title}</h2>
<h2 cond="$act == 'dispLayoutAdminInsert'" class="h2">{$selected_layout->title}</h2>
<form ruleset="updateLayout"|cond="$act == 'dispLayoutAdminModify'" ruleset="insertLayout"|cond="$act == 'dispLayoutAdminInsert'" action="./" class="form" enctype="multipart/form-data" method="post">
<input type="hidden" name="module" value="layout" />
<input type="hidden" name="act" value="procLayoutAdminUpdate"|cond="$act == 'dispLayoutAdminModify'" value="procLayoutAdminInsert"|cond="$act == 'dispLayoutAdminInsert'" />
<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}" />
<input type="hidden" name="success_return_url" value="{getUrl('act', 'dispLayoutAdminInstanceList')}" />
<form id="config_form" ruleset="updateLayout"|cond="$act == 'dispLayoutAdminModify'" ruleset="insertLayout"|cond="$act == 'dispLayoutAdminInsert'" action="./" class="form" enctype="multipart/form-data" method="post">
<input type="hidden" name="module" value="layout" />
<input type="hidden" name="act" value="procLayoutAdminUpdate"|cond="$act == 'dispLayoutAdminModify'" value="procLayoutAdminInsert"|cond="$act == 'dispLayoutAdminInsert'" />
<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}" />
<input type="hidden" name="success_return_url" value="{getUrl('act', 'dispLayoutAdminInstanceList')}" />
<!--// For submit config. Do not delete this division. -->
<div></div>
</form>
<div id="layout_config" class="form">
<ul>
<li>
<p class="q">{$lang->layout}</p>
@ -44,7 +49,7 @@
</li>
</ul>
<block loop="$selected_layout->extra_var => $name, $var">
<block cond="$act == 'dispLayoutAdminModify'" loop="$selected_layout->extra_var => $name, $var">
<block cond="!$not_first && !$var->group"><ul></block>
<block cond="$group != $var->group">
<block cond="$not_first"></ul></block>
@ -71,10 +76,21 @@
</div>
<block cond="$var->type == 'image'">
<block cond="$var->value">
<p><img src="../../../{$var->value}" alt="" /> <input type="checkbox" name="del_{$name}" value="Y" id="del_{$name}" /><label for="del_{$name}">{$lang->cmd_delete}</label></p>
</block>
<p><input type="file" name="{$name}" value="" /></p>
<input type="hidden" name="{$name}" id="file_{$name}" value="{$var->value}" />
<div id="preview_{$name}" style="display:none;"|cond="!$var->value">
<img src="../../../{$var->value}"|cond="$var->value" alt="" style="max-width: 250px" />
<input type="button" value="{$lang->cmd_delete}" onclick="deleteImage('{$name}')" />
</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 type="submit" value="{$lang->cmd_submit}" />
</p>
</form>
</block>
<select cond="$var->type == 'select'" name="{$name}">
@ -118,8 +134,7 @@
<p class="desc">{$var->description}</p>
</li>
</block>
</ul>
<block cond="$act == 'dispLayoutAdminModify'"></ul></block>
<h3 class="h3" cond="$selected_layout->menu">{$lang->menu}</h3>
<ul cond="$selected_layout->menu">
@ -148,10 +163,18 @@
</ul>
<div class="btnArea">
<span class="etc">
<!--@if($layout)-->
<span class="btn"><a href="{getUrl('', 'module', 'admin', 'act', 'dispLayoutAdminInstanceList', 'layout', $selected_layout->layout)}">{$lang->cmd_list}</a></span>
<!--@else-->
<span class="btn"><a href="{getUrl('', 'module', 'admin', 'act', 'dispLayoutAdminAllInstanceList')}">{$lang->cmd_list}</a></span>
<!--@end-->
</span>
<span class="btn medium">
<input type="submit" value="{$lang->cmd_insert}"|cond="$act == 'dispLayoutAdminInsert'" value="{$lang->cmd_save}"|cond="$act == 'dispLayoutAdminModify'" />
<input type="submit" value="{$lang->cmd_insert}"|cond="$act == 'dispLayoutAdminInsert'" value="{$lang->cmd_save}"|cond="$act == 'dispLayoutAdminModify'" onclick="doSubmitConfig()"/>
</span>
</div>
<include target="include.multilang.html" />
<include target="include.multilang.textarea.html" />
</form>
</div>
<iframe name="hiddenIframe" src="about:blank" width="0" height="0" frameborder="0"></iframe>

View file

@ -1,14 +1,14 @@
<div class="cnb">
<a cond="$type == 'M'" href="{getUrl('act', 'dispLayoutAdminInstalledList', 'type', 'P')}">PC({$pcLayoutCount})</a>
<block cond="$type != 'M'">PC({$pcLayoutCount})</block>
|
<a cond="$type != 'M'" href="{getUrl('act', 'dispLayoutAdminInstalledList', 'type', 'M')}">Mobile({$mobileLayoutCount})</a>
<block cond="$type == 'M'">Mobile({$mobileLayoutCount})</block>
<a cond="$type == 'M'" href="{getUrl('act', 'dispLayoutAdminInstalledList', 'type', 'P')}">PC({$pcLayoutCount})</a>
<block cond="$type != 'M'">PC({$pcLayoutCount})</block>
|
<a cond="$type != 'M'" href="{getUrl('act', 'dispLayoutAdminInstalledList', 'type', 'M')}">Mobile({$mobileLayoutCount})</a>
<block cond="$type == 'M'">Mobile({$mobileLayoutCount})</block>
</div>
<div class="cnb">
<a cond="$act != 'dispLayoutAdminAllInstanceList'" href="{getUrl('act', 'dispLayoutAdminAllInstanceList', 'layout_srl', '')}">{$lang->instance_layout}</a>
<block cond="$act == 'dispLayoutAdminAllInstanceList'">{$lang->instance_layout}</block>
|
<a cond="$act != 'dispLayoutAdminInstalledList'" href="{getUrl('act', 'dispLayoutAdminInstalledList')}">{$lang->installed_layout}</a>
<block cond="$act == 'dispLayoutAdminInstalledList'">{$lang->installed_layout}</block>
<a cond="$act != 'dispLayoutAdminAllInstanceList'" href="{getUrl('act', 'dispLayoutAdminAllInstanceList', 'layout_srl', '')}">{$lang->instance_layout}</a>
<block cond="$act == 'dispLayoutAdminAllInstanceList'">{$lang->instance_layout}</block>
|
<a cond="$act != 'dispLayoutAdminInstalledList'" href="{getUrl('act', 'dispLayoutAdminInstalledList')}">{$lang->installed_layout}</a>
<block cond="$act == 'dispLayoutAdminInstalledList'">{$lang->installed_layout}</block>
</div>