mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-30 08:39:58 +09:00
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:
parent
927d8743af
commit
dfe7b61159
3 changed files with 62 additions and 13 deletions
|
|
@ -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" />
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@
|
||||||
$site_args->index_module_srl = $mid_output->data->module_srl;
|
$site_args->index_module_srl = $mid_output->data->module_srl;
|
||||||
$site_args->domain = $domain;
|
$site_args->domain = $domain;
|
||||||
$site_args->default_language = $db_info->lang_type;
|
$site_args->default_language = $db_info->lang_type;
|
||||||
|
|
||||||
if($output->data && !$output->data->index_module_srl) {
|
if($output->data && !$output->data->index_module_srl) {
|
||||||
$output = executeQuery('module.updateSite', $site_args);
|
$output = executeQuery('module.updateSite', $site_args);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -150,7 +150,7 @@
|
||||||
$oCacheHandler->put($cache_key,$output->data->module_srl);
|
$oCacheHandler->put($cache_key,$output->data->module_srl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$module_info = $output->data;
|
$module_info = $output->data;
|
||||||
if(!$module_info->module_srl && $module_info->data[0]) $module_info = $module_info->data[0];
|
if(!$module_info->module_srl && $module_info->data[0]) $module_info = $module_info->data[0];
|
||||||
return $this->addModuleExtraVars($module_info);
|
return $this->addModuleExtraVars($module_info);
|
||||||
|
|
@ -214,7 +214,7 @@
|
||||||
* @brief Add extra vars to the module basic information
|
* @brief Add extra vars to the module basic information
|
||||||
**/
|
**/
|
||||||
function addModuleExtraVars($module_info) {
|
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);
|
if(!is_array($module_info)) $target_module_info = array($module_info);
|
||||||
else $target_module_info = $module_info;
|
else $target_module_info = $module_info;
|
||||||
// Get module_srl
|
// Get module_srl
|
||||||
|
|
@ -370,7 +370,7 @@
|
||||||
FileHandler::writeFile($cache_file, $str);
|
FileHandler::writeFile($cache_file, $str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(file_exists($cache_file)) {
|
if(file_exists($cache_file)) {
|
||||||
$GLOBALS['__MODULE_EXTEND__'] = include($cache_file);
|
$GLOBALS['__MODULE_EXTEND__'] = include($cache_file);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -562,7 +562,7 @@
|
||||||
|
|
||||||
$info->menu->{$menu_name}->title = $menu_title;
|
$info->menu->{$menu_name}->title = $menu_title;
|
||||||
$info->menu->{$menu_name}->acts = array();
|
$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->title=\'%s\';', $menu_name, $menu_title);
|
||||||
$buff .= sprintf('$info->menu->%s->type=\'%s\';', $menu_name, $menu_type);
|
$buff .= sprintf('$info->menu->%s->type=\'%s\';', $menu_name, $menu_type);
|
||||||
|
|
@ -1027,9 +1027,9 @@
|
||||||
list($table_name) = explode(".",$tmp_files[$j]);
|
list($table_name) = explode(".",$tmp_files[$j]);
|
||||||
if($oDB->isTableExists($table_name)) $created_table_count ++;
|
if($oDB->isTableExists($table_name)) $created_table_count ++;
|
||||||
}
|
}
|
||||||
// Check if DB is installed
|
// Check if DB is installed
|
||||||
if($table_count > $created_table_count) return true;
|
if($table_count > $created_table_count) return true;
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -1083,7 +1083,7 @@
|
||||||
$info->table_count = $table_count;
|
$info->table_count = $table_count;
|
||||||
$info->path = $path;
|
$info->path = $path;
|
||||||
$info->admin_index_act = $info->admin_index_act;
|
$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;
|
if($table_count > $created_table_count) $info->need_install = true;
|
||||||
else $info->need_install = false;
|
else $info->need_install = false;
|
||||||
// Check if it is upgraded to module.class.php on each module
|
// 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) {
|
function isSiteAdmin($member_info, $site_srl = null) {
|
||||||
if(!$member_info->member_srl) return false;
|
if(!$member_info->member_srl) return false;
|
||||||
|
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
@ -1371,7 +1391,7 @@
|
||||||
* @param module, act
|
* @param module, act
|
||||||
**/
|
**/
|
||||||
function getValidatorFilePath($module, $ruleset) {
|
function getValidatorFilePath($module, $ruleset) {
|
||||||
// load dynamic ruleset xml file
|
// load dynamic ruleset xml file
|
||||||
if (strpos($ruleset, '@') !== false){
|
if (strpos($ruleset, '@') !== false){
|
||||||
$rulsetFile = str_replace('@', '', $ruleset);
|
$rulsetFile = str_replace('@', '', $ruleset);
|
||||||
$xml_file = sprintf('./files/ruleset/%s.xml', $rulsetFile);
|
$xml_file = sprintf('./files/ruleset/%s.xml', $rulsetFile);
|
||||||
|
|
|
||||||
28
modules/module/tpl/filebox_list_html.html
Normal file
28
modules/module/tpl/filebox_list_html.html
Normal 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">« 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 »</a>
|
||||||
|
<span id="FileBoxGoTo" class="tgContent">
|
||||||
|
<input name="page" title="{$lang->cmd_go_to_page}" />
|
||||||
|
<button>Go</button>
|
||||||
|
</span>
|
||||||
|
</form>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue