mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-16 01:39:58 +09:00
merge from 1.7.3.5(r13153:r13167)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cc47d2b247
commit
2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions
|
|
@ -1,155 +1,176 @@
|
|||
<?php
|
||||
/**
|
||||
* @class moduleView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief view class of the module module
|
||||
**/
|
||||
/**
|
||||
* @class moduleView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief view class of the module module
|
||||
*/
|
||||
class moduleView extends module
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
// Set the template path
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
class moduleView extends module {
|
||||
/**
|
||||
* @brief Display skin information
|
||||
*/
|
||||
function dispModuleSkinInfo()
|
||||
{
|
||||
$selected_module = Context::get('selected_module');
|
||||
$skin = Context::get('skin');
|
||||
// Get modules/skin information
|
||||
$module_path = sprintf("./modules/%s/", $selected_module);
|
||||
if(!is_dir($module_path)) $this->stop("msg_invalid_request");
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
// Set the template path
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
$skin_info_xml = sprintf("%sskins/%s/skin.xml", $module_path, $skin);
|
||||
if(!file_exists($skin_info_xml)) $this->stop("msg_invalid_request");
|
||||
|
||||
/**
|
||||
* @brief Display skin information
|
||||
**/
|
||||
function dispModuleSkinInfo() {
|
||||
$selected_module = Context::get('selected_module');
|
||||
$skin = Context::get('skin');
|
||||
// Get modules/skin information
|
||||
$module_path = sprintf("./modules/%s/", $selected_module);
|
||||
if(!is_dir($module_path)) $this->stop("msg_invalid_request");
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
|
||||
Context::set('skin_info',$skin_info);
|
||||
|
||||
$skin_info_xml = sprintf("%sskins/%s/skin.xml", $module_path, $skin);
|
||||
if(!file_exists($skin_info_xml)) $this->stop("msg_invalid_request");
|
||||
$this->setLayoutFile("popup_layout");
|
||||
$this->setTemplateFile("skin_info");
|
||||
}
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
|
||||
Context::set('skin_info',$skin_info);
|
||||
/**
|
||||
* @brief Select a module
|
||||
*/
|
||||
function dispModuleSelectList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
$this->setLayoutFile("popup_layout");
|
||||
$this->setTemplateFile("skin_info");
|
||||
}
|
||||
$oModuleModel = &getModel('module');
|
||||
// Extract the number of virtual sites
|
||||
$output = executeQuery('module.getSiteCount');
|
||||
$site_count = $output->data->count;
|
||||
Context::set('site_count', $site_count);
|
||||
// Variable setting for site keyword
|
||||
$site_keyword = Context::get('site_keyword');
|
||||
// If there is no site keyword, use as information of the current virtual site
|
||||
$args = new stdClass();
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin == 'Y')
|
||||
{
|
||||
$query_id = 'module.getSiteModules';
|
||||
$module_category_exists = false;
|
||||
if(!$site_keyword)
|
||||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
if($site_module_info && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
$site_keyword = $site_module_info->domain;
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
Context::set('site_keyword', $site_keyword);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query_id = 'module.getDefaultModules';
|
||||
$args->site_srl = 0;
|
||||
$module_category_exists = true;
|
||||
}
|
||||
// If site keyword exists, extract information from the sites
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->site_keyword = $site_keyword;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$query_id = 'module.getSiteModules';
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
}
|
||||
//if(is_null($args->site_srl)) $query_id = 'module.getDefaultModules';
|
||||
// Get a list of modules at the site
|
||||
$output = executeQueryArray($query_id, $args);
|
||||
$category_list = $mid_list = array();
|
||||
if(count($output->data))
|
||||
{
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
$module = trim($val->module);
|
||||
if(!$module) continue;
|
||||
|
||||
/**
|
||||
* @brief Select a module
|
||||
**/
|
||||
function dispModuleSelectList() {
|
||||
if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
|
||||
$category = $val->category;
|
||||
$obj = new stdClass();
|
||||
$obj->module_srl = $val->module_srl;
|
||||
$obj->browser_title = $val->browser_title;
|
||||
$mid_list[$module]->list[$category][$val->mid] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
// Extract the number of virtual sites
|
||||
$output = executeQuery('module.getSiteCount');
|
||||
$site_count = $output->data->count;
|
||||
Context::set('site_count', $site_count);
|
||||
// Variable setting for site keyword
|
||||
$site_keyword = Context::get('site_keyword');
|
||||
// If there is no site keyword, use as information of the current virtual site
|
||||
$args = null;
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin == 'Y') {
|
||||
$query_id = 'module.getSiteModules';
|
||||
$module_category_exists = false;
|
||||
if(!$site_keyword) {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
if($site_module_info && $logged_info->is_admin != 'Y') {
|
||||
$site_keyword = $site_module_info->domain;
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
Context::set('site_keyword', $site_keyword);
|
||||
} else {
|
||||
$query_id = 'module.getDefaultModules';
|
||||
$args->site_srl = 0;
|
||||
$module_category_exists = true;
|
||||
}
|
||||
// If site keyword exists, extract information from the sites
|
||||
} else {
|
||||
$args->site_keyword = $site_keyword;
|
||||
}
|
||||
} else {
|
||||
$query_id = 'module.getSiteModules';
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
}
|
||||
//if(is_null($args->site_srl)) $query_id = 'module.getDefaultModules';
|
||||
// Get a list of modules at the site
|
||||
$output = executeQueryArray($query_id, $args);
|
||||
$category_list = $mid_list = array();
|
||||
if(count($output->data)) {
|
||||
foreach($output->data as $key => $val) {
|
||||
$module = trim($val->module);
|
||||
if(!$module) continue;
|
||||
$selected_module = Context::get('selected_module');
|
||||
if(count($mid_list))
|
||||
{
|
||||
foreach($mid_list as $module => $val)
|
||||
{
|
||||
if(!$selected_module) $selected_module = $module;
|
||||
$xml_info = $oModuleModel->getModuleInfoXml($module);
|
||||
$mid_list[$module]->title = $xml_info->title;
|
||||
}
|
||||
}
|
||||
|
||||
// not show admin bar
|
||||
Context::set('admin_bar', 'false');
|
||||
Context::set('mid_list', $mid_list);
|
||||
Context::set('selected_module', $selected_module);
|
||||
Context::set('selected_mids', $mid_list[$selected_module]->list);
|
||||
Context::set('module_category_exists', $module_category_exists);
|
||||
|
||||
$category = $val->category;
|
||||
$obj = null;
|
||||
$obj->module_srl = $val->module_srl;
|
||||
$obj->browser_title = $val->browser_title;
|
||||
$mid_list[$module]->list[$category][$val->mid] = $obj;
|
||||
}
|
||||
}
|
||||
$security = new Security();
|
||||
$security->encodeHTML('id', 'type');
|
||||
|
||||
$selected_module = Context::get('selected_module');
|
||||
if(count($mid_list)) {
|
||||
foreach($mid_list as $module => $val) {
|
||||
if(!$selected_module) $selected_module = $module;
|
||||
$xml_info = $oModuleModel->getModuleInfoXml($module);
|
||||
$mid_list[$module]->title = $xml_info->title;
|
||||
}
|
||||
}
|
||||
// Set the layout to be pop-up
|
||||
$this->setLayoutFile('popup_layout');
|
||||
// Set a template file
|
||||
$this->setTemplateFile('module_selector');
|
||||
}
|
||||
|
||||
Context::set('mid_list', $mid_list);
|
||||
Context::set('selected_module', $selected_module);
|
||||
Context::set('selected_mids', $mid_list[$selected_module]->list);
|
||||
Context::set('module_category_exists', $module_category_exists);
|
||||
// See the file box
|
||||
function dispModuleFileBox()
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('id', 'type');
|
||||
$input_name = Context::get('input');
|
||||
|
||||
// Set the layout to be pop-up
|
||||
$this->setLayoutFile('popup_layout');
|
||||
// Set a template file
|
||||
$this->setTemplateFile('module_selector');
|
||||
}
|
||||
// See the file box
|
||||
function dispModuleFileBox(){
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
|
||||
if(!$input_name) return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
$input_name = Context::get('input');
|
||||
$addscript = sprintf('<script>//<![CDATA[
|
||||
var selected_filebox_input_name = "%s";
|
||||
//]]></script>',$input_name);
|
||||
Context::addHtmlHeader($addscript);
|
||||
|
||||
if(!$input_name) return new Object(-1, 'msg_not_permitted');
|
||||
$oModuleModel = &getModel('module');
|
||||
$output = $oModuleModel->getModuleFileBoxList();
|
||||
Context::set('filebox_list', $output->data);
|
||||
|
||||
$filter = Context::get('filter');
|
||||
if($filter) Context::set('arrfilter',explode(',',$filter));
|
||||
|
||||
$addscript = sprintf('<script type="text/javascript">//<![CDATA[
|
||||
var selected_filebox_input_name = "%s";
|
||||
//]]></script>',$input_name);
|
||||
Context::addHtmlHeader($addscript);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
$this->setLayoutFile('popup_layout');
|
||||
$this->setTemplateFile('filebox_list');
|
||||
}
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$output = $oModuleModel->getModuleFileBoxList();
|
||||
Context::set('filebox_list', $output->data);
|
||||
// Screen to add a file box
|
||||
function dispModuleFileBoxAdd()
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
$filter = Context::get('filter');
|
||||
if($filter) Context::set('arrfilter',explode(',',$filter));
|
||||
$filter = Context::get('filter');
|
||||
if($filter) Context::set('arrfilter',explode(',',$filter));
|
||||
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
$this->setLayoutFile('popup_layout');
|
||||
$this->setTemplateFile('filebox_list');
|
||||
}
|
||||
// Screen to add a file box
|
||||
function dispModuleFileBoxAdd(){
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
$filter = Context::get('filter');
|
||||
if($filter) Context::set('arrfilter',explode(',',$filter));
|
||||
|
||||
$this->setLayoutFile('popup_layout');
|
||||
$this->setTemplateFile('filebox_add');
|
||||
}
|
||||
}
|
||||
?>
|
||||
$this->setLayoutFile('popup_layout');
|
||||
$this->setTemplateFile('filebox_add');
|
||||
}
|
||||
}
|
||||
/* End of file module.view.php */
|
||||
/* Location: ./modules/module/module.view.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue