Close Connection when there is no connection value.

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@13161 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
misol 2013-09-25 15:29:32 +00:00
parent 034a5c0288
commit f70ce644ce
1410 changed files with 7188 additions and 53541 deletions

View file

@ -78,7 +78,7 @@ class moduleAdminController extends module
/**
* @brief Copy Module
*/
function procModuleAdminCopyModule($args = NULL)
function procModuleAdminCopyModule($args = NULL)
{
$isProc = false;
if(!$args)
@ -93,7 +93,10 @@ class moduleAdminController extends module
$module_srl = $args->module_srl;
}
if(!$module_srl) return;
if(!$module_srl)
{
return $this->_returnByProc($isProc);
}
// Get module name to create and browser title
$clones = array();
@ -107,7 +110,10 @@ class moduleAdminController extends module
if($mid && !$browser_title) $browser_title = $mid;
$clones[$mid] = $browser_title;
}
if(!count($clones)) return;
if(!count($clones))
{
return $this->_returnByProc($isProc);
}
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
@ -164,15 +170,17 @@ class moduleAdminController extends module
$triggerObj->moduleSrlList = array();
$errorLog = array();
foreach($clones as $mid => $browser_title)
foreach($clones as $mid => $browser_title)
{
$clone_args = null;
$clone_args = clone($module_info);
$clone_args = clone $module_info;
$clone_args->module_srl = null;
$clone_args->content = null;
$clone_args->mid = $mid;
$clone_args->browser_title = $browser_title;
$clone_args->is_default = 'N';
$clone_args->isMenuCreate = $args->isMenuCreate;
unset($clone_args->menu_srl);
// Create a module
$output = $oModuleController->insertModule($clone_args);
@ -248,6 +256,16 @@ class moduleAdminController extends module
return $module_srl;
}
private function _returnByProc($isProc, $msg='msg_invalid_request')
{
if(!$isProc)
return;
else
{
return new Object(-1, $msg);
}
}
/**
* @brief Save the module permissions
*/
@ -345,17 +363,31 @@ class moduleAdminController extends module
$mode = $mode === 'P' ? 'P' : 'M';
$oModuleModel = &getModel('module');
$columnList = array('module_srl', 'module', 'skin', 'mskin');
$columnList = array('module_srl', 'module', 'skin', 'mskin', 'is_skin_fix', 'is_mskin_fix');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
if($module_info->module_srl)
if($module_info->module_srl)
{
if($mode === 'M')
{
$skin = $module_info->mskin;
if($module_info->is_mskin_fix == 'Y')
{
$skin = $module_info->mskin;
}
else
{
$skin = $oModuleModel->getModuleDefaultSkin($module_info->module, 'M');
}
}
else
{
$skin = $module_info->skin;
if($module_info->is_skin_fix == 'Y')
{
$skin = $module_info->skin;
}
else
{
$skin = $oModuleModel->getModuleDefaultSkin($module_info->module, 'P');
}
}
// Get skin information (to check extra_vars)
@ -382,9 +414,9 @@ class moduleAdminController extends module
unset($obj->module);
unset($obj->_mode);
// Separately handle if a type of extra_vars is an image in the original skin_info
if($skin_info->extra_vars)
if($skin_info->extra_vars)
{
foreach($skin_info->extra_vars as $vars)
foreach($skin_info->extra_vars as $vars)
{
if($vars->type!='image') continue;
@ -479,10 +511,10 @@ class moduleAdminController extends module
$oModuleModel = &getModel('module');
$oModuleController= &getController('module');
$columnList = array('module_srl', 'module', 'menu_srl', 'site_srl', 'mid', 'browser_title', 'is_default', 'content', 'mcontent', 'open_rss', 'regdate');
$updateList = array('module_category_srl','layout_srl','skin','mlayout_srl','mskin','description','header_text','footer_text'); //use_mobile
$updateList = array('module_category_srl','layout_srl','skin','mlayout_srl','mskin','description','header_text','footer_text', 'use_mobile');
foreach($updateList as $key=>$val)
{
if(!$vars->{$val} && $vars->{$val} !== 0)
if(!strlen($vars->{$val}))
{
unset($updateList[$key]);
$columnList[] = $val;
@ -806,7 +838,7 @@ class moduleAdminController extends module
function makeCacheDefinedLangCode($site_srl = 0)
{
$args = new stdClass();
// Get the language file of the current site
if(!$site_srl)
{
@ -887,10 +919,12 @@ class moduleAdminController extends module
$layoutSrl = Context::get('layout_srl');
$skinFixTargetValue = ($skinType == 'M') ? 'is_mskin_fix' : 'is_skin_fix';
$isSkinFix = Context::get($skinFixTargetValue);
$isSkinFix = Context::get('is_skin_fix');
$isSkinFix = ($isSkinFix == 'N') ? 'N' : 'Y';
if($isSkinFix)
{
$isSkinFix = ($isSkinFix == 'N') ? 'N' : 'Y';
}
$skinName = Context::get('skin_name');
$skinVars = Context::get('skin_vars');
@ -928,8 +962,15 @@ class moduleAdminController extends module
$layoutTargetValue = ($skinType == 'M') ? 'mlayout_srl' : 'layout_srl';
$skinFixTargetValue = ($skinType == 'M') ? 'is_mskin_fix' : 'is_skin_fix';
$moduleInfo->{$layoutTargetValue} = $layoutSrl;
$moduleInfo->{$skinFixTargetValue} = $isSkinFix;
if(strlen($layoutSrl))
{
$moduleInfo->{$layoutTargetValue} = $layoutSrl;
}
if(strlen($isSkinFix))
{
$moduleInfo->{$skinFixTargetValue} = $isSkinFix;
}
if($isSkinFix == 'Y')
{
@ -949,10 +990,6 @@ class moduleAdminController extends module
}
}
}
else
{
$moduleInfo->{$skinTargetValue} = '';
}
$oModuleController = getController('module');
$output = $oModuleController->updateModule($moduleInfo);

View file

@ -54,8 +54,33 @@ class moduleAdminModel extends module
return $output;
}
function getSelectedManageHTML($grantList, $tabChoice = array())
function getSelectedManageHTML($grantList, $tabChoice = array(), $modulePath = NULL)
{
if($modulePath)
{
// get the skins path
$oModuleModel = &getModel('module');
$skin_list = $oModuleModel->getSkins($modulePath);
Context::set('skin_list',$skin_list);
$mskin_list = $oModuleModel->getSkins($modulePath, "m.skins");
Context::set('mskin_list', $mskin_list);
}
// get the layouts path
$oLayoutModel = &getModel('layout');
$layout_list = $oLayoutModel->getLayoutList();
Context::set('layout_list', $layout_list);
$mobile_layout_list = $oLayoutModel->getLayoutList(0,"M");
Context::set('mlayout_list', $mobile_layout_list);
$security = new Security();
$security->encodeHTML('layout_list..layout', 'layout_list..title');
$security->encodeHTML('mlayout_list..layout', 'mlayout_list..title');
$security->encodeHTML('skin_list..title');
$security->encodeHTML('mskin_list..title');
$grant_list =new stdClass();
// Grant virtual permission for access and manager
if(!$grantList)
@ -369,9 +394,16 @@ class moduleAdminModel extends module
* @brief Get values for a particular language code
* Return its corresponding value if lang_code is specified. Otherwise return $name.
*/
function getLangCode($site_srl, $name)
function getLangCode($site_srl, $name, $isFullLanguage = FALSE)
{
$lang_supported = Context::get('lang_supported');
if($isFullLanguage)
{
$lang_supported = Context::loadLangSupported();
}
else
{
$lang_supported = Context::get('lang_supported');
}
if(substr($name,0,12)=='$user_lang->')
{
@ -529,6 +561,9 @@ class moduleAdminModel extends module
Context::set('lang_code_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
$oSecurity = new Security();
$oSecurity->encodeHTML('lang_code_list..');
$oTemplate = TemplateHandler::getInstance();
$tpl = $oTemplate->compile('./modules/module/tpl', 'multilingual_v17_list.html');

View file

@ -146,6 +146,9 @@ class moduleAdminView extends module
$columnList = array('module_srl', 'module', 'mid', 'browser_title');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
Context::set('module_info', $module_info);
$oSecurity = new Security();
$oSecurity->encodeHTML('module_info.');
// Set the layout to be pop-up
$this->setLayoutPath('./common/tpl');
$this->setLayoutFile('popup_layout');
@ -301,6 +304,10 @@ class moduleAdminView extends module
Context::set('filebox_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
Context::set('page', $page);
$oSecurity = new Security();
$oSecurity->encodeHTML('filebox_list..comment', 'filebox_list..attributes.');
debugPrint($output->data);
$this->setTemplateFile('adminFileBox');
}
}

View file

@ -96,11 +96,23 @@ class module extends ModuleObject
}
// XE 1.7
$output = executeQueryArray('module.getNotLinkedModuleGroupSiteSrl');
$args->site_srl = 0;
$output = executeQueryArray('module.getNotLinkedModuleBySiteSrl',$args);
if($output->toBool() && $output->data && count($output->data) > 0) return true;
// check fix mskin
if(!$oDB->isColumnExists("modules", "is_mskin_fix")) return true;
$oModuleModel = getModel('module');
$moduleConfig = $oModuleModel->getModuleConfig('module');
if(!$moduleConfig->isUpdateFixedValue) return true;
// check lost module
if(!$moduleConfig->isUpdateLostModule)
{
return true;
}
return false;
}
@ -356,19 +368,7 @@ class module extends ModuleObject
if(!$oDB->isColumnExists("modules", "is_skin_fix"))
{
$oDB->addColumn('modules', 'is_skin_fix', 'char', 1, 'N');
$output = executeQueryArray('module.getAllSkinSetModule');
if($output->toBool() && $output->data)
{
$module_srls = array();
foreach($output->data as $val)
{
$module_srls[] = $val->module_srl;
}
unset($args);
$args->module_srls = implode(',', $module_srls);
$args->is_skin_fix = 'Y';
$output = executeQuery('module.updateSkinFixModules', $args);
}
$output = executeQuery('module.updateSkinFixModules');
}
if(!$oDB->isColumnExists("module_config", "site_srl"))
{
@ -398,51 +398,101 @@ class module extends ModuleObject
if(!$oDB->isColumnExists("modules", "is_mskin_fix"))
{
$oDB->addColumn('modules', 'is_mskin_fix', 'char', 1, 'N');
$output = executeQueryArray('module.getAllMobileSkinSetModule');
if($output->toBool() && $output->data)
{
$module_srls = array();
foreach($output->data as $val)
{
$module_srls[] = $val->module_srl;
}
unset($args);
$args->module_srls = implode(',', $module_srls);
$args->is_mskin_fix = 'Y';
$output = executeQuery('module.updateMobileSkinFixModules', $args);
}
$output = executeQuery('module.updateMobileSkinFixModules');
}
$output = executeQueryArray('module.getNotLinkedModuleGroupSiteSrl');
unset($args);
$args->site_srl = 0;
$output = executeQueryArray('module.getNotLinkedModuleBySiteSrl',$args);
if($output->toBool() && $output->data && count($output->data) > 0)
{
foreach($output->data as $siteInfo)
//create temp menu.
$args->title = 'Temporary menu';
$menuSrl = $args->menu_srl = getNextSequence();
$args->listorder = $args->menu_srl * -1;
$ioutput = executeQuery('menu.insertMenu', $args);
if(!$ioutput->toBool())
{
unset($args);
$args->site_srl = $siteInfo->site_srl;
return $ioutput;
}
//create temp menu.
$args->title = 'Temporary menu';
$menuSrl = $args->menu_srl = getNextSequence();
$args->listorder = $args->menu_srl * -1;
//getNotLinkedModuleBySiteSrl
$soutput = executeQueryArray('module.getNotLinkedModuleBySiteSrl', $args);
$uoutput = $this->updateLinkModule($soutput->data, $menuSrl);
}
$ioutput = executeQuery('menu.insertMenu', $args);
$oModuleModel = getModel('module');
$moduleConfig = $oModuleModel->getModuleConfig('module');
if(!$moduleConfig->isUpdateFixedValue)
{
$output = executeQuery('module.updateSkinFixModules');
$output = executeQuery('module.updateMobileSkinFixModules');
if(!$ioutput->toBool())
$oModuleController = getController('module');
$moduleConfig->isUpdateFixedValue = TRUE;
$output = $oModuleController->updateModuleConfig('module', $moduleConfig);
}
// check lost module
if(!$moduleConfig->isUpdateLostModule)
{
$args = new stdClass();
$args->site_srl = 0;
$output = executeQueryArray('module.getMidList', $args);
if(!$output->toBool())
{
return $output;
}
if($output->data)
{
$oMenuAdminModel = getAdminModel('menu'); /* @var $oMenuAdminModel menuAdminModel */
foreach($output->data as $row)
{
return $ioutput;
}
$args = new stdClass();
$args->url = $row->mid;
$output2 = executeQuery('module.getMenuItem', $args);
//getNotLinkedModuleBySiteSrl
$soutput = executeQueryArray('module.getNotLinkedModuleBySiteSrl', $args);
$uoutput = $this->updateLinkModule($soutput->data, $menuSrl);
if(!$output2->data->count)
{
$menuInfo = $oMenuAdminModel->getMenuByTitle('Temporary menu');
if(!$uoutput->toBool())
{
return $uoutput;
if(!$menuInfo)
{
$args = new stdClass();
$args->title = 'Temporary menu';
$menuSrl = $args->menu_srl = getNextSequence();
$args->listorder = $args->menu_srl * -1;
$ioutput = executeQuery('menu.insertMenu', $args);
if(!$ioutput->toBool())
{
return $ioutput;
}
}
else
{
$menuSrl = $menuInfo->menu_srl;
}
$uoutput = $this->updateLinkModule(array($row), $menuSrl);
if(!$uoutput->toBool())
{
return $uoutput;
}
}
}
}
$oModuleController = getController('module');
$moduleConfig->isUpdateLostModule = TRUE;
$output = $oModuleController->updateModuleConfig('module', $moduleConfig);
if(!$output->toBool())
{
return $output;
}
}
return new Object(0, 'success_updated');
@ -454,7 +504,7 @@ class module extends ModuleObject
* @param array $moduleInfos
* @param int $menuSrl
*
* @return Object
* @return Object
*/
private function updateLinkModule($moduleInfos, $menuSrl)
{
@ -468,6 +518,7 @@ class module extends ModuleObject
// search menu.
$args->url = $moduleInfo->mid;
$args->site_srl = $moduleInfo->site_srl;
$args->is_shortcut = 'N';
$output = executeQuery('menu.getMenuItemByUrl', $args);
@ -485,7 +536,7 @@ class module extends ModuleObject
$item_args->listorder = -1*$item_args->menu_item_srl;
$output = executeQuery('menu.insertMenuItem', $item_args);
if(!$output->toBool())
if(!$output->toBool())
{
return $output;
}
@ -493,7 +544,7 @@ class module extends ModuleObject
}
$output = executeQuery('module.updateModule', $moduleInfo);
if(!$output->toBool())
if(!$output->toBool())
{
return $output;
}
@ -519,7 +570,7 @@ class module extends ModuleObject
$bFirst = true;
foreach($output2->data as $site)
{
if($bFirst)
if($bFirst)
{
$bFirst = false;
continue;

View file

@ -185,7 +185,7 @@ class moduleController extends module
{
$cache_key = 'object:module_config:module_'.$module.'_site_srl_'.$site_srl;
$oCacheHandler->delete($cache_key);
}
}
return $output;
}
@ -263,7 +263,7 @@ class moduleController extends module
if($args->domain && !isSiteID($args->domain))
{
$args->domain = $args->domain;
$args->domain = preg_replace('/\/$/','',$args->domain);
}
}
$output = executeQuery('module.updateSite', $args);
@ -332,6 +332,15 @@ class moduleController extends module
*/
function insertModule($args)
{
if(isset($args->isMenuCreate))
{
$isMenuCreate = $args->isMenuCreate;
}
else
{
$isMenuCreate = TRUE;
}
$output = $this->arrangeModuleInfo($args, $extra_vars);
if(!$output->toBool()) return $output;
// Check whether the module name already exists
@ -366,8 +375,8 @@ class moduleController extends module
$args->is_skin_fix = 'Y';
}
}
if($args->mskin = '/USE_DEFAULT/')
if($args->mskin == '/USE_DEFAULT/')
{
$args->is_mskin_fix = 'N';
}
@ -383,6 +392,57 @@ class moduleController extends module
}
}
unset($output);
if($isMenuCreate == TRUE)
{
$menuArgs->menu_srl = $args->menu_srl;
$menuOutput = executeQuery('menu.getMenu', $menuArgs);
// if menu is not created, create menu also. and does not supported that in virtual site.
if(!$menuOutput->data && !$args->site_srl)
{
$oMenuAdminModel = &getAdminModel('menu');
$tempMenu = $oMenuAdminModel->getMenuByTitle(array('Temporary menu'));
if(!$tempMenu)
{
$siteMapOutput->site_srl = 0;
$siteMapArgs->title = 'Temporary menu';
$tempMenu->menu_srl = $siteMapArgs->menu_srl = getNextSequence();
$siteMapArgs->listorder = $siteMapArgs->menu_srl * -1;
$siteMapOutput = executeQuery('menu.insertMenu', $siteMapArgs);
if(!$siteMapOutput->toBool())
{
$oDB->rollback();
return $siteMapOutput;
}
}
$menuArgs->menu_srl = $tempMenu->menu_srl;
$menuArgs->menu_item_srl = getNextSequence();
$menuArgs->parent_srl = 0;
$menuArgs->open_window = 'N';
$menuArgs->url = $args->mid;
$menuArgs->expand = 'N';
$menuArgs->is_shortcut = 'N';
$menuArgs->name = $args->browser_title;
$menuArgs->listorder = $args->menu_item_srl * -1;
$menuItemOutput = executeQuery('menu.insertMenuItem', $menuArgs);
if(!$menuItemOutput->toBool())
{
$oDB->rollback();
return $menuItemOutput;
}
$oMenuAdminController = &getAdminController('menu');
$oMenuAdminController->makeXmlFile($tempMenu->menu_srl);
}
}
$args->menu_srl = $menuArgs->menu_srl;
// Insert a module
$output = executeQuery('module.insertModule', $args);
if(!$output->toBool())
@ -407,17 +467,16 @@ class moduleController extends module
{
$output = $this->arrangeModuleInfo($args, $extra_vars);
if(!$output->toBool()) return $output;
// begin transaction
$oDB = &DB::getInstance();
$oDB->begin();
$oModuleModel = &getModel('module');
$columnList = array('module_srl', 'site_srl', 'browser_title', 'mid');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
if(!$args->site_srl || !$args->browser_title)
{
$oModuleModel = &getModel('module');
$columnList = array('module_srl', 'site_srl', 'browser_title');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
if(!$args->site_srl) $args->site_srl = (int)$module_info->site_srl;
if(!$args->browser_title) $args->browser_title = $module_info->browser_title;
}
@ -445,14 +504,14 @@ class moduleController extends module
$args->is_skin_fix = 'Y';
}
}
if($args->mskin = '/USE_DEFAULT/')
if($args->mskin == '/USE_DEFAULT/')
{
$args->is_mskin_fix = 'N';
}
else
{
if(isset($args->is_skin_fix))
if(isset($args->is_mskin_fix))
{
$args->is_mskin_fix = ($args->is_mskin_fix != 'Y') ? 'N' : 'Y';
}
@ -461,7 +520,6 @@ class moduleController extends module
$args->is_mskin_fix = 'Y';
}
}
$output = executeQuery('module.updateModule', $args);
if(!$output->toBool())
{
@ -469,6 +527,25 @@ class moduleController extends module
return $output;
}
$menuArgs->url = $module_info->mid;
$menuArgs->site_srl = $module_info->site_srl;
$menuOutput = executeQuery('menu.getMenuItemByUrl', $menuArgs);
if($menuOutput->data->menu_item_srl)
{
$oMenuAdminController = &getAdminController('menu');
$itemInfo = $menuOutput->data;
$itemInfo->url = $args->mid;
$updateMenuItemOutput = $oMenuAdminController->updateMenuItem($itemInfo);
if(!$updateMenuItemOutput->toBool())
{
$oDB->rollback();
return $updateMenuItemOutput;
}
}
// Insert module extra vars
$this->insertModuleExtraVars($args->module_srl, $extra_vars);
@ -506,7 +583,7 @@ class moduleController extends module
* Attempt to delete all related information when deleting a module.
* Origin method is changed. because menu validation check is needed
*/
function deleteModule($module_srl)
function deleteModule($module_srl, $site_srl = 0)
{
if(!$module_srl) return new Object(-1,'msg_invalid_request');
@ -517,11 +594,25 @@ class moduleController extends module
$args = new stdClass();
$args->url = $output->mid;
$args->is_shortcut = 'N';
$args->site_srl = $site_module_info->site_srl;
if(!$site_srl) $args->site_srl = $site_module_info->site_srl;
else $args->site_srl = $site_srl;
unset($output);
$output = executeQuery('menu.getMenuItemByUrl', $args);
$oMenuAdminModel = &getAdminModel('menu');
$menuOutput = $oMenuAdminModel->getMenuList($args);
// get menu_srl by site_srl
if(is_array($menuOutput->data))
{
foreach($menuOutput->data AS $key=>$value)
{
$args->menu_srl = $value->menu_srl;
break;
}
}
$output = executeQuery('menu.getMenuItemByUrl', $args);
// menu delete
if($output->data)
{

View file

@ -259,7 +259,7 @@ class moduleModel extends module
$layoutInfoPc = $layoutSrlPc ? $oLayoutModel->getLayoutRawData($layoutSrlPc, array('title')) : NULL;
$layoutInfoMobile = $layoutSrlMobile ? $oLayoutModel->getLayoutRawData($layoutSrlMobile, array('title')) : NULL;
$skinInfoPc = $this->loadSkinInfo(Modulehandler::getModulePath($moduleInfo->module), $skinNamePc);
$skinInfoMobile = $this->loadSkinInfo(Modulehandler::getModulePath($moduleInfo->module), $skinNameMobile, 'm.skin');
$skinInfoMobile = $this->loadSkinInfo(Modulehandler::getModulePath($moduleInfo->module), $skinNameMobile, 'm.skins');
if(!$skinInfoPc)
{
$skinInfoPc = new stdClass();
@ -355,19 +355,19 @@ class moduleModel extends module
/**
* Apply default skin info
*
*
* @param stdClass $moduleInfo Module information
*/
private function applyDefaultSkin(&$moduleInfo)
{
if($moduleInfo->is_skin_fix == 'N')
{
$moduleInfo->skin = '/USE_DEFAULT';
$moduleInfo->skin = '/USE_DEFAULT/';
}
if($moduleInfo->is_mskin_fix == 'N')
{
$moduleInfo->mskin = '/USE_DEFAULT';
$moduleInfo->mskin = '/USE_DEFAULT/';
}
}
/**
@ -833,6 +833,7 @@ class moduleModel extends module
$grant = $action->attrs->grant?$action->attrs->grant:'guest';
$standalone = $action->attrs->standalone=='true'?'true':'false';
$ruleset = $action->attrs->ruleset?$action->attrs->ruleset:'';
$method = $action->attrs->method?$action->attrs->method:'';
$index = $action->attrs->index;
$admin_index = $action->attrs->admin_index;
@ -845,6 +846,7 @@ class moduleModel extends module
$info->action->{$name}->grant = $grant;
$info->action->{$name}->standalone = $standalone=='true'?true:false;
$info->action->{$name}->ruleset = $ruleset;
$info->action->{$name}->method = $method;
if($action->attrs->menu_name)
{
if($menu_index == 'true')
@ -866,6 +868,7 @@ class moduleModel extends module
$buff .= sprintf('$info->action->%s->grant=\'%s\';', $name, $grant);
$buff .= sprintf('$info->action->%s->standalone=%s;', $name, $standalone);
$buff .= sprintf('$info->action->%s->ruleset=\'%s\';', $name, $ruleset);
$buff .= sprintf('$info->action->%s->method=\'%s\';', $name, $method);
if($index=='true')
{
@ -929,6 +932,11 @@ class moduleModel extends module
*/
function getSkins($path, $dir = 'skins')
{
if(substr($path, -1) == '/')
{
$path = substr($path, 0, -1);
}
$skin_path = sprintf("%s/%s/", $path, $dir);
$list = FileHandler::readDir($skin_path);
if(!count($list)) return;
@ -937,6 +945,10 @@ class moduleModel extends module
foreach($list as $skin_name)
{
if(!is_dir($skin_path . $skin_name))
{
continue;
}
unset($skin_info);
$skin_info = $this->loadSkinInfo($path, $skin_name, $dir);
if(!$skin_info)
@ -986,7 +998,6 @@ class moduleModel extends module
{
$type = 'M';
}
$defaultSkinName = $this->getModuleDefaultSkin($module, $type, $site_info->site_srl);
if(isset($defaultSkinName))
@ -1001,7 +1012,7 @@ class moduleModel extends module
$skin_list = array_merge($useDefaultList, $skin_list);
}
}
return $skin_list;
}
@ -1693,6 +1704,7 @@ class moduleModel extends module
function getModuleDefaultSkin($module_name, $skin_type = 'P', $site_srl = 0, $updateCache = true)
{
$target = ($skin_type == 'M') ? 'mskin' : 'skin';
if(!$site_srl) $site_srl = 0;
$designInfoFile = sprintf(_XE_PATH_.'files/site_design/design_%s.php', $site_srl);
if(is_readable($designInfoFile))
@ -1701,7 +1713,6 @@ class moduleModel extends module
$skinName = $designInfo->module->{$module_name}->{$target};
}
if(!$skinName)
{
$dir = ($skin_type == 'M') ? 'm.skins/' : 'skins/';
@ -1835,7 +1846,7 @@ class moduleModel extends module
function getGrant($module_info, $member_info, $xml_info = '')
{
$grant = new stdClass();
if(!$xml_info)
{
$module = $module_info->module;
@ -2059,7 +2070,7 @@ class moduleModel extends module
Context::set('page_navigation', $output->page_navigation);
$security = new Security();
$security->encodeHTML('filebox_list..comment');
$security->encodeHTML('filebox_list..comment', 'filebox_list..attributes.');
$oTemplate = &TemplateHandler::getInstance();
$html = $oTemplate->compile('./modules/module/tpl/', 'filebox_list_html');

View file

@ -4,6 +4,7 @@
</tables>
<columns>
<column name="*" />
<column name="count(module_srl)" alias="instanceCount" />
</columns>
<conditions>
<condition operation="equal" column="site_srl" var="site_srl" filter="number" />

View file

@ -7,6 +7,6 @@
</columns>
<conditions>
<condition operation="equal" column="menu_srl" default="0" />
<condition operation="equal" column="site_srl" var="site_srl" notnull="notnull" pipe="and" />
<condition operation="equal" column="site_srl" var="site_srl" default="0" notnull="notnull" pipe="and" />
</conditions>
</query>

View file

@ -1,14 +0,0 @@
<query id="getNotLinkedModuleGroupSiteSrl" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="site_srl" />
</columns>
<conditions>
<condition operation="equal" column="menu_srl" default="0" />
</conditions>
<groups>
<group column="site_srl" />
</groups>
</query>

View file

@ -3,9 +3,10 @@
<table name="modules" />
</tables>
<columns>
<column name="is_mskin_fix" var="is_mskin_fix" />
<column name="is_mskin_fix" default="Y" />
</columns>
<conditions>
<condition operation="in" column="module_srl" var="module_srls" notnull="notnull" />
<condition operation="notnull" column="mskin" />
<condition operation="notequal" column="mskin" default=" " pipe="or" />
</conditions>
</query>

View file

@ -3,9 +3,10 @@
<table name="modules" />
</tables>
<columns>
<column name="is_skin_fix" var="is_skin_fix" />
<column name="is_skin_fix" default="Y" />
</columns>
<conditions>
<condition operation="in" column="module_srl" var="module_srls" notnull="notnull" />
<condition operation="notnull" column="skin" />
<condition operation="notequal" column="skin" default=" " pipe="or" />
</conditions>
</query>

View file

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0">
<customrules>
<rule name="signed_number" type="regex" test="/-?[0-9]+/" />
</customrules>
<fields>
<field name="module_srls" required="true" />
<field name="module_category_srl" rule="number" />
<field name="layout_srl" rule="number" />
<field name="layout_srl" rule="signed_number" />
</fields>
</ruleset>

View file

@ -1,9 +1,9 @@
<!--%load_js_plugin("filebox")-->
<div class="x_page-header">
<h1>{$lang->menu_gnb_sub['filebox']} <a class="x_icon-question-sign" href="./help/index.html#UMAN_config_filebox" target="_blank">{$lang->help}</a></h1>
<h1>{$lang->menu_gnb_sub['filebox']} <a class="x_icon-question-sign" href="./admin/help/index.html#UMAN_config_filebox" target="_blank">{$lang->help}</a></h1>
</div>
<div cond="$XE_VALIDATOR_MESSAGE" class="x_alert x_alert-{$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/module/tpl/adminFileBox/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
@ -15,6 +15,7 @@
<input type="hidden" name="vid" value="{$vid}" />
<input type="hidden" name="filter" value="{$filter}" />
<input type="hidden" name="input" value="{$input}" />
<input type="hidden" name="xe_validator_id" value="modules/module/tpl/adminFileBox/1" />
<div class="x_control-group __attribute" data-count="1">
<label for="attribute_name1" class="x_control-label __attribute_name_label">{$lang->attribute_name}</label>
<div class="x_controls">
@ -66,7 +67,7 @@
</td>
<td>
<p loop="$val->attributes => $name, $value">
{$name}: {$value}
{htmlspecialchars($name)}: {$value}
</p>
</td>
<td>

View file

@ -1,8 +1,14 @@
<!--%import("filter/update_category.xml")-->
<!--#include("./header.html")-->
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
{@
$validator_ids = array(
'modules/module/tpl/category_list/1' => 1,
'modules/module/tpl/category_list/2' => 1,
'modules/module/tpl/category_update_form/1' => 1
);
}
<div cond="$XE_VALIDATOR_MESSAGE && isset($validator_ids[$XE_VALIDATOR_ID])" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<!-- 카테고리의 위/아래, 삭제와 관련된 form -->
@ -10,6 +16,7 @@
<input type="hidden" name="module" value="module" />
<input type="hidden" name="act" value="procModuleAdminDeleteCategory" />
<input type="hidden" name="module_category_srl" value="" />
<input type="hidden" name="xe_validator_id" value="modules/module/tpl/category_list/1" />
</form>
<table class="x_table x_table-striped x_table-hover">
<thead>
@ -45,6 +52,7 @@
<input type="hidden" name="page" value="{$page}" />
<input type="hidden" name="module_srl" value="{$module_srl}" />
<input type="hidden" name="module_category_srl" value="" />
<input type="hidden" name="xe_validator_id" value="modules/module/tpl/category_list/2" />
<div class="x_pull-right x_input-append">
<input type="text" name="title" title="{$lang->category_title}" placeholder="{$lang->category_title}" required />
<input type="submit" class="x_btn x_btn-primary" value="{$lang->cmd_registration}">

View file

@ -1,7 +1,7 @@
<!--#include("./header.html")-->
<!-- 카테고리 수정 -->
<!--@if($selected_category)-->
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/module/tpl/category_update_form/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<section class="section">
@ -10,6 +10,7 @@
<input type="hidden" name="act" value="procModuleAdminUpdateCategory" />
<input type="hidden" name="module_category_srl" value="{$selected_category->module_category_srl}" />
<input type="hidden" name="mode" value="update" />
<input type="hidden" name="xe_validator_id" value="modules/module/tpl/category_update_form/1" />
<label for="category_title" style="display:inline-block;padding:4px 0 0 0"><strong>{$lang->category_title}</strong>: </label>
<span class="x_input-append">
<input type="text" name="title" id="category_title" value="{$selected_category->title}" />

View file

@ -1,5 +1,5 @@
<load target="js/module_admin.js" usecdn="true" />
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/module/tpl/copy_module/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<section class="section">
@ -7,6 +7,7 @@
<input type="hidden" name="module" value="module" />
<input type="hidden" name="act" value="procModuleAdminCopyModule" />
<input type="hidden" name="module_srl" value="{$module_info->module_srl}" />
<input type="hidden" name="xe_validator_id" value="modules/module/tpl/copy_module/1" />
<h2>{$lang->module_copy}</h2>
<table class="x_table x_table-striped x_table-hover">
<tr>

View file

@ -21,7 +21,7 @@
</td>
<td>
<p loop="$val->attributes => $name, $value">
{$name} : {$value}
{htmlspecialchars($name)} : {$value}
</p>
</td>
<td cond="!$allow_multiple">

View file

@ -1,6 +1,6 @@
<load target="js/module_admin.js" usecdn="true" />
<div class="x_page-header">
<h1>{$lang->installed_modules} <a class="x_icon-question-sign" href="./help/index.html#UMAN_advanced_installed_module" target="_blank">{$lang->help}</a></h1>
<h1>{$lang->installed_modules} <a class="x_icon-question-sign" href="./admin/help/index.html#UMAN_advanced_installed_module" target="_blank">{$lang->help}</a></h1>
</div>
<script>
xe.lang.favorite_on = '{$lang->favorite}({$lang->on})';

View file

@ -34,6 +34,6 @@
</div>
</div>
<div class="x_modal-footer">
<button type="button" class="x_btn x_pull-left">{$lang->cmd_close}</button>
<button type="button" class="x_btn x_pull-left" data-hide="#manageSelectedModule">{$lang->cmd_close}</button>
</div>
</section>

View file

@ -7,6 +7,7 @@
<input type="hidden" name="act" value="procModuleAdminModuleGrantSetup" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input type="hidden" name="module_srls" value="{$module_srls}" />
<input type="hidden" name="xe_validator_id" value="modules/module/tpl/manage_selected" />
<h1>{$lang->permission_setting}</h1>
<p>{$lang->about_grant_deatil}</p>
<div loop="$grant_list => $grant_name, $grant_item" class="x_control-group">

View file

@ -3,6 +3,7 @@
<input type="hidden" name="act" value="procModuleAdminModuleSetup" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input type="hidden" name="module_srls" value="" />
<input type="hidden" name="xe_validator_id" value="modules/module/tpl/manage_selected" />
<div class="x_control-group">
<label class="x_control-label" for="module_category_srl">{$lang->module_category}</label>
<div class="x_controls">
@ -35,6 +36,17 @@
<p class="x_help-inline">{$lang->about_skin}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="use_mobile">{$lang->mobile_view}</label>
<div class="x_controls">
<select name="use_mobile" id="use_mobile">
<option value="" selected="selected">{$lang->keep_existing_value}</option>
<option value="Y">{$lang->use}</option>
<option value="N">{$lang->notuse}</option>
</select>
<p class="x_help-inline">{$lang->about_mobile_view}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="mlayout_srl">{$lang->mobile_layout}</label>
<div class="x_controls">

View file

@ -24,8 +24,11 @@ $('a.modalAnchor[href=#manageSelectedModule]')
var module_srls = new Array();
$selectedModule.each(function(){
var $this = $(this);
var row = '<tr><td>' + $this.data('mid') + '</td><td>' + $this.data('browser_title') + '</td></tr>';
$selectedBody.append(row);
var $row = $('<tr></tr>');
var $mid = $('<td></td>').text($this.data('mid'));
var $browser_title = $('<td></td>').text($this.data('browser_title'));
$row.append($mid).append($browser_title);
$selectedBody.append($row);
module_srls.push($this.val());
});
@ -34,4 +37,4 @@ $('a.modalAnchor[href=#manageSelectedModule]')
$('#manageSelectedModuleGrant input[name=module_srls]').val(module_srls);
});
});
});

View file

@ -6,10 +6,11 @@
<input type="hidden" name="module" value="module" />
<input type="hidden" name="act" value="procModuleAdminModuleGrantSetup" />
<input type="hidden" name="module_srls" value="{$module_srls}" />
<input type="hidden" name="xe_validator_id" value="modules/module/tpl/module_grant_setup/1" />
<div class="x_modal-header">
<h1>{$lang->bundle_grant_setup}</h1>
</div>
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/module/tpl/module_grant_setup/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<div class="x_modal-body">

View file

@ -1,12 +1,8 @@
<div class="x_page-header">
<h1>{$lang->menu_gnb_sub['multilingual']} <a class="x_icon-question-sign" href="./help/index.html#UMAN_content_langcode" target="_blank">{$lang->help}</a></h1>
<h1>{$lang->cmd_multilingual} <a class="x_icon-question-sign" href="./admin/help/index.html#UMAN_content_langcode" target="_blank">{$lang->help}</a></h1>
</div>
<p>{$lang->multilingual_desc}</p>
<div cond="$XE_VALIDATOR_MESSAGE" class="x_aleart x_alert-{$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
{@$use_in_page = true}
<include target="multilingual_v17.html" />
<script>

View file

@ -1,4 +1,7 @@
<include target="header.html" />
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/autoinstall/tpl/uninstall/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<table class="x_table x_table-striped x_table-hover">
<caption>
<strong>All({count($module_list)})</strong>

View file

@ -3,10 +3,11 @@
<input type="hidden" name="module" value="module" />
<input type="hidden" name="act" value="procModuleAdminModuleSetup" />
<input type="hidden" name="module_srls" value="{$module_srls}" />
<input type="hidden" name="xe_validator_id" value="modules/module/tpl/module_setup/1" />
<div class="x_modal-header">
<h1>{$lang->bundle_setup}</h1>
</div>
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/module/tpl/module_setup/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<div class="x_modal-body">

View file

@ -56,7 +56,7 @@
</ul>
</form>
<form action="" class="search center x_input-append x_pull-right">
<select name="lang_code">
<select name="lang_code" style="margin-right:4px">
<option loop="$lang_supported => $code, $lname" value="{$code}" selected="selected"|cond="$code == $lang_code">{$lname}</option>
</select>
<input type="search" name="search_keyword" title="Search" value="<!--@if($name)-->{htmlspecialchars($lang_code_list[1]->value)}<!--@else-->{htmlspecialchars($search_keyword)}<!--@end-->">

View file

@ -1,7 +1,6 @@
<div cond="$XE_VALIDATOR_MESSAGE" class="x_alert x_alert-{$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/module/tpl/skin_config/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form action="./" method="post" enctype="multipart/form-data" class="x_form-horizontal">
<input type="hidden" name="module" value="module" />
<input type="hidden" name="vid" value="{$vid}" />
@ -10,10 +9,9 @@
<input type="hidden" name="_mode" value="{$mode}" />
<input type="hidden" name="module_srl" value="{$module_info->module_srl}" />
<input type="hidden" name="page" value="{$page}" />
<input type="hidden" name="xe_validator_id" value="modules/module/tpl/skin_config/1" />
<section class="section">
<h1>{$lang->skin_default_info}</h1>
<div class="x_control-group">
<label class="x_control-label">
{$lang->skin}
@ -70,14 +68,12 @@
<!--@else-->
{@ $_width = 200; $_height = 20; $_talign = "left"; }
<!--@end-->
<div class="x_thumbnail" style="display:inline-block;text-align:{$_talign};margin-bottom:1em;width:{$_width}px;height:{$_height}px;margin-right:10px;">
<div class="x_thumbnail"|cond="$val->screenshot" style="display:inline-block;width:{$_width}px;margin-right:10px;">
<label for="colorset_{$key}">
<input type="radio" name="colorset" value="{$val->name}" id="colorset_{$key}" checked="checked"|cond="$skin_vars['colorset']->value==$val->name" />
{$val->title}
</label>
<block cond="$val->screenshot">
<img src="../../../{$val->screenshot}" alt="{$val->title}" />
</block>
<img src="../../../{$val->screenshot}" alt="{$val->title}" cond="$val->screenshot" />
</div>
</block>
</div>
@ -91,13 +87,13 @@
</block>
<div class="x_control-group">
<label class="x_control-label" for="{$val->name}">{$val->title}</label>
<label class="x_control-label" for="{$val->name}"|cond="$val->type!='text'&&$val->type!='textarea'" for="lang_{$val->name}"|cond="$val->type=='text'||$val->type=='textarea'">{$val->title}</label>
<div class="x_controls">
<!--// text -->
<input cond="$val->type == 'text'" type="text" name="{$val->name}" id="{$val->name}" value="{htmlspecialchars($val->value)}" class="lang_code" />
<input cond="$val->type == 'text'" type="text" name="{$val->name}" id="{$val->name}" value="<!--@if(strpos($val->value, '$user_lang->') === false)-->{$val->value}<!--@else-->{htmlspecialchars($val->value)}<!--@end-->" class="lang_code" />
<!--// textarea -->
<textarea cond="$val->type == 'textarea'" rows="8" cols="42" name="{$val->name}" id="{$val->name}" class="lang_code">{htmlspecialchars($val->value)}</textarea>
<textarea cond="$val->type == 'textarea'" rows="8" cols="42" name="{$val->name}" id="{$val->name}" class="lang_code"><!--@if(strpos($val->value, '$user_lang->') === false)-->{$val->value}<!--@else-->{htmlspecialchars($val->value)}<!--@end--></textarea>
<!--// select -->
<select cond="$val->type == 'select'" name="{$val->name}" id="{$val->name}">
@ -124,17 +120,15 @@
<input type="text" class="color-indicator" name="{$val->name}" id="{$val->name}" value="{$val->value}" />
<p id="categoy_color_help" hidden style="margin:8px 0 0 0">{$lang->about_category_color}</p>
</div>
<p class="x_help-inline" cond="$val->description">{nl2br(trim($val->description))}</p>
<a href="#about_{$val->name}" data-toggle class="x_icon-question-sign" cond="$val->description" style="vertical-align:top;margin-top:5px"|cond="$val->type == 'textarea'">{$lang->help}</a>
<p class="x_help-block" id="about_{$val->name}" hidden cond="$val->description">{nl2br(trim($val->description))}</p>
</div>
</div>
</block>
</section>
<!--@end-->
<div class="x_clearfix btnArea">
<div class="x_pull-right">
<button class="x_btn x_btn-primary" type="submit">{$lang->cmd_registration}</button>
</div>
<div class="btnArea">
<button class="x_btn x_btn-primary x_pull-right" type="submit">{$lang->cmd_registration}</button>
</div>
</form>
<!--@if($use_colorpicker)-->