issue 70 poll module's admin UI/UX modified.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8721 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-08-04 05:34:03 +00:00
parent f7c964226a
commit 3e70a2c10c
30 changed files with 335 additions and 92 deletions

View file

@ -23,6 +23,17 @@
<th scope="col"><input type="checkbox" title="Check All" /></th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="col" class="text">{$lang->comment}</th>
<th scope="col">{$lang->nick_name}</th>
<th scope="col">{$lang->cmd_vote}(+/-)</th>
<th scope="col">{$lang->date}</th>
<th scope="col">{$lang->ipaddress}</th>
<th scope="col">{$lang->status}</th>
<th scope="col"><input type="checkbox" title="Check All" /></th>
</tr>
</tfoot>
<tbody>
<!--@foreach($comment_list as $no => $val)-->
{@ $comment = cut_str(trim(htmlspecialchars(strip_tags($val->content))), 200, '...')}

View file

@ -24,6 +24,18 @@
<th scope="col"><input type="checkbox" title="Check All" /></th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="col" class="title">{$lang->title}</th>
<th scope="col">{$lang->author}</th>
<th scope="col">{$lang->readed_count}</th>
<th scope="col">{$lang->cmd_vote}(+/-)</th>
<th scope="col">{$lang->date}</th>
<th scope="col">{$lang->ipaddress}</th>
<th scope="col">{$lang->status}</th>
<th scope="col"><input type="checkbox" title="Check All" /></th>
</tr>
</tfoot>
<tbody>
<!--@foreach($document_list as $no => $oDocument)-->
<tr>

View file

@ -56,5 +56,5 @@
$lang->msg_not_allowed_outlink = 'It is not allowed to download files from sites other than this.';
$lang->msg_not_permitted_create = 'Failed to create a file or directory.';
$lang->msg_file_upload_error = 'An error has occurred during uploading.';
$lang->no_files = 'No Files';
?>

View file

@ -53,5 +53,5 @@
$lang->msg_not_allowed_outlink = 'It is not allowed to download files not from this site.';
$lang->msg_not_permitted_create = '파일 또는 디렉토리를 생성할 수 없습니다.';
$lang->msg_file_upload_error = '파일 업로드 중 에러가 발생하였습니다.';
$lang->no_files = 'No Files';
?>

View file

@ -53,5 +53,5 @@
$lang->msg_not_allowed_outlink = 'It is not allowed to download files not from this site.';
$lang->msg_not_permitted_create = '파일 또는 디렉토리를 생성할 수 없습니다.';
$lang->msg_file_upload_error = '파일 업로드 중 에러가 발생하였습니다.';
$lang->no_files = 'No Files';
?>

View file

@ -55,5 +55,5 @@
$lang->msg_not_allowed_outlink = '外部リンクからのダウンロードは許可されていません。';
$lang->msg_not_permitted_create = 'ファイルまたはディレクトリを生成できません。';
$lang->msg_file_upload_error = 'ファイルアップロードに失敗しました。';
$lang->no_files = 'No Files';
?>

View file

@ -55,5 +55,5 @@
$lang->msg_not_allowed_outlink = 'It is not allowed to download files not from this site.';
$lang->msg_not_permitted_create = '파일 또는 디렉토리를 생성할 수 없습니다.';
$lang->msg_file_upload_error = '파일 업로드 중 에러가 발생하였습니다.';
$lang->no_files = 'No Files';
?>

View file

@ -56,5 +56,5 @@
$lang->msg_not_allowed_outlink = 'Bu siteden dosya indirimine izin verilmemektedir.';
$lang->msg_not_permitted_create = 'Dosya veya dizin oluşturma hatası.';
$lang->msg_file_upload_error = 'Karşıya yükleme esnasında bir hata oluştu.';
$lang->no_files = 'No Files';
?>

View file

@ -59,5 +59,5 @@
$lang->msg_not_allowed_outlink = 'Không cho phép tải file từ những trang khác ngoài trang này.';
$lang->msg_not_permitted_create = '파일 또는 디렉토리를 생성할 수 없습니다.';
$lang->msg_file_upload_error = '파일 업로드 중 에러가 발생하였습니다.';
$lang->no_files = 'No Files';
?>

View file

@ -53,5 +53,5 @@
$lang->msg_not_allowed_outlink = '此站不允许外链下载。';
$lang->msg_not_permitted_create = '无法生成文件或文件夹。';
$lang->msg_file_upload_error = '上传文件发生出错。';
$lang->no_files = 'No Files';
?>

View file

