Create the module finder script and apply it to the importer admin page

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8955 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-08-30 09:57:42 +00:00
parent 56b95cdb40
commit 58831579e1
3 changed files with 94 additions and 159 deletions

View file

@ -18,27 +18,26 @@
<em class="desc success">성공! XML 파일이 요기잉네?</em>
</p>
</li>
<li class="xml ttxml">
<p class="q">{$lang->data_destination}</p>
<li class="xml ttxml modulefinder">
<p class="q">{$lang->data_destination} <br />가상 사이트의 도메인을 입력한 후 <em>사이트 찾기</em>를 클릭하면 됩니다. 도메인을 빈 칸으로 남겨두면 모든 사이트의 목록을 보여줍니다.</p>
<div class="a">
<input type="text" name="site_keyword" /> <a href="#suggestion1" class="tgAnchor findsite">{$lang->find_site}</a>
<div id="suggestion1" class="tgContent suggestion">
<ul>
</ul>
<ul></ul>
</div>
</div>
<p class="a">
<select id="moduleList" class="moduleList" style="width:290px">
<select class="moduleList" style="width:290px">
<option>{$lang->select_module}</option>
</select>
</p>
<p class="a">
<select id="moduleIdList" style="width:290px">
<select class="moduleIdList" style="width:290px">
<option>{$lang->select_module_id}</option>
</select>
</p>
</li>
<li class="ttxml">
<li class="ttxml modulefinder">
<p class="q">{$lang->guestbook_destination}</p>
<div class="a">
<input type="text" name="site_keyword" /> <a href="#suggestion3" class="tgAnchor findsite">{$lang->find_site}</a>
@ -48,7 +47,12 @@
</div>
</div>
<p class="a">
<select name="_guestbook_target_module" style="width:290px">
<select style="width:290px">
<option>{$lang->select_module_id}</option>
</select>
</p>
<p class="a">
<select style="width:290px">
<option>{$lang->select_module_id}</option>
</select>
</p>
@ -98,60 +102,4 @@
<span class="btn"><input type="submit" value="{$lang->importer}" /></span>
</div>
</form>
<!--
<form action="./" class="form" method="get" onsubmit="return doPreProcessing(this)" id="fo_import">
<input type="hidden" name="type" value="ttxml" />
<input type="hidden" name="target_module" value="" id="target_module" />
<input type="hidden" name="guestbook_target_module" value="" id="guestbook_target_module" />
<h2 class="h2">{$lang->type_ttxml}</h2>
<ul>
<li>
<p class="q">{$lang->xml_path}</p>
<p class="a">
<input type="text" name="xml_file" value="./" />
<button type="button">경로 확인</button>
<em class="desc">XML 파일의 경로가 올바르지 않습니다.</em>
<em class="desc">XML 파일의 경로가 바르게 설정되었습니다.</em>
</p>
</li>
<li>
<p class="q">{$lang->document_destination}</p>
<div class="a">
<input type="text" name="site_keyword" /> <a href="#suggestion2" class="tgAnchor findsite">{$lang->find_site}</a>
<div id="suggestion2" class="tgContent suggestion">
<ul>
</ul>
</div>
</div>
<p class="a">
<select name="_target_module" style="width:290px">
<option>{$lang->select_module_id}</option>
</select>
</p>
</li>
<li>
<p class="q">{$lang->guestbook_destination}</p>
<div class="a">
<input type="text" name="site_keyword" /> <a href="#suggestion3" class="tgAnchor findsite">{$lang->find_site}</a>
<div id="suggestion3" class="tgContent suggestion">
<ul>
</ul>
</div>
</div>
<p class="a">
<select name="_guestbook_target_module" style="width:290px">
<option>{$lang->select_module_id}</option>
</select>
</p>
</li>
<li>
<p class="q">{$lang->about_ttxml_user_id}</p>
<p class="a"><input type="text" name="user_id" value="{$logged_info->user_id}" /></p>
</li>
</ul>
<div class="btnArea">
<span class="btn"><input type="submit" value="{$lang->importer}" /></span>
</div>
</form>
-->
<include target="./process.html" />

View file

@ -238,97 +238,3 @@ function displayProgress(total, cur) {
.find('div.progress2')
.text(cur+'/'+total);
}
function insertSelectedModule(id, module_srl, mid, browser_title) {
get_by_id(id).value = module_srl;
get_by_id('_'+id).value = browser_title + ' ('+mid+')';
}
var currentClickedObject = null;
var currentClickedSiteObject = null;
jQuery(function($){
$('a.findsite')
.bind('before-open.tc', function(){
var $this = $(this), $layer = $($this.attr('href')), $ul = $layer.find('>ul'), $button;
currentClickedObject = $this;
var searchKeyword = $this.prev('input[name=site_keyword]').val();
var params = new Array();
var response_tags = ['error', 'message', 'site_list'];
params['domain'] = searchKeyword;
exec_xml('admin','getSiteAllList',params, completeGetSiteAllList, response_tags);
});
$('div.suggestion')
.delegate('button', 'click', function(){
var $this = $(this), site_srl = $this.data('site_srl');
currentClickedSiteObject = $this;
// TODO : 모듈 목록을 찾아서 셀렉트 박스에 할당
var params = new Array();
var response_tags = ['error', 'message', 'module_list'];
params['site_srl'] = site_srl;
exec_xml('module','procModuleAdminGetList',params, completeGetModuleList, response_tags);
});
$('select.moduleList').change(function(){
alert(this);
});
});
xe.siteAllList = [];
function completeGetSiteAllList(ret_obj)
{
if(!jQuery.isArray(ret_obj['site_list']['item'])) xe.siteAllList = [ret_obj['site_list']['item']];
else xe.siteAllList = ret_obj['site_list']['item'];
var $layer = jQuery(currentClickedObject.attr('href')), $ul = $layer.find('>ul'), $button;
$ul.empty();
for(var i=0,c=xe.siteAllList.length; i < c; i++) {
$button = jQuery('<button type="button">'+xe.siteAllList[i].domain+'</button>');
$button.data('domain', xe.siteAllList[i].domain).data('site_srl', xe.siteAllList[i].site_srl);
jQuery('<li>').append($button).appendTo($ul);
}
}
var module_list = '';
function completeGetModuleList(ret_obj, response_tags)
{
module_list = ret_obj['module_list'];
var htmlListBuffer = '';
for(var x in module_list)
{
if(x == 'page') continue;
var moduleObject = module_list[x];
htmlListBuffer += '<option value="'+x+'">'+moduleObject.title+'</option>';
}
currentClickedSiteObject.parents('li').find('select:first').html(htmlListBuffer).prop('selectedIndex', 0).change();
//makeMidList(jQuery('#module_list').val());
}
/*jQuery(document).ready(function($){
$('#module_list').bind('change', function(e){
makeMidList($('#module_list').val());
});
$('#mid_list').bind('change', function(e){
doGetCategoryFromModule($('#mid_list').val());
});
});*/
function makeMidList(moduleName)
{
var mid_list = module_list[moduleName].list;
var htmlListBuffer = '';
for(var x in mid_list)
{
var moduleInstance = mid_list[x];
htmlListBuffer += '<option value="'+moduleInstance.module_srl+'">'+x+'</option>';
}
jQuery('#mid_list').html(htmlListBuffer);
doGetCategoryFromModule(jQuery('#mid_list').val());
}