Index: branches/5.2.x/core/install/install_toolkit.php =================================================================== diff -u -r14428 -r14628 --- branches/5.2.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 14428) +++ branches/5.2.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 14628) @@ -1,6 +1,6 @@ setToolkit($this); } @@ -702,8 +705,9 @@ { static $fields = null; - if (!isset($fields)) { + if ( !isset($fields) ) { $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + /* @var $ml_formatter kMultiLanguage */ $fields['name'] = $ml_formatter->LangFieldName('Name'); $fields['description'] = $ml_formatter->LangFieldName('Description'); @@ -722,12 +726,12 @@ $category_fields['ParentId'] = $this->Application->getBaseCategory(); - if (isset($category_template)) { + if ( isset($category_template) ) { $category_fields['Template'] = $category_template; $category_fields['CachedTemplate'] = $category_template; } - if (isset($category_icon)) { + if ( isset($category_icon) ) { $category_fields['UseMenuIconUrl'] = 1; $category_fields['MenuIconUrl'] = $category_icon; } @@ -784,7 +788,7 @@ $module_folder = strtolower($module_folder); $module_name = $module_folder; - if ($module_folder == 'kernel') { + if ( $module_folder == 'kernel' ) { $module_name = 'in-portal'; $module_folder = 'core'; } @@ -810,6 +814,8 @@ // create correct columns in CustomData table $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper'); + /* @var $ml_helper kMultiLanguageHelper */ + $ml_helper->createFields($prefix . '-cdata', true); } @@ -918,7 +924,7 @@ * Upgrades primary skin to the latest version * * @param Array $module_info - * @return string + * @return string|bool */ function upgradeSkin($module_info) { @@ -933,7 +939,7 @@ foreach ($matches as $index => $match) { $version_int = $this->ConvertModuleVersion($match[2][0]); - if ($version_int < $from_version_int) { + if ( $version_int < $from_version_int ) { // only process versions, that were released after currently used version continue; } @@ -949,7 +955,7 @@ ); } - if (!$versions) { + if ( !$versions ) { // not skin changes -> quit return true; } @@ -959,9 +965,9 @@ $primary_skin->Load(1, 'IsPrimary'); - if (!$primary_skin->isLoaded()) { + if ( !$primary_skin->isLoaded() ) { // we always got primary skin, but just in case - return ; + return false; } $temp_handler =& $this->Application->recallObject('skin_TempHandler', 'kTempTablesHandler'); @@ -970,15 +976,15 @@ // clone current skin $cloned_ids = $temp_handler->CloneItems('skin', '', Array ($primary_skin->GetID())); - if (!$cloned_ids) { + if ( !$cloned_ids ) { // can't clone - return ; + return false; } $skin =& $this->Application->recallObject('skin.tmp', null, Array ('skip_autoload' => true)); /* @var $skin kDBItem */ - $skin->Load( $cloned_ids[0] ); + $skin->Load($cloned_ids[0]); // save css to temp file (for patching) $skin_file = tempnam('/tmp', 'skin_css_'); @@ -1009,18 +1015,18 @@ $has_errors = false; foreach ($output as $version => $version_output) { - $version_errors = trim( preg_replace("/(^|\n)(patching file .*?|Hunk #.*?\.)(\n|$)/m", '', $version_output) ); + $version_errors = trim(preg_replace("/(^|\n)(patching file .*?|Hunk #.*?\.)(\n|$)/m", '', $version_output)); - if ($version_errors) { + if ( $version_errors ) { $has_errors = true; - $output[$version] = trim( preg_replace("/(^|\n)(patching file .*?)(\n|$)/m", '', $output[$version]) ); + $output[$version] = trim(preg_replace("/(^|\n)(patching file .*?)(\n|$)/m", '', $output[$version])); } else { unset($output[$version]); } } - if (!$has_errors) { + if ( !$has_errors ) { // copy patched css back to primary skin $primary_skin->SetDBField('CSS', $skin->GetDBField('CSS')); $primary_skin->Update();