@ -55,5 +55,5 @@
$lang->msg_not_allowed_outlink = '無法從網站下載檔案。';
$lang->msg_not_permitted_create = '파일 또는 디렉토리를 생성할 수 없습니다.';
$lang->msg_file_upload_error = '파일 업로드 중 에러가 발생하였습니다.';
$lang->no_files = 'No Files';
?>

View file

@ -3,7 +3,7 @@
<grants />
<permissions />
<actions>
<action name="dispPollAdminList" type="view" admin_index="true" standalone="true" />
<action name="dispPollAdminList" type="view" admin_index="true" standalone="true" menu_name="poll" menu_index="true" />
<action name="dispPollAdminResult" type="view" standalone="true" />
<action name="dispPollAdminConfig" type="view" standalone="true" />
@ -15,8 +15,10 @@
<action name="procInsert" type="controller" standalone="true" />
<action name="procPoll" type="controller" standalone="true" ruleset="poll" />
<action name="procPollViewResult" type="controller" standalone="true" />
<action name="procPollGetList" type="controller" standalone="true" />
<action name="procPollAdminDeleteChecked" type="controller" standalone="true" ruleset="deleteChecked" />
<action name="procPollAdminInsertConfig" type="controller" standalone="true" ruleset="insertConfig" />
<action name="procPollAdminAddCart" type="controller" standalone="true" />
</actions>
<menus>
<menu name="poll">

View file

@ -35,4 +35,6 @@
'regdate' => 'Posting date',
'ipaddress' => 'IP Address',
);
$lang->single_check = 'Single Check';
$lang->multi_check = 'Multi Check';
?>

View file

@ -35,4 +35,6 @@
'regdate' => 'Fecha de la participación',
'ipaddress' => 'Dirección IP',
);
$lang->single_check = 'Single Check';
$lang->multi_check = 'Multi Check';
?>

View file

@ -35,4 +35,6 @@
'regdate' => 'Jour posté',
'ipaddress' => 'Adresse IP',
);
$lang->single_check = 'Single Check';
$lang->multi_check = 'Multi Check';
?>

View file

@ -35,4 +35,6 @@
'regdate' => '登録日',
'ipaddress' => 'IPアドレス',
);
$lang->single_check = 'Single Check';
$lang->multi_check = 'Multi Check';
?>

View file

@ -28,4 +28,6 @@
'regdate' => '등록일',
'ipaddress' => 'IP 주소',
);
$lang->single_check = '단일 선택';
$lang->multi_check = '다중 선택';
?>

View file

@ -35,4 +35,6 @@
'regdate' => 'Дата Размещения', // // translator's remark: this may be as "Дата Регистрации"
'ipaddress' => 'IP-адрес',
);
$lang->single_check = 'Single Check';
$lang->multi_check = 'Multi Check';
?>

View file

@ -35,4 +35,6 @@
'regdate' => 'Mesaj Tarihi',
'ipaddress' => 'IP Adresi',
);
$lang->single_check = 'Single Check';
$lang->multi_check = 'Multi Check';
?>

View file

@ -37,4 +37,6 @@
'regdate' => 'Ngày gửi',
'ipaddress' => 'IP',
);
$lang->single_check = 'Single Check';
$lang->multi_check = 'Multi Check';
?>

View file

@ -35,4 +35,6 @@
'regdate' => '登录日期',
'ipaddress' => 'IP 地址',
);
$lang->single_check = 'Single Check';
$lang->multi_check = 'Multi Check';
?>

View file

@ -35,4 +35,6 @@
'regdate' => '登錄日期',
'ipaddress' => 'IP位址',
);
$lang->single_check = 'Single Check';
$lang->multi_check = 'Multi Check';
?>

View file

@ -60,6 +60,27 @@
}
}
function procPollAdminAddCart()
{
$poll_index_srl = (int)Context::get('poll_index_srl');
$oPollAdminModel = &getAdminModel('poll');
//$columnList = array('comment_srl');
$args->pollIndexSrlList = array($poll_index_srl);
$args->list_count = 100;
$output = $oPollAdminModel->getPollList($args);
if(is_array($output->data))
{
foreach($output->data AS $key=>$value)
{
if($_SESSION['poll_management'][$value->poll_index_srl]) unset($_SESSION['poll_management'][$value->poll_index_srl]);
else $_SESSION['poll_management'][$value->poll_index_srl] = true;
}
}
}
/**
* @brief Delete the poll (when several questions are registered in one poll, delete this question)
**/

View file

