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="getModuleAdminLangListByValue" 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="procModuleAdminUpdateCategory" type="controller" standalone="true" ruleset="updateCategory" />

View file

@ -112,7 +112,7 @@
$site_args->index_module_srl = $mid_output->data->module_srl;
$site_args->domain = $domain;
$site_args->default_language = $db_info->lang_type;
if($output->data && !$output->data->index_module_srl) {
$output = executeQuery('module.updateSite', $site_args);
} else {
@ -150,7 +150,7 @@
$oCacheHandler->put($cache_key,$output->data->module_srl);
}
}
$module_info = $output->data;
if(!$module_info->module_srl && $module_info->data[0]) $module_info = $module_info->data[0];
return $this->addModuleExtraVars($module_info);
@ -214,7 +214,7 @@
* @brief Add extra vars to the module basic information
**/
function addModuleExtraVars($module_info) {
// Process although one or more module informaion is requested
// Process although one or more module informaion is requested
if(!is_array($module_info)) $target_module_info = array($module_info);
else $target_module_info = $module_info;
// Get module_srl
@ -370,7 +370,7 @@
FileHandler::writeFile($cache_file, $str);
}
if(file_exists($cache_file)) {
$GLOBALS['__MODULE_EXTEND__'] = include($cache_file);
} else {
@ -562,7 +562,7 @@
$info->menu->{$menu_name}->title = $menu_title;
$info->menu->{$menu_name}->acts = array();
$info->menu->{$menu_name}->type = $menu_type;
$info->menu->{$menu_name}->type = $menu_type;
$buff .= sprintf('$info->menu->%s->title=\'%s\';', $menu_name, $menu_title);
$buff .= sprintf('$info->menu->%s->type=\'%s\';', $menu_name, $menu_type);
@ -1027,9 +1027,9 @@
list($table_name) = explode(".",$tmp_files[$j]);
if($oDB->isTableExists($table_name)) $created_table_count ++;
}
// Check if DB is installed
if($table_count > $created_table_count) return true;
else return false;
// Check if DB is installed
if($table_count > $created_table_count) return true;
else return false;
}
return false;
}
@ -1083,7 +1083,7 @@
$info->table_count = $table_count;
$info->path = $path;
$info->admin_index_act = $info->admin_index_act;
// Check if DB is installed
// Check if DB is installed
if($table_count > $created_table_count) $info->need_install = true;
else $info->need_install = false;
// Check if it is upgraded to module.class.php on each module
@ -1136,7 +1136,7 @@
}
/**
* @brief Check if it is an administrator of site_module_info
* @brief Check if it is an administrator of site_module_info
**/
function isSiteAdmin($member_info, $site_srl = null) {
if(!$member_info->member_srl) return false;
@ -1357,11 +1357,31 @@
function getModuleFileBoxList(){
$args->page = Context::get('page');
$args->list_count = 10;
$args->page_count = 10;
$args->list_count = 5;
$args->page_count = 5;
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){
return sprintf("./files/attach/filebox/%s",getNumberingPath($module_filebox_srl,3));
}
@ -1371,7 +1391,7 @@
* @param module, act
**/
function getValidatorFilePath($module, $ruleset) {
// load dynamic ruleset xml file
// load dynamic ruleset xml file
if (strpos($ruleset, '@') !== false){
$rulsetFile = str_replace('@', '', $ruleset);
$xml_file = sprintf('./files/ruleset/%s.xml', $rulsetFile);

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>