Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1054442
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, Jul 6, 4:53 PM
Size
37 KB
Mime Type
text/x-diff
Expires
Tue, Jul 8, 4:53 PM (6 h, 54 m)
Engine
blob
Format
Raw Data
Handle
680178
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/kernel/admin/include/toolbar/advanced_view.php
===================================================================
--- trunk/kernel/admin/include/toolbar/advanced_view.php (revision 608)
+++ trunk/kernel/admin/include/toolbar/advanced_view.php (revision 609)
@@ -1,432 +1,456 @@
<?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;
$m_tab_Categories_hide = isset($DefaultTab) && ($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.2
$where_clauses = Array(); $q = '';
//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, false, 'set_last');
$IsSearch = TRUE;
}
else
$objCatList->LoadCategories($CategoryFilter,$OrderBy, false, 'set_last');
$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
+ TabActive = tabId;
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;
}
-
+
+ // Event Handling Stuff Cross-Browser
+ getEvent = window.Event
+ ? function(e){return e}
+ : function() {return event}
+
+ getEventSrcElement = window.Event
+ ? function(e){var targ=e.target;return targ.nodeType==1?targ:targ.parentNode}
+ : function() {return event.srcElement}
+
+ function getKeyCode(e){return e.charCode||e.keyCode}
+
+ function getKey(eMoz)
+ {
+ var e = getEvent(eMoz)
+ var keyCode = getKeyCode(e)
+
+ if(keyCode == 13)
+ {
+ var el = document.getElementById(TabActive+'_imgSearch');
+ if(typeof(el) != 'undefined') el.onclick();
+ }
+
+ }
</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.5
\ No newline at end of property
+1.6
\ No newline at end of property
Index: trunk/kernel/admin/advanced_view.php
===================================================================
--- trunk/kernel/admin/advanced_view.php (revision 608)
+++ trunk/kernel/admin/advanced_view.php (revision 609)
@@ -1,57 +1,57 @@
<?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. ##
##############################################################
global $rootURL, $imagesURL, $adminURL,$admin,$pathtoroot;
$localURL = $rootURL."kernel/";
$pathtolocal = $pathtoroot."kernel/";
require_once ($pathtolocal."admin/include/navmenu.php");
//Set Section
$section = 'in-portal:advanced_view';
//Set Environment Variable
$envar = "env=" . BuildEnv($mod_prefixes);
?>
<!-- CATS -->
<div id="category" class="ini_tab" isTab="true" tabTitle="Categories" ActionPrefix="m_cat_" EditURL="admin/category/addcategory">
<table cellSpacing=0 cellPadding=2 width="100%" class="tabTable">
<tr>
<td align="left" width="70%">
<img height=15 src="<?php echo $imagesURL; ?>/arrow.gif" width=15 align=absMiddle border=0>
<b class=text><?php echo prompt_language("la_Page"); ?></b> <?php print $objCatList->GetAdminPageLinkList($_SERVER["PHP_SELF"]); ?>
</td>
<td align="right" width="30%">
- <?php ShowSearchForm('m', $envar); ?>
+ <?php ShowSearchForm('m', $envar, 'category'); ?>
</td>
</tr>
</table><br>
<form name=category_form action="" method=post>
<input type="hidden" name="Action">
<table cellSpacing=0 cellPadding=2 width="100%" border=0>
<tbody>
<?php print adListSubCats(0, 'cat_tab_element.tpl','m_adv_view_search'); ?>
</tbody>
</table>
</form>
</div>
<!-- END CATS -->
\ No newline at end of file
Property changes on: trunk/kernel/admin/advanced_view.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/admin/advanced_view.php
===================================================================
--- trunk/admin/advanced_view.php (revision 608)
+++ trunk/admin/advanced_view.php (revision 609)
@@ -1,366 +1,371 @@
<?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(__FILE__));
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"]);
//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");
$mod_prefixes = Array();
$m = GetModuleArray();
foreach($m as $key=>$value)
{
$path = $pathtoroot.$value."admin/include/parser.php";
if(file_exists($path))
{
//echo "<!-- $path -->";
$mod_prefixes[] = $key;
@include_once($path);
}
}
if(!defined('IS_INSTALL'))define('IS_INSTALL',0);
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)
+function ShowSearchForm($prefix, $envar, $TabID)
{
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').' </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><input id="'.$prefix.'_SearchWord" type="text" value="'.$SearchWord.'" name="SearchWord" size="10" style="border-width: 1; border-style: solid; border-color: 999999"></td>
<td>
<img
- id="imgSearch"
+ id="'.$TabID.'_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"
>
</td>
</tr>
</table>
- </form>';
+ </form>
+ <script language="javascript">
+ document.getElementById("'.$prefix.'_SearchWord").onkeydown = getKey;
+ </script>
+
+ ';
}
// 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;
$bit_combo = $objModules->ExecuteFunction('GetModuleInfo', 'all_bitmask');
$bit_combo = $objModules->MergeReturn($bit_combo);
foreach($bit_combo['VarName'] as $mod_name => $VarName)
{
//echo "VarName: [$VarName] = [".$objConfig->Get($VarName)."], ALL = [".$bit_combo['Bits'][$mod_name]."]<br>";
if( $objConfig->Get($VarName) )
if( $objConfig->Get($VarName) != $bit_combo['Bits'][$mod_name] )
{
$filter = true;
break;
}
}
?>
</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();
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.7
\ No newline at end of property
+1.8
\ No newline at end of property
Index: trunk/admin/listview/listview.js
===================================================================
--- trunk/admin/listview/listview.js (revision 608)
+++ trunk/admin/listview/listview.js (revision 609)
@@ -1,238 +1,237 @@
var lcp = 0;
var cbContainers = new Array();
getEventSrcElement = window.event ? function(e){var targ=e.target;return targ.nodeType==1?targ:targ.parentNode} : function() {return event.srcElement}
function initSelectiorContainers()
{
var selectorType;
var inputs = document.getElementsByTagName("INPUT");
for (var i = 0; i < inputs.length; i++)
if (inputs[i].getAttribute("isSelector"))
{
selectorType = inputs[i].type;
break;
}
if (!selectorType) return;
for (var i = 0; i < inputs.length; i++)
if (inputs[i].type == selectorType && inputs[i].getAttribute("isSelector"))
{
var container = inputs[i].parentNode.parentNode;
inputs[i].container = container;
container.chB = inputs[i];
cbContainers[cbContainers.length] = container;
inputs[i].checked=false;
if (selectorType != "radio")
container.chB.onclick = function(e)
{
this.lcp = lcp++;
eval(this.getAttribute("onclicksrc"));
var evt = (e) ? e : window.event;
if (!evt) return;
evt.cancelBubble = true;
}
else container.chB.onclick = container.onclick;
container.chB.onclickA = function()
{
eval(this.getAttribute("onclicksrc"));
}
container.onclick = function(e)
{
var evt = (e) ? e : window.event;
if (!evt) return;
if (evt.ctrlKey && selectorType != "radio")
{
this.chB.checked = !this.chB.checked;
this.chB.onclick();
if (document.selection) document.selection.empty();
return;
}
if (evt.shiftKey && selectorType != "radio")
{
var maxLcp = 0;
var maxIndex = 0;
var cIndex = 0;
for (var i = 0; i < cbContainers.length; i++)
{
if (cbContainers[i].chB.lcp > maxLcp)
{
maxLcp = cbContainers[i].chB.lcp;
maxIndex = i;
}
if (cbContainers[i] == this) cIndex = i;
}
for (var i = 0; i < cbContainers.length; i++)
{
var cChb = (i <= cIndex && i >= maxIndex && maxIndex <= cIndex || i >= cIndex && i <= maxIndex && maxIndex > cIndex);
if (cChb != cbContainers[i].chB.checked)
{
cbContainers[i].chB.checked = cChb;
cbContainers[i].chB.onclickA();
}
}
if (document.selection) document.selection.empty();
return;
}
selectAll(false);
this.chB.checked = !this.chB.checked;
if (selectorType != "radio") this.chB.onclick()
else
{
var checkArray;
this.chB.onclickA();
for (var i = 0; i < cbContainers.length; i++)
if (this.id != cbContainers[i].id)
{
var rowId = cbContainers[i].chB.getAttribute('rowId')
try
{
if (!checkArray) checkArray = eval(cbContainers[i].chB.getAttribute('checkArrayName'))
}
catch (err)
{
}
checkArray.CheckValues[rowId]=0;
cbContainers[i].className = "table_color" + (i % 2 + 1);
}
if (checkArray) checkArray.itemschecked = (this.chB.checked) ? 1 : 0;
}
}
container.ondblclick = function(e)
{ if (selectorType == "radio") return;
selectAll(false);
if (this.chB.checked != true) this.chB.checked = true;
this.chB.onclick();
handleDoubleClick();
}
container.oncontextmenu = function(e)
{ if (selectorType == "radio") return;
var evt = (e) ? e : window.event;
if (!evt) return;
evt.cancelBubble = true;
evt.returnValue = false;
if (!this.chB.checked)
{
selectAll(false);
this.chB.checked = !this.chB.checked;
this.chB.onclick();
}
showContextMenu();
return false;
}
}
document.onkeydown = function(e)
{ if (selectorType == "radio") return;
var evt = (e) ? e : window.event;
if (!evt) return;
var keyCode = (e) ? e.which : window.event.keyCode;
if (keyCode == 65 && evt.ctrlKey)
{
selectAll(true)
if (document.selection) document.selection.empty();
evt.returnValue = false;
evt.cancelBubble = true;
return false;
}
}
}
function selectAll(value)
{
for (var i = 0; i < cbContainers.length; i++)
if (value != cbContainers[i].chB.checked)
{
cbContainers[i].chB.checked = value;
cbContainers[i].chB.onclickA();
}
}
function showContextMenu()
{
if(initContextMenu())
{
window.FW_showMenu(window.contextMenu,window.event.clientX,window.event.clientY);
window.event.returnValue = false;
window.event.cancelBubble = true;
}
return false;
}
//unchanged
function ShowViewMenu()
{
button = document.getElementById('viewmenubutton');
if(button)
{
x = getRealLeft(button);
y = getRealTop(button);
fwLoadMenus();
window.FW_showMenu(window.view_menu,x,y+32);
}
return false;
}
//This overrides the function in tabs.js for use in lists
function edit_submit(formname, status_field, targetURL, save_value,env_str)
{
var full_env = env;
if( HasParam(env_str) ) full_env += env_str;
if(full_env.substr(0,3) != "env") full_env = 'env='+full_env;
var URLPrefix = '';
if( targetURL.substring(0, rootURL.length) != rootURL ) URLPrefix = rootURL;
var loc = URLPrefix + targetURL + '?' + full_env;
document.location = loc;
}
function HandleKeyPress(e)
{
alert(e.which);
}
// Event Handling Stuff Cross-Browser
-
getEvent = window.Event
? function(e){return e}
: function() {return event}
getEventSrcElement = window.Event
? function(e){var targ=e.target;return targ.nodeType==1?targ:targ.parentNode}
: function() {return event.srcElement}
function getKeyCode(e){return e.charCode||e.keyCode}
function getKey(eMoz)
{
var e = getEvent(eMoz)
var keyCode = getKeyCode(e)
if(keyCode == 13)
{
var el = document.getElementById('imgSearch');
el.onclick();
}
}
d = document.getElementById('ListSearchWord');
if(d) d.onkeyup = getKey
Property changes on: trunk/admin/listview/listview.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Event Timeline
Log In to Comment