issue 70 admin UI/UX developemnt in data import module

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8799 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-08-18 01:30:54 +00:00
parent e46231ae96
commit 5d415ec3c3
8 changed files with 147 additions and 17 deletions

View file

@ -3,7 +3,7 @@
<grants />
<permissions />
<actions>
<action name="dispImporterAdminContent" type="view" standalone="true" admin_index="true" menu_name="importer" menu_index="true" />
<action name="dispImporterAdminImportForm" type="view" standalone="true" admin_index="true" menu_name="importer" menu_index="true" />
<action name="procImporterAdminImport" type="controller" standalone="true" />
<action name="procImporterAdminPreProcessing" type="controller" standalone="true" />

View file

@ -54,5 +54,15 @@
$this->setTemplateFile($template_filename);
}
/**
* @brief Display a form to upload the xml file
**/
function dispImporterAdminImportForm() {
$oDocumentModel = &getModel('document'); //for document lang use in this page
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('index');
}
}
?>

View file

@ -1,5 +1,10 @@
<include target="./header.html" />
<form action="./" class="form" method="get" onsubmit="return doPreProcessing(this)" id="fo_import">
<load target="js/importer_admin.js" />
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form action="./" class="form" method="get" onsubmit="return doPreProcessing(this)" id="moduleImportForm">
<input type="hidden" name="type" value="module" />
<input type="hidden" name="target_module" value="" id="target_module" />
<h2 class="h2">{$lang->type_module}</h2>
@ -13,18 +18,20 @@
<li>
<p class="q">{$lang->data_destination}</p>
<div class="a">
<input type="text" /> <a href="#suggestion1" class="tgAnchor">{$lang->find_site}</a>
<input type="text" name="site_keyword" /> <a href="#suggestion1" class="tgAnchor findsite">{$lang->find_site}</a>
<div id="suggestion1" class="tgContent suggestion">
<ul>
<li><button type="button">#</button></li>
<li><button type="button">#</button></li>
</ul>
</div>
</div>
<p class="a">
<select class="moduleList" style="width:290px">
<option>{$lang->select_module}</option>
</select>
</p>
<p class="a">
<select style="width:290px">
<option>{$lang->select_module_id}</option>
<option>#</option>
</select>
</p>
</li>
@ -72,36 +79,30 @@
<li>
<p class="q">{$lang->document_destination}</p>
<div class="a">
<input type="text" /> <a href="#suggestion2" class="tgAnchor">{$lang->find_site}</a>
<input type="text" name="site_keyword" /> <a href="#suggestion2" class="tgAnchor findsite">{$lang->find_site}</a>
<div id="suggestion2" class="tgContent suggestion">
<ul>
<li><button type="button">#</button></li>
<li><button type="button">#</button></li>
</ul>
</div>
</div>
<p class="a">
<select name="_target_module" style="width:290px">
<option>{$lang->select_module_id}</option>
<option>#</option>
</select>
</p>
</li>
<li>
<p class="q">{$lang->guestbook_destination}</p>
<div class="a">
<input type="text" /> <a href="#suggestion3" class="tgAnchor">{$lang->find_site}</a>
<input type="text" name="site_keyword" /> <a href="#suggestion3" class="tgAnchor findsite">{$lang->find_site}</a>
<div id="suggestion3" class="tgContent suggestion">
<ul>
<li><button type="button">#</button></li>
<li><button type="button">#</button></li>
</ul>
</div>
</div>
<p class="a">
<select name="_guestbook_target_module" style="width:290px">
<option>{$lang->select_module_id}</option>
<option>#</option>
</select>
</p>
</li>

View file

@ -171,3 +171,92 @@ 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('site','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());
}

View file

@ -466,14 +466,19 @@
$oModuleModel = &getModel('module');
// Variable setting for site keyword
$site_keyword = Context::get('site_keyword');
$site_srl = Context::get('site_srl');
// If there is no site keyword, use as information of the current virtual site
$args = null;
$logged_info = Context::get('logged_info');
$site_module_info = Context::get('site_module_info');
$args->site_keyword = $site_keyword;
if($site_keyword) $args->site_keyword = $site_keyword;
if(!$site_srl)
{
if($logged_info->is_admin == 'Y' && !$site_keyword) $args->site_srl = 0;
else $args->site_srl = (int)$site_module_info->site_srl;
}
else $args->site_srl = $site_srl;
$args->sort_index1 = 'sites.domain';

View file

@ -3,5 +3,6 @@
<grants />
<permissions />
<actions>
<action name="getSiteAllList" type="model" standalone="true" />
</actions>
</module>

View file

@ -0,0 +1,12 @@
<query id="getSiteAllList" action="select">
<tables>
<table name="sites" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="in" column="site_srl" var="siteSrls" />
<condition operation="like" column="domain" var="domain" pipe="and" />
</conditions>
</query>

View file

@ -21,6 +21,18 @@
}
function getSiteAllList()
{
if(Context::get('domain')) $args->domain = Context::get('domain');
$columnList = array('domain', 'site_srl');
$siteList = array();
$output = executeQueryArray('site.getSiteAllList', $args, $columnList);
if($output->toBool()) $siteList = $output->data;
$this->add('site_list', $siteList);
}
function makeGnbUrl($member_srl)
{
global $lang;