Index: branches/5.2.x/core/units/helpers/themes_helper.php =================================================================== diff -u -N -r14244 -r14628 --- branches/5.2.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 14244) +++ branches/5.2.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 14628) @@ -1,6 +1,6 @@ Application->ModuleInfo; } else { @@ -162,13 +163,13 @@ /* @var $language_import_helper LanguageImportHelper */ foreach ($modules as $module_name => $module_info) { - if ($module_name == 'In-Portal') { + if ( $module_name == 'In-Portal' ) { continue; } $lang_file = $theme_path . '/' . $module_info['TemplatePath'] . '_install/english.lang'; - if (file_exists($lang_file)) { + if ( file_exists($lang_file) ) { $language_import_helper->performImport($lang_file, '|0|', '', LANG_SKIP_EXISTING); } } @@ -179,26 +180,28 @@ * * @param int $theme_id * @param string $theme_path + * @return Array + * @access protected */ - function getTemplateAliases($theme_id, $theme_path) + protected function getTemplateAliases($theme_id, $theme_path) { $template_aliases = Array (); $xml_parser =& $this->Application->recallObject('kXMLHelper'); /* @var $xml_parser kXMLHelper */ foreach ($this->Application->ModuleInfo as $module_name => $module_info) { - if ($module_name == 'In-Portal') { + if ( $module_name == 'In-Portal' ) { continue; } $xml_file = $theme_path . '/' . $module_info['TemplatePath'] . '_install/theme.xml'; - if (file_exists($xml_file)) { + if ( file_exists($xml_file) ) { $xml_data = file_get_contents($xml_file); $root_node =& $xml_parser->Parse($xml_data); - if (!is_object($root_node) || !is_a($root_node, 'kXMLNode') || !$root_node->Children) { + if ( !is_object($root_node) || !is_a($root_node, 'kXMLNode') || !$root_node->Children ) { // broken xml OR no aliases defined continue; } @@ -207,22 +210,20 @@ do { $template_path = trim($current_node->Data); - $alias = '#' . $module_info['TemplatePath'] . strtolower($current_node->Name). '#'; + $alias = '#' . $module_info['TemplatePath'] . strtolower($current_node->Name) . '#'; // remember alias in global theme mapping $template_aliases[$alias] = $template_path; // store alias in theme file record to use later in design dropdown - $t_parts = Array ( - 'path' => dirname($template_path) == '.' ? '' : '/' . dirname($template_path), - 'file' => basename($template_path), - ); + $t_parts = Array ('path' => dirname($template_path) == '.' ? '' + : '/' . dirname($template_path), 'file' => basename($template_path),); $sql = 'UPDATE ' . TABLE_PREFIX . 'ThemeFiles SET TemplateAlias = ' . $this->Conn->qstr($alias) . ' WHERE (ThemeId = ' . $theme_id . ') AND (FilePath = ' . $this->Conn->qstr($t_parts['path']) . ') AND (FileName = ' . $this->Conn->qstr($t_parts['file'] . '.tpl') . ')'; $this->Conn->Query($sql); - } while (($current_node =& $current_node->NextSibling())); + } while ( ($current_node =& $current_node->NextSibling()) ); } }