Index: branches/unlabeled/unlabeled-1.8.2/core/units/categories/cache_updater.php =================================================================== diff -u -r7025 -r7057 --- branches/unlabeled/unlabeled-1.8.2/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 7025) +++ branches/unlabeled/unlabeled-1.8.2/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 7057) @@ -139,12 +139,17 @@ var $primaryLanguageId = 0; var $languageCount = 0; var $root_prefixes = Array(); + var $StrictPath = false; function Init($prefix, $special, $event_params = null) { parent::Init($prefix, $special, $event_params); $continuing = isset($event_params['continue']) ? $event_params['continue'] : 1; + $this->StrictPath = isset($event_params['strict_path']) ? $event_params['strict_path'] : false; + if ($this->StrictPath && !is_array($this->StrictPath)) { + $this->StrictPath = explode('|', trim($this->StrictPath, '|')); + } // cache widely used values to speed up process: begin $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper'); @@ -171,6 +176,9 @@ { $this->Stack =& new clsRecursionStack(); $sql = 'DELETE FROM '.TABLE_PREFIX.'PermCache'; + if ($this->StrictPath) { + $sql .= ' WHERE CategoryId IN ('.implode(',',$this->StrictPath).')'; + } $this->Conn->Query($sql); $this->initData(); } @@ -257,6 +265,13 @@ // if we have more children if (isset($data['children'][$data['current_child']])) { + if ($this->StrictPath) { + while ( isset($data['children'][ $data['current_child'] ]) && !in_array($data['children'][ $data['current_child'] ], $this->StrictPath) ) { + $data['current_child']++; + continue; + } + if (!isset($data['children'][ $data['current_child'] ])) return false; //error + } $next_data = Array(); $next_data['titles'] = $data['titles']; $next_data['parent_path'] = $data['parent_path']; @@ -368,12 +383,12 @@ } } } - + /** * Rebuild all cache in one step * */ - function OneStepRun() + function OneStepRun($path='') { $needs_more = true; while ($needs_more) {