added support of filebox

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9006 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2011-09-03 07:20:09 +00:00
parent 927d8743af
commit dfe7b61159
3 changed files with 62 additions and 13 deletions

View file

@ -30,6 +30,7 @@
<action name="getModuleAdminLangListByName" type="model" standalone="true" /> <action name="getModuleAdminLangListByName" type="model" standalone="true" />
<action name="getModuleAdminLangListByValue" type="model" standalone="true" /> <action name="getModuleAdminLangListByValue" type="model" standalone="true" />
<action name="getLangListByLangcodeForAutoComplete" type="model" standalone="true" /> <action name="getLangListByLangcodeForAutoComplete" type="model" standalone="true" />
<action name="getFileBoxListHtml" type="model" />
<action name="procModuleAdminInsertCategory" type="controller" standalone="true" ruleset="insertCategory" /> <action name="procModuleAdminInsertCategory" type="controller" standalone="true" ruleset="insertCategory" />
<action name="procModuleAdminUpdateCategory" type="controller" standalone="true" ruleset="updateCategory" /> <action name="procModuleAdminUpdateCategory" type="controller" standalone="true" ruleset="updateCategory" />

View file

@ -1357,11 +1357,31 @@
function getModuleFileBoxList(){ function getModuleFileBoxList(){
$args->page = Context::get('page'); $args->page = Context::get('page');
$args->list_count = 10; $args->list_count = 5;
$args->page_count = 10; $args->page_count = 5;
return executeQuery('module.getModuleFileBoxList', $args); return executeQuery('module.getModuleFileBoxList', $args);
} }
function getFileBoxListHtml()
{
$logged_info = Context::get('logged_info');
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
$oModuleModel = &getModel('module');
$output = $oModuleModel->getModuleFileBoxList();
Context::set('filebox_list', $output->data);
$page = Context::get('page');
if (!$page) $page = 1;
Context::set('page', $page);
Context::set('page_navigation', $output->page_navigation);
$oTemplate = &TemplateHandler::getInstance();
$html = $oTemplate->compile('./modules/module/tpl/', 'filebox_list_html');
$this->add('html', $html);
}
function getModuleFileBoxPath($module_filebox_srl){ function getModuleFileBoxPath($module_filebox_srl){
return sprintf("./files/attach/filebox/%s",getNumberingPath($module_filebox_srl,3)); return sprintf("./files/attach/filebox/%s",getNumberingPath($module_filebox_srl,3));
} }

View file

@ -0,0 +1,28 @@
{@debugPrint($filebox_list)}
<p cond="!$filebox_list">등록된 파일이 없습니다.</p>
<ul cond="$filebox_list" class="lined">
<li loop="$filebox_list=>$key,$fileInfo">
<a href="#" class="select"><img class="filebox_item" src="{$fileInfo->filename}" alt="{$fileInfo->comment}" /></a>
</li>
</ul>
<div class="pagination" cond="$page_navigation">
<a href="#" class="direction" page="1">&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="#" page="1">1</a>
<a href="#FileBoxGoTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
</block>
<block loop="$page_no = $page_navigation->getNextPage()">
{@$last_page = $page_no}
<strong cond="$page_no == $page">{$page_no}</strong>
<a cond="$page_no != $page" href="#" page="{$page_no}">{$page_no}</a>
</block>
<block cond="$last_page != $page_navigation->last_page">
<a href="#FileBoxGoTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
<a href="#" page="{$page_navigation->last_page}">{$page_navigation->last_page}</a>
</block>
<a href="#" page="{$page_navigation->last_page}" class="direction">LAST &raquo;</a>
<span id="FileBoxGoTo" class="tgContent">
<input name="page" title="{$lang->cmd_go_to_page}" />
<button>Go</button>
</span>
</form>