Index: trunk/admin/category/category_maint.php
===================================================================
diff -u -r563 -r565
--- trunk/admin/category/category_maint.php (.../category_maint.php) (revision 563)
+++ trunk/admin/category/category_maint.php (.../category_maint.php) (revision 565)
@@ -1,19 +1,19 @@
-GetVariable('PermCache_UpdateRequired'))
+ die(header('Location: '.$adminURL.'/'.$objSession->GetVariable('ReturnScript').'?env='.BuildEnv()));
- $objEditItems = new clsCatList();
- $objEditItems->SourceTable = $objSession->GetEditTable("Category");
- $table = $objEditItems->SourceTable;
- //echo "Dropping Table..
\n";
- @$ado->Execute("DROP TABLE IF EXISTS $table");
- if($objCatList->CurrentCategoryID()>0)
- {
- $c = $objCatList->GetItem($objCatList->CurrentCategoryID());
- $path = $c->Get("ParentPath");
- $sql = "SELECT CategoryId,ParentPath FROM ".$objCatList->SourceTable." WHERE ParentPath LIKE '".$path."%'";
- $ado->Execute("CREATE TABLE $table ".$sql);
- }
- else
- {
- $sql = "SELECT CategoryId,ParentPath FROM ".$objCatList->SourceTable;
- $objEditTable->SourceTable = $objCatList->SourceTable;
- $table = $objCatList->SourceTable;
- }
- $NumCats = TableCount($table,"",0);
-
- $title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories");
- int_header(NULL,NULL,$title);
- flush();
+if (isset($_GET['continue'])) {
+ $updater =& new clsCacheUpdater(1);
}
-elseif( is_numeric($_GET["CatIndex"]) )
-{
- $NumCats = $_REQUEST['NumCats'];
- $CatIndex = (int)$_REQUEST['CatIndex'];
- $table = ($objCatList->CurrentCategoryID() > 0) ? $objSession->GetEditTable("Category") : $objCatList->SourceTable;
- //echo $NumCats." Loaded
\n";
- $title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories");
- $title .= " $CatIndex / $NumCats ".prompt_language("la_Text_complete");
- int_header(NULL,NULL,$title);
- flush();
-
- $sql = "SELECT * FROM $table ORDER BY ParentPath ASC LIMIT $CatIndex,$CatsPerLoad";
-
- $objCatList->Query_Item($sql);
- foreach($objCatList->Items as $cat)
- {
- $cat->UpdateACL();
- $cat->UpdateCachedPath();
- }
+else {
+ $updater =& new clsCacheUpdater();
}
+
+$title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories");
+$title .= " $CatIndex / $NumCats ".prompt_language("la_Text_complete");
+int_header(NULL,NULL,$title);
+flush();
+$percent=$updater->getDonePercent();
+echo '
';
+if ($percent == 0)
+ echo ''.$percent.'% |
';
+else if ($percent < 60)
+ echo ' | '.$percent.'% |
';
+else if ($percent == 100)
+ echo ''.$percent.'% | ';
else
-{
- $title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories");
- int_header(NULL,NULL,$title);
- flush();
-}
+ echo '
'.$percent.'% | |
';
+echo '
';
+flush();
-$no_url = $adminURL.'/'.$objSession->GetVariable('ReturnScript').'?env='.BuildEnv();
-$yes_url = $_SERVER['PHP_SELF'].'?env='.BuildEnv().'&CatIndex=0&NumCats='.$NumCats;
-$cat_update = $objSession->GetVariable('PermCache_UpdateRequired');
-
-
-?>
-
-setData();
+ $url=$adminURL.'/category/category_maint.php?env='.BuildEnv().'&continue=1';
}
+else
+{
+ $updater->clearData();
+ $url = $adminURL.'/'.$objSession->GetVariable('ReturnScript').'?env='.BuildEnv();
+ $objSession->SetVariable('PermCache_UpdateRequired', 0);
+}
+print "";
+int_footer();
+exit;
?>
-
-";
- echo "$percent";
- echo "% | ";
- }
- else if ($percent < 60)
- {
- echo "";
- $row2 = 100-$percent;
- echo " | $percent";
- echo "% |
";
- }
- else if ($percent == 100)
- {
- echo "$percent% | ";
- }
- else
- {
- echo "
$percent%";
- $row2 = 100-$percent;
- echo " | |
";
- }
- }
- flush();
-?>
-
-$NumCats)
- {
- $objSession->SetVariable('PermCache_UpdateRequired', 0);
- $target = $adminURL."/".$objSession->GetVariable('ReturnScript').'?env='.BuildEnv();
- }
- else
- {
- $next = $CatIndex+$CatsPerLoad;
- if($next > $NumCats)
- {
- $objSession->SetVariable('PermCache_UpdateRequired', 0);
- $target = $adminURL."/".$objSession->GetVariable('ReturnScript').'?env='.BuildEnv();
- }
- else
- $target = $_SERVER["PHP_SELF"]."?env=".BuildEnv()."&CatIndex=".$next."&NumCats=$NumCats";
- }
-
- //print "$target";
-
- print "";
-?>
-