Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F773090
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Feb 2, 1:03 AM
Size
8 KB
Mime Type
text/x-diff
Expires
Tue, Feb 4, 1:03 AM (1 d, 12 h)
Engine
blob
Format
Raw Data
Handle
556351
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/admin/category/category_maint.php
===================================================================
--- trunk/admin/category/category_maint.php (revision 377)
+++ trunk/admin/category/category_maint.php (revision 378)
@@ -1,246 +1,245 @@
<?php
##############################################################
##In-portal ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law. ##
##############################################################
if(!strlen($pathtoroot))
{
$path = dirname(realpath($_SERVER['SCRIPT_FILENAME']));
if( strlen($path) )
{
// determine the OS type for path parsing
$pos = strpos($path, ':');
$gOS_TYPE = ($pos === false) ? 'unix' : 'win';
$pathchar = ($gOS_TYPE == 'unix') ? '/' : "\\";
$p = $path.$pathchar;
// Start looking for the root flag file
while( !strlen($pathtoroot) && strlen($p) )
{
$sub = substr($p, strlen($pathchar) * -1);
$filename = $p.( ($sub == $pathchar) ? '' : $pathchar).'root.flg';
if( !file_exists($filename) )
{
$parent = realpath($p.$pathchar."..".$pathchar);
$p = ($parent != $p) ? $parent : '';
}
else
$pathtoroot = $p;
}
if( !strlen($pathtoroot) ) $pathtoroot = '.'.$pathchar;
}
else
$pathtoroot = '.'.$pathchar;
}
$sub = substr($pathtoroot,strlen($pathchar)*-1);
if( $sub != $pathchar) $pathtoroot = $pathtoroot.$pathchar;
//echo $pathtoroot;
//$FrontEnd=2;
require_once($pathtoroot."kernel/startup.php");
//admin only util
$rootURL="http://".ThisDomain().$objConfig->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";
-//echo "In MaintScript<br>";
-//flush();
-//die();
-
$CatsPerLoad = 10;
$ado = GetADODBConnection();
-
// init vars
if( !isset($NumCats) ) $NumCats = 0;
if( !isset($CatIndex) ) $CatIndex = 0;
-if( !is_numeric($_GET["CatIndex"]) )
+if( !is_numeric( GetVar('CatIndex') ) )
{
unset($objEditItems);
$objEditItems = new clsCatList();
$objEditItems->SourceTable = $objSession->GetEditTable("Category");
$table = $objEditItems->SourceTable;
//echo "Dropping Table..<br>\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();
}
elseif( is_numeric($_GET["CatIndex"]) )
{
$NumCats = $_REQUEST['NumCats'];
$CatIndex = (int)$_REQUEST['CatIndex'];
$table = ($objCatList->CurrentCategoryID() > 0) ? $objSession->GetEditTable("Category") : $objCatList->SourceTable;
//echo $NumCats." Loaded <br>\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
{
$title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories");
int_header(NULL,NULL,$title);
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');
?>
<TABLE cellspacing="0" cellpadding="2" width="100%" border="0" class="tableborder">
<script language="javascript">
function goto_url(url)
{
document.location = url;
}
<?php if( !$cat_update )
{
$objSession->SetVariable('PermCache_UpdateRequired', 0);
echo "goto_url('$no_url');\n";
}
?>
</script>
<?php
-if(!is_numeric($_GET["CatIndex"]) && $NumCats > $CatsPerLoad)
+if(!is_numeric( GetVar('CatIndex') ) && $NumCats > $CatsPerLoad)
{
int_subsection_title(prompt_language("la_confirm_maintenance"));
?>
<tr>
<td align="center" colspan="3" bgcolor="#FFFFFF"><?php echo prompt_language("la_prompt_perform_now"); ?></td>
</tr>
<tr>
<td align="right" width="50%">
<input type="button" name="yes_btn" value="<?php echo admin_language("lu_yes"); ?>" onclick="javascript:goto_url('<?php echo $yes_url; ?>');" class="button">
</td>
<td><img src="<?php echo $imagesURL; ?>/spacer.gif" width="10"></td>
<td align="left" width="50%">
<input type="button" name="yes_btn" value="<?php echo admin_language("lu_no"); ?>" onclick="javascript:goto_url('<?php echo $no_url; ?>');" class="button">
</td>
</tr>
</table>
<?php
int_footer();
die();
}
?>
<?php int_subsection_title(""); ?>
<?php
if($NumCats==0)
{
$percent=100;
}
else
{
$percent = (int)(($CatIndex/$NumCats) * 100);
}
if(is_numeric($_GET["CatIndex"]))
{
if ($percent == 0)
{
echo "<TR>";
echo "<TD BGCOLOR=\"#FFFFFF\" width=\"100%\" >$percent";
echo "%</td></TR>";
}
else if ($percent < 60)
{
echo "<TR><TD BGCOLOR=\"#4682B2\" width=\"".$percent."%\" >";
$row2 = 100-$percent;
echo "</td> <TD BGCOLOR=\"#FFFFFF\" width=\"".$row2."%\" > $percent";
echo "%</td></TR>";
}
else if ($percent == 100)
{
echo "<TR><TD BGCOLOR=\"#4682B2\" align=\"right\" width=\"100%\" ><FONT COLOR=\"#FFFFFF\">$percent%</FONT></td>";
}
else
{
echo "<TR><TD BGCOLOR=\"#4682B2\" align=\"right\" width=\"".$percent."%\" ><FONT COLOR=\"#FFFFFF\">$percent%</FONT>";
$row2 = 100-$percent;
echo "</td> <TD BGCOLOR=\"#FFFFFF\" width=\"".$row2."%\" ></td></TR>";
}
}
flush();
?>
</TABLE>
<?php
if($CatIndex+1 >$NumCats)
{
$objSession->SetVariable('PermCache_UpdateRequired', 0);
- $target = $adminURL."/".$objSession->GetVariable('ReturnScript').'?env='.BuildEnv(); //$adminURL."/browse.php?env=".BuildEnv();
+ $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(); //$adminURL."/browse.php?env=".BuildEnv();
+ $target = $adminURL."/".$objSession->GetVariable('ReturnScript').'?env='.BuildEnv();
}
else
$target = $_SERVER["PHP_SELF"]."?env=".BuildEnv()."&CatIndex=".$next."&NumCats=$NumCats";
}
//print "<A HREF=\"$target\">$target</A>";
print "<script language=\"javascript\">" ;
print "setTimeout(\"document.location='$target';\",40);";
print " </script>";
?>
<?php int_footer(); ?>
Property changes on: trunk/admin/category/category_maint.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.7
\ No newline at end of property
Event Timeline
Log In to Comment