@ -17,13 +17,24 @@
* @brief Get the list of polls
**/
function getPollList($args) {
$output = executeQuery('poll.getPollList', $args);
$output = executeQueryArray('poll.getPollList', $args);
if(!$output->toBool()) return $output;
if($output->data && !is_array($output->data)) $output->data = array($output->data);
//if($output->data && !is_array($output->data)) $output->data = array($output->data);
return $output;
}
/**
* @brief Get the list of polls with member info
**/
function getPollListWithMember($args)
{
$output = executeQueryArray('poll.getPollListWithMember', $args);
if(!$output->toBool()) return $output;
return $output;
}
/**
* @brief Get the original poll
**/

View file

@ -40,11 +40,20 @@
$args->list_count = 50; // The number of posts to show on one page
$args->page_count = 10; // The number of pages to display in the page navigation
$args->sort_index = 'list_order'; // Sorting value
$args->sort_index = 'P.list_order'; // Sorting value
// Get the list
$oPollAdminModel = &getAdminModel('poll');
$output = $oPollAdminModel->getPollList($args);
$output = $oPollAdminModel->getPollListWithMember($args);
if(is_array($output->data))
{
foreach($output->data AS $key=>$value)
{
if($_SESSION['poll_management'][$value->poll_index_srl]) $value->isCarted = true;
else $value->isCarted = false;
}
}
// Configure the template variables
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);

View file

@ -191,6 +191,46 @@
$this->add('tpl',$tpl);
}
/**
* @brief poll list
**/
function procPollGetList()
{
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
// Taken from a list of selected sessions
$flagList = $_SESSION['poll_management'];
if(count($flagList)) {
foreach($flagList as $key => $val) {
if(!is_bool($val)) continue;
$pollSrlList[] = $key;
}
}
global $lang;
if(count($pollSrlList) > 0) {
$oPollAdminModel = &getAdminModel('poll');
$args->pollIndexSrlList = $pollSrlList;
$output = $oPollAdminModel->getPollListWithMember($args);
$pollList = $output->data;
if(is_array($pollList))
{
foreach($pollList AS $key=>$value)
{
if($value->checkcount == 1) $value->checkName = $lang->single_check;
else $value->checkName = $lang->multi_check;
}
}
}
else
{
$pollList = array();
$this->setMessage($lang->no_documents);
}
$this->add('poll_list', $pollList);
}
/**
* @brief A poll synchronization trigger when a new post is registered
**/

View file

@ -6,7 +6,8 @@
<column name="*" />
</columns>
<conditions>
<condition operation="like" column="title" var="s_title" />
<condition operation="in" column="poll_index_srl" var="pollIndexSrlList" filter="number" />
<condition operation="like" column="title" var="s_title" pipe="or"/>
<condition operation="like_prefix" column="regdate" var="s_regdate" pipe="or" />
<condition operation="like_prefix" column="ipaddress" var="s_ipaddress" pipe="or" />
</conditions>

View file

@ -0,0 +1,24 @@
<query id="getPollList" action="select">
<tables>
<table name="poll_title" alias="P" />
<table name="member" alias="M" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<group pipe="and">
<condition operation="equal" column="P.member_srl" var="M.member_srl" notnull="notnull" />
<condition operation="in" column="poll_index_srl" var="pollIndexSrlList" filter="number" pipe="and" />
</group>
<condition operation="like" column="P.title" var="s_title" pipe="or"/>
<condition operation="like_prefix" column="P.regdate" var="s_regdate" pipe="or" />
<condition operation="like_prefix" column="P.ipaddress" var="s_ipaddress" pipe="or" />
</conditions>
<navigation>
<index var="sort_index" default="P.list_order" order="asc" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
</query>

View file

@ -54,3 +54,52 @@ function completeMovePoll(ret_obj, response_tags) {
if(comment_srl) url = url+'#comment_'+comment_srl;
winopen(url, 'pollTarget');
}
function getPollList()
{
var params = new Array();
var response_tags = ['error','message', 'poll_list'];
exec_xml('poll','procPollGetList',params, completeGetPollList, response_tags);
}
function completeGetPollList(ret_obj, response_tags)
{
var htmlListBuffer = '';
if(ret_obj['poll_list'] == null)
{
htmlListBuffer = '<tr>' +
'<td colspan="3" style="text-align:center;">'+ret_obj['message']+'</td>' +
'</tr>';
}
else
{
var poll_list = ret_obj['poll_list']['item'];
if(!jQuery.isArray(poll_list)) poll_list = [poll_list];
for(var x in poll_list)
{
var objPoll = poll_list[x];
htmlListBuffer += '<tr>' +
'<td class="title">'+objPoll.title+'</td>' +
'<td>'+objPoll.poll_count+'</td>' +
'<td>'+objPoll.nick_name+'</td>' +
'</tr>' +
'<input type="hidden" name="cart[]" value="'+objPoll.poll_index_srl+'" />';
}
jQuery('#selectedPollCount').html(poll_list.length);
}
jQuery('#pollManageListTable>tbody').html(htmlListBuffer);
}
function addCart(poll_index_srl) {
var params = new Array();
var response_tags = ['error','message'];
params['poll_index_srl'] = poll_index_srl;
exec_xml('poll','procPollAdminAddCart',params, completeAddCart, response_tags);
}
function completeAddCart(ret_obj, response_tags)
{
}

