mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
merge from branch luminous (version 1.5.4.2, ~r12561)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@12611 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
2263200ce4
commit
cc47d2b247
196 changed files with 3655 additions and 2033 deletions
|
|
@ -272,9 +272,6 @@
|
|||
return new Object(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
$code = preg_replace('/<\?.*(\?>)?/Usm', '', $code);
|
||||
$code = preg_replace('/<script[\s]*language[\s]*=("|\')php("|\')[\s]*>.*<\/script>/Usm', '', $code);
|
||||
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_file = $oLayoutModel->getUserLayoutHtml($layout_srl);
|
||||
FileHandler::writeFile($layout_file, $code);
|
||||
|
|
@ -630,7 +627,8 @@
|
|||
$oLayoutModel = &getModel('layout');
|
||||
$layout = $oLayoutModel->getLayout($sourceArgs->layout_srl);
|
||||
|
||||
$args->extra_vars = $oLayoutModel->getLayoutRawData($sourceArgs->layout_srl, array('extra_vars'));
|
||||
$output = $oLayoutModel->getLayoutRawData($sourceArgs->layout_srl, array('extra_vars'));
|
||||
$args->extra_vars = $output->extra_vars;
|
||||
$extra_vars = unserialize($args->extra_vars);
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
|
|
|
|||
|
|
@ -101,6 +101,8 @@
|
|||
$layout_list[$item->layout][] = $item;
|
||||
}
|
||||
|
||||
usort($layout_list, array($this, 'sortLayoutInstance'));
|
||||
|
||||
Context::set('layout_list', $layout_list);
|
||||
|
||||
$this->setTemplateFile('layout_all_instance_list');
|
||||
|
|
@ -109,6 +111,22 @@
|
|||
$security->encodeHTML('layout_list..');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort layout instance by layout name, instance name
|
||||
*/
|
||||
function sortLayoutInstance($a, $b)
|
||||
{
|
||||
$aTitle = strtolower($a['title']);
|
||||
$bTitle = strtolower($b['title']);
|
||||
|
||||
if($aTitle == $bTitle)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ($aTitle < $bTitle) ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display list of pc layout instance
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@
|
|||
if(!$output->toBool())
|
||||
return;
|
||||
|
||||
return $output->data->extra_vars;
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -143,7 +143,7 @@
|
|||
$searched_count = count($searched_list);
|
||||
if(!$searched_count) return;
|
||||
|
||||
natcasesort($searched_list);
|
||||
// natcasesort($searched_list);
|
||||
// Return information for looping searched list of layouts
|
||||
$list = array();
|
||||
for($i=0;$i<$searched_count;$i++) {
|
||||
|
|
@ -152,6 +152,11 @@
|
|||
// Get information of the layout
|
||||
$layout_info = $this->getLayoutInfo($layout, null, $layout_type);
|
||||
|
||||
if(!$layout_info)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($withAutoinstallInfo)
|
||||
{
|
||||
// get easyinstall remove url
|
||||
|
|
@ -170,9 +175,37 @@
|
|||
}
|
||||
$list[] = $layout_info;
|
||||
}
|
||||
|
||||
usort($list, array($this, 'sortLayoutByTitle'));
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort layout by title
|
||||
*/
|
||||
function sortLayoutByTitle($a, $b)
|
||||
{
|
||||
if(!$a->title)
|
||||
{
|
||||
$a->title = $a->layout;
|
||||
}
|
||||
|
||||
if(!$b->title)
|
||||
{
|
||||
$b->title = $b->layout;
|
||||
}
|
||||
|
||||
$aTitle = strtolower($a->title);
|
||||
$bTitle = strtolower($b->title);
|
||||
|
||||
if($aTitle == $bTitle)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ($aTitle < $bTitle) ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a count of layout
|
||||
* @param string $layoutType (P : PC, M : Mobile)
|
||||
|
|
@ -238,6 +271,7 @@
|
|||
// Read the xml file for module skin information
|
||||
if(!$xml_file) $xml_file = sprintf("%sconf/info.xml", $layout_path);
|
||||
if(!file_exists($xml_file)) {
|
||||
$layout_info->title = $layout;
|
||||
$layout_info->layout = $layout;
|
||||
$layout_info->path = $layout_path;
|
||||
$layout_info->layout_title = $layout_title;
|
||||
|
|
@ -254,6 +288,7 @@
|
|||
if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file)) {
|
||||
@include($cache_file);
|
||||
|
||||
|
||||
if($layout_info->extra_var && $vars) {
|
||||
foreach($vars as $key => $value) {
|
||||
if(!$layout_info->extra_var->{$key} && !$layout_info->{$key}) {
|
||||
|
|
@ -261,6 +296,12 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$layout_info->title)
|
||||
{
|
||||
$layout_info->title = $layout;
|
||||
}
|
||||
|
||||
return $layout_info;
|
||||
}
|
||||
// If no cache file exists, parse the xml and then return the variable.
|
||||
|
|
@ -484,13 +525,18 @@
|
|||
|
||||
if($header_script)
|
||||
{
|
||||
$header_script = str_replace('"','\\"',$header_script);
|
||||
$buff .= sprintf(' $layout_info->header_script = "%s"; ', str_replace('$','\$',$header_script));
|
||||
$buff .= sprintf(' $layout_info->header_script = "%s"; ', str_replace(array('$','"'),array('\$','\\"'),$header_script));
|
||||
}
|
||||
|
||||
$buff = '<?php if(!defined("__ZBXE__")) exit(); '.$buff.' ?>';
|
||||
FileHandler::writeFile($cache_file, $buff);
|
||||
if(file_exists($cache_file)) @include($cache_file);
|
||||
|
||||
if(!$layout_info->title)
|
||||
{
|
||||
$layout_info->title = $layout;
|
||||
}
|
||||
|
||||
return $layout_info;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,9 +44,6 @@
|
|||
$layout_srl = Context::get('layout_srl');
|
||||
$code = Context::get('code');
|
||||
|
||||
$code = preg_replace('/<\?.*(\?>)?/Usm', '', $code);
|
||||
$code = preg_replace('/<script[\s]*language[\s]*=("|\')php("|\')[\s]*>.*<\/script>/Usm', '', $code);
|
||||
|
||||
$code_css = Context::get('code_css');
|
||||
if(!$layout_srl || !$code) return new Object(-1, 'msg_invalid_request');
|
||||
// Get the layout information
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
var ConfirmCheck = xe.createPlugin('confirm_check', {
|
||||
API_BEFORE_VALIDATE: function(sender, params){
|
||||
return confirm(xe.lang.confirm_delete);
|
||||
if(params[0].className == 'layout_delete_form'){
|
||||
return confirm(xe.lang.confirm_delete);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var Validator = xe.getApp('Validator')[0];
|
||||
Validator.registerPlugin(new ConfirmCheck());
|
||||
Validator.registerPlugin(new ConfirmCheck());
|
||||
|
|
|
|||
|
|
@ -38,5 +38,46 @@
|
|||
</table>
|
||||
</div>
|
||||
<div cond="$layout_info->layout != 'faceoff'" class="btnArea">
|
||||
<span class="btn"><a href="{getUrl('act', 'dispLayoutAdminInsert', 'layout', $layout_info->layout)}">{$lang->cmd_insert}...</a></span>
|
||||
<span class="btn"><a href="#insertLayout" class="modalAnchor">{$lang->cmd_insert}...</a></span>
|
||||
</div>
|
||||
<div id="insertLayout" class="modal">
|
||||
<div class="fg">
|
||||
<h2></h2>
|
||||
|
||||
<form ruleset="insertLayout" action="./" class="form">
|
||||
<input type="hidden" name="module" value="layout" />
|
||||
<input type="hidden" name="act" value="procLayoutAdminInsert" />
|
||||
<input type="hidden" name="layout" value="{$layout_info->layout}" />
|
||||
<input type="hidden" name="_layout_type" value="{$type}" />
|
||||
<input type="hidden" name="success_return_url" value="{getUrl('act', 'dispLayoutAdminInstanceList')}" />
|
||||
<ul>
|
||||
<li>
|
||||
<p class="q">{$lang->layout}</p>
|
||||
<p class="a">{$layout_info->title} ver {$layout_info->version} ({$layout_info->layout})</p>
|
||||
</li>
|
||||
<li cond="$layout_info->path">
|
||||
<p class="q">{$lang->path}</p>
|
||||
<p class="a">{$layout_info->path}</p>
|
||||
</li>
|
||||
<li cond="$layout_info->description">
|
||||
<p class="q">{$lang->description}</p>
|
||||
<p class="a">{$layout_info->description}</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q">{$lang->author}</p>
|
||||
<p class="a"><a href="{$layout_info->author->homepage}" target="_blank">{$layout_info->layout->author->name}</a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q">{$lang->title}</p>
|
||||
<p class="a">
|
||||
<input type="text" name="title" value="" />
|
||||
</p>
|
||||
<p class="desc">{$lang->about_title}</p>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="btnArea">
|
||||
<span class="btn"><input type="submit" value="{$lang->cmd_insert}" /></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@
|
|||
<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 id="config_form" ruleset="updateLayout"|cond="$act == 'dispLayoutAdminModify'" ruleset="insertLayout"|cond="$act == 'dispLayoutAdminInsert'" action="./" class="form" enctype="multipart/form-data" method="post">
|
||||
<form id="config_form" ruleset="updateLayout"|cond="$act == 'dispLayoutAdminModify'" 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="act" value="procLayoutAdminUpdate"|cond="$act == 'dispLayoutAdminModify'" />
|
||||
<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}" />
|
||||
|
|
@ -97,6 +96,12 @@
|
|||
<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><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'">
|
||||
<block loop="$var->options => $key, $val">
|
||||
<block cond="$val->thumbnail">
|
||||
|
|
@ -177,4 +182,4 @@
|
|||
<include target="include.multilang.html" />
|
||||
<include target="include.multilang.textarea.html" />
|
||||
</div>
|
||||
<iframe name="hiddenIframe" src="about:blank" width="0" height="0" frameborder="0"></iframe>
|
||||
<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