Merge pull request #9 from xpressengine/develop

Develop - 140825
This commit is contained in:
sejin7940 2014-08-26 23:39:46 +09:00
commit bdbc1474c1
49 changed files with 965 additions and 312 deletions

View file

@ -242,9 +242,18 @@ class Context
}
}
// check if using rewrite module
$this->allow_rewrite = ($this->db_info->use_rewrite == 'Y' ? TRUE : FALSE);
// If XE is installed, get virtual site information
if(self::isInstalled())
{
// If using rewrite module, initializes router
if($this->allow_rewrite)
{
Router::proc();
}
$oModuleModel = getModel('module');
$site_module_info = $oModuleModel->getDefaultMid();
@ -365,15 +374,6 @@ class Context
$this->lang = &$GLOBALS['lang'];
$this->loadLang(_XE_PATH_ . 'common/lang/');
// check if using rewrite module
$this->allow_rewrite = ($this->db_info->use_rewrite == 'Y' ? TRUE : FALSE);
// If using rewrite module, initializes router
if($this->allow_rewrite)
{
Router::proc();
}
// set locations for javascript use
if($_SERVER['REQUEST_METHOD'] == 'GET')
{
@ -1072,6 +1072,7 @@ class Context
*/
function convertEncodingStr($str)
{
if(!$str) return null;
$obj = new stdClass();
$obj->str = $str;
$obj = self::convertEncoding($obj);

View file

@ -174,7 +174,7 @@ class HTMLDisplayHandler
$output = preg_replace_callback('!<meta(.*?)(?:\/|)>!is', array($this, '_moveMetaToHeader'), $output);
// change a meta fine(widget often put the tag like <!--Meta:path--> to the content because of caching)
$output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\-\/\.\@]+)-->/is', array($this, '_transMeta'), $output);
$output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\-\/\.\@\:]+)-->/is', array($this, '_transMeta'), $output);
// handles a relative path generated by using the rewrite module
if(Context::isAllowRewrite())
@ -451,10 +451,23 @@ class HTMLDisplayHandler
// add common JS/CSS files
if(__DEBUG__ || !__XE_VERSION_STABLE__)
{
$oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -111000), true);
$oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -110000), true);
$oContext->loadFile(array('./common/js/x.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/common.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/js_app.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true);
$oContext->loadFile(array('./common/css/mobile.css', '', '', -1000000), true);
}
else
{
$oContext->loadFile(array('./common/js/jquery-1.x.min.js', 'head', 'lt IE 9', -111000), true);
$oContext->loadFile(array('./common/js/jquery.min.js', 'head', 'gte IE 9', -110000), true);
$oContext->loadFile(array('./common/js/x.min.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/css/xe.min.css', '', '', -1000000), true);
$oContext->loadFile(array('./common/css/mobile.min.css', '', '', -1000000), true);
}
}

View file

@ -1017,6 +1017,33 @@ class FileHandler
$path = self::getRealPath($path);
return is_dir($path) ? $path : FALSE;
}
/**
* Check is writable dir
*
* @param string $path Target dir path
* @return bool
*/
function isWritableDir($path)
{
$path = self::getRealPath($path);
if(is_dir($path)==FALSE)
{
return FALSE;
}
$checkFile = $path . '/_CheckWritableDir';
$fp = fopen($checkFile, 'w');
if(!is_resource($fp))
{
return FALSE;
}
fclose($fp);
self::removeFile($checkFile);
return TRUE;
}
}
/* End of file FileHandler.class.php */

View file

@ -8,7 +8,7 @@
class FrontEndFileHandler extends Handler
{
static $isSSL = FALSE;
static $isSSL = null;
/**
* Map for css
@ -50,12 +50,13 @@ class FrontEndFileHandler extends Handler
* Check SSL
*
* @return bool If using ssl returns true, otherwise returns false.
* @deprecated
*/
function isSsl()
{
if(self::$isSSL)
if(!is_null(self::$isSSL))
{
return TRUE;
return self::$isSSL;
}
$url_info = parse_url(Context::getRequestUrl());

View file

@ -59,7 +59,10 @@ class ModuleHandler extends Handler
$this->mid = $mid ? $mid : Context::get('mid');
$this->document_srl = $document_srl ? (int) $document_srl : (int) Context::get('document_srl');
$this->module_srl = $module_srl ? (int) $module_srl : (int) Context::get('module_srl');
$this->entry = Context::convertEncodingStr(Context::get('entry'));
if($entry = Context::get('entry'))
{
$this->entry = Context::convertEncodingStr($entry);
}
// Validate variables to prevent XSS
$isInvalid = NULL;
@ -548,7 +551,6 @@ class ModuleHandler extends Handler
}
$xml_info = $oModuleModel->getModuleActionXml($forward->module);
$oMemberModel = getModel('member');
if($this->module == "admin" && $type == "view")
{
@ -1145,12 +1147,25 @@ class ModuleHandler extends Handler
{
return new Object();
}
//store before trigger call time
$before_trigger_time = NULL;
if(__LOG_SLOW_TRIGGER__> 0)
{
$before_trigger_time = microtime(true);
}
foreach($triggers as $item)
{
$module = $item->module;
$type = $item->type;
$called_method = $item->called_method;
$before_each_trigger_time = NULL;
if(__LOG_SLOW_TRIGGER__> 0)
{
$before_each_trigger_time = microtime(true);
}
// todo why don't we call a normal class object ?
$oModule = getModule($module, $type);
@ -1165,6 +1180,57 @@ class ModuleHandler extends Handler
return $output;
}
unset($oModule);
//store after trigger call time
$after_each_trigger_time = NULL;
//init value to 0
$elapsed_time_trigger = 0;
if(__LOG_SLOW_TRIGGER__> 0)
{
$after_each_trigger_time = microtime(true);
$elapsed_time_trigger = ($after_each_trigger_time - $before_each_trigger_time) * 1000;
}
// if __LOG_SLOW_TRIGGER__ is defined, check elapsed time and leave trigger time log
if(__LOG_SLOW_TRIGGER__> 0 && $elapsed_time_trigger > __LOG_SLOW_TRIGGER__)
{
$buff = '';
$log_file = _XE_PATH_ . 'files/_db_slow_trigger.php';
if(!file_exists($log_file))
{
$buff = '<?php exit(); ?' . '>' . "\n";
}
$buff .= sprintf("%s\t%s.%s.%s.%s(%s)\n\t%0.6f msec\n\n", date("Y-m-d H:i"), $item->trigger_name,$item->module,$item->called_method,$item->called_position,$item->type, $elapsed_time_trigger);
@file_put_contents($log_file, $buff, FILE_APPEND|LOCK_EX);
}
}
//store after trigger call time
$after_trigger_time = NULL;
//init value to 0
$elapsed_time = 0;
if(__LOG_SLOW_TRIGGER__> 0)
{
$after_trigger_time = microtime(true);
$elapsed_time = ($after_trigger_time - $before_trigger_time) * 1000;
}
// if __LOG_SLOW_TRIGGER__ is defined, check elapsed time and leave trigger time log
if(__LOG_SLOW_TRIGGER__> 0 && $elapsed_time > __LOG_SLOW_TRIGGER__)
{
$buff = '';
$log_file = _XE_PATH_ . 'files/_slow_trigger.php';
if(!file_exists($log_file))
{
$buff = '<?php exit(); ?' . '>' . "\n";
}
$buff .= sprintf("%s\t%s.totaltime\n\t%0.6f msec\n\n", date("Y-m-d H:i"), $trigger_name,$elapsed_time);
@file_put_contents($log_file, $buff, FILE_APPEND|LOCK_EX);
}
return new Object();

View file

@ -18,29 +18,29 @@ class Router
*/
private static $routes = array(
// rss , blogAPI
'(rss|atom)' => array('module' => 'rss', 'act' => '$1'),
'([a-zA-Z0-9_]+)/(rss|atom|api)' => array('mid' => '$1', 'act' => '$2'),
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/(rss|atom|api)' => array('vid' => '$1', 'mid' => '$2', 'act' => '$3'),
'(rss|atom)' => array('module' => 'rss', 'act' => '$1', '[L]' => TRUE),
'([a-zA-Z0-9_]+)/(rss|atom|api)' => array('mid' => '$1', 'act' => '$2', '[L]' => TRUE),
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/(rss|atom|api)' => array('vid' => '$1', 'mid' => '$2', 'act' => '$3', '[L]' => TRUE),
// trackback
'([0-9]+)/(.+)/trackback' => array('document_srl' => '$1', 'key' => '$2', 'act' => 'trackback'),
'([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback' => array('mid' => '$1', 'document_srl' => '$2', 'key' => '$3', 'act' => 'trackback'),
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback' => array('vid' => '$1', 'mid' => '$2', 'document_srl' => '$3' , 'key' => '$4', 'act' => 'trackback'),
// mid
'([a-zA-Z0-9_]+)/?' => array('mid' => '$1'),
// mid + document_srl
'([a-zA-Z0-9_]+)/([0-9]+)' => array('mid' => '$1', 'document_srl' => '$2'),
// vid + mid
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/' => array('vid' => '$1', 'mid' => '$2'),
// vid + mid + document_srl
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)?' => array('vid' => '$1', 'mid' => '$2', 'document_srl' => '$3'),
'([0-9]+)/(.+)/trackback' => array('document_srl' => '$1', 'key' => '$2', 'act' => 'trackback', '[L]' => TRUE),
'([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback' => array('mid' => '$1', 'document_srl' => '$2', 'key' => '$3', 'act' => 'trackback', '[L]' => TRUE),
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback' => array('vid' => '$1', 'mid' => '$2', 'document_srl' => '$3' , 'key' => '$4', 'act' => 'trackback', '[L]' => TRUE),
// document_srl
'([0-9]+)' => array('document_srl' => '$1'),
'([0-9]+)' => array('document_srl' => '$1', '[L]' => TRUE),
// mid
'([a-zA-Z0-9_]+)/?' => array('mid' => '$1', '[L]' => TRUE),
// mid + document_srl
'([a-zA-Z0-9_]+)/([0-9]+)' => array('mid' => '$1', 'document_srl' => '$2', '[L]' => TRUE),
// vid + mid
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/' => array('vid' => '$1', 'mid' => '$2', '[L]' => TRUE),
// vid + mid + document_srl
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)?' => array('vid' => '$1', 'mid' => '$2', 'document_srl' => '$3', '[L]' => TRUE),
// mid + entry title
'([a-zA-Z0-9_]+)/entry/(.+)' => array('mid' => '$1', 'entry' => '$2'),
'([a-zA-Z0-9_]+)/entry/(.+)' => array('mid' => '$1', 'entry' => '$2', '[L]' => TRUE),
// vid + mid + entry title
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/(.+)' => array('vid' => '$1', 'mid' => '$2', 'entry' => '$3'),
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/(.+)' => array('vid' => '$1', 'mid' => '$2', 'entry' => '$3', '[L]' => TRUE),
// shop / vid / [category|product] / identifier
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_\.-]+)' => array('act' => 'route', 'vid' => '$1', 'type' => '$2', 'identifier'=> '$3')
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_\.-]+)' => array('act' => 'route', 'vid' => '$1', 'type' => '$2', 'identifier'=> '$3', '[L]' => TRUE)
);
/**
@ -72,6 +72,7 @@ class Router
return;
}
// Get relative path from request uri
$path = parse_url($uri, PHP_URL_PATH);
// Do some final cleaning of the URI and return it
@ -80,33 +81,80 @@ class Router
if(strlen($path) > 0)
{
self::$segments = explode('/', $path);
// Remove the meanless segment
unset(self::$segments[0]);
}
if(isset(self::$routes[$path]))
{
foreach(self::$routes[$path] as $key => $val)
{
$val = preg_replace('#^\$([0-9]+)$#e', '\$matches[$1]', $val);
if(strlen($val) > 0)
{
if(substr_compare($val, '$', 0, 1) == 0)
{
$segment_index = (int) substr($val, 1) - 1;
if($segment_index < 0)
{
continue;
}
Context::set($key, $val, TRUE);
Context::set($key, self::$segments[$segment_index], TRUE);
}
else
{
Context::set($key, $val, TRUE);
}
}
else
{
Context::set($key, '', TRUE);
}
}
return;
}
$break = FALSE;
// Apply routes
foreach(self::$routes as $regex => $query)
{
// Stop the routing proccess
if($break)
{
break;
}
if(preg_match('#^' . $regex . '$#', $path, $matches))
{
foreach($query as $key => $val)
{
$val = preg_replace('#^\$([0-9]+)$#e', '\$matches[$1]', $val);
// If [L] keyword is defined
if($key == '[L]')
{
// Stop the routing process and don't apply any more rules
$break = TRUE;
continue;
}
Context::set($key, $val, TRUE);
if(strlen($val) > 0)
{
if(substr($val, 0, 1) == '$')
{
$segment_index = (int) substr($val, 1) - 1;
if($segment_index < 0)
{
continue;
}
Context::set($key, self::$segments[$segment_index], TRUE);
}
else
{
Context::set($key, $val, TRUE);
}
}
else
{
Context::set($key, '', TRUE);
}
}
}
}
@ -150,7 +198,7 @@ class Router
*/
public static function getSegment($index)
{
return self::$segments[$index];
return self::$segments[$index - 1];
}

View file

@ -911,7 +911,7 @@ function get_by_id(id) {
jQuery(function($){
// display popup menu that contains member actions and document actions
$(document).click(function(evt) {
$(document).on('click touchstart', function(evt) {
var $area = $('#popup_menu_area');
if(!$area.length) $area = $('<div id="popup_menu_area" tabindex="0" style="display:none;z-index:9999" />').appendTo(document.body);
@ -927,6 +927,18 @@ jQuery(function($){
if(cls) match = cls.match(new RegExp('(?:^| )((document|comment|member)_([1-9]\\d*))(?: |$)',''));
if(!match) return;
// mobile에서 touchstart에 의한 동작 시 pageX, pageY 위치를 구함
if(evt.pageX===undefined || evt.pageY===undefined)
{
var touch = evt.originalEvent.touches[0];
if(touch!==undefined || !touch)
{
touch = evt.originalEvent.changedTouches[0];
}
evt.pageX = touch.pageX;
evt.pageY = touch.pageY;
}
var action = 'get'+ucfirst(match[2])+'Menu';
var params = {
mid : current_mid,

View file

@ -910,7 +910,7 @@ function get_by_id(id) {
jQuery(function($){
// display popup menu that contains member actions and document actions
$(document).click(function(evt) {
$(document).on('click touchstart', function(evt) {
var $area = $('#popup_menu_area');
if(!$area.length) $area = $('<div id="popup_menu_area" tabindex="0" style="display:none;z-index:9999" />').appendTo(document.body);
@ -926,6 +926,18 @@ jQuery(function($){
if(cls) match = cls.match(new RegExp('(?:^| )((document|comment|member)_([1-9]\\d*))(?: |$)',''));
if(!match) return;
// mobile에서 touchstart에 의한 동작 시 pageX, pageY 위치를 구함
if(evt.pageX===undefined || evt.pageY===undefined)
{
var touch = evt.originalEvent.touches[0];
if(touch!==undefined || !touch)
{
touch = evt.originalEvent.changedTouches[0];
}
evt.pageX = touch.pageX;
evt.pageY = touch.pageY;
}
var action = 'get'+ucfirst(match[2])+'Menu';
var params = {
mid : current_mid,
@ -1650,31 +1662,55 @@ function xml2json(xml, tab, ignoreAttrib) {
if(typeof(xeVid)!='undefined') $.extend(data,{vid:xeVid});
$.ajax({
type: "POST",
dataType: "json",
url: request_uri,
contentType: "application/json",
data: $.param(data),
success: function(data) {
$(".wfsr").hide().trigger('cancel_confirm');
if(data.error != '0' && data.error > -1000) {
if(data.error == -1 && data.message == 'msg_is_not_administrator') {
alert('You are not logged in as an administrator');
if($.isFunction(callback_error)) callback_error(data);
try {
$.ajax({
type: "POST",
dataType: "json",
url: request_uri,
contentType: "application/json",
data: $.param(data),
success: function(data) {
$(".wfsr").hide().trigger('cancel_confirm');
if(data.error != '0' && data.error > -1000) {
if(data.error == -1 && data.message == 'msg_is_not_administrator') {
alert('You are not logged in as an administrator');
if($.isFunction(callback_error)) callback_error(data);
return;
} else {
alert(data.message);
if($.isFunction(callback_error)) callback_error(data);
return;
} else {
alert(data.message);
if($.isFunction(callback_error)) callback_error(data);
return;
return;
}
}
}
if($.isFunction(callback_sucess)) callback_sucess(data);
}
});
if($.isFunction(callback_sucess)) callback_sucess(data);
},
error: function(xhr, textStatus) {
$(".wfsr").hide();
var msg = '';
if (textStatus == 'parsererror') {
msg = 'The result is not valid JSON :\n-------------------------------------\n';
if(xhr.responseText === "") return;
msg += xhr.responseText.replace(/<[^>]+>/g, '');
} else {
msg = textStatus;
}
try{
console.log(msg);
} catch(ee){}
}
});
} catch(e) {
alert(e);
return;
}
}
};
@ -1694,17 +1730,43 @@ function xml2json(xml, tab, ignoreAttrib) {
if(show_waiting_message) $(".wfsr").html(waiting_message).show();
$.extend(data,{module:action[0],act:action[1]});
$.ajax({
type:"POST",
dataType:"html",
url:request_uri,
data:$.param(data),
success : function(html){
$(".wfsr").hide().trigger('cancel_confirm');
self[type](html);
if($.isFunction(func)) func(args);
}
});
try {
$.ajax({
type:"POST",
dataType:"html",
url:request_uri,
data:$.param(data),
success : function(html){
$(".wfsr").hide().trigger('cancel_confirm');
self[type](html);
if($.isFunction(func)) func(args);
},
error: function(xhr, textStatus) {
$(".wfsr").hide();
var msg = '';
if (textStatus == 'parsererror') {
msg = 'The result is not valid page :\n-------------------------------------\n';
if(xhr.responseText === "") return;
msg += xhr.responseText.replace(/<[^>]+>/g, '');
} else {
msg = textStatus;
}
try{
console.log(msg);
} catch(ee){}
}
});
} catch(e) {
alert(e);
return;
}
}
};
@ -1713,7 +1775,7 @@ function xml2json(xml, tab, ignoreAttrib) {
}
$(function($){
$('.wfsr')
$(document)
.ajaxStart(function(){
$(window).bind('beforeunload', beforeUnloadHandler);
})

3
common/js/xe.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -414,31 +414,55 @@ function xml2json(xml, tab, ignoreAttrib) {
if(typeof(xeVid)!='undefined') $.extend(data,{vid:xeVid});
$.ajax({
type: "POST",
dataType: "json",
url: request_uri,
contentType: "application/json",
data: $.param(data),
success: function(data) {
$(".wfsr").hide().trigger('cancel_confirm');
if(data.error != '0' && data.error > -1000) {
if(data.error == -1 && data.message == 'msg_is_not_administrator') {
alert('You are not logged in as an administrator');
if($.isFunction(callback_error)) callback_error(data);
try {
$.ajax({
type: "POST",
dataType: "json",
url: request_uri,
contentType: "application/json",
data: $.param(data),
success: function(data) {
$(".wfsr").hide().trigger('cancel_confirm');
if(data.error != '0' && data.error > -1000) {
if(data.error == -1 && data.message == 'msg_is_not_administrator') {
alert('You are not logged in as an administrator');
if($.isFunction(callback_error)) callback_error(data);
return;
} else {
alert(data.message);
if($.isFunction(callback_error)) callback_error(data);
return;
} else {
alert(data.message);
if($.isFunction(callback_error)) callback_error(data);
return;
return;
}
}
}
if($.isFunction(callback_sucess)) callback_sucess(data);
}
});
if($.isFunction(callback_sucess)) callback_sucess(data);
},
error: function(xhr, textStatus) {
$(".wfsr").hide();
var msg = '';
if (textStatus == 'parsererror') {
msg = 'The result is not valid JSON :\n-------------------------------------\n';
if(xhr.responseText === "") return;
msg += xhr.responseText.replace(/<[^>]+>/g, '');
} else {
msg = textStatus;
}
try{
console.log(msg);
} catch(ee){}
}
});
} catch(e) {
alert(e);
return;
}
}
};
@ -458,17 +482,43 @@ function xml2json(xml, tab, ignoreAttrib) {
if(show_waiting_message) $(".wfsr").html(waiting_message).show();
$.extend(data,{module:action[0],act:action[1]});
$.ajax({
type:"POST",
dataType:"html",
url:request_uri,
data:$.param(data),
success : function(html){
$(".wfsr").hide().trigger('cancel_confirm');
self[type](html);
if($.isFunction(func)) func(args);
}
});
try {
$.ajax({
type:"POST",
dataType:"html",
url:request_uri,
data:$.param(data),
success : function(html){
$(".wfsr").hide().trigger('cancel_confirm');
self[type](html);
if($.isFunction(func)) func(args);
},
error: function(xhr, textStatus) {
$(".wfsr").hide();
var msg = '';
if (textStatus == 'parsererror') {
msg = 'The result is not valid page :\n-------------------------------------\n';
if(xhr.responseText === "") return;
msg += xhr.responseText.replace(/<[^>]+>/g, '');
} else {
msg = textStatus;
}
try{
console.log(msg);
} catch(ee){}
}
});
} catch(e) {
alert(e);
return;
}
}
};
@ -477,7 +527,7 @@ function xml2json(xml, tab, ignoreAttrib) {
}
$(function($){
$('.wfsr')
$(document)
.ajaxStart(function(){
$(window).bind('beforeunload', beforeUnloadHandler);
})

View file

@ -11,19 +11,18 @@
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<!--// TITLE -->
<title>{Context::getBrowserTitle()}</title>
<!--// CSS-->
<!--@foreach($css_files as $key => $css_file)-->
<!--@if($css_file['targetie'])--><!--[if {$css_file['targetie']}]><!--@end-->
<link rel="stylesheet" href="{$css_file['file']}" media="{$css_file['media']}"|cond="$css_file['media'] != 'all'" />
<!--@if($css_file['targetie'])--><![endif]--><!--@end-->
<!--@end-->
<!--// JS -->
<!--@foreach($js_files as $key => $js_file)-->
<!--@if($js_file['targetie'])--><!--[if {$js_file['targetie']}]><!--@end-->
<script src="{$js_file['file']}"></script>
<!--@if($js_file['targetie'])--><![endif]--><!--@end-->
<!--@end-->
<!-- CSS -->
<block loop="$css_files=>$key,$css_file">
<block cond="$css_file['targetie']"><!--[if {$css_file['targetie']}]></block>
<link rel="stylesheet" href="{$css_file['file']}" media="{$css_file['media']}"|cond="$css_file['media'] != 'all'" />
<block cond="$css_file['targetie']"><![endif]--></block>
</block>
<!-- JS -->
<block loop="$js_files=>$key,$js_file">
<block cond="$js_file['targetie']"><!--[if {$js_file['targetie']}]><block cond="stripos($js_file['targetie'], 'gt') === 0"><!--></block></block>
<script src="{$js_file['file']}"></script>
<block cond="$js_file['targetie']"><![endif]--></block>
</block>
<!--[if lt IE 9]><script src="../js/html5.js"></script><![endif]-->
<!--// RSS -->

View file

@ -173,6 +173,20 @@ if(!defined('__LOG_SLOW_QUERY__'))
define('__LOG_SLOW_QUERY__', 0);
}
if(!defined('__LOG_SLOW_TRIGGER__'))
{
/**
* Trigger excute time log
*
* <pre>
* 0: Do not leave a log
* > 0: leave a log when the trigger takes over specified milliseconds
* Log file is saved as ./files/_db_slow_trigger.php file
* </pre>
*/
define('__LOG_SLOW_TRIGGER__', 0);
}
if(!defined('__DEBUG_QUERY__'))
{
/**

View file

@ -714,43 +714,9 @@ function zdate($str, $format = 'Y-m-d H:i:s', $conversion = TRUE)
}
}
// If year value is less than 1970, handle it separately.
if((int) substr($str, 0, 4) < 1970)
{
$hour = (int) substr($str, 8, 2);
$min = (int) substr($str, 10, 2);
$sec = (int) substr($str, 12, 2);
$year = (int) substr($str, 0, 4);
$month = (int) substr($str, 4, 2);
$day = (int) substr($str, 6, 2);
$date = new DateTime($str);
$string = $date->format($format);
// leading zero?
$lz = create_function('$n', 'return ($n>9?"":"0").$n;');
$trans = array(
'Y' => $year,
'y' => $lz($year % 100),
'm' => $lz($month),
'n' => $month,
'd' => $lz($day),
'j' => $day,
'G' => $hour,
'H' => $lz($hour),
'g' => $hour % 12,
'h' => $lz($hour % 12),
'i' => $lz($min),
's' => $lz($sec),
'M' => getMonthName($month),
'F' => getMonthName($month, FALSE)
);
$string = strtr($format, $trans);
}
else
{
// if year value is greater than 1970, get unixtime by using ztime() for date() function's argument.
$string = date($format, ztime($str));
}
// change day and am/pm for each language
$unit_week = Context::getLang('unit_week');
$unit_meridiem = Context::getLang('unit_meridiem');

View file

@ -120,6 +120,11 @@ class adminAdminController extends admin
$db = DB::getInstance();
$db->deleteDuplicateIndexes();
}
// check autoinstall packages
$oAutoinstallAdminController = getAdminController('autoinstall');
$oAutoinstallAdminController->checkInstalled();
$this->setMessage('success_updated');
}

View file

@ -619,6 +619,7 @@ class adminAdminView extends admin
$info['PHP_Core'] = $php_core;
$str_info = "[XE Server Environment " . date("Y-m-d") . "]\n\n";
$str_info .= "realpath : ".realpath('./')."\n";
foreach( $info as $key=>$value )
{
if( is_array( $value ) == false ) {

View file

@ -435,7 +435,7 @@
.undelegate(".jstree")
.removeData("jstree-instance-id")
.find("[class^='jstree']")
.andSelf()
.addBack()
.attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
$(document)
.unbind(".jstree-" + n)
@ -678,7 +678,7 @@
}
else {
original_obj = obj;
if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); }
if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").addBack(); }
else { obj = obj.find("li.jstree-closed"); }
}
var _this = this;
@ -694,12 +694,12 @@
var _this = this;
obj = obj ? this._get_node(obj) : this.get_container();
if(!obj || obj === -1) { obj = this.get_container_ul(); }
obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); });
obj.find("li.jstree-open").addBack().each(function () { _this.close_node(this, !do_animation); });
this.__callback({ "obj" : obj });
},
clean_node : function (obj) {
obj = obj && obj != -1 ? $(obj) : this.get_container_ul();
obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");
obj = obj.is("li") ? obj.find("li").addBack() : obj.find("li");
obj.removeClass("jstree-last")
.filter("li:last-child").addClass("jstree-last").end()
.filter(":has(li)")
@ -922,7 +922,7 @@
if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
obj.o.each(function () {
if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; }
if(r.parentsUntil(".jstree", "li").addBack().index(this) !== -1) { ret = false; return false; }
});
return ret;
},
@ -941,7 +941,7 @@
var o = false;
if(is_copy) {
o = obj.o.clone(true);
o.find("*[id]").andSelf().each(function () {
o.find("*[id]").addBack().each(function () {
if(this.id) { this.id = "copy_" + this.id; }
});
}
@ -1138,7 +1138,7 @@
switch(!0) {
case (is_range):
this.data.ui.last_selected.addClass("jstree-last-selected");
obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").andSelf();
obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").addBack();
if(s.select_limit == -1 || obj.length < s.select_limit) {
this.data.ui.last_selected.removeClass("jstree-last-selected");
this.data.ui.selected.each(function () {
@ -1242,7 +1242,7 @@
.bind("move_node.jstree", $.proxy(function (e, data) {
if(this._get_settings().crrm.move.open_onmove) {
var t = this;
data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () {
data.rslt.np.parentsUntil(".jstree").addBack().filter(".jstree-closed").each(function () {
t.open_node(this, false, true);
});
}
@ -2800,7 +2800,7 @@
obj.each(function () {
t = $(this);
c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked";
t.find("li").andSelf().each(function () {
t.find("li").addBack().each(function () {
var $t = $(this), nm;
$t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
if(rc) {
@ -2844,13 +2844,13 @@
}
else {
if(state) {
coll = obj.find("li").andSelf();
coll = obj.find("li").addBack();
if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
if(rc) { coll.children(":checkbox").removeAttr("checked"); }
}
else {
coll = obj.find("li").andSelf();
coll = obj.find("li").addBack();
if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
if(rc) { coll.children(":checkbox").attr("checked","checked"); }
@ -2861,8 +2861,8 @@
var $this = $(this);
if(state) {
if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
$this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); }
$this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); }
return false;
}
else {
@ -2872,8 +2872,8 @@
}
else {
if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
$this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); }
$this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); }
return false;
}
else {
@ -2944,8 +2944,8 @@
else if(a === 0 && b === 0) { this.change_state(obj, true); }
else if(a === c) { this.change_state(obj, false); }
else {
obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); }
obj.parentsUntil(".jstree","li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { obj.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); }
}
},
reselect : function () {
@ -3415,7 +3415,7 @@
this.get_container()
.bind("search.jstree", function (e, data) {
$(this).children("ul").find("li").hide().removeClass("jstree-last");
data.rslt.nodes.parentsUntil(".jstree").andSelf().show()
data.rslt.nodes.parentsUntil(".jstree").addBack().show()
.filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
})
.bind("clear_search.jstree", function () {
@ -4001,7 +4001,7 @@
// this used to use html() and clean the whitespace, but this way any attached data was lost
this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
// remove white space from LI node - otherwise nodes appear a bit to the right
this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove();
this.data.html_data.original_container_html.find("li").addBack().contents().filter(function() { return this.nodeType == 3; }).remove();
},
defaults : {
data : false,
@ -4427,7 +4427,7 @@
obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
if(obj === false) { return; } // added for removing root nodes
obj.each(function () {
$(this).find("li").andSelf().each(function () {
$(this).find("li").addBack().each(function () {
var $t = $(this);
if($t.children(".jstree-wholerow-span").length) { return true; }
$t.prepend("<span class='jstree-wholerow-span' style='width:" + ($t.parentsUntil(".jstree","li").length * 18) + "px;'>&#160;</span>");
@ -4542,4 +4542,4 @@
})(jQuery);
//*/
})();
})();

View file

@ -42,7 +42,7 @@ jQuery(function($){
});
$('a._child_delete').click(function() {
var menu_item_srl = $(this).parents('li').find('._item_key').val();
var menu_item_srl = $(this).closest('li').find('._item_key').val();
listForm.find('input[name=menu_item_srl]').val(menu_item_srl);
listForm.submit();
});

View file

@ -1 +1 @@
jQuery(function(a){function b(b){var c;if(moduleList=b.menuList){var d=a("#menuNameList");for(var e in moduleList){var f=moduleList[e];c=a('<optgroup label="'+e+'" />').appendTo(d);for(var g in f)c.append('<option value="'+e+":"+g+'">'+f[g].title+"</option>")}}}var c,d,e=a("#editForm"),f=a("#listForm");a("a._add").click(function(){if(d=a(this).parent().prevAll("._item_key").val(),e.find("input[name=parent_srl]").val(d),!c){var f=[],g=["menuList"];exec_xml("menu","procMenuAdminAllActList",f,b,g)}}),a("a._parent_delete").click(function(){var b=a(this).parent().prevAll("._parent_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()}),a("a._child_delete").click(function(){var b=a(this).parents("li").find("._item_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()})}),jQuery(function(a){function b(a,b){for(var c=0,d=0;a&&a!=b;)c+=a.offsetTop,d+=a.offsetLeft,a=a.offsetParent;return{top:c,left:d}}a("form.adminMap").delegate("li:not(.placeholder)","dropped.st",function(){var b,c,d=a(this);b=d.find(">input._parent_key"),c=!!d.parent("ul").parent("li").length,b.val(c?d.parent("ul").parent("li").find(">input._item_key").val():"0")});var c=!1,d=a('<li class="placeholder">');a("form.adminMap>ul").delegate("li:not(.placeholder,.parent)",{"mousedown.st":function(e){var f,g,h,i,j,k,l,m,n,o;if(!a(e.target).is("a,input,label,textarea")&&1==e.which){for(c=!0,f=a(this),j=f.height(),i=f.width(),g=f.parentsUntil(".adminMap").filter("ul"),h=g.eq(-1),l={x:e.pageX,y:e.pageY},k=b(this,h.get(0)),$clone=f.clone(!0).attr("target",!0),n=g.length-1;n;n--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();return m=[],h.find("li").each(function(){if(f[0]===this||f.has(this).length)return!0;var c=b(this,h.get(0));m.push({top:c.top,bottom:c.top+32,$item:a(this)})}),$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",opacity:.6,width:i,height:j,left:k.left,top:k.top,zIndex:100}).appendTo(h.eq(0)),d.css({position:"absolute",opacity:.6,width:i,height:"10px",left:k.left,top:k.top,zIndex:99}).appendTo(h.eq(0)),f.css("opacity",.6),a(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,c,e,f,g;for(o=null,b={x:l.x-a.pageX,y:l.y-a.pageY},c=k.top-b.y,e=0,f=m.length;f>e;e++)g=m[e],g.top>c||g.bottom<c||(o={element:g.$item},g.$item.hasClass("parent")?(o.state="prepend",d.css("top",g.bottom-5)):g.top>c-12?(o.state="before",d.css("top",g.top-5)):(o.state="after",d.css("top",g.bottom-5)));$clone.css({top:c})}).bind("mouseup.st",function(){var b,e;c=!1,a(document).unbind("mousemove.st mouseup.st"),f.css("opacity",""),$clone.remove(),d.remove(),e=a("<li />").height(f.height()),o&&(b=a(o.element),f.before(e),"prepend"==o.state?(b.find(">ul").length||b.find(">.side").after("<ul>"),b.find(">ul").prepend(f.hide())):b[o.state](f.hide()),f.slideDown(100,function(){f.removeClass("active")}),e.slideUp(100,function(){var a=e.parent();e.remove(),a.children("li").length||a.remove()}),f.trigger("dropped.st"))}),!1}},"mouseover.st":function(){return c||a(this).addClass("active"),!1},"mouseout.st":function(){return c||a(this).removeClass("active"),!1}}).find("li li").prepend('<button type="button" class="moveTo">Move to</button>').end().end(),a('<div id="dropzone-marker" />').css({display:"none",position:"absolute",backgroundColor:"#000",opacity:.7}).appendTo("body")});
jQuery(function(a){function b(b){var c;if(moduleList=b.menuList){var d=a("#menuNameList");for(var e in moduleList){var f=moduleList[e];c=a('<optgroup label="'+e+'" />').appendTo(d);for(var g in f)c.append('<option value="'+e+":"+g+'">'+f[g].title+"</option>")}}}var c,d,e=a("#editForm"),f=a("#listForm");a("a._add").click(function(){if(d=a(this).parent().prevAll("._item_key").val(),e.find("input[name=parent_srl]").val(d),!c){var f=[],g=["menuList"];exec_xml("menu","procMenuAdminAllActList",f,b,g)}}),a("a._parent_delete").click(function(){var b=a(this).parent().prevAll("._parent_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()}),a("a._child_delete").click(function(){var b=a(this).closest("li").find("._item_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()})}),jQuery(function(a){function b(a,b){for(var c=0,d=0;a&&a!=b;)c+=a.offsetTop,d+=a.offsetLeft,a=a.offsetParent;return{top:c,left:d}}a("form.adminMap").delegate("li:not(.placeholder)","dropped.st",function(){var b,c,d=a(this);b=d.find(">input._parent_key"),c=!!d.parent("ul").parent("li").length,b.val(c?d.parent("ul").parent("li").find(">input._item_key").val():"0")});var c=!1,d=a('<li class="placeholder">');a("form.adminMap>ul").delegate("li:not(.placeholder,.parent)",{"mousedown.st":function(e){var f,g,h,i,j,k,l,m,n,o;if(!a(e.target).is("a,input,label,textarea")&&1==e.which){for(c=!0,f=a(this),j=f.height(),i=f.width(),g=f.parentsUntil(".adminMap").filter("ul"),h=g.eq(-1),l={x:e.pageX,y:e.pageY},k=b(this,h.get(0)),$clone=f.clone(!0).attr("target",!0),n=g.length-1;n;n--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();return m=[],h.find("li").each(function(){if(f[0]===this||f.has(this).length)return!0;var c=b(this,h.get(0));m.push({top:c.top,bottom:c.top+32,$item:a(this)})}),$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",opacity:.6,width:i,height:j,left:k.left,top:k.top,zIndex:100}).appendTo(h.eq(0)),d.css({position:"absolute",opacity:.6,width:i,height:"10px",left:k.left,top:k.top,zIndex:99}).appendTo(h.eq(0)),f.css("opacity",.6),a(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,c,e,f,g;for(o=null,b={x:l.x-a.pageX,y:l.y-a.pageY},c=k.top-b.y,e=0,f=m.length;f>e;e++)g=m[e],g.top>c||g.bottom<c||(o={element:g.$item},g.$item.hasClass("parent")?(o.state="prepend",d.css("top",g.bottom-5)):g.top>c-12?(o.state="before",d.css("top",g.top-5)):(o.state="after",d.css("top",g.bottom-5)));$clone.css({top:c})}).bind("mouseup.st",function(){var b,e;c=!1,a(document).unbind("mousemove.st mouseup.st"),f.css("opacity",""),$clone.remove(),d.remove(),e=a("<li />").height(f.height()),o&&(b=a(o.element),f.before(e),"prepend"==o.state?(b.find(">ul").length||b.find(">.side").after("<ul>"),b.find(">ul").prepend(f.hide())):b[o.state](f.hide()),f.slideDown(100,function(){f.removeClass("active")}),e.slideUp(100,function(){var a=e.parent();e.remove(),a.children("li").length||a.remove()}),f.trigger("dropped.st"))}),!1}},"mouseover.st":function(){return c||a(this).addClass("active"),!1},"mouseout.st":function(){return c||a(this).removeClass("active"),!1}}).find("li li").prepend('<button type="button" class="moveTo">Move to</button>').end().end(),a('<div id="dropzone-marker" />').css({display:"none",position:"absolute",backgroundColor:"#000",opacity:.7}).appendTo("body")});

View file

@ -181,6 +181,7 @@ class autoinstallAdminController extends autoinstall
@set_time_limit(0);
$package_srls = Context::get('package_srl');
$oModel = getModel('autoinstall');
$oAdminModel = getAdminModel('autoinstall');
$packages = explode(',', $package_srls);
$ftp_info = Context::getFTPInfo();
if(!$_SESSION['ftp_password'])
@ -196,7 +197,11 @@ class autoinstallAdminController extends autoinstall
foreach($packages as $package_srl)
{
$package = $oModel->getPackage($package_srl);
if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported)
if($oAdminModel->checkUseDirectModuleInstall($package)->toBool())
{
$oModuleInstaller = new DirectModuleInstaller($package);
}
else if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported)
{
$oModuleInstaller = new SFTPModuleInstaller($package);
}
@ -308,7 +313,11 @@ class autoinstallAdminController extends autoinstall
{
$package_srl = Context::get('package_srl');
$this->uninstallPackageByPackageSrl($package_srl);
$output = $this->uninstallPackageByPackageSrl($package_srl);
if($output->toBool()==FALSE)
{
return $output;
}
if(Context::get('return_url'))
{
@ -348,6 +357,8 @@ class autoinstallAdminController extends autoinstall
{
$path = $package->path;
$oAdminModel = getAdminModel('autoinstall');
if(!$_SESSION['ftp_password'])
{
$ftp_password = Context::get('ftp_password');
@ -359,7 +370,11 @@ class autoinstallAdminController extends autoinstall
$ftp_info = Context::getFTPInfo();
$isSftpSupported = function_exists(ssh2_sftp);
if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported)
if($oAdminModel->checkUseDirectModuleInstall($package)->toBool())
{
$oModuleInstaller = new DirectModuleInstaller($package);
}
else if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported)
{
$oModuleInstaller = new SFTPModuleInstaller($package);
}

View file

@ -316,7 +316,7 @@ class autoinstallAdminModel extends autoinstall
}
}
$installedPackage = $oModel->getInstalledPackage($package_srl);
$installedPackage = $oModel->getInstalledPackage($packageSrl);
if($installedPackage)
{
$package->installed = TRUE;
@ -348,6 +348,61 @@ class autoinstallAdminModel extends autoinstall
$this->add('package', $package);
}
public function checkUseDirectModuleInstall($package)
{
$directModuleInstall = TRUE;
$arrUnwritableDir = array();
$output = $this->isWritableDir($package->path);
if($output->toBool()==FALSE)
{
$directModuleInstall = FALSE;
$arrUnwritableDir[] = $output->get('path');
}
foreach($package->depends as $dep)
{
$output = $this->isWritableDir($dep->path);
if($output->toBool()==FALSE)
{
$directModuleInstall = FALSE;
$arrUnwritableDir[] = $output->get('path');
}
}
if($directModuleInstall==FALSE)
{
$output = new Object(-1, 'msg_direct_inall_invalid');
$output->add('path', $arrUnwritableDir);
return $output;
}
return new Object();
}
public function isWritableDir($path)
{
$path_list = explode('/', dirname($path));
$real_path = './';
while($path_list)
{
$check_path = realpath($real_path . implode('/', $path_list));
if(FileHandler::isDir($check_path))
{
break;
}
array_pop($path_list);
}
if(FileHandler::isWritableDir($check_path)==FALSE)
{
$output = new Object(-1, 'msg_unwritable_directory');
$output->add('path', FileHandler::getRealPath($check_path));
return $output;
}
return new Object();
}
}
/* End of file autoinstall.admin.model.php */
/* Location: ./modules/autoinstall/autoinstall.admin.model.php */

View file

@ -368,6 +368,13 @@ class autoinstallAdminView extends autoinstall
Context::set('need_password', TRUE);
}
$output = $oAdminModel->checkUseDirectModuleInstall($package);
if($output->toBool()==TRUE)
{
Context::set('show_ftp_note', FALSE);
}
Context::set('directModuleInstall', $output);
$this->setTemplateFile('install');
$security = new Security();
@ -503,6 +510,7 @@ class autoinstallAdminView extends autoinstall
}
$oModel = getModel('autoinstall');
$oAdminModel = getAdminModel('autoinstall');
$installedPackage = $oModel->getInstalledPackage($package_srl);
if(!$installedPackage)
{
@ -529,6 +537,13 @@ class autoinstallAdminView extends autoinstall
return $this->stop("msg_invalid_request");
}
$output = $oAdminModel->checkUseDirectModuleInstall($installedPackage);
if($output->toBool()==TRUE)
{
Context::set('show_ftp_note', FALSE);
}
Context::set('directModuleInstall', $output);
$params["act"] = "getResourceapiPackages";
$params["package_srls"] = $package_srl;
$body = XmlGenerater::generate($params);

View file

@ -867,6 +867,131 @@ class FTPModuleInstaller extends ModuleInstaller
return new Object();
}
}
/**
* Module installer for Direct. Not use FTP
* @author NAVER (developers@xpressengine.com)
*/
class DirectModuleInstaller extends ModuleInstaller
{
/**
* Constructor
*
* @param object $package Package information
*/
function DirectModuleInstaller(&$package)
{
$this->package = &$package;
}
/**
* empty
*
* @return Object
*/
function _connect()
{
return new Object();
}
/**
* Remove file
*
* @param string $path Path to remove
* @return Object
*/
function _removeFile($path)
{
if(substr($path, 0, 2) == "./")
{
$path = substr($path, 2);
}
$target_path = FileHandler::getRealPath($path);
if(!FileHandler::removeFile($target_path))
{
return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path));
}
return new Object();
}
/**
* Remove directory
* @param string $path Path to remove
* @return Object
*/
function _removeDir_real($path)
{
if(substr($path, 0, 2) == "./")
{
$path = substr($path, 2);
}
$target_path = FileHandler::getRealPath($path);
FileHandler::removeDir($target_path);
return new Object();
}
/**
* Close
*
* @return void
*/
function _close()
{
}
/**
* Copy directory
*
* @param array $file_list File list to copy
* @return Object
*/
function _copyDir(&$file_list)
{
$output = $this->_connect();
if(!$output->toBool())
{
return $output;
}
$target_dir = $this->target_path;
if(is_array($file_list))
{
foreach($file_list as $k => $file)
{
$org_file = $file;
if($this->package->path == ".")
{
$file = substr($file, 3);
}
$path = FileHandler::getRealPath("./" . $this->target_path . "/" . $file);
$path_list = explode('/', dirname($this->target_path . "/" . $file));
$real_path = "./";
for($i = 0; $i < count($path_list); $i++)
{
if($path_list == "")
{
continue;
}
$real_path .= $path_list[$i] . "/";
if(!file_exists(FileHandler::getRealPath($real_path)))
{
FileHandler::makeDir($real_path);
}
}
FileHandler::copyFile( FileHandler::getRealPath($this->download_path . "/" . $org_file), FileHandler::getRealPath("./" . $target_dir . '/' . $file));
}
}
$this->_close();
return new Object();
}
}
/* End of file autoinstall.lib.php */
/* Location: ./modules/autoinstall/autoinstall.lib.php */

View file

@ -323,6 +323,11 @@
<value xml:lang="en"><![CDATA[SFTP is not supported.]]></value>
<value xml:lang="jp"><![CDATA[SFTPの非対応環境です。]]></value>
</item>
<item name="msg_direct_install_not_supported">
<value xml:lang="ko"><![CDATA[아래 목록에 나열된 디렉터리에 쓰기 권한이 없기 때문에 FTP를 사용합니다.]]></value>
<value xml:lang="en"><![CDATA[Use FTP because there is no write permission to the directories listed in the list below.]]></value>
<value xml:lang="jp"><![CDATA[下記のリストにリストされているディレクトリへの書き込み権限がないため、FTPを使用してください。]]></value>
</item>
<item name="msg_does_not_support_delete">
<value xml:lang="ko"><![CDATA[이 패키지가 삭제를 지원하지 않습니다(모듈 클래스에 moduleUninstall()이 없음).]]></value>
<value xml:lang="en"><![CDATA[Cannot delete this package (no moduleUninstall() in the module class).]]></value>

View file

@ -9,6 +9,7 @@
<div cond="$XE_VALIDATOR_MESSAGE && isset($from_id[$XE_VALIDATOR_ID])" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<!--
<form action="" method="post">
<input type="hidden" name="module" value="autoinstall" />
<input type="hidden" name="act" value="procAutoinstallAdminUpdateinfo" />
@ -22,4 +23,5 @@
{sprintf($lang->description_update, $btnUpdate)}
</p>
</form>
-->
<include target="list.html" />

View file

@ -6,30 +6,37 @@
<h4>{$lang->msg_update_core_title}</h4>
<p>{$lang->msg_update_core}</p>
</div>
<div class="x_well">
<p cond="$package->installed">{$lang->current_version}: {$package->cur_version} <block cond="$package->need_update">({$lang->require_update})</block></p>
<p cond="!$package->installed">{$lang->require_installation}</p>
<block cond="$package->depends">
<p>{$lang->about_depending_programs}</p>
<ul>
<li loop="$package->depends => $dep">
{$dep->title} ver. {$dep->version} -
<block cond="$dep->installed">{$lang->current_version}: {$dep->cur_version} <block cond="$dep->need_update">({$lang->require_update})</block></block>
<block cond="!$dep->installed">{$lang->require_installation}</block>
<block cond="$show_ftp_note && ($dep->need_update || !$dep->installed)">
<a href="{_XE_DOWNLOAD_SERVER_}?module=resourceapi&act=procResourceapiDownload&package_srl={$dep->package_srl}">{$lang->cmd_download}</a> ({$lang->path}: {$dep->path})
</block>
</li>
</ul>
<p>{$lang->description_install}</p>
</block>
<div cond="$package->installed" class="x_well">
<p>{$lang->current_version}: {$package->cur_version} <block cond="$package->need_update">({$lang->require_update})</block></p>
</div>
<div cond="$package->depends && (!$package->installed || $package->need_update)" class="x_well">
<p>{$lang->about_depending_programs}</p>
<p>{$lang->description_install}</p>
<ul>
<li loop="$package->depends => $dep">
{$dep->title} ver. {$dep->version} -
<block cond="$dep->installed">{$lang->current_version}: {$dep->cur_version} <block cond="$dep->need_update">({$lang->require_update})</block></block>
<block cond="!$dep->installed">{$lang->require_installation}</block>
<block cond="$show_ftp_note && ($dep->need_update || !$dep->installed)">
<a href="{_XE_DOWNLOAD_SERVER_}?module=resourceapi&act=procResourceapiDownload&package_srl={$dep->package_srl}">{$lang->cmd_download}</a> ({$lang->path}: {$dep->path})
</block>
</li>
</ul>
</div>
<block cond="!$package->installed || $package->need_update">
<div cond="$show_ftp_note" class="x_well x_clearfix">
<p>{$lang->description_download}. (<a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigFtp')}">FTP Setup</a>)</p>
<p>{$lang->path}: {$package->path}</p>
<p><a class="x_btn x_btn-primary x_pull-right" href="{_XE_DOWNLOAD_SERVER_}?module=resourceapi&act=procResourceapiDownload&package_srl={$package->package_srl}">{$lang->cmd_download}</a>
<div cond="!$directModuleInstall->toBool() || $show_ftp_note" class="x_well x_clearfix">
<block cond="!$directModuleInstall->toBool()">
<p>{$lang->msg_direct_install_not_supported}</p>
<ul>
<li loop="$directModuleInstall->get('path') => $path">{$path}</li>
</ul>
</block>
<block cond="$show_ftp_note" >
<p>{$lang->description_download}. (<a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigFtp')}">FTP Setup</a>)</p>
<p>{$lang->path}: {$package->path}</p>
<p><a class="x_btn x_btn-primary x_pull-right" href="{_XE_DOWNLOAD_SERVER_}?module=resourceapi&act=procResourceapiDownload&package_srl={$package->package_srl}">{$lang->cmd_download}</a>
</block>
</div>
<div cond="!$show_ftp_note">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/autoinstall/tpl/install/1'" class="message error">
@ -40,10 +47,10 @@
<input type="hidden" name="act" value="procAutoinstallAdminPackageinstall" />
<input type="hidden" name="package_srl" value="{$package->package_srl}" />
<input type="hidden" name="return_url" value="{$return_url}" />
<input cond="!$need_password" type="hidden" name="ftp_password" value="dummy" />
<input cond="!$need_password || $directModuleInstall->toBool()" type="hidden" name="ftp_password" value="dummy" />
<input type="hidden" name="xe_validator_id" value="modules/autoinstall/tpl/install/1" />
<block cond="$need_password">
<block cond="$need_password && !$directModuleInstall->toBool()">
<div class="x_control-group">
<label class="x_control-label" for="ftp_password">FTP {$lang->password}</label>
<div class="x_controls">

View file

@ -58,7 +58,7 @@
<p class="x_btn-group" style="text-align:right">
<a cond="$item->current_version && $item->need_update != 'Y'" class="x_btn x_disabled" href="#">{$lang->installed}</a>
<a cond="!$item->current_version" class="x_btn" href="{getUrl('act','dispAutoinstallAdminInstall','package_srl',$item->package_srl)}"><i class="x_icon-download-alt"></i> {$lang->install}</a>
<a cond="!$show_ftp_note && $item->current_version && $item->avail_remove" class="x_btn" href="{getUrl('act','dispAutoinstallAdminUninstall','package_srl',$item->package_srl)}"><i class="x_icon-remove"></i> {$lang->cmd_delete}</a>
<a cond="$item->current_version && $item->avail_remove" class="x_btn" href="{getUrl('act','dispAutoinstallAdminUninstall','package_srl',$item->package_srl)}"><i class="x_icon-remove"></i> {$lang->cmd_delete}</a>
<a cond="$item->current_version && $item->need_update == 'Y'" class="x_btn" href="{getUrl('act','dispAutoinstallAdminInstall','package_srl',$item->package_srl)}"><i class="x_icon-refresh"></i> {$lang->update}</a>
</p>
</div>

View file

@ -8,43 +8,55 @@
<div class="x_alert x_alert-block">
<p>{$lang->description_uninstall}</p>
</div>
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/autoinstall/tpl/uninstall/1'" class="message error">
<p>{$XE_VALIDATOR_MESSAGE}</p>
<div class="x_well x_clearfix">
<block cond="!$directModuleInstall->toBool()">
<p>{$lang->msg_direct_install_not_supported}</p>
<ul>
<li loop="$directModuleInstall->get('path') => $path">{$path}</li>
</ul>
</block>
<block cond="$show_ftp_note">
<p>{$lang->ftp_form_title}. (<a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigFtp')}">FTP Setup</a>)</p>
</block>
</div>
<form action="./" class="x_form-horizontal" method="post" ruleset="ftp">
<input type="hidden" name="module" value="autoinstall" />
<input type="hidden" name="act" value="procAutoinstallAdminUninstallPackage" />
<input type="hidden" name="package_srl" value="{$package_srl}" />
<input type="hidden" name="return_url" value="{$return_url}" />
<input cond="!$need_password" type="hidden" name="ftp_password" value="dummy" />
<input type="hidden" name="xe_validator_id" value="modules/autoinstall/tpl/uninstall/1" />
<block cond="$need_password">
<div class="x_control-group">
<label class="x_control-label" for="ftp_password">FTP {$lang->password}</label>
<div class="x_controls">
<input type="password" name="ftp_password" id="ftp_password" value="" />
<span class="x_help-block">{$lang->about_ftp_password}</span>
<div cond="!$show_ftp_note">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/autoinstall/tpl/uninstall/1'" class="message error">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form action="./" class="x_form-horizontal" method="post" ruleset="ftp">
<input type="hidden" name="module" value="autoinstall" />
<input type="hidden" name="act" value="procAutoinstallAdminUninstallPackage" />
<input type="hidden" name="package_srl" value="{$package_srl}" />
<input type="hidden" name="return_url" value="{$return_url}" />
<input cond="!$need_password || $directModuleInstall->toBool()" type="hidden" name="ftp_password" value="dummy" />
<input type="hidden" name="xe_validator_id" value="modules/autoinstall/tpl/uninstall/1" />
<block cond="$need_password && !$directModuleInstall->toBool()">
<div class="x_control-group">
<label class="x_control-label" for="ftp_password">FTP {$lang->password}</label>
<div class="x_controls">
<input type="password" name="ftp_password" id="ftp_password" value="" />
<span class="x_help-block">{$lang->about_ftp_password}</span>
</div>
</div>
</block>
<div class="x_clearfix btnArea">
<div class="x_pull-right">
<input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_delete}" />
</div>
</div>
</block>
<div class="x_clearfix btnArea">
<div class="x_pull-right">
<input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_delete}" />
</div>
</div>
</form>
</form>
</div>
</block>
<block cond="!$package->avail_remove">
<div class="x_alert x_alert-error">
<p cond="$package->deps">{$lang->msg_dependency_package}</p>
<p cond="!$package->deps">{$lang->msg_does_not_support_delete}</p>
</div>
<div class="x_well">
<p cond="$package->deps">{$lang->dependant_list}:</p>
<ul cond="$package->deps">
<div cond="$package->deps" class="x_well">
<p>{$lang->dependant_list}:</p>
<ul>
<li loop="$package->deps => $dep_package_srl">{$installed[$dep_package_srl]->title}</li>
</ul>
</div>

View file

@ -30,12 +30,24 @@ class boardAdminController extends board {
if(is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status);
unset($args->board_name);
// setup extra_order_target
$extra_order_target = array();
if($args->module_srl)
{
$oDocumentModel = getModel('document');
$module_extra_vars = $oDocumentModel->getExtraKeys($args->module_srl);
foreach($module_extra_vars as $oExtraItem)
{
$extra_order_target[$oExtraItem->eid] = $oExtraItem->name;
}
}
// setup other variables
if($args->except_notice != 'Y') $args->except_notice = 'N';
if($args->use_anonymous != 'Y') $args->use_anonymous = 'N';
if($args->consultation != 'Y') $args->consultation = 'N';
if($args->protect_content!= 'Y') $args->protect_content = 'N';
if(!in_array($args->order_target,$this->order_target)) $args->order_target = 'list_order';
if(!in_array($args->order_target,$this->order_target) && !in_array($args->order_target, $extra_order_target)) $args->order_target = 'list_order';
if(!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc';
// if there is an existed module

View file

@ -168,11 +168,21 @@ class boardAdminView extends board {
$oBoardModel = getModel('board');
// setup the extra vaiables
Context::set('extra_vars', $oBoardModel->getDefaultListConfig($this->module_info->module_srl));
$extra_vars = $oBoardModel->getDefaultListConfig($this->module_info->module_srl);
Context::set('extra_vars', $extra_vars);
// setup the list config (install the default value if there is no list config)
Context::set('list_config', $oBoardModel->getListConfig($this->module_info->module_srl));
// setup extra_order_target
$module_extra_vars = $oDocumentModel->getExtraKeys($this->module_info->module_srl);
$extra_order_target = array();
foreach($module_extra_vars as $oExtraItem)
{
$extra_order_target[$oExtraItem->eid] = $oExtraItem->name;
}
Context::set('extra_order_target', $extra_order_target);
$security = new Security();
$security->encodeHTML('extra_vars..name','list_config..name');

View file

@ -9,9 +9,9 @@
class board extends ModuleObject
{
var $search_option = array('title','content','title_content','comment','user_name','nick_name','user_id','tag'); ///< 검색 옵션
var $search_option = array('title_content','title','content','comment','user_name','nick_name','user_id','tag'); ///< 검색 옵션
var $order_target = array('list_order', 'update_order', 'regdate', 'voted_count', 'blamed_count', 'readed_count', 'comment_count', 'title'); // 정렬 옵션
var $order_target = array('list_order', 'update_order', 'regdate', 'voted_count', 'blamed_count', 'readed_count', 'comment_count', 'title', 'nick_name', 'user_name', 'user_id'); // 정렬 옵션
var $skin = "default"; ///< skin name
var $list_count = 20; ///< the number of documents displayed in a page

View file

@ -171,6 +171,9 @@
<div class="x_controls">
<select name="order_target" id="order_target" title="{$lang->order_target}">
<option loop="$order_target=> $key, $val" value="{$key}" selected="selected"|cond="$module_info->order_target== $key">{$val}</option>
<block cond="$extra_order_target">
<option loop="$extra_order_target=> $key, $val" value="{$key}" selected="selected"|cond="$module_info->order_target== $key">{$val}</option>
</block>
</select>
<select name="order_type" id="order_type" title="{$lang->order_type}">
<option value="asc" selected="selected"|cond="$module_info->order_type != 'desc'">{$lang->order_asc}</option>

View file

@ -1,3 +1,3 @@
.barContainer{margin-right:103px;position:relative;height:100%;}
.graphHr{position:relative; display:inline-block; background:transparent url(images/iconBar.gif) 4px 0 repeat-x;height:5px}
.graphHr>span{position:absolute;top:-7px;left:100%;padding-left:4px;width:100px}
.graphHr>span{position:absolute;top:-7px;left:100%;padding-left:4px;width:100px;white-space:nowrap}

View file

@ -751,18 +751,77 @@ class editorModel extends editor
}
// List extra variables (text type only for editor component)
$extra_vars = $xml_doc->component->extra_vars->var;
$extra_vars = $xml_doc->component->extra_vars;
if($extra_vars)
{
if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
foreach($extra_vars as $key => $val)
$extra_var_groups = $extra_vars->group;
if(!$extra_var_groups)
{
$key = $val->attrs->name;
$extra_var = new stdClass;
$extra_var->title = $val->title->body;
$extra_var->description = $val->description->body;
$component_info->extra_vars->{$key} = $extra_var;
$extra_var_groups = $extra_vars;
}
if(!is_array($extra_var_groups))
{
$extra_var_groups = array($extra_var_groups);
}
foreach($extra_var_groups as $group)
{
$extra_vars = $group->var;
if(!is_array($group->var))
{
$extra_vars = array($group->var);
}
foreach($extra_vars as $key => $val)
{
if(!$val)
{
continue;
}
$obj = new stdClass();
if(!$val->attrs)
{
$val->attrs = new stdClass();
}
if(!$val->attrs->type)
{
$val->attrs->type = 'text';
}
$obj->group = $group->title->body;
$obj->name = $val->attrs->name;
$obj->title = $val->title->body;
$obj->type = $val->attrs->type;
$obj->description = $val->description->body;
if($obj->name)
{
$obj->value = $extra_vals->{$obj->name};
}
if(strpos($obj->value, '|@|') != FALSE)
{
$obj->value = explode('|@|', $obj->value);
}
if($obj->type == 'mid_list' && !is_array($obj->value))
{
$obj->value = array($obj->value);
}
// 'Select'type obtained from the option list.
if($val->options && !is_array($val->options))
{
$val->options = array($val->options);
}
for($i = 0, $c = count($val->options); $i < $c; $i++)
{
$obj->options[$i] = new stdClass();
$obj->options[$i]->title = $val->options[$i]->title->body;
$obj->options[$i]->value = $val->options[$i]->attrs->value;
}
$component_info->extra_vars->{$obj->name} = $obj;
}
}
}

View file

@ -5492,7 +5492,7 @@ xe.XE_Table = $.Class({
// 첫번째 셀 가로 확장
var colspan = 0;
cell.eq(0).nextAll('td,th').andSelf().filter('.xe_selected_cell').each(function(idx){
cell.eq(0).nextAll('td,th').addBack().filter('.xe_selected_cell').each(function(idx){
colspan += self._getSpan(this, 'col');
});
@ -5685,7 +5685,7 @@ xe.XE_Table = $.Class({
_mousedown : function(event) {
var cur = $(event.target);
var sel = cur.parents().andSelf().filter('td,th,table');
var sel = cur.parents().addBack().filter('td,th,table');
var app = this.oApp;
var self = this;
@ -5700,7 +5700,7 @@ xe.XE_Table = $.Class({
function delayed(){
sel = app.getSelection().cloneRange();
sel.collapseToStart();
sel = $(sel.startContainer).parents().andSelf().filter('td,th').eq(0);
sel = $(sel.startContainer).parents().addBack().filter('td,th').eq(0);
if (!sel.length) return self._removeAllListener()||true;
@ -5726,7 +5726,7 @@ xe.XE_Table = $.Class({
_mousemove : function(event) {
var cur = $(event.target);
var cell = cur.parents().andSelf().filter('td,th').eq(0);
var cell = cur.parents().addBack().filter('td,th').eq(0);
var self = this;
// 마우스 왼쪽 버튼이 눌리지 않았으면 종료

View file

@ -5497,7 +5497,7 @@ xe.XE_Table = $.Class({
// 첫번째 셀 가로 확장
var colspan = 0;
cell.eq(0).nextAll('td,th').andSelf().filter('.xe_selected_cell').each(function(idx){
cell.eq(0).nextAll('td,th').addBack().filter('.xe_selected_cell').each(function(idx){
colspan += self._getSpan(this, 'col');
});
@ -5690,7 +5690,7 @@ xe.XE_Table = $.Class({
_mousedown : function(event) {
var cur = $(event.target);
var sel = cur.parents().andSelf().filter('td,th,table');
var sel = cur.parents().addBack().filter('td,th,table');
var app = this.oApp;
var self = this;
@ -5705,7 +5705,7 @@ xe.XE_Table = $.Class({
function delayed(){
sel = app.getSelection().cloneRange();
sel.collapseToStart();
sel = $(sel.startContainer).parents().andSelf().filter('td,th').eq(0);
sel = $(sel.startContainer).parents().addBack().filter('td,th').eq(0);
if (!sel.length) return self._removeAllListener()||true;
@ -5731,7 +5731,7 @@ xe.XE_Table = $.Class({
_mousemove : function(event) {
var cur = $(event.target);
var cell = cur.parents().andSelf().filter('td,th').eq(0);
var cell = cur.parents().addBack().filter('td,th').eq(0);
var self = this;
// 마우스 왼쪽 버튼이 눌리지 않았으면 종료

File diff suppressed because one or more lines are too long

View file

@ -32,13 +32,29 @@
<a href="#" onclick="winopen('{$component->link}');return false;">{$component->link}</a>
</div>
</div>
<div class="x_control-group" loop="$component->extra_vars=>$key,$val">
<label class="x_control-label">{$val->title}</label>
<div class="x_controls">
<input type="text" name="{$key}" value="{$val->value}" />
<span class="x_help-block">{$val->description}</span>
</div>
</div>
<block cond="count($component->extra_vars)">
<block loop="$component->extra_vars => $id, $var">
<block cond="$group != $var->group">
<h2>{$var->group}</h2>
{@$group = $var->group}
</block>
{@$not_first = true}
<div class="x_control-group" cond="!$not_first && $group != $var->group"></div>
<div class="x_control-group">
<label class="x_control-label" for="{$var->name}"|cond="$var->type != 'textarea'" for="lang_{$var->name}"|cond="$var->type == 'textarea'">{$var->title}</label>
<div class="x_controls">
<input cond="$var->type == 'text'" type="text" name="{$var->name}" id="{$var->name}" value="{htmlspecialchars($var->value, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}">
<textarea cond="$var->type == 'textarea'" name="{$var->name}" id="{$var->name}" rows="8" cols="42">{htmlspecialchars($var->value, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}</textarea>
<select cond="$var->type == 'select'" name="{$var->name}" id="{$var->name}">
<option loop="$var->options => $option" value="{$option->value}" selected="selected"|cond="$var->value == $option->value">{$option->title}</option>
</select>
<span class="x_help-inline">{nl2br($var->description)}</span>
</div>
</div>
</block>
</block>
<div class="x_control-group">
<label class="x_control-label">{$lang->grant}</label>
<div class="x_controls">

View file

@ -764,7 +764,7 @@ class fileController extends file
$oDocumentController = getController('document');
$documentSrlList = array();
for($i=0;$i<count($srls);$i++)
for($i=0, $c=count($srls); $i<$c; $i++)
{
$srl = (int)$srls[$i];
if(!$srl) continue;
@ -818,29 +818,33 @@ class fileController extends file
{
// Get a list of attachements
$oFileModel = getModel('file');
$columnList = array('uploaded_filename', 'module_srl');
$columnList = array('file_srl', 'uploaded_filename', 'module_srl');
$file_list = $oFileModel->getFiles($upload_target_srl, $columnList);
// Success returned if no attachement exists
if(!is_array($file_list)||!count($file_list)) return new Object();
// Remove from the DB
$args = new stdClass();
$args->upload_target_srl = $upload_target_srl;
$output = executeQuery('file.deleteFiles', $args);
if(!$output->toBool()) return $output;
// Delete the file
$path = array();
$file_count = count($file_list);
for($i=0;$i<$file_count;$i++)
{
$uploaded_filename = $file_list[$i]->uploaded_filename;
FileHandler::removeFile($uploaded_filename);
$module_srl = $file_list[$i]->module_srl;
$this->deleteFile($file_list[$i]->file_srl);
$uploaded_filename = $file_list[$i]->uploaded_filename;
$path_info = pathinfo($uploaded_filename);
if(!in_array($path_info['dirname'], $path)) $path[] = $path_info['dirname'];
}
// Remove a file directory of the document
for($i=0;$i<count($path);$i++) FileHandler::removeBlankDir($path[$i]);
for($i=0, $c=count($path); $i<$c; $i++)
{
FileHandler::removeBlankDir($path[$i]);
}
return $output;
}

View file

@ -225,7 +225,8 @@ class installController extends install
);
$db_info->slave_db = array($db_info->master_db);
$db_info->default_url = Context::getRequestUri();
$db_info->lang_type = Context::getLangType();
$db_info->lang_type = Context::get('lang_type') ? Context::get('lang_type') : Context::getLangType();
Context::setLangType($db_info->lang_type);
$db_info->use_rewrite = Context::get('use_rewrite');
$db_info->time_zone = Context::get('time_zone');

View file

@ -35,6 +35,27 @@ class installView extends install
$install_config_file = FileHandler::getRealPath('./config/install.config.php');
if(file_exists($install_config_file))
{
/**
* If './config/install.config.php' file created and write array shown in the example below, XE installed using config file.
* ex )
$install_config = array(
'db_type' =>'mysqli_innodb',
'db_port' =>'3306',
'db_hostname' =>'localhost',
'db_userid' =>'root',
'db_password' =>'root',
'db_database' =>'xe_database',
'db_table_prefix' =>'xe',
'user_rewrite' =>'N',
'time_zone' =>'0000',
'email_address' =>'admin@xe.com',
'password' =>'pass',
'password2' =>'pass',
'nick_name' =>'admin',
'user_id' =>'admin',
'lang_type' =>'ko', // en, jp, ...
);
*/
include $install_config_file;
if(is_array($install_config))
{

View file

@ -2,6 +2,7 @@
// ko/en/...
$lang = Context::getLangType();
$logged_info = Context::get('logged_info');
// insertMenu
$oMenuAdminController = getAdminController('menu'); /* @var $oMenuAdminController menuAdminController */
@ -114,20 +115,27 @@ $oDocumentModel = getModel('document'); /* @var $oDocumentModel documentModel */
$oDocumentController = getController('document'); /* @var $oDocumentController documentController */
$obj = new stdClass;
$obj->member_srl = $logged_info->member_srl;
$obj->user_id = htmlspecialchars_decode($logged_info->user_id);
$obj->user_name = htmlspecialchars_decode($logged_info->user_name);
$obj->nick_name = htmlspecialchars_decode($logged_info->nick_name);
$obj->email_address = $logged_info->email_address;
$obj->module_srl = $module_srl;
Context::set('version', __XE_VERSION__);
$obj->title = 'Welcome XE';
$obj->content = $oTemplateHandler->compile(_XE_PATH_ . 'modules/install/script/welcome_content', 'welcome_content_'.$lang);
$output = $oDocumentController->insertDocument($obj);
$output = $oDocumentController->insertDocument($obj, true);
if(!$output->toBool()) return $output;
$document_srl = $output->get('document_srl');
unset($obj->document_srl);
$obj->title = 'Welcome mobile XE';
$output = $oDocumentController->insertDocument($obj);
$output = $oDocumentController->insertDocument($obj, true);
if(!$output->toBool()) return $output;
// save PageWidget

View file

@ -94,7 +94,7 @@ class memberAdminView extends member
}
}
$config = $this->memberConfig;
$memberIdentifiers = array('email_address'=>'email_address', 'user_id'=>'user_id', 'user_name'=>'user_name', 'nick_name'=>'nick_name');
$memberIdentifiers = array('user_id'=>'user_id', 'user_name'=>'user_name', 'nick_name'=>'nick_name');
$usedIdentifiers = array();
if(is_array($config->signupForm))

View file

@ -66,8 +66,8 @@ class member extends ModuleObject {
if(!$config->image_name_max_height) $config->image_name_max_height = '20';
if(!$config->image_mark_max_width) $config->image_mark_max_width = '20';
if(!$config->image_mark_max_height) $config->image_mark_max_height = '20';
if(!$config->profile_image_max_width) $config->profile_image_max_width = '80';
if(!$config->profile_image_max_height) $config->profile_image_max_height = '80';
if(!$config->profile_image_max_width) $config->profile_image_max_width = '90';
if(!$config->profile_image_max_height) $config->profile_image_max_height = '90';
if($config->group_image_mark!='Y') $config->group_image_mark = 'N';
if(!$config->password_strength) $config->password_strength = 'normal';

View file

@ -705,13 +705,14 @@ class memberController extends member
// Check uploaded file
if(!checkUploadedFile($target_file)) return;
$oModuleModel = getModel('module');
$config = $oModuleModel->getModuleConfig('member');
$oMemberModel = getModel('member');
$config = $oMemberModel->getMemberConfig();
// Get an image size
$max_width = $config->profile_image_max_width;
if(!$max_width) $max_width = "90";
$max_height = $config->profile_image_max_height;
if(!$max_height) $max_height = "20";
if(!$max_height) $max_height = "90";
// Get a target path to save
$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
FileHandler::makeDir($target_path);
@ -1008,7 +1009,7 @@ class memberController extends member
$oMail->setTitle( Context::getLang('msg_find_account_title') );
$oMail->setContent($content);
$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
$oMail->setReceiptor( $member_info->nick_name, $member_info->email_address );
$oMail->send();
// Return message
$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
@ -1180,7 +1181,7 @@ class memberController extends member
$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
$oMail->setContent($content);
$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
$oMail->setReceiptor( $member_info->nick_name, $member_info->email_address );
$oMail->send();
// Return message
$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
@ -1263,7 +1264,7 @@ class memberController extends member
$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
$oMail->setContent($content);
$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
$oMail->setReceiptor( $args->user_name, $args->email_address );
$oMail->setReceiptor( $args->email_address, $args->email_address );
$oMail->send();
$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@ -1390,7 +1391,7 @@ class memberController extends member
$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
$oMail->setContent($content);
$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
$oMail->setReceiptor( $member_info->nick_name, $member_info->email_address );
$oMail->send();
}

View file

@ -57,8 +57,8 @@ class memberModel extends member
if(!$config->image_name_max_height) $config->image_name_max_height = 20;
if(!$config->image_mark_max_width) $config->image_mark_max_width = 20;
if(!$config->image_mark_max_height) $config->image_mark_max_height = 20;
if(!$config->profile_image_max_width) $config->profile_image_max_width = 80;
if(!$config->profile_image_max_height) $config->profile_image_max_height = 80;
if(!$config->profile_image_max_width) $config->profile_image_max_width = 90;
if(!$config->profile_image_max_height) $config->profile_image_max_height = 90;
if(!$config->skin) $config->skin = 'default';
if(!$config->colorset) $config->colorset = 'white';
if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'xpresseditor';

View file

@ -8,7 +8,7 @@
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/member/skins'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form ruleset="@login" action="{getUrl('')}" method="post" id="fo_member_login">
<form ruleset="@login" action="{getUrl('', 'act', 'procMemberLogin')}" method="post" id="fo_member_login">
<input type="hidden" name="success_return_url" value="{$referer_url}" />
<input type="hidden" name="act" value="procMemberLogin" />
<input type="hidden" name="xe_validator_id" value="modules/member/skins" />

View file

@ -0,0 +1,16 @@
<include target="./common_header.html" />
<h1>{$lang->cmd_resend_auth_mail}</h1>
<p>{$lang->about_resend_auth_mail}</p>
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/member/skins/default/resend_auth_mail/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form ruleset="resendAuthMail" class="form" action="./" method="post">
<input type="hidden" name="module" value="member" />
<input type="hidden" name="act" value="procMemberResendAuthMail" />
<input type="hidden" name="xe_validator_id" value="modules/member/skins/default/resend_auth_mail/1" />
<div class="input-append">
<input type="text" id="email_address" name="email_address" value="" title="{$lang->email_address}" placeholder="{$lang->email_address}" />
<input type="submit" id="resend_button" name="" value="{$lang->cmd_resend_auth_mail}" class="btn btn-inverse" />
</div>
</form>
<include target="./common_footer.html" />

View file

@ -47,8 +47,8 @@
</td>
{@ $member_info['group_list'] = implode(', ', $member_info['group_list'])}
<td class="nowr" loop="$usedIdentifiers=>$name,$title">{$member_info[$name]}</td>
<td class="nowr">{zdate($member_info['regdate'], 'Y-m-d')}</td>
<td class="nowr">{zdate($member_info['last_login'], 'Y-m-d')}</td>
<td class="nowr" title="{zdate($member_info['regdate'], 'Y-m-d H:i:s')}">{zdate($member_info['regdate'], 'Y-m-d')}</td>
<td class="nowr" title="{zdate($member_info['last_login'], 'Y-m-d H:i:s')}">{zdate($member_info['last_login'], 'Y-m-d')}</td>
<td>{$member_info['group_list']}&nbsp;</td>
<td class="nowr"><a href="{getUrl('', 'module', 'admin', 'act', 'dispMemberAdminInsert', 'member_srl', $member_info['member_srl'])}">{$lang->inquiry}/{$lang->cmd_modify}</a></td>
{@$used_values = ''}

View file

@ -435,7 +435,7 @@
.undelegate(".jstree")
.removeData("jstree-instance-id")
.find("[class^='jstree']")
.andSelf()
.addBack()
.attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
$(document)
.unbind(".jstree-" + n)
@ -678,7 +678,7 @@
}
else {
original_obj = obj;
if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); }
if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").addBack(); }
else { obj = obj.find("li.jstree-closed"); }
}
var _this = this;
@ -694,12 +694,12 @@
var _this = this;
obj = obj ? this._get_node(obj) : this.get_container();
if(!obj || obj === -1) { obj = this.get_container_ul(); }
obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); });
obj.find("li.jstree-open").addBack().each(function () { _this.close_node(this, !do_animation); });
this.__callback({ "obj" : obj });
},
clean_node : function (obj) {
obj = obj && obj != -1 ? $(obj) : this.get_container_ul();
obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");
obj = obj.is("li") ? obj.find("li").addBack() : obj.find("li");
obj.removeClass("jstree-last")
.filter("li:last-child").addClass("jstree-last").end()
.filter(":has(li)")
@ -922,7 +922,7 @@
if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
obj.o.each(function () {
if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; }
if(r.parentsUntil(".jstree", "li").addBack().index(this) !== -1) { ret = false; return false; }
});
return ret;
},
@ -941,7 +941,7 @@
var o = false;
if(is_copy) {
o = obj.o.clone(true);
o.find("*[id]").andSelf().each(function () {
o.find("*[id]").addBack().each(function () {
if(this.id) { this.id = "copy_" + this.id; }
});
}
@ -1138,7 +1138,7 @@
switch(!0) {
case (is_range):
this.data.ui.last_selected.addClass("jstree-last-selected");
obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").andSelf();
obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").addBack();
if(s.select_limit == -1 || obj.length < s.select_limit) {
this.data.ui.last_selected.removeClass("jstree-last-selected");
this.data.ui.selected.each(function () {
@ -1242,7 +1242,7 @@
.bind("move_node.jstree", $.proxy(function (e, data) {
if(this._get_settings().crrm.move.open_onmove) {
var t = this;
data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () {
data.rslt.np.parentsUntil(".jstree").addBack().filter(".jstree-closed").each(function () {
t.open_node(this, false, true);
});
}
@ -2800,7 +2800,7 @@
obj.each(function () {
t = $(this);
c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked";
t.find("li").andSelf().each(function () {
t.find("li").addBack().each(function () {
var $t = $(this), nm;
$t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
if(rc) {
@ -2844,13 +2844,13 @@
}
else {
if(state) {
coll = obj.find("li").andSelf();
coll = obj.find("li").addBack();
if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
if(rc) { coll.children(":checkbox").removeAttr("checked"); }
}
else {
coll = obj.find("li").andSelf();
coll = obj.find("li").addBack();
if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
if(rc) { coll.children(":checkbox").attr("checked","checked"); }
@ -2861,8 +2861,8 @@
var $this = $(this);
if(state) {
if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
$this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); }
$this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); }
return false;
}
else {
@ -2872,8 +2872,8 @@
}
else {
if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
$this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); }
$this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); }
return false;
}
else {
@ -2944,8 +2944,8 @@
else if(a === 0 && b === 0) { this.change_state(obj, true); }
else if(a === c) { this.change_state(obj, false); }
else {
obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); }
obj.parentsUntil(".jstree","li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
if(rc) { obj.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); }
}
},
reselect : function () {
@ -3415,7 +3415,7 @@
this.get_container()
.bind("search.jstree", function (e, data) {
$(this).children("ul").find("li").hide().removeClass("jstree-last");
data.rslt.nodes.parentsUntil(".jstree").andSelf().show()
data.rslt.nodes.parentsUntil(".jstree").addBack().show()
.filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
})
.bind("clear_search.jstree", function () {
@ -4001,7 +4001,7 @@
// this used to use html() and clean the whitespace, but this way any attached data was lost
this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
// remove white space from LI node - otherwise nodes appear a bit to the right
this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove();
this.data.html_data.original_container_html.find("li").addBack().contents().filter(function() { return this.nodeType == 3; }).remove();
},
defaults : {
data : false,
@ -4427,7 +4427,7 @@
obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
if(obj === false) { return; } // added for removing root nodes
obj.each(function () {
$(this).find("li").andSelf().each(function () {
$(this).find("li").addBack().each(function () {
var $t = $(this);
if($t.children(".jstree-wholerow-span").length) { return true; }
$t.prepend("<span class='jstree-wholerow-span' style='width:" + ($t.parentsUntil(".jstree","li").length * 18) + "px;'>&#160;</span>");
@ -4542,4 +4542,4 @@
})(jQuery);
//*/
})();
})();