Merge pull request #14 from xpressengine/develop

Develop
This commit is contained in:
퍼니엑스이 2014-08-16 23:14:10 +09:00
commit 3f4bef0c46
23 changed files with 596 additions and 148 deletions

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())

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

@ -1650,31 +1650,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 +1718,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 +1763,7 @@ function xml2json(xml, tab, ignoreAttrib) {
}
$(function($){
$('.wfsr')
$(document)
.ajaxStart(function(){
$(window).bind('beforeunload', beforeUnloadHandler);
})

2
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

@ -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>");

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

@ -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 = $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,9 @@ class autoinstallAdminView extends autoinstall
Context::set('need_password', TRUE);
}
$output = $oAdminModel->checkUseDirectModuleInstall($package);
Context::set('directModuleInstall', $output);
$this->setTemplateFile('install');
$security = new Security();
@ -503,6 +506,7 @@ class autoinstallAdminView extends autoinstall
}
$oModel = getModel('autoinstall');
$oAdminModel = getAdminModel('autoinstall');
$installedPackage = $oModel->getInstalledPackage($package_srl);
if(!$installedPackage)
{
@ -529,6 +533,9 @@ class autoinstallAdminView extends autoinstall
return $this->stop("msg_invalid_request");
}
$output = $oAdminModel->checkUseDirectModuleInstall($installedPackage);
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

@ -40,10 +40,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">
@ -52,6 +52,12 @@
</div>
</div>
</block>
<block cond="!$directModuleInstall->toBool()">
<p>{$lang->msg_direct_install_not_supported}</p>
<ul>
<li loop="$directModuleInstall->get('path') => $path">{$path}</li>
</ul>
</block>
<div class="x_clearfix btnArea">
<div class="x_pull-right">
<input class="x_btn x_btn-primary" type="submit" value="{$package->installed?$lang->update:$lang->install}" />

View file

@ -17,10 +17,10 @@
<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 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">
<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">
@ -29,7 +29,12 @@
</div>
</div>
</block>
<block cond="!$directModuleInstall->toBool()">
<p>{$lang->msg_direct_install_not_supported}</p>
<ul>
<li loop="$directModuleInstall->get('path') => $path">{$path}</li>
</ul>
</block>
<div class="x_clearfix btnArea">
<div class="x_pull-right">
<input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_delete}" />

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

@ -35,6 +35,26 @@ 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',
);
*/
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

@ -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>");