Index: branches/5.2.x/core/units/helpers/list_helper.php =================================================================== diff -u -N -r14646 -r14699 --- branches/5.2.x/core/units/helpers/list_helper.php (.../list_helper.php) (revision 14646) +++ branches/5.2.x/core/units/helpers/list_helper.php (.../list_helper.php) (revision 14699) @@ -117,7 +117,9 @@ $sorting_prefix = getArrayValue($list_sortings, $list->Special) ? $list->Special : ''; $user_sorting_start = 0; - if ( $forced_sorting = getArrayValue($list_sortings, $sorting_prefix, 'ForcedSorting') ) { + $forced_sorting = getArrayValue($list_sortings, $sorting_prefix, 'ForcedSorting'); + + if ( $forced_sorting ) { $user_sorting_start = count($forced_sorting); } @@ -130,6 +132,7 @@ * @param kDBItem $object * @param string $list_prefix * @param bool $next + * @param string $select_fields * @return int */ function getNavigationResource(&$object, $list_prefix, $next = true, $select_fields = null) Index: branches/5.2.x/core/units/modules/modules_event_handler.php =================================================================== diff -u -N -r14602 -r14699 --- branches/5.2.x/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 14602) +++ branches/5.2.x/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 14699) @@ -1,6 +1,6 @@ getObject(); /* @var $object kDBList */ - + if ($event->Special) { $object->addFilter('current_module', '%1$s.Name = '.$event->Special); } @@ -130,7 +130,11 @@ { parent::OnAfterListQuery($event); - $new_modules = $this->_getNewModules(); + $modules_helper =& $this->Application->recallObject('ModulesHelper'); + /* @var $modules_helper kModulesHelper */ + + $new_modules = $modules_helper->getModules(kModulesHelper::NOT_INSTALLED); + if (!$new_modules || $this->Application->RecallVar('user_id') != USER_ROOT) { return ; } @@ -154,48 +158,4 @@ $object->addRecord($module_record); } } - - /** - * Returns list of modules, that are not installed, but available in file system - * - * @return Array - */ - function _getNewModules() - { - $modules_helper =& $this->Application->recallObject('ModulesHelper'); - /* @var $modules_helper kModulesHelper */ - - $modules = Array (); - if ($dir = @opendir(MODULES_PATH)) { - while (($file = readdir($dir)) !== false) { - if ($file != '.' && $file != '..') { - $module_folder = MODULES_PATH . '/' . $file; - if (is_dir($module_folder) && $this->_isModule($module_folder)) { - // this is module -> check if it's installed already - if (!$modules_helper->moduleInstalled($file)) { - $install_order = trim( file_get_contents($module_folder . '/install/install_order.txt') ); - $modules[$install_order] = $file; - } - } - } - } - - closedir($dir); - } - - // allows to control module install order - ksort($modules, SORT_NUMERIC); - return $modules; - } - - /** - * Checks, that given folder is module root folder - * - * @param string $folder - * @return bool - */ - function _isModule($folder) - { - return file_exists($folder . '/install.php') && file_exists($folder . '/install/install_schema.sql'); - } } \ No newline at end of file Index: branches/5.2.x/core/kernel/session/session_storage.php =================================================================== diff -u -N -r14628 -r14699 --- branches/5.2.x/core/kernel/session/session_storage.php (.../session_storage.php) (revision 14628) +++ branches/5.2.x/core/kernel/session/session_storage.php (.../session_storage.php) (revision 14699) @@ -1,7 +1,7 @@ _getStylesheetPath() . DIRECTORY_SEPARATOR); - while (false !== ($file = $dh->read())) { - if ( preg_match('/admin-(.*)-([\d]+).css/', $file, $rets) ) { - if ($rets[1] == $style_name && $rets[2] > $last_compiled) { - $last_compiled = $rets[2]; - } + $iterator = new DirectoryIterator( $this->_getStylesheetPath() . DIRECTORY_SEPARATOR ); + /* @var $file_info DirectoryIterator */ + + foreach ($iterator as $file_info) { + if ( !$file_info->isFile() ) { + continue; } - } - $dh->close(); + $regs = $this->isSkinFile( $file_info->getFilename() ); + if ( $regs && $regs[1] == $style_name && $regs[2] > $last_compiled ) { + $last_compiled = max($last_compiled, $regs[2]); + } + } + return $last_compiled; } @@ -222,14 +231,29 @@ */ function deleteCompiled() { - $dh = dir($this->_getStylesheetPath() . DIRECTORY_SEPARATOR); + $iterator = new DirectoryIterator( $this->_getStylesheetPath() . DIRECTORY_SEPARATOR ); + /* @var $file_info DirectoryIterator */ - while (false !== ($file = $dh->read())) { - if ( preg_match('/admin-(.*)-([\d]+).css/', $file, $rets) ) { - unlink($dh->path . $file); + foreach ($iterator as $file_info) { + if ( $file_info->isFile() && $this->isSkinFile( $file_info->getFilename() ) ) { + unlink( $file_info->getPathname() ); } } + } - $dh->close(); + /** + * Determines if given file is admin skin file + * + * @param string $filename + * @return array|bool + * @access protected + */ + protected function isSkinFile($filename) + { + if ( preg_match(self::SKIN_REGEXP, $filename, $regs) ) { + return $regs; + } + + return false; } } \ No newline at end of file Index: branches/5.2.x/core/kernel/managers/url_manager.php =================================================================== diff -u -N -r14653 -r14699 --- branches/5.2.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 14653) +++ branches/5.2.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 14699) @@ -1,6 +1,6 @@ Application->recallObject('HTTPQuery'); /* @var $http_query kHTTPQuery */ - + $get_sid = getArrayValue($http_query->Get, $this->GETName); } @@ -1022,12 +1022,13 @@ /** * Deletes given sessions * - * @return Array - * @access private + * @param $session_ids + * @param int $delete_reason + * @return void */ function DeleteSessions($session_ids, $delete_reason = SESSION_LOG_EXPIRED) { - return $this->Storage->DeleteSessions($session_ids, $delete_reason); + $this->Storage->DeleteSessions($session_ids, $delete_reason); } /** Index: branches/5.2.x/core/install/prerequisites.php =================================================================== diff -u -N -r14244 -r14699 --- branches/5.2.x/core/install/prerequisites.php (.../prerequisites.php) (revision 14244) +++ branches/5.2.x/core/install/prerequisites.php (.../prerequisites.php) (revision 14699) @@ -1,6 +1,6 @@ Application->recallObject('FCKHelper'); /* @var $fck_helper fckFCKHelper */ $default_folders = defined('FCK_DEFAULT_FOLDERS') ? FCK_DEFAULT_FOLDERS : Array ('Files', 'Images', 'Flash', 'Media', 'Documents'); foreach ($default_folders as $index => $folder) { - if (!$fck_helper->CreateFolder($folder)) { + if ( !$fck_helper->CreateFolder($folder) ) { unset($default_folders[$index]); } } - if (!$default_folders) { + if ( !$default_folders ) { return ''; } $ret = ''; foreach ($default_folders as $folder) { $selected = ($this->Application->GetVar('type') == $folder) ? 'selected' : ''; - $ret.= '