View file

@ -1,82 +1,125 @@
<!--%import("js/poll_admin.js")-->
<!--#include("./header.html")-->
<div class="content" id="content">
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form ruleset="deleteChecked" action="./" method="post" id="fo_list">
<input type="hidden" name="act" value="procPollAdminDeleteChecked" />
<input type="hidden" name="page" value="{$page}" />
<!-- 목록 -->
<table cellspacing="0" class="crossTable">
<caption>Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}</caption>
<thead>
<tr>
<th scope="col"><div>{$lang->no}</div></th>
<th scope="col"><div><input type="checkbox" onclick="XE.checkboxToggleAll('cart[]'); return false;" /></div></th>
<th scope="col" class="wide"><div>{$lang->title}</div></th>
<th scope="col"><div>{$lang->poll_checkcount}</div></th>
<th scope="col"><div>{$lang->poll_join_count}</div></th>
<th scope="col"><div>{$lang->regdate}</div></th>
<th scope="col"><div>&nbsp;</div></th>
</tr>
</thead>
<tbody>
<!--@foreach($poll_list as $no => $val)-->
<tr class="row{$cycle_idx}">
<td class="number center">{$no}</td>
<td class="center"><input type="checkbox" name="cart[]" value="{$val->poll_index_srl}" /></td>
<td><a href="#" onclick="doMovePoll({$val->poll_srl},{$val->upload_target_srl});return false;">{htmlspecialchars($val->title)}</a></td>
<td class="number center">{$val->checkcount}</td>
<td class="number center">{$val->poll_count}</td>
<td class="date nowrap center">{zdate($val->regdate,"Y-m-d H:i")}</td>
<td class="center nowrap view"><a href="{getUrl('','module','poll','act','dispPollAdminResult','poll_srl',$val->poll_srl,'poll_index_srl',$val->poll_index_srl)}" onclick="popopen(this.href); return false;" title="{htmlspecialchars($lang->cmd_view)}">{$lang->cmd_view}</a></td>
</tr>
<!--@end-->
</tbody>
</table>
<!-- 버튼 -->
<div class="clear">
<div class="fl">
<a href="javascript:XE.checkboxToggleAll('cart[]', { checked:false })" class="button"><span>{$lang->cmd_unselect_all}</span></a>
<a href="javascript:XE.checkboxToggleAll('cart[]')" class="button"><span>{$lang->cmd_reverse_all}</span></a>
</div>
<div class="fr">
<span class="button black strong"><input type="submit" value="{$lang->cmd_delete_checked_poll}" /></span>
</div>
<form action="" class="form">
<h1 class="h1">Poll</h1>
<div class="table even">
<table width="100%" border="1" cellspacing="0">
<caption>
All({number_format($total_count)})
<span class="side"><span class="btn"><a href="#listManager" class="modalAnchor" onclick="getPollList">선택한 설문 관리...</a></span></span>
</caption>
<thead>
<tr>
<th scope="col" class="text">{$lang->title}</th>
<th scope="col">{$lang->poll_checkcount}</th>
<th scope="col">{$lang->poll_join_count}</th>
<th scope="col">Author</th>
<th scope="col">{$lang->regdate}</th>
<th scope="col"><input type="checkbox" title="Check All" /></th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="col" class="text">{$lang->title}</th>
<th scope="col">{$lang->poll_checkcount}</th>
<th scope="col">{$lang->poll_join_count}</th>
<th scope="col">Author</th>
<th scope="col">{$lang->regdate}</th>
<th scope="col"><input type="checkbox" title="Check All" /></th>
</tr>
</tfoot>
<tbody>
<!--@foreach($poll_list as $no => $val)-->
<tr>
<td class="title"><a href="#" onclick="doMovePoll({$val->poll_srl},{$val->upload_target_srl});return false;">{htmlspecialchars($val->title)}</a></td>
<td><!--@if($val->checkcount == 1)-->{$lang->single_check}<!--@else-->{$lang->multi_check}<!--@end--></td>
<td>{$val->poll_count}</td>
<td><a href="#popup_menu_area">{$val->nick_name}</a></td>
<td>{zdate($val->regdate,"Y-m-d H:i")}</td>
<td>
<input type="checkbox" name="cart[]" value="{$val->poll_index_srl}" <!--@if($val->isCarted)-->checked<!--@end--> onclick="addCart({$val->poll_index_srl})" />
</td>
</tr>
<!--@end-->
</tbody>
</table>
</div>
<div class="btnArea">
<span class="btn"><a href="#listManager" class="modalAnchor" onclick="getPollList();">선택한 설문 관리...</a></span>
</div>
</form>
<div class="modal" id="listManager">
<form ruleset="deleteChecked" action="./" method="post" action="" class="fg form">
<input type="hidden" name="act" value="procPollAdminDeleteChecked" />
<input type="hidden" name="page" value="{$page}" />
<h2 class="h2">선택한 설문 관리</h2>
<div class="table">
<table width="100%" border="1" cellspacing="0" id="pollManageListTable">
<caption>선택한 설문 <strong id="selectedPollCount">2</strong></caption>
<thead>
<tr>
<th scope="col" class="text">{$lang->title}</th>
<th scope="col">{$lang->poll_join_count}</th>
<th scope="col">Author</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="btnArea">
<span class="btn"><input type="submit" value="Delete" /></span>
</div>
</form>
</div>
<div class="search">
<form action="./" class="pagination">
<input type="hidden" name="error_return_url" value="" />
<input type="hidden" name="module" value="{$module}" />
<input type="hidden" name="act" value="{$act}" />
<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />
<a href="{getUrl('page', '')}" class="direction">&laquo; FIRST</a>
<block cond="$page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page && $page_navigation->page_count != $page_navigation->total_page">
<a href="{getUrl('page', '')}">1</a>
<a href="#goTo" class="tgSimple">...</a>
<span id="goTo" class="tgContent">
<input name="page" title="Go to Page" />
<button type="submit">Go</button>
</span>
<a href="{getUrl('page', $page_navigation->last_page)}">{$page_navigation->last_page}</a>
</block>
<!--@while($page_no = $page_navigation->getNextPage())-->
{@$last_page = $page_no}
<strong cond="$page_no == $page">{$page_no}</strong>
<a cond="$page_no != $page" href="{getUrl('page', $page_no)}">{$page_no}</a>
<!--@end-->
<block cond="$last_page != $page_navigation->last_page">
<a href="#goTo" class="tgSimple">...</a>
<span id="goTo" class="tgContent">
<input name="page" title="Go to Page" />
<button type="submit">Go</button>
</span>
<a href="{getUrl('page', $page_navigation->last_page)}">{$page_navigation->last_page}</a>
</block>
<a href="{getUrl('page', $page_navigation->last_page)}" class="direction">LAST &raquo;</a>
</form>
<form action="./" method="get">
<input type="hidden" name="module" value="{$module}" />
<input type="hidden" name="act" value="{$act}" />
<select name="search_target">
<option value="">{$lang->search_target}</option>
<!--@foreach($lang->search_target_list as $key => $val)-->
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
<!--@end-->
</select>
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
<input type="submit" value="{$lang->cmd_search}" />
<a href="{getUrl('','module',$module,'act',$act)}">{$lang->cmd_cancel}</a>
</form>
</div>
</div>
</form>
<!-- 페이지 네비게이션 -->
<div class="pagination a1">
<a href="{getUrl('page','','module_srl','')}" class="prevEnd">{$lang->first_page}</a>
<!--@while($page_no = $page_navigation->getNextPage())-->
<!--@if($page == $page_no)-->
<strong>{$page_no}</strong>
<!--@else-->
<a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a>
<!--@end-->
<!--@end-->
<a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="nextEnd">{$lang->last_page}</a>
</div>
<!-- 검색 -->
<form action="./" method="get" class="adminSearch">
<input type="hidden" name="module" value="{$module}" />
<input type="hidden" name="act" value="{$act}" />
<fieldset>
<select name="search_target">
<option value="">{$lang->search_target}</option>
<!--@foreach($lang->search_target_list as $key => $val)-->
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
<!--@end-->
</select>
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" class="inputTypeText" />
<span class="button"><input type="submit" value="{$lang->cmd_search}" /></span>
<a href="{getUrl('','module',$module,'act',$act)}" class="button"><span>{$lang->cmd_cancel}</span></a>
</fieldset>
</form>