issue 92 add Theme skin info

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8650 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
devjin 2011-07-26 09:31:37 +00:00
parent bfef639efd
commit 24ee496a42
3 changed files with 23 additions and 3 deletions

View file

@ -10,8 +10,21 @@ class HTMLDisplayHandler {
$oTemplate = &TemplateHandler::getInstance(); $oTemplate = &TemplateHandler::getInstance();
// compile module tpl // compile module tpl
if ($oModule->module_info->module == $oModule->module)
$skin = $oModule->origin_module_info->skin;
else
$skin = $oModule->module_config->skin;
if ($skin){
$theme_skin = explode('.', $skin);
if (count($theme_skin) == 2)
$template_path = sprintf('./themes/%s/modules/%s/', $theme_skin[0], $theme_skin[1]);
else
$template_path = $oModule->getTemplatePath();
}else
$template_path = $oModule->getTemplatePath(); $template_path = $oModule->getTemplatePath();
$tpl_file = $oModule->getTemplateFile(); $tpl_file = $oModule->getTemplateFile();
$output = $oTemplate->compile($template_path, $tpl_file); $output = $oTemplate->compile($template_path, $tpl_file);
// add #xeAdmin div for adminitration pages // add #xeAdmin div for adminitration pages

View file

@ -158,6 +158,8 @@
* @return executed module instance * @return executed module instance
**/ **/
function procModule() { function procModule() {
$oModuleModel = &getModel('module');
// If error occurred while preparation, return a message instance // If error occurred while preparation, return a message instance
if($this->error) { if($this->error) {
$type = Mobile::isFromMobilePhone() ? 'mobile' : 'view'; $type = Mobile::isFromMobilePhone() ? 'mobile' : 'view';
@ -168,8 +170,6 @@
return $oMessageObject; return $oMessageObject;
} }
$oModuleModel = &getModel('module');
// Get action information with conf/action.xml // Get action information with conf/action.xml
$xml_info = $oModuleModel->getModuleActionXml($this->module); $xml_info = $oModuleModel->getModuleActionXml($this->module);

View file

@ -11,6 +11,7 @@
var $module = NULL; ///< Class name of Xe Module that is identified by mid var $module = NULL; ///< Class name of Xe Module that is identified by mid
var $module_srl = NULL; ///< integer value to represent a run-time instance of Module (XE Module) var $module_srl = NULL; ///< integer value to represent a run-time instance of Module (XE Module)
var $module_info = NULL; ///< an object containing the module information var $module_info = NULL; ///< an object containing the module information
var $origin_module_info = NULL;
var $xml_info = NULL; ///< an object containing the module description extracted from XML file var $xml_info = NULL; ///< an object containing the module description extracted from XML file
var $module_path = NULL; ///< a path to directory where module source code resides var $module_path = NULL; ///< a path to directory where module source code resides
@ -26,6 +27,8 @@
var $stop_proc = false; ///< a flag to indicating whether to stop the execution of code. var $stop_proc = false; ///< a flag to indicating whether to stop the execution of code.
var $module_config = NULL;
/** /**
* @brief setter to set the name of module * @brief setter to set the name of module
* @param name of module * @param name of module
@ -116,6 +119,7 @@
$this->mid = $module_info->mid; $this->mid = $module_info->mid;
$this->module_srl = $module_info->module_srl; $this->module_srl = $module_info->module_srl;
$this->module_info = $module_info; $this->module_info = $module_info;
$this->origin_module_info = $module_info;
$this->xml_info = $xml_info; $this->xml_info = $xml_info;
$this->skin_vars = $module_info->skin_vars; $this->skin_vars = $module_info->skin_vars;
// validate certificate info and permission settings necessary in Web-services // validate certificate info and permission settings necessary in Web-services
@ -156,8 +160,11 @@
} }
// permission variable settings // permission variable settings
$this->grant = $grant; $this->grant = $grant;
Context::set('grant', $grant); Context::set('grant', $grant);
$this->module_config = $oModuleModel->getModuleConfig($this->module, $module_info->site_srl);
if(method_exists($this, 'init')) $this->init(); if(method_exists($this, 'init')) $this->init();
} }