Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sat, Feb 1, 6:54 PM

in-portal

Index: trunk/kernel/include/custommetadata.php
===================================================================
--- trunk/kernel/include/custommetadata.php (revision 128)
+++ trunk/kernel/include/custommetadata.php (revision 129)
@@ -1,273 +1,272 @@
<?php
class clsCustomMetaData extends clsItem
{
// var $m_CustomDataId;
// var $m_ResourceId;
// var $m_CustomFieldId;
// var $m_Value;
var $FieldName;
function clsCustomMetaData($CustomDataId=-1,$table="CustomMetaData")
{
$this->clsItem();
$this->tablename=GetTablePrefix()."CustomMetaData";
$this->type=12;
$this->BasePermission="";
$this->id_field = "CustomDataId";
$this->NoResourceId=1; //set this to avoid using a resource ID
if(isset($CustomDataId))
$this->LoadFromDatabase($CustomDataId);
}
function Validate()
{
global $Errors;
$dataValid = true;
if(!strlen($this->Get("ResourceId")))
{
$Errors->AddError("error.fieldIsRequired",'ResourceId',"","",get_class($this),"Validate");
$dataValid = false;
}
return $dataValid;
}
function SetFieldName($name)
{
$this->FieldName = $name;
}
function GetFieldName()
{
return $this->FieldName;
}
function Save()
{
if(is_numeric($this->Get("CustomDataId")))
{
$this->Update();
}
else
$this->Create();
}
/*
function LoadFromDatabase($Id)
{
global $objSession, $Errors;
if(!isset($Id))
{
$Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromDatabase");
return false;
}
$sql = sprintf("SELECT * FROM ".$this->SourceTable." WHERE CustomDataId = '%s'",$Id);
$result = $this->adodbConnection->Execute($sql);
if ($result === false)
{
$Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase");
return false;
}
$data = $result->fields;
$this->SetFromArray($data);
$this->Clean();
return true;
}
*/
} /*clsCustomMetaData*/
class clsCustomDataList extends clsItemCollection
{
function clsCustomDataList($table="")
{
$this->clsItemCollection();
$this->classname = "clsCustomMetaData";
if(!strlen($table))
$table = GetTablePrefix()."CustomMetaData";
$this->SetTable('live', $table);
}
function LoadResource($ResourceId)
{
$sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=".$ResourceId;
$this->Query_Item($sql);
return $this->Items;
}
function DeleteResource($ResourceId)
{
$sql = "DELETE FROM ".$this->SourceTable." WHERE ResourceID=".$ResourceId;
$this->adodbConnection->Execute($ResourceId);
}
function &SetFieldValue($FieldId,$ResourceId,$Value)
{
// so strange construction used, because in normal
// way it doesn't work at all (gets item copy not
// pointer)
$index = $this->GetDataItem($FieldId, true);
if($index !== false)
$d =& $this->Items[$index];
else
$d = null;
if(is_object($d))
{
$d->Set("Value",$Value);
if(!strlen($Value))
{
for($x=0;$x<count($this->Items);$x++)
{
if($this->Items[$x]->Get("CustomFieldId")==$FieldId &&
$this->Items[$x]->Get("ResourceId")==$ResourceId)
{
$this->Items[$x]->Set("CustomFieldId",0);
break;
}
}
$d->Delete();
}
}
else
{
if(strlen($Value)>0)
{
$d = new clsCustomMetaData();
$d->Set("CustomFieldId",$FieldId);
$d->Set("ResourceId",$ResourceId);
$d->Set("Value",$Value);
array_push($this->Items,$d);
}
}
- $this->ShowItems();
return $d;
}
function &GetDataItem($id, $return_index = false)
{
// $id - custom field id to find
// $return_index - return index to items, not her.
$found = false;
$index = false;
for($i = 0; $i < $this->NumItems(); $i++)
{
$d =& $this->GetItemRefByIndex($i);
if($d->Get("CustomFieldId")==$id)
{
$found=TRUE;
break;
}
}
return $found ? ($return_index ? $i : $d) : false;
}
function SaveData()
{
foreach($this->Items as $f)
{
$FieldId = $f->Get("CustomFieldId");
$value = $f->Get("Value");
$ResId = $f->Get("ResourceId");
$DataId = $f->Get("CustomDataId");
if(is_numeric($DataId))
{
$sql = "UPDATE ".$this->SourceTable." SET Value='".$value."' WHERE CustomFieldId='$FieldId' AND ResourceId='$ResId'";
$this->adodbConnection->Execute($sql);
}
else
{
if($FieldId>0)
{
$sql = "INSERT INTO ".$this->SourceTable." (ResourceId,CustomFieldId,Value) VALUES ('".$ResId."','$FieldId','$value')";
$this->adodbConnection->Execute($sql);
}
}
}
$rs = $this->adodbConnection->Execute("SELECT * FROM ".$this->SourceTable." WHERE CustomDataId=0 ");
while($rs && !$rs->EOF)
{
$m = $this->adodbConnection->Execute("SELECT MIN(CustomDataId) as MinValue FROM ".$this->SourceTable);
$NewId = $m->fields["MinValue"]-1;
$sql = "UPDATE ".$this->SourceTable." SET CustomDataId=$NewId WHERE ResourceId=".$rs->fields["ResourceId"]." AND ";
$sql .= "CustomFieldId=".$rs->fields["CustomFieldId"];
$this->adodbConnection->Execute($sql);
$rs->MoveNext();
}
}
function CopyToEditTable($idfield, $idlist)
{
global $objSession;
$edit_table = $objSession->GetEditTable($this->SourceTable);
@$this->adodbConnection->Execute("DROP TABLE $edit_table");
if(is_array($idlist))
{
$list = implode(",",$idlist);
}
else
$list = $idlist;
$query = "SELECT * FROM ".$this->SourceTable." WHERE $idfield IN ($list)";
$insert = "CREATE TABLE ".$edit_table." ".$query;
if((int)$GLOBALS["debuglevel"])
echo $insert;
$this->adodbConnection->Execute($insert);
$this->SourceTable = $edit_table;
$this->SaveData();
}
function CopyFromEditTable($ResourceId)
{
global $objSession;
$edit_table = $objSession->GetEditTable($this->SourceTable);
$idlist = array();
//$this->adodbConnection->Execute($sql);
$sql = "SELECT * FROM $edit_table";
$this->Clear();
$rs = $this->adodbConnection->Execute($sql);
while($rs && !$rs->EOF)
{
$data = $rs->fields;
$c = $this->AddItemFromArray($data);
if(strlen($data["Value"])>0)
{
$c->Dirty();
if($data["CustomDataId"]>0)
{
$c->Update();
}
else
{
$c->UnsetIdField();
$c->Create();
}
$idlist[] = $c->Get("CustomDataId");
}
else
{
$sql = "DELETE FROM ".$this->SourceTable." WHERE ResourceId=".$data["ResourceId"]." AND CustomFieldId=".$data["CustomFieldId"];
//echo $sql."<br>\n";
$this->adodbConnection->Execute($sql);
}
$rs->MoveNext();
}
@$this->adodbConnection->Execute("DROP TABLE $edit_table");
}
} /* clsCustomDataList */
?>
Property changes on: trunk/kernel/include/custommetadata.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/kernel/admin/include/toolbar/advanced_view.php
===================================================================
--- trunk/kernel/admin/include/toolbar/advanced_view.php (revision 128)
+++ trunk/kernel/admin/include/toolbar/advanced_view.php (revision 129)
@@ -1,431 +1,435 @@
<?php
global $objConfig,$objSections,$section, $rootURL,$adminURL, $admin, $imagesURL,$envar,
$m_var_list_update,$objCatList, $homeURL, $upURL, $objSession,$DefaultTab;
global $CategoryFilter,$TotalItemCount;
global $Bit_All,$Bit_Pending,$Bit_Disabled,$Bit_New,$Bit_Pop,$Bit_Hot,$Bit_Ed;
//global $hideSelectAll;
if(strlen($DefaultTab))
{
$m_tab_Categories_hide = ($DefaultTab=="category") ? 0 : 1;
}
/* bit place holders for category view menu */
$Bit_Active=64;
$Bit_Pending=32;
$Bit_Disabled=16;
$Bit_New=8;
$Bit_Pop=4;
$Bit_Hot=2;
$Bit_Ed=1;
+
+if( isset($_GET['SetTab']) ) $DefaultTab = $_GET["SetTab"];
+
+
// category list filtering stuff: begin
$CategoryView = $objConfig->Get("Category_View");
if(!is_numeric($CategoryView))
{
$CategoryView = 127;
}
$Category_Sortfield = $objConfig->Get("Category_Sortfield");
if( !strlen($Category_Sortfield) ) $Category_Sortfield = "Name";
$Category_Sortorder = $objConfig->Get("Category_Sortorder");
if( !strlen($Category_Sortorder) ) $Category_Sortorder = "desc";
$Perpage_Category = (int)$objConfig->Get("Perpage_Category");
if(!$Perpage_Category)
$Perpage_Category="'all'";
if($CategoryView == 127)
{
$Category_ShowAll = 1;
}
else
{
$Category_ShowAll = 0;
// FILTERING CODE V. 1.1
$where_clauses = Array();
//Group #1: Category Statuses (active,pending,disabled)
$Status = array(-1);
if($CategoryView & $Bit_Pending) $Status[] = STATUS_PENDING;
if($CategoryView & $Bit_Active) $Status[] = STATUS_ACTIVE;
if($CategoryView & $Bit_Disabled) $Status[] = STATUS_DISABLED;
if( count($Status) ) $where_clauses[] = 'Status IN ('.implode(',', $Status).')';
//Group #2: Category Statistics (new,pick)
$Status = array();
if(!($CategoryView & $Bit_New))
{
$cutoff = adodb_date("U") - ($objConfig->Get("Category_DaysNew") * 86400);
if($cutoff > 0) $q = 'CreatedOn > '.$cutoff;
$q .= (!empty($q) ? ' OR ' : '').'NewItem = 1';
$Status[] = "NOT ($q)";
}
if(!($CategoryView & $Bit_Ed)) $Status[] = 'NOT (EditorsPick = 1)';
if( count($Status) )
$where_clauses[] = '('.implode(') AND (', $Status).')';
$CategoryFilter = count($where_clauses) ? '('.implode(') AND (', $where_clauses).')' : '';
}
// category list filtering stuff: end
$OrderBy = $objCatList->QueryOrderByClause(TRUE,TRUE,TRUE);
$objCatList->Clear();
$IsSearch = FALSE;
$list = $objSession->GetVariable("m_adv_view_search");
$SearchQuery = $objCatList->AdminSearchWhereClause($list);
if(strlen($SearchQuery))
{
$SearchQuery = " (".$SearchQuery.")".($CategoryFilter ? 'AND ('.$CategoryFilter.')' : '');
$objCatList->LoadCategories($SearchQuery,$OrderBy);
$IsSearch = TRUE;
}
else
$objCatList->LoadCategories($CategoryFilter,$OrderBy);
$TotalItemCount += $objCatList->QueryItemCount;
$CatTotal = TableCount($objCatList->SourceTable,null,false);
$mnuClearSearch = language("la_SearchMenu_Clear");
$mnuNewSearch = language("la_SearchMenu_New");
$mnuSearchCategory = language("la_SearchMenu_Categories");
$lang_New = language("la_Text_New");
$lang_Hot = language("la_Text_Hot");
$lang_EdPick = language("la_prompt_EditorsPick");
$lang_Pop = language("la_Text_Pop");
$lang_Rating = language("la_prompt_Rating");
$lang_Hits = language("la_prompt_Hits");
$lang_Votes = language("la_prompt_Votes");
$lang_Name = language("la_prompt_Name");
$lang_Categories = language("la_ItemTab_Categories");
$lang_Description = language("la_prompt_Description");
$lang_MetaKeywords = language("la_prompt_MetaKeywords");
$lang_SubSearch = language("la_prompt_SubSearch");
$lang_Within = language("la_Text_Within");
$lang_Current = language("la_Text_Current");
$lang_Active = language("la_Text_Active");
$lang_SubCats = language("la_Text_SubCats");
$lang_SubItems = language("la_Text_Subitems");
$ItemTabs->AddTab(language("la_ItemTab_Categories"),"category",$objCatList->QueryItemCount, $m_tab_Categories_hide, $CatTotal);
print <<<END
<script language="JavaScript">
var default_tab = "$DefaultTab";
var Category_Sortfield = '$Category_Sortfield';
var Category_Sortorder = '$Category_Sortorder';
var Category_Perpage = $Perpage_Category;
var Category_ShowAll = $Category_ShowAll;
var CategoryView = $CategoryView;
//JS Language variables
var lang_New = "$lang_New";
var lang_Hot = "$lang_Hot";
var lang_EdPick = "$lang_EdPick";
var lang_Pop = "$lang_Pop";
var lang_Rating = "$lang_Rating";
var lang_Hits = "$lang_Hits";
var lang_Votes = "$lang_Votes";
var lang_Name = "$lang_Name";
var lang_Categories = "$lang_Categories";
var lang_Description = "$lang_Description";
var lang_MetaKeywords = "$lang_MetaKeywords";
var lang_SubSearch = "$lang_SubSearch";
var lang_Within="$lang_Within";
var lang_Current = "$lang_Current";
var lang_Active = "$lang_Active";
var lang_SubCats = "$lang_SubCats";
var lang_SubItems = "$lang_SubItems";
var hostname = '$rootURL';
var env = '$envar';
var actionlist = new Array();
// Common function for all "Advanced View" page
function InitPage()
{
addCommonActions();
initToolbar('mainToolBar', actionHandler);
initCheckBoxes(null, false);
toggleMenu();
}
function AddButtonAction(actionname,actionval)
{
var item = new Array(actionname,actionval);
actionlist[actionlist.length] = item;
}
function actionHandler(button)
{
for(i=0; i<actionlist.length;i++)
{
a = actionlist[i];
if(button.action == a[0])
{
eval(a[1]);
break;
}
}
}
function addCommonActions()
{
AddButtonAction('edit',"check_submit('','edit');"); //edit
AddButtonAction('delete',"check_submit('$admin/advanced_view','delete');"); //delete
AddButtonAction('approve',"check_submit('$admin/advanced_view','approve');"); //approve
AddButtonAction('decline',"check_submit('$admin/advanced_view','decline');"); //decline
AddButtonAction('print',"window.print();"); //print ?
AddButtonAction('view',"toggleMenu(); window.FW_showMenu(window.cat_menu,getRealLeft(button) - ((document.all) ? 6 : -2),getRealTop(button)+32);");
}
function check_submit(page,actionValue)
{
if (actionValue.match(/delete$/))
if (!theMainScript.Confirm(lang_DeleteConfirm)) return;
var formname = '';
var action_prefix ='';
if (activeTab)
{
form_name = activeTab.id;
action_prefix = activeTab.getAttribute("ActionPrefix");
if(page.length == 0) page = activeTab.getAttribute("EditURL");
}
var f = document.getElementsByName(form_name+'_form')[0];
if(f)
{
f.Action.value = action_prefix + actionValue;
f.action = '$rootURL' + page + '.php?'+ env;
f.submit();
}
}
function flip_current(field_suffix)
{
if(activeTab)
{
field = activeTab.getAttribute("tabTitle")+field_suffix;
return flip(eval(field));
}
}
function config_current(field_suffix,value)
{
if(activeTab)
{
field = activeTab.getAttribute("tabTitle")+field_suffix;
config_val(field,value);
}
}
function toggleMenu()
{
if (activeTab)
{
// module filtring menu
filterfunc = activeTab.getAttribute("tabTitle")+'_FilterMenu(cat_menu_filter);';
window.cat_menu_filter = new Menu(lang_View);
cat_menu_filter = eval(filterfunc);
// module sorting menu
sortfunc = activeTab.getAttribute("tabTitle")+'_SortMenu(cat_menu_sorting);';
window.cat_menu_sorting = new Menu(lang_Sort);
cat_menu_sorting = eval(sortfunc);
// module select menu
selectfunc = activeTab.getAttribute("tabTitle")+"_SelectMenu(cat_menu_select);";
window.cat_menu_select = new Menu(lang_Select);
cat_menu_select = eval(selectfunc);
// module per-page menu (in case if module selected)
pagefunc = activeTab.getAttribute("tabTitle")+"_PerPageMenu();";
window.PerPageMenu = eval(pagefunc);
}
window.cat_menu = new Menu("root");
if (activeTab)
{
// add root ViewMenu elements
window.cat_menu.addMenuItem(cat_menu_filter); // "View" menu
window.cat_menu.addMenuItem(cat_menu_sorting); // "Sort" menu
window.cat_menu.addMenuItem(PerPageMenu); // Module "Per-Page" menu
window.cat_menu.addMenuItem(cat_menu_select); // "Select" menu
}
window.triedToWriteMenus = false;
window.cat_menu.writeMenus();
}
function toggleTabB(tabId, atm)
{
var hl = document.getElementById("hidden_line");
var activeTabId;
if (activeTab) activeTabId = activeTab.id;
if (activeTabId != tabId)
{
if (activeTab)
{
//alert('switching to tab');
toggleTab(tabId, true)
}
else
{
//alert('opening tab');
toggleTab(tabId, atm)
}
if (hl) hl.style.display = "none";
}
tab_hdr = document.getElementById('tab_headers');
if (!tab_hdr) return;
// process all module tabs
var active_str = '';
for (var i = 0; i < tabIDs.length; i++)
{
var tabHeader;
TDs = tab_hdr.getElementsByTagName("TD");
// find tab
for (var j = 0; j < TDs.length; j++)
if (TDs[j].getAttribute("tabHeaderOf") == tabIDs[i])
{
tabHeader = TDs[j];
break;
}
if (!tabHeader) continue;
var tab = document.getElementById(tabIDs[i]);
if (!tab) continue;
active_str = (tab.active) ? "tab_active" : "tab_inactive";
if (TDs[j].getAttribute("tabHeaderOf") == tabId) {
// module tab is selected
SetBackground('l_' + tabId, "$imagesURL/itemtabs/" + active_str + "_l.gif");
SetBackground('m_' + tabId, "$imagesURL/itemtabs/" + active_str + ".gif");
SetBackground('m1_' + tabId, "$imagesURL/itemtabs/" + active_str + ".gif");
SetBackground('r_' + tabId, "$imagesURL/itemtabs/" + active_str + "_r.gif");
}
else
{
// module tab is not selected
SetBackground('l_' +tabIDs[i], "$imagesURL/itemtabs/" + active_str + "_l.gif");
SetBackground('m_' + tabIDs[i], "$imagesURL/itemtabs/" + active_str + ".gif");
SetBackground('m1_' + tabIDs[i], "$imagesURL/itemtabs/" + active_str + ".gif");
SetBackground('r_' + tabIDs[i], "$imagesURL/itemtabs/" + active_str + "_r.gif");
}
var images = tabHeader.getElementsByTagName("IMG");
if (images.length < 1) continue;
images[0].src = "$imagesURL/itemtabs/" + ((tab.active) ? "divider_up" : "divider_empty") + ".gif";
}
}
function SetBackground(element_id, img_url)
{
// set background image of element specified by id
var el = document.getElementById(element_id);
el.style.backgroundImage = 'url('+img_url+')';
}
function initContextMenu()
{
window.contextMenu = new Menu("Context");
contextMenu.addMenuItem("Edit","check_submit('','edit');","");
contextMenu.addMenuItem("Delete","check_submit('admin/advanced_view','delete');","");
contextMenu.addMenuSeparator();
contextMenu.addMenuItem("Approve","check_submit('admin/advanced_view','approve');","");
contextMenu.addMenuItem("Decline","check_submit('admin/advanced_view','decline');","");
window.triedToWriteMenus = false;
window.contextMenu.writeMenus();
return true;
}
// only "Category" tab functions
function Categories_SortMenu(menu_sorting)
{
if(menu_sorting == null && typeof(menu_sorting) == 'undefined') menu_sorting = new Menu(lang_Categories);
menu_sorting.addMenuItem(lang_Asc,"config_val('Category_Sortorder','asc');",RadioIsSelected(Category_Sortorder,'asc'));
menu_sorting.addMenuItem(lang_Desc,"config_val('Category_Sortorder','desc');",RadioIsSelected(Category_Sortorder,'desc'));
menu_sorting.addMenuSeparator();
menu_sorting.addMenuItem(lang_Default,"config_val('Category_Sortfield','Name');","");
menu_sorting.addMenuItem(lang_Name,"config_val('Category_Sortfield','Name');",RadioIsSelected(Category_Sortfield,'Name'));
menu_sorting.addMenuItem(lang_Description,"config_val('Category_Sortfield','Description');",RadioIsSelected(Category_Sortfield,'Description'));
menu_sorting.addMenuItem(lang_CreatedOn,"config_val('Category_Sortfield','CreatedOn');",RadioIsSelected(Category_Sortfield,'CreatedOn'));
menu_sorting.addMenuItem(lang_SubCats,"config_val('Category_Sortfield','CachedDescendantCatsQty');",RadioIsSelected(Category_Sortfield,'CachedDescendantCatsQty'));
menu_sorting.addMenuItem(lang_SubItems,"config_val('Category_Sortfield','SubItems');",RadioIsSelected(Category_Sortfield,'SubItems'));
return menu_sorting;
}
function Categories_FilterMenu(menu_filter)
{
if(menu_filter == null && typeof(menu_filter) == 'undefined') menu_filter = new Menu(lang_Categories);
menu_filter.addMenuItem(lang_All,"config_val('Category_View', 127);",CategoryView==127);
menu_filter.addMenuSeparator();
menu_filter.addMenuItem(lang_Active,"FlipBit('Category_View',CategoryView,6);",BitStatus(CategoryView,6));
menu_filter.addMenuItem(lang_Pending,"FlipBit('Category_View',CategoryView,5);", BitStatus(CategoryView,5));
menu_filter.addMenuItem(lang_Disabled,"FlipBit('Category_View',CategoryView,4);",BitStatus(CategoryView,4));
menu_filter.addMenuSeparator();
menu_filter.addMenuItem(lang_New,"FlipBit('Category_View',CategoryView,3);",BitStatus(CategoryView,3));
menu_filter.addMenuItem(lang_EdPick,"FlipBit('Category_View',CategoryView,0);",BitStatus(CategoryView,0));
return menu_filter;
}
function Categories_SelectMenu(menu_select)
{
if(menu_select == null && typeof(menu_select) == 'undefined') menu_select = new Menu(lang_Categories);
menu_select.addMenuItem(lang_All,"javascript:selectAllC('"+activeTab.id+"');","");
menu_select.addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');","");
menu_select.addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');","");
return menu_select;
}
function Categories_PerPageMenu()
{
caption = lang_Categories +" "+lang_PerPage;
menu_results = new Menu(caption);
menu_results.addMenuItem("10","config_val('Perpage_Category', '10');",RadioIsSelected(Category_Perpage,10));
menu_results.addMenuItem("20","config_val('Perpage_Category', '20');",RadioIsSelected(Category_Perpage,20));
menu_results.addMenuItem("50","config_val('Perpage_Category', '50');",RadioIsSelected(Category_Perpage,50));
menu_results.addMenuItem("100","config_val('Perpage_Category', '100');",RadioIsSelected(Category_Perpage,100));
menu_results.addMenuItem("500","config_val('Perpage_Category', '500');",RadioIsSelected(Category_Perpage,500));
return menu_results;
}
</script>
END;
?>
\ No newline at end of file
Property changes on: trunk/kernel/admin/include/toolbar/advanced_view.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/advanced_view.php
===================================================================
--- trunk/admin/advanced_view.php (revision 128)
+++ trunk/admin/advanced_view.php (revision 129)
@@ -1,377 +1,370 @@
<?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. ##
##############################################################
//$pathtoroot="";
$b_topmargin = "0";
//$b_header_addon = "<DIV style='position:relative; z-Index: 1; background-color: #ffffff; padding-top:1px;'><div style='position:absolute; width:100%;top:0px;' align='right'><img src='images/logo_bg.gif'></div><img src='images/spacer.gif' width=1 height=15><br><div style='z-Index:1; position:relative'>";
if(!strlen($pathtoroot))
{
$path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
if(strlen($path))
{
/* determine the OS type for path parsing */
$pos = strpos($path,":");
if ($pos === false)
{
$gOS_TYPE="unix";
$pathchar = "/";
}
else
{
$gOS_TYPE="win";
$pathchar="\\";
}
$p = $path.$pathchar;
/*Start looking for the root flag file */
while(!strlen($pathtoroot) && strlen($p))
{
$sub = substr($p,strlen($pathchar)*-1);
if($sub==$pathchar)
{
$filename = $p."root.flg";
}
else
$filename = $p.$pathchar."root.flg";
if(file_exists($filename))
{
$pathtoroot = $p;
}
else
{
$parent = realpath($p.$pathchar."..".$pathchar);
if($parent!=$p)
{
$p = $parent;
}
else
$p = "";
}
}
if(!strlen($pathtoroot))
$pathtoroot = ".".$pathchar;
}
else
{
$pathtoroot = ".".$pathchar;
}
}
$sub = substr($pathtoroot,strlen($pathchar)*-1);
if($sub!=$pathchar)
{
$pathtoroot = $pathtoroot.$pathchar;
}
//echo $pathtoroot;
require_once($pathtoroot."kernel/startup.php");
if (!admin_login())
{
if(!headers_sent())
setcookie("sid"," ",time()-3600);
$objSession->Logout();
header("Location: ".$adminURL."/login.php");
die();
//require_once($pathtoroot."admin/login.php");
}
$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";
$browseURL = $adminURL."/browse";
$cssURL = $adminURL."/include";
$indexURL = $rootURL."index.php";
$m_var_list_update["cat"] = 0;
$homeURL = "javascript:AdminCatNav('".$_SERVER["PHP_SELF"]."?env=".BuildEnv()."');";
unset($m_var_list_update["cat"]);
$envar = "env=" . BuildEnv();
if($objCatList->CurrentCategoryID()>0)
{
$c = $objCatList->CurrentCat();
$upURL = "javascript:AdminCatNav('".$c->Admin_Parent_Link()."');";
}
else
$upURL = $_SERVER["PHP_SELF"]."?".$envar;
//admin only util
$pathtolocal = $pathtoroot."kernel/";
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."/browse/toolbar.php");
$m = GetModuleArray();
foreach($m as $key=>$value)
{
$path = $pathtoroot.$value."admin/include/parser.php";
if(file_exists($path))
{
//echo "<!-- $path -->";
@include_once($path);
}
}
if(!$is_install)
{
if (!admin_login())
{
if(!headers_sent())
setcookie("sid"," ",time()-3600);
$objSession->Logout();
header("Location: ".$adminURL."/login.php");
die();
//require_once($pathtoroot."admin/login.php");
}
}
//Set Section
$section = 'in-portal:advanced_view';
//Set Environment Variable
// save last category visited
$objSession->SetVariable('prev_category', $objSession->GetVariable('last_category') );
$objSession->SetVariable('last_category', $objCatList->CurrentCategoryID() );
$objSession->SetVariable("HasChanges", 0);
// where should all edit popups submit changes
$objSession->SetVariable("ReturnScript", basename($_SERVER['PHP_SELF']) );
// common "Advanced View" tab php functions: begin
function GetAdvView_SearchWord($prefix)
{
global $objSession;
return $objSession->GetVariable($prefix.'_adv_view_search');
}
function SaveAdvView_SearchWord($prefix)
{
global $objSession;
$SearchWord = $objSession->GetVariable($prefix.'_adv_view_search');
if( isset($_REQUEST['SearchWord']) )
{
$SearchWord = $_REQUEST['SearchWord'];
$objSession->SetVariable($prefix.'_adv_view_search', $SearchWord);
}
}
function ResetAdvView_SearchWord($prefix)
{
global $objSession;
$objSession->SetVariable($prefix.'_adv_view_search', '');
}
function ShowSearchForm($prefix, $envar)
{
global $imagesURL;
$btn_prefix = $imagesURL.'/toolbar/icon16_search';
$SearchWord = GetAdvView_SearchWord($prefix);
echo '<form method="post" action="'.$_SERVER["PHP_SELF"].'?'.$envar.'" name="'.$prefix.'_adv_view_search" id="'.$prefix.'_adv_view_search">
<input type="hidden" name="Action" value="">
<table cellspacing="0" cellpadding="0">
<tr>
<td>'.admin_language('la_SearchLabel').'&nbsp;</td>
<td><input id="SearchWord" type="text" value="'.$SearchWord.'" name="SearchWord" size="10" style="border-width: 1; border-style: solid; border-color: 999999"></td>
<td>
<img
id="imgSearch"
src="'.$btn_prefix.'.gif"
alt="'.admin_language("la_ToolTip_Search").'"
align="absMiddle"
onclick="SubmitSearch(\''.$prefix.'_adv_view_search\',\''.$prefix.'_adv_view_search\');"
onmouseover="this.src=\''.$btn_prefix.'_f2.gif\'"
onmouseout="this.src=\''.$btn_prefix.'.gif\'"
style="cursor:hand"
width="22"
height="22"
>
<img
id="imgSearchReset"
src="'.$btn_prefix.'_reset.gif"
alt="'.admin_language("la_ToolTip_Search").'"
align="absMiddle"
onclick="SubmitSearch(\''.$prefix.'_adv_view_search\',\''.$prefix.'_adv_view_search_reset\');"
onmouseover="this.src=\''.$btn_prefix.'_reset_f2.gif\'"
onmouseout="this.src=\''.$btn_prefix.'_reset.gif\'"
style="cursor:hand"
width="22"
height="22"
>&nbsp;
</td>
</tr>
</table>
</form>';
}
// common "Advanced View" tab php functions: end
/* page header */
print <<<END
<html>
<head>
<title>In-portal</title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta http-equiv="Pragma" content="no-cache">
<script language="JavaScript">
imagesPath='$imagesURL'+'/';
</script>
END;
require_once($pathtoroot.$admin."/include/mainscript.php");
print <<<END
<script type="text/javascript">
if (window.opener != null) {
theMainScript.CloseAndRefreshParent();
}
</script>
END;
print <<<END
<script src="$browseURL/toolbar.js"></script>
<script src="$browseURL/checkboxes_new.js"></script>
<script language="JavaScript1.2" src="$browseURL/fw_menu.js"></script>
<link rel="stylesheet" type="text/css" href="$browseURL/checkboxes.css">
<link rel="stylesheet" type="text/css" href="$cssURL/style.css">
<link rel="stylesheet" type="text/css" href="$browseURL/toolbar.css">
END;
load_module_styles();
if( !isset($list) ) $list = '';
int_SectionHeader();
$filter = false;
$sessVars = $objConfig->GetSessionValues(0);
//print_pre($sessVars);
foreach ($sessVars as $key => $value) {
if (strstr($key, '_View')) {
//echo "$value<br>";
if ($value != 1) {
$filter = true;
}
}
}
?>
</div>
<!-- alex mark -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<div name="toolBar" id="mainToolBar">
<tb:button action="edit" alt="<?php echo admin_language("la_ToolTip_Edit"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
<tb:button action="delete" alt="<?php echo admin_language("la_ToolTip_Delete"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
<tb:separator ImagePath="<?php echo $imagesURL."/toolbar/";?>">
<tb:button action="approve" alt="<?php echo admin_language("la_ToolTip_Approve"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
<tb:button action="decline" alt="<?php echo admin_language("la_ToolTip_Decline"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
<tb:separator ImagePath="<?php echo $imagesURL."/toolbar/";?>">
<tb:button action="print" alt="<?php echo admin_language("la_ToolTip_Print"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
<tb:button action="view" alt="<?php echo admin_language("la_ToolTip_View"); ?>" ImagePath="<?php echo $imagesURL."/toolbar/";?>">
</div>
</td>
</tr>
</tbody>
</table>
<?php if ($filter) { ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
<tr>
<td valign="top">
<?php int_hint_red(admin_language("la_Warning_Filter")); ?>
</td>
</tr>
</table>
<?php } ?>
<br>
<!-- CATEGORY DIVIDER -->
</DIV>
</div>
<DIV style="background-color: #ffffff; position: relative; padding-top: 1px; top: -1px; z-Index:0" id="firstContainer">
<DIV style="background-color: #ffffff; position: relative; padding-top: 1px; top: -1px; z-Index:2" id="secondContainer">
<?php
print $ItemTabs->TabRow();
if(count($ItemTabs->Tabs))
{
?>
<div class="divider" id="tabsDevider"><img width=1 height=1 src="images/spacer.gif"></div>
<?php
}
?>
</DIV>
<?php
unset($m);
$m = GetModuleArray("admin");
foreach($m as $key=>$value)
{
$path = $pathtoroot.$value."admin/advanced_view.php";
//echo "Including File: $path<br>";
if(file_exists($path))
{
//echo "\n<!-- $path -->\n";
include_once($path);
}
}
?>
<form method="post" action="advanced_view.php?env=<?php echo BuildEnv(); ?>" name="viewmenu">
<input type="hidden" name="fieldname" value="">
<input type="hidden" name="varvalue" value="">
<input type="hidden" name="varvalue2" value="">
<input type="hidden" name="Action" value="">
</form>
</DIV>
<!-- END CODE-->
<script language="JavaScript">
InitPage();
-
- tabs_on = theMainScript.GetCookie('tabs_on');
- if (tabs_on == '1' || tabs_on == null) {
- if(default_tab.length == 0 || default_tab == 'categories' )
- {
- cookie_start = theMainScript.GetCookie('active_tab');
- if (cookie_start != null) start_tab = cookie_start;
- if(start_tab!=null) {
- toggleTabB(start_tab, true);
- }
- }
- else
- {
- toggleTabB(default_tab,true);
- }
- }
-
+ if(default_tab.length == 0)
+ {
+ cookie_start = theMainScript.GetCookie('active_tab');
+ if (cookie_start != null) start_tab = cookie_start;
+ if(start_tab!=null) toggleTabB(start_tab, true);
+ }
+ else
+ {
+ toggleTabB(default_tab,true);
+ }
</script>
<?php int_footer(); ?>
\ No newline at end of file
Property changes on: trunk/admin/advanced_view.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property

Event Timeline