Layout duplication bug fix

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11814 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
nagoon97 2012-10-22 03:00:28 +00:00
parent 240142d62e
commit 26562620ec

View file

@ -1547,6 +1547,9 @@ jQuery(function($){
$("#tmpl_menuTypeItem").template( "menuTypeItem" ); $("#tmpl_menuTypeItem").template( "menuTypeItem" );
$('#add').bind("show", function(){ $('#add').bind("show", function(){
fillInInstalledMenuList();
});
function fillInInstalledMenuList(){
$.exec_json("menu.getMenuAdminInstalledMenuType", {}, function(htData){ $.exec_json("menu.getMenuAdminInstalledMenuType", {}, function(htData){
//console.log(htData); //console.log(htData);
@ -1574,7 +1577,7 @@ jQuery(function($){
$('#add ._itemList').html(sResult); $('#add ._itemList').html(sResult);
scrollToRight(); scrollToRight();
}); });
}); }
$('#add').bind("hide", function(){ $('#add').bind("hide", function(){
}); });
@ -1651,11 +1654,17 @@ jQuery(function($){
$Panel.find('.list').html(""); $Panel.find('.list').html("");
var item; var item;
var $node; var $node, sIsInstalled;
if(htData.item_list){ if(htData.item_list){
for(var i=0, nLen=htData.item_list.length; i<nLen; i++){ for(var i=0, nLen=htData.item_list.length; i<nLen; i++){
item = htData.item_list[i]; item = htData.item_list[i];
if(item.current_version){
sIsInstalled = "installed";
}else{
sIsInstalled = "";
}
$node = $.tmpl( "downloadableMenuTypeItem", { $node = $.tmpl( "downloadableMenuTypeItem", {
MenuType: item.title, MenuType: item.title,
MenuTypeDesc: item.package_description, MenuTypeDesc: item.package_description,
@ -1664,8 +1673,7 @@ jQuery(function($){
TotalVotes: item.package_voted, TotalVotes: item.package_voted,
LastUpdated: item.item_regdate, LastUpdated: item.item_regdate,
TotalDownloads: item.package_downloaded, TotalDownloads: item.package_downloaded,
//IsInstalled: "installed", IsInstalled: sIsInstalled
IsInstalled: ""
} ).data('sItemType', sItemType).data('sPackageSrl', item.package_srl); } ).data('sItemType', sItemType).data('sPackageSrl', item.package_srl);
$Panel.find('.list').append($node); $Panel.find('.list').append($node);
@ -2053,10 +2061,13 @@ jQuery(function($){
if(this !== ev.target) return; if(this !== ev.target) return;
}); });
$('#layout .list').on('show', function(){ $('#layout .list').on('show', function(){
fillInInstalledLayoutList();
});
function fillInInstalledLayoutList(){
var sMode = $._xeAdminVar.htPrevSetting.bMobilePreviewTabOpen?"M":"P"; var sMode = $._xeAdminVar.htPrevSetting.bMobilePreviewTabOpen?"M":"P";
loadInstalledLayoutList(sMode); loadInstalledLayoutList(sMode);
}); }
function updateLayoutListDisplayStatus(){ function updateLayoutListDisplayStatus(){
$ChkBox = $('#layout ._chkUseDefaultLayout'); $ChkBox = $('#layout ._chkUseDefaultLayout');
@ -2167,7 +2178,7 @@ jQuery(function($){
var sTitle = $msgBox.find('input[type="text"]').val(); var sTitle = $msgBox.find('input[type="text"]').val();
$.exec_json("layout.procLayoutAdminCopyLayout", { $.exec_json("layout.procLayoutAdminCopyLayout", {
layout_srl : sLayoutSrl, layout_srl : sLayoutSrl,
title : sTitle title : [sTitle]
}, function(htData){ }, function(htData){
//console.log(htData); //console.log(htData);
if(htData.error !== 0){ if(htData.error !== 0){
@ -2401,9 +2412,13 @@ jQuery(function($){
} }
}); });
$('#skin .list').on('show', function(){ $('#skin .list').on('show', function(){
var sMode = $._xeAdminVar.htPrevSetting.bMobilePreviewTabOpen?"M":"P"; fillInInstalledSkinList();
loadInstalledSkinList(sMode);
}); });
function fillInInstalledSkinList(){
var sMode = $._xeAdminVar.htPrevSetting.bMobilePreviewTabOpen?"M":"P";
loadInstalledSkinList(sMode);
}
$('#skin ._chkUseDefault').click(function(){ $('#skin ._chkUseDefault').click(function(){
updateSkinListDisplayStatus(); updateSkinListDisplayStatus();
@ -2897,10 +2912,10 @@ jQuery(function($){
var sPackageSrl = $item.data('sPackageSrl'); var sPackageSrl = $item.data('sPackageSrl');
var sPackageType = $item.data('sItemType'); var sPackageType = $item.data('sItemType');
installPackage(sPackageSrl, sPackageType); installPackage(sPackageSrl, sPackageType, $item);
}); });
// sPackageType = menu/layout/skin // sPackageType = menu/layout/skin
function installPackage(sPackageSrl, sPackageType){ function installPackage(sPackageSrl, sPackageType, $item){
//act=getAutoinstallAdminIsAuthed //act=getAutoinstallAdminIsAuthed
$.exec_json("admin.getAutoinstallAdminIsAuthed", {}, function(htData){ $.exec_json("admin.getAutoinstallAdminIsAuthed", {}, function(htData){
if(htData.error !== 0){ if(htData.error !== 0){
@ -2909,7 +2924,7 @@ jQuery(function($){
} }
// FTP 비밀번호 뿐만 아니라 정보가 전혀 없을 경우? // FTP 비밀번호 뿐만 아니라 정보가 전혀 없을 경우?
if(htData.is_authed !== "1"){ if(htData.is_authed !== 1){
console.log('no'); console.log('no');
/* /*
confirmDialog( confirmDialog(
@ -2931,7 +2946,7 @@ jQuery(function($){
fnOnOK : function(){ fnOnOK : function(){
var sPw = $msgBox.find('input[type="password"]').val(); var sPw = $msgBox.find('input[type="password"]').val();
//console.log(sPackageSrl); //console.log(sPackageSrl);
doInstallPackage(sPackageSrl, sPackageType, sPw); doInstallPackage(sPackageSrl, sPackageType, sPw, $item);
//window.location.href="./?module=admin&act=dispAdminConfigFtp"; //window.location.href="./?module=admin&act=dispAdminConfigFtp";
} }
} }
@ -2942,32 +2957,28 @@ jQuery(function($){
} }
console.log('ok'); console.log('ok');
doInstallPackage(sPackageSrl, sPackageType, ""); doInstallPackage(sPackageSrl, sPackageType, ".", $item);
}); });
} }
function doInstallPackage(sPackageSrl, sPackageType, sPw){ function doInstallPackage(sPackageSrl, sPackageType, sPw, $item){
/* var htFunc = {
API: index.php?act=procAutoinstallAdminPackageinstall download: fillInInstalledMenuList,
downloadLayout: fillInInstalledLayoutList,
파라미터 downloadSkin: fillInInstalledSkinList
};
package_srl 설치할 패키지 번호
ftp_password FTP 비밀번호. getAutoinstallAdminAuthed로 비밀번호 인증이 된 상태에서는 아무 값이나 넣음. showFoggy();
응답
{
"message_type":"update",
"error":0,
"message":"설치에 성공하였습니다."
}
*/
$.exec_json("admin.procAutoinstallAdminPackageinstall", { $.exec_json("admin.procAutoinstallAdminPackageinstall", {
package_srl : sPackageSrl, package_srl : sPackageSrl,
ftp_password : sPw ftp_password : sPw
}, function(htData){ }, function(htData){
hideFoggy();
console.log(htData); console.log(htData);
$item.addClass('installed');
htFunc[sPackageType]();
}); });
} }