Get("Site_Path");
$admin = $objConfig->Get("AdminDirectory");
if(!strlen($admin))
$admin = "admin";
$localURL=$rootURL."kernel/";
$adminURL = $rootURL.$admin;
$imagesURL = $adminURL."/images";
//$pathtolocal = $pathtoroot."in-news/";
require_once ($pathtoroot.$admin."/include/elements.php");
require_once ($pathtoroot."kernel/admin/include/navmenu.php");
//require_once ($pathtolocal."admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
require_once($pathtoroot.$admin."/listview/listview.php");
$section = "in-portal:category_maint";
$CatsPerLoad = 10;
$ado = GetADODBConnection();
if(!is_numeric($_GET["CatIndex"]))
{
unset($objEditItems);
$objEditItems = new clsCatList();
$objEditItems->SourceTable = $objSession->GetEditTable("Category");
$table = $objEditItems->SourceTable;
//echo "Dropping Table..
\n";
@$ado->Execute("DROP TABLE $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);
}
// init vars
if( !isset($NumCats) ) $NumCats = 0;
if( !isset($CatIndex) ) $CatIndex = 0;
if(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");
}
else
$title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories");
$sql = "SELECT * FROM $table ORDER BY ParentPath ASC LIMIT $CatIndex,$CatsPerLoad";
$start = getmicrotime();
//echo $sql."
\n";
$objCatList->Query_Item($sql);
//echo getmicrotime() - $start." QUERY ".$x."
\n";
$x = 0;
foreach($objCatList->Items as $cat)
{
// echo getmicrotime() - $start." START ".$x."
\n";
$cat->UpdateACL();
// echo getmicrotime() - $start." ACL ".$x."
\n";
$cat->UpdateCachedPath();
// echo getmicrotime() - $start." PATH ".$x."
\n";
$x++;
// echo "
\n";
// echo $cat->Get("ParentPath")."
\n";
// $cat->UpdateCacheCounts();
// $objSystemCache->PurgeCategory($cat->Get("CategoryId"));
}
int_header(NULL,NULL,$title);
?>
" onclick="javascript:goto_url('');" class="button"> | " onclick="javascript:goto_url('');" class="button"> |