Index: trunk/admin/editor/FCKeditor/js/fck_editor.js =================================================================== diff -u -r13 -r767 --- trunk/admin/editor/FCKeditor/js/fck_editor.js (.../fck_editor.js) (revision 13) +++ trunk/admin/editor/FCKeditor/js/fck_editor.js (.../fck_editor.js) (revision 767) @@ -1,619 +1,311 @@ /* * FCKeditor - The text editor for internet - * Copyright (C) 2003 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License - * (http://www.opensource.org/licenses/lgpl-license.php) - * - * For further information go to http://www.fredck.com/FCKeditor/ - * or contact fckeditor@fredck.com. - * - * fck_editor.js: Main script that initializes the editor. - * - * Authors: - * Frederico Caldeira Knabben (fckeditor@fredck.com) - */ - - var bInitialized = false ; - var bDataLoaded = false ; - - function initEditor() - { - if (! bInitialized) - { - bInitialized = true ; - - loadToolbarSet() ; - loadToolbarSourceSet() ; - - objContent.BaseURL = config.BaseUrl ; - } - - if (! bDataLoaded && ! objContent.Busy) - { - bDataLoaded = true ; - - objContent.DOM.body.onpaste = onPaste ; - objContent.DOM.body.ondrop = onDrop ; - - objContent.DOM.body.onkeydown = onKeyDown ; - - objContent.ShowBorders = config.StartupShowBorders ; - objContent.ShowDetails = config.StartupShowDetails ; - - //alert(config.EditorAreaCSS); - objContent.DOM.createStyleSheet(config.EditorAreaCSS) ; - setLinkedField() ; - setTimeout("loadStylesheet()",1000); - } - } - - // Method: loadToolbarSet() - // Description: Loads a toobar buttons set from an array inside the Toolbar holder. - // Author: FredCK - function loadToolbarSet() - { - var sToolBarSet = URLParams["Toolbar"] == null ? "Default" : URLParams["Toolbar"] ; - - // FredCK: Toobar holder (DIV) - var oToolbarHolder = document.getElementById("divToolbar") ; - - var oToolbar = new TBToolbar() ; - oToolbar.LoadButtonsSet( sToolBarSet ) ; - oToolbarHolder.innerHTML = oToolbar.GetHTML() ; - - } - - function loadToolbarSourceSet() - { - // FredCK: Toobar holder (DIV) - var oToolbarHolder = document.getElementById("divToolbarSource") ; - - var oToolbar = new TBToolbar() ; - oToolbar.LoadButtonsSet( "Source" ) ; - oToolbarHolder.innerHTML = oToolbar.GetHTML() ; - } - - function switchEditMode() - { - var bSource = (trSource.style.display == "none") ; - - if (bSource) - txtSource.value = objContent.DOM.body.innerHTML ; - else - { - objContent.DOM.body.innerHTML = "
 
" + txtSource.value ; - objContent.DOM.getElementById('__tmpFCKRemove__').removeNode(true) ; - } - - trEditor.style.display = bSource ? "none" : "inline" ; - trSource.style.display = bSource ? "inline" : "none" ; - - events.fireEvent('onViewMode', bSource) ; - } - - // setValue(): called from reset() to make a select list show the current font - // or style attributes - function selValue(el, str, text) - { - //if (!RichEditor.txtView) return; // Disabled in View Source mode - for (var i = 0; i < el.length; i++) - { - if (((text || !el[i].value) && el[i].text == str) || ((!text || el[i].value) && el[i].value == str)) - { - el.selectedIndex = i; - return; - } - } - el.selectedIndex = 0; - } - - var oLinkedField = null ; - function setLinkedField() - { - if (! URLParams['FieldName']) return ; - - oLinkedField = parent.document.getElementsByName(URLParams['FieldName'])[0] ; - - if (! oLinkedField) return ; - - // __tmpFCKRemove__ added and removed to solve DHTML component error when loading "


" - objContent.DOM.body.innerHTML = "
 
" + oLinkedField.value ; - objContent.DOM.getElementById('__tmpFCKRemove__').removeNode(true) ; - - var oForm = oLinkedField.form ; - - if (!oForm) return ; - - // Attaches the field update to the onsubmit event - oForm.attachEvent("onsubmit", setFieldValue) ; - - // Attaches the field update to the submit method (IE doesn't fire onsubmit on this case) - if (! oForm.updateFCKEditor) oForm.updateFCKEditor = new Array() ; - oForm.updateFCKEditor[oForm.updateFCKEditor.length] = setFieldValue ; - if (! oForm.originalSubmit) - { - oForm.originalSubmit = oForm.submit ; - oForm.submit = function() - { - if (this.updateFCKEditor) - { - for (var i = 0 ; i < this.updateFCKEditor.length ; i++) - { - this.updateFCKEditor[i]() ; - } - } - this.originalSubmit() ; - } - } - } - - function setFieldValue() - { - if (trSource.style.display != "none") - { - switchEditMode() ; - } - - if (config.EnableXHTML) - { - window.status = lang["ProcessingXHTML"] ; - oLinkedField.value = getXhtml( objContent.DOM.body ) ; - window.status = 'Done' ; - } - else - oLinkedField.value = objContent.DOM.body.innerHTML ; - } - - function onPaste() - { - if (config.ForcePasteAsPlainText) - { - pastePlainText() ; - return false ; - } - else if (config.AutoDetectPasteFromWord && BrowserInfo.IsIE55OrMore) - { - var sHTML = GetClipboardHTML() ; - var re = /<\w[^>]* class="?MsoNormal"?/gi ; - if ( re.test( sHTML ) ) - { - if ( confirm( lang["PasteWordConfirm"] ) ) - { - cleanAndPaste( sHTML ) ; - return false ; - } - } - } - else - return true ; - } - - function onDrop() - { - if (config.ForcePasteAsPlainText) - { - var sText = HTMLEncode( objContent.DOM.parentWindow.event.dataTransfer.getData("Text") ) ; - sText = sText.replace(/\n/g,'
') ; - insertHtml(sText) ; - return false ; - } - else if (config.AutoDetectPasteFromWord && BrowserInfo.IsIE55OrMore) - { - // TODO - // To find a way to get the HTML that is dropped, - // clean it and insert it into the document. - return true ; - } - else - return true ; - } - - function onKeyDown() - { - var oWindow = objContent.DOM.parentWindow ; - - if ( oWindow.event.ctrlKey || oWindow.event.altKey || oWindow.event.shiftKey ) - { - oWindow.event.returnValue = true ; - return ; - } - - if ( oWindow.event.keyCode == 9 && config.TabSpaces > 0 ) // added tab support - { - var sSpaces = "" ; - for ( i = 0 ; i < config.TabSpaces ; i++ ) - sSpaces += " " ; - insertHtml( sSpaces ) ; - } - else if ( oWindow.event.keyCode == 13 && config.UseBROnCarriageReturn ) - { - if ( objContent.DOM.queryCommandState( 'InsertOrderedList' ) || objContent.DOM.queryCommandState( 'InsertUnorderedList' ) ) - { - oWindow.event.returnValue = true ; - return ; - } - - insertHtml("
 ") ; - - var oRange = objContent.DOM.selection.createRange() ; - oRange.moveStart('character',-1) ; - oRange.select() ; - objContent.DOM.selection.clear() ; - - oWindow.event.returnValue = false ; - } - } - - function loadStylesheet() - { - var a,b; - var styleList = new Array(); - - passedValue = objContent.DOM.styleSheets; - - for (var i = 0; passedValue && i < passedValue.length; i++) - { - for (var j = 0; j < passedValue[i].rules.length; j++) - { - // Extract the rule and the rule definition from the passed style - // data. - a = passedValue[i].rules[j].selectorText.toString(); - b = passedValue[i].rules[j].style.cssText; - //alert(a + " --> " + b); - //document.body.innerHTML += a + " --> " + b + "
"; - // Ignore non-style entries - if (!a || !b) continue; - - // Id: These are added to the document style sheet but are not - // available in the style dropdown - if (a.indexOf("#") != -1) - { - continue; - } - - // Class: Append a cless element to the style list - if (a.indexOf(".") == 0) - { - styleList[styleList.length] = [a.substr(1), "Class " + a, 1]; - //alert('Adding class '+a); - } - - // SubClass: Append the sub-class to the style list - else if(a.indexOf(".") > 0) - { - l = a.split("."); - styleList[styleList.length] = [l[1], a, 1]; - } - - // Otherwise, assume it's a tag and select the existing tag entry - // in the style list. - else - { - styleList[styleList.length] = [a, a.toLowerCase(), 1]; - } - } - } - - for (var i = 0; i < styleList.length; i++) - { - var oOption = document.createElement("OPTION"); - if (styleList[i][0]) oOption.value = styleList[i][0]; - oOption.text = styleList[i][1]; - oOption.style.backgroundColor = 'white'; - // Choose the combobox, in this case cmbFontStyle - if(document.all.cmbFontStyle) - { - document.all.cmbFontStyle.add(oOption); - } - } - } \ No newline at end of file Index: trunk/admin/include/toolbar.js =================================================================== diff -u -r13 -r767 --- trunk/admin/include/toolbar.js (.../toolbar.js) (revision 13) +++ trunk/admin/include/toolbar.js (.../toolbar.js) (revision 767) @@ -1,806 +1,405 @@ - - - - - - - - END; - } - ?> \ No newline at end of file Index: trunk/admin/browse.php =================================================================== diff -u -r726 -r767 --- trunk/admin/browse.php (.../browse.php) (revision 726) +++ trunk/admin/browse.php (.../browse.php) (revision 767) @@ -1,943 +1,473 @@

"; - - 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"]); - - $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 ""; - @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:browse'; - - //Set Environment Variable - - //echo $objCatList->ItemsOnClipboard()." Categories on the clipboard
\n"; - //echo $objTopicList->ItemsOnClipboard()." Topics on the clipboard
\n"; - //echo $objLinkList->ItemsOnClipboard()." Links on the clipboard
\n"; - //echo $objArticleList->ItemsOnClipboard()." Articles on the clipboard
\n"; - - // save last category visited - $objSession->SetVariable('prev_category', $objSession->GetVariable('last_category') ); - $objSession->SetVariable('last_category', $objCatList->CurrentCategoryID() ); - - /* // for testing - $last_cat = $objSession->GetVariable('last_category'); - $prev_cat = $objSession->GetVariable('prev_category'); - echo "Last CAT: [$last_cat]
"; - echo "Prev CAT: [$prev_cat]
"; - */ - $SearchType = $objSession->GetVariable("SearchType"); - if(!strlen($SearchType)) - $SearchType = "all"; - $SearchLabel = "la_SearchLabel"; - if( GetVar('SearchWord') !== false ) $objSession->SetVariable('admin_seach_words', GetVar('SearchWord') ); - $SearchWord = $objSession->GetVariable('admin_seach_words'); - - $objSession->SetVariable("HasChanges", 0); - - // where should all edit popups submit changes - $objSession->SetVariable("ReturnScript", basename($_SERVER['PHP_SELF']) ); - /* page header */ - print << - - In-portal - - - - - END; - - require_once($pathtoroot.$admin."/include/mainscript.php"); - - print << - if (window.opener != null) { - theMainScript.CloseAndRefreshParent(); - } - - END; - - print << - - - - - - END; - load_module_styles(); - if( !isset($list) ) $list = ''; - if(($SearchType=="categories" || $SearchType="all") && strlen($list)) - { - int_SectionHeader(NULL,NULL,NULL,admin_language("la_Title_SearchResults")); - } - else - int_SectionHeader(); - - $filter = false; // always initialize variables before use - - if($objSession->GetVariable("SearchWord") != '') { - $filter = true; - } - else { - $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]."]
"; - if( $objConfig->Get($VarName) ) - if( $objConfig->Get($VarName) != $bit_combo['Bits'][$mod_name] ) - { - $filter = true; - break; - } - } - } - ?> -
- - - - - - - -
-
- " ImagePath=""> - " ImagePath=""> - "> - " ImagePath=""> - " ImagePath=""> - - 0) - print "tab=\"".$btn["Tab"]."\""; - print ">\n"; - } - ?> - " ImagePath=""> - " ImagePath=""> - "> - " ImagePath=""> - " ImagePath=""> - "> - " ImagePath=""> - " ImagePath=""> - " ImagePath=""> - "> - " ImagePath=""> - " ImagePath=""> - "> - " ImagePath=""> - " ImagePath=""> -
-
- - - - - - - -
- - -
" NAME="admin_search" ID="admin_search">">"> - - - - -
 /icon16_search.gif" alt="" align="absMiddle" onclick="this.action = this.getAttribute('action'); actionHandler(this);" src="/arrow16.gif" onmouseover="this.src='/icon16_search_f2.gif'" onmouseout="this.src='/icon16_search.gif'" style="cursor:hand" width="22" width="22"> - /icon16_search_reset.gif" alt="" align="absMiddle" onclick="document.all.SearchWord.value = ''; this.action = this.getAttribute('action'); actionHandler(this);" onmouseover="this.src='/icon16_search_reset_f2.gif'" onmouseout="this.src='/icon16_search_reset.gif'" style="cursor:hand" width="22" width="22">  -
-
- -
- - - - - -
- -
- -
- - QueryOrderByClause(TRUE,TRUE,TRUE); - $objCatList->Clear(); - $IsSearch = FALSE; - if($SearchType == 'categories' || $SearchType == 'all') - { - $list = $objSession->GetVariable("SearchWord"); - $SearchQuery = $objCatList->AdminSearchWhereClause($list); - if(strlen($SearchQuery)) - { - $SearchQuery = " (".$SearchQuery.") "; - if( strlen($CatScopeClause) ) { $SearchQuery .= " AND ParentId = ".$objCatList->CurrentCategoryID();//" AND ".$CatScopeClause; } - $objCatList->LoadCategories($SearchQuery.$CategoryFilter,$OrderBy); - $IsSearch = TRUE; - } - else - $objCatList->LoadCategories("ParentId=".$objCatList->CurrentCategoryID()." ".$CategoryFilter,$OrderBy); - } - else - $objCatList->LoadCategories("ParentId=".$objCatList->CurrentCategoryID()." ".$CategoryFilter, $OrderBy); - - $TotalItemCount += $objCatList->QueryItemCount; - - ?> - GetAdminUserErrors(); - if(count($e)>0) - { - echo ""; - for($ex = 0; $ex"; - } - echo "
".prompt_language($e[$ex])."

"; - } - ?> - - - - - - - -
- - - - - - - -
- - - :  - - (QueryItemCount; ?>)  - - -
-
 
-
- - -
-
- -
-
- - CurrentCategoryID(),$template); - ?> -
-
-
- - TabRow(); - if(count($ItemTabs->Tabs)) - { - ?> -
- -
- $value) - { - $path = $pathtoroot.$value."admin/browse.php"; - if(file_exists($path)) - { - //echo "\n\n"; - include_once($path); - } - } - ?> -
- - - - -
-
- - - - \ No newline at end of file Index: trunk/admin/browse/toolbar.js =================================================================== diff -u -r123 -r767 --- trunk/admin/browse/toolbar.js (.../toolbar.js) (revision 123) +++ trunk/admin/browse/toolbar.js (.../toolbar.js) (revision 767) @@ -190,8 +190,8 @@ } function showContextMenu(evt) { - initContextMenu(evt.clientX,evt.clientY); - window.FW_showMenu(window.contextMenu,evt.clientX,evt.clientY); + initContextMenu(evt.clientX,evt.clientY+document.body.scrollTop); + window.FW_showMenu(window.contextMenu,evt.clientX,evt.clientY+document.body.scrollTop); evt.returnValue = false; evt.cancelBubble = true; return false; Index: trunk/admin/listview/listview.js =================================================================== diff -u -r609 -r767 --- trunk/admin/listview/listview.js (.../listview.js) (revision 609) +++ trunk/admin/listview/listview.js (.../listview.js) (revision 767) @@ -124,18 +124,22 @@ } container.oncontextmenu = function(e) - { if (selectorType == "radio") return; - var evt = (e) ? e : window.event; - if (!evt) return; - evt.cancelBubble = true; - evt.returnValue = false; + { + if (selectorType == "radio") return; + var evt = (!document.all) ? e : event; + if(evt) + { + evt.cancelBubble = true; + evt.returnValue = false; + } if (!this.chB.checked) { selectAll(false); this.chB.checked = !this.chB.checked; this.chB.onclick(); } - showContextMenu(); + + showContextMenu(evt); return false; } } @@ -166,13 +170,13 @@ } } -function showContextMenu() +function showContextMenu(evt) { - if(initContextMenu()) + if(initContextMenu(evt.clientX,evt.clientY+document.body.scrollTop)) { - window.FW_showMenu(window.contextMenu,window.event.clientX,window.event.clientY); - window.event.returnValue = false; - window.event.cancelBubble = true; + window.FW_showMenu(window.contextMenu,evt.clientX,evt.clientY+document.body.scrollTop); + evt.returnValue = false; + evt.cancelBubble = true; } return false; }