Index: trunk/core/kernel/processors/tag_processor.php =================================================================== diff -u -r3723 -r4199 --- trunk/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 3723) +++ trunk/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 4199) @@ -40,21 +40,21 @@ }*/ } - function ProcessParsedTag($tag, $params, $prefix) + function ProcessParsedTag($tag, $params, $prefix) { - $Method=$tag; + $Method = $tag; if(method_exists($this, $Method)) { if( $this->Application->isDebugMode() && dbg_ConstOn('DBG_SHOW_TAGS') ) { global $debugger; $debugger->appendHTML('Processing PreParsed Tag '.$Method.' in '.$this->Prefix); } - + //echo htmlspecialchars($tag->GetFullTag()).'
'; return $this->$Method($params); } - else + else { if ($this->Application->hasObject('TagsAggregator')) { $aggregator =& $this->Application->recallObject('TagsAggregator'); @@ -69,25 +69,13 @@ $params['PrefixSpecial'] = $prefix; return $processor->ProcessParsedTag($tag_mapping[1], $params, $prefix); } - trigger_error('Tag '.$Method.' Undefined in '.get_class($this).'[Agregated Tag]:
'.$tag.'', E_USER_WARNING); + trigger_error('Tag '.$Method.' Undefined in '.get_class($this).'[Agregated Tag]:
'.$tag.'', E_USER_WARNING); } trigger_error('Tag Undefined:
'.$tag.'',E_USER_WARNING); return false; } } - /** - * Checks if object propery value matches value passed - * - * @param Array $params - * @return bool - */ - function PropertyEquals($params) - { - $object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); - $property_name = $params['property']; - return $object->$property_name == $params['value']; - } /** * Not tag, method for parameter Index: trunk/core/kernel/db/db_tag_processor.php =================================================================== diff -u -r4043 -r4199 --- trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 4043) +++ trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 4199) @@ -1473,6 +1473,19 @@ } /** + * Checks if object propery value matches value passed + * + * @param Array $params + * @return bool + */ + function PropertyEquals($params) + { + $object =& $this->getObject($params); + $property_name = $this->SelectParam($params, 'name,var,property'); + return $object->$property_name == $params['value']; + } + + /** * Group list records by header, saves internal order in group * * @param Array $records Index: trunk/admin/include/sections.php =================================================================== diff -u -r4112 -r4199 --- trunk/admin/include/sections.php (.../sections.php) (revision 4112) +++ trunk/admin/include/sections.php (.../sections.php) (revision 4199) @@ -93,16 +93,15 @@ { global $rootURL, $m_var_list_update; - if(!$this->IsJavaScriptLink()) - { - $m_var_list_update['opener']='r'; - if ( $this->IsKernel4Link() ) { + if (!$this->IsJavaScriptLink()) { + $m_var_list_update['opener'] = 'r'; + if ($this->IsKernel4Link()) { global $var_list_update; $stack_t = isset($var_list_update['t']) ? $var_list_update['t'] : null; $var_list_update['t'] = $this->Get('file'); $env = BuildEnv(); - $url = $rootURL.$this->Get("path"); - $url .= strstr($url,"?") ? '&env='.$env : '?env='.$env; + $url = $rootURL.$this->Get('path'); + $url .= (strstr($url, '?') ? '&' : '?').'env='.$env; if ($stack_t == null) { unset($var_list_update['t']); } @@ -115,16 +114,13 @@ $env = BuildEnv(); } - $url = $rootURL.$this->Get("path").$this->Get("file"); - if(strstr($url,"?")) - { - $url .= "&env=".$env; - } - else - $url .= "?env=".$env; + $url = $rootURL.$this->Get('path').$this->Get('file'); + $url .= (strstr($url, '?') ? '&' : '?').'env='.$env; } - else - $url = $this->Get("file"); + else { + // never called (tested with all modules installed) + $url = $this->Get('file'); + } return $url; } @@ -361,7 +357,7 @@ $notree = $this->sections[$child]->Get("notree"); if (($child == NULL) or ($notree==-1)) { - print "var item = insDoc($j_par, gLnk(0, \"".$caption."\", \"".$this->SectionURL($element)."\"));\n"; + print 'var item = insDoc('.$j_par.', gLnk(0, "'.$caption.'", "'.$this->SectionURL($element).'", "return checkEditMode();"));'."\n"; print "item.iconSrc = '".$this->SectionIconURL($element,0)."';\n"; if($this->sections[$element]->Get("right")!=NULL) $this->BuildTree($this->sections[$element]->Get("right"), $parent); @@ -371,7 +367,7 @@ if ($child != NULL && $notree !=-1) { //print "$j_el = insFld($j_par, gFld(\"".$sections[$element]['name']."\"));\n"; - print "var $j_el = insFld($j_par, gFld(\"".$caption."\",\"".$this->SectionURL($element)."\"));\n"; + print 'var '.$j_el.' = insFld('.$j_par.', gFld("'.$caption.'","'.$this->SectionURL($element).'", "return checkEditMode();"));'."\n"; print $j_el . ".iconSrc='".$this->SectionIconURL($element,0)."';\n"; if($this->sections[$element]->Get("right")!=NULL) $this->BuildTree($this->sections[$element]->Get("right"), $parent); Index: trunk/admin/tree/tree.php =================================================================== diff -u -r3145 -r4199 --- trunk/admin/tree/tree.php (.../tree.php) (revision 3145) +++ trunk/admin/tree/tree.php (.../tree.php) (revision 4199) @@ -17,22 +17,44 @@ $ServerName = $objConfig->Get('Site_Name'); $rootLink = $adminURL."/subitems.php?env=".BuildEnv()."§ion=in-portal:root"; $charset = GetRegionalOption('Charset'); + + $main_tag_processor =& $application->recallTagProcessor('m'); + $phrase_EditingInProgress = $main_tag_processor->Phrase( Array('name' => 'la_EditingInProgress', 'escape' => 1) ); + + $phrase_EditingInProgress = str_replace(Array('<', '>', 'br/', 'br /', "\n", "\r"), Array('<', '>', 'br', 'br', '', ''), $phrase_EditingInProgress); ?> "> - Index: trunk/globals.php =================================================================== diff -u -r4120 -r4199 --- trunk/globals.php (.../globals.php) (revision 4120) +++ trunk/globals.php (.../globals.php) (revision 4199) @@ -1358,14 +1358,6 @@ return $x; } -if (!function_exists('print_pre')) { - function print_pre($str) - { - // no comments here :) - echo '
'.print_r($str, true).'
'; - } -} - function GetOptions($field) // by Alex { // get dropdown values from custom field Index: trunk/kernel/admin_templates/incs/script.js =================================================================== diff -u -r4169 -r4199 --- trunk/kernel/admin_templates/incs/script.js (.../script.js) (revision 4169) +++ trunk/kernel/admin_templates/incs/script.js (.../script.js) (revision 4199) @@ -9,6 +9,7 @@ var $env = ''; var submitted = false; + var $edit_mode = false; var $init_made = true; // in case of double inclusion of script.js :) } Index: trunk/admin/index.php =================================================================== diff -u -r3884 -r4199 --- trunk/admin/index.php (.../index.php) (revision 3884) +++ trunk/admin/index.php (.../index.php) (revision 4199) @@ -51,20 +51,28 @@ - Index: trunk/admin/install/langpacks/english.lang =================================================================== diff -u -r3983 -r4199 --- trunk/admin/install/langpacks/english.lang (.../english.lang) (revision 3983) +++ trunk/admin/install/langpacks/english.lang (.../english.lang) (revision 4199) @@ -184,6 +184,7 @@ RGlzYWJsZWQ= RG93bmxvYWQgRXhwb3J0IEZpbGU= RG93bmxvYWQgTGFuZ3VhZ2UgRXhwb3J0 + WW91IGhhdmUgbm90IHNhdmVkIGNoYW5nZXMgdG8gdGhlIGl0ZW0geW91IGFyZSBlZGl0aW5nITxiciAvPkNsaWNrIE9LIHRvIGxvb3NlIGNoYW5nZXMgYW5kIGdvIHRvIHRoZSBzZWxlY3RlZCBzZWN0aW9uPGJyIC8+b3IgQ2FuY2VsIHRvIHN0YXkgaW4gdGhlIGN1cnJlbnQgc2VjdGlvbi4= RmlsZSBpcyBlbXB0eQ== RW5hYmxlZA== Q2FuJ3Qgc2F2ZSBhIGZpbGU= @@ -263,6 +264,7 @@ Q2F0ZWdvcnk= Q2F0ZWdvcnkgRm9ybWF0 Q2F0ZWdvcnkgc2VwYXJhdG9y + Q2F0ZWdvcnkgVGVtcGxhdGU= Q2hhcnNldA== Q2hlY2sgRHVwbGljYXRlcyBieQ== Q29weSBMYWJlbHMgZnJvbSB0aGlzIExhbmd1YWdl @@ -301,6 +303,7 @@ SW5zdGFsbCBNb2R1bGVz SW5zdGFsbCBQaHJhc2UgVHlwZXM= VXNlIGN1cnJlbnQgY2F0ZWdvcnkgYXMgcm9vdCBmb3IgdGhlIGV4cG9ydA== + SXRlbSBUZW1wbGF0ZQ== TGFuZ3VhZ2UgRmlsZQ== TGFuZ3VhZ2UgSUQ= TGVmdA== @@ -1350,6 +1353,7 @@ U2VuZCBFLW1haWw= U2VuZCBFLW1haWw= U2V0IFByaW1hcnk= + U2V0IFByaW1hcnkgTGFuZ3VhZ2U= Q2FuY2Vs VXAgYSBDYXRlZ29yeQ== VmFsaWRhdGU= Index: trunk/admin/include/mainscript.php =================================================================== diff -u -r3983 -r4199 --- trunk/admin/include/mainscript.php (.../mainscript.php) (revision 3983) +++ trunk/admin/include/mainscript.php (.../mainscript.php) (revision 4199) @@ -115,6 +115,7 @@ var ErrorMsg = '$errormsg'; //en = $en var rootURL = '$rootURL'; +var \$edit_mode = false; function clear_list_checkboxes() { Index: trunk/kernel/admin_templates/incs/form_blocks.tpl =================================================================== diff -u -r3983 -r4199 --- trunk/kernel/admin_templates/incs/form_blocks.tpl (.../form_blocks.tpl) (revision 3983) +++ trunk/kernel/admin_templates/incs/form_blocks.tpl (.../form_blocks.tpl) (revision 4199) @@ -27,6 +27,10 @@ + Index: trunk/admin/include/elements.php =================================================================== diff -u -r3668 -r4199 --- trunk/admin/include/elements.php (.../elements.php) (revision 3668) +++ trunk/admin/include/elements.php (.../elements.php) (revision 4199) @@ -79,16 +79,8 @@ //Page Header function int_header($toolbar=NULL,$NavBarText=NULL,$ExtraTitle=NULL,$onLoad=NULL, $ExtraHead=NULL,$skip_modules=Array(),$OtherSection = '') { - global $pathtoroot; - global $pathtolocal; - global $section; - global $objSections; - global $rootURL; - global $localURL; - global $adminURL; - global $envar; - global $admin; - global $metatag; + global $pathtoroot, $pathtolocal, $section, $objSections, $rootURL, $localURL, $adminURL, $envar, $admin, $metatag, $objSession; + $style_sheet_global = $adminURL."/include/style.css"; $style_sheet_local = $localURL."admin/include/style.css"; @@ -123,8 +115,12 @@ $sectionname = $sectionname[sizeof($sectionname)-1]; load_module_javascript($sectionname, $skip_modules); - if(is_object($toolbar)) - print $toolbar->GetInitScript(); + if (is_object($toolbar)) { + print $toolbar->GetInitScript(); + } + + echo ''; + print ' 0) - auxEv = "" - else - auxEv = "" - - if (level>0) - if (lastNode) //the last child in the children array - { - this.renderOb(leftSide + auxEv + "") - leftSide = leftSide + "" - this.isLastNode = 1 - } - else - { - this.renderOb(leftSide + auxEv + "") - leftSide = leftSide + "" - this.isLastNode = 0 - } - else - this.renderOb("") - - if (nc > 0) - { - level = level + 1 - for (i=0 ; i < this.nChildren; i++) - { - if (i == this.nChildren-1) - this.children[i].initialize(level, 1, leftSide) - else - this.children[i].initialize(level, 0, leftSide) - } - } - } - - function setStateFolder(isOpen) - { - var subEntries - var totalHeight - var fIt = 0 - var i=0 - - if (isOpen == this.isOpen) - return - - if (browserVersion == 2) - { - totalHeight = 0 - for (i=0; i < this.nChildren; i++) - totalHeight = totalHeight + this.children[i].navObj.clip.height - subEntries = this.subEntries() - if (this.isOpen) - totalHeight = 0 - totalHeight - for (fIt = this.id + subEntries + 1; fIt < nEntries; fIt++) - indexOfEntries[fIt].navObj.moveBy(0, totalHeight) - } - this.isOpen = isOpen - propagateChangesInState(this) - } - - function propagateChangesInState(folder) - { - var i=0 - - if (folder.isOpen) - { - if (folder.nodeImg) - if (folder.isLastNode) - folder.nodeImg.src = "ftv2mlastnode.gif" - else - folder.nodeImg.src = "ftv2mnode.gif" - folder.iconImg.src = folder.iconSrc; // "ftv2folderopen.gif" - for (i=0; i") - doc.write(leftSide) - this.outputLink() - doc.write("") - doc.write("") - if (USETEXTLINKS) - { - this.outputLink() - doc.write(this.desc + "") - } - else - doc.write(this.desc) - doc.write("") - - this.blockEnd() - - if (browserVersion == 1) { - this.navObj = doc.all["folder"+this.id] - this.iconImg = doc.all["folderIcon"+this.id] - this.nodeImg = doc.all["nodeIcon"+this.id] - } else if (browserVersion == 2) { - this.navObj = doc.layers["folder"+this.id] - this.iconImg = this.navObj.document.images["folderIcon"+this.id] - this.nodeImg = this.navObj.document.images["nodeIcon"+this.id] - doc.yPos=doc.yPos+this.navObj.clip.height - } else if (browserVersion == 3) { - this.navObj = doc.getElementById("folder"+this.id) - this.iconImg = doc.getElementById("folderIcon"+this.id) - this.nodeImg = doc.getElementById("nodeIcon"+this.id) - } - } - - function outputFolderLink() - { - if (this.hreference) - { - - doc.write(" 0) - - doc.write("onClick='javascript:clickOnFolder("+this.id+")'") - - doc.write(">") - + doc.write(' 0) { + doc.write('onClick="javascript:return clickOnFolder('+this.id+', \'' + this.onClick + '\')"'); + } + else { + doc.write('onclick="' + this.onClick + '"'); + } + doc.write('>'); } - - else - - doc.write("") - + else { + doc.write(''); + } // doc.write("") - } - - function addChild(childNode) - { - this.children[this.nChildren] = childNode - this.nChildren++ - return childNode - } - - function folderSubEntries() - { - var i = 0 - var se = this.nChildren - - for (i=0; i < this.nChildren; i++){ - if (this.children[i].children) //is a folder - se = se + this.children[i].subEntries() - } - - return se - } - - - // Definition of class Item (a document or link inside a Folder) - // ************************************************************* - - -function Item(itemDescription, itemLink) // Constructor - +function Item(itemDescription, itemLink, itemOnClick) // Constructor { - - // constant data - - this.desc = itemDescription - - this.link = itemLink - - this.id = -1 //initialized in initalize() - - this.navObj = 0 //initialized in render() - - this.iconImg = 0 //initialized in render() - - //this.iconSrc = "ftv2doc.gif" - - - - // methods - - this.initialize = initializeItem - - this.createIndex = createEntryIndex - - this.esconde = escondeBlock - - this.mostra = mostra - - this.renderOb = drawItem - - this.totalHeight = totalHeight - - this.blockStart = blockStart - - this.blockEnd = blockEnd - +// alert('creating item: ['+itemDescription+'] ; ['+itemLink+'] ; [' + itemOnClick + ']'); + + // constant data + this.desc = itemDescription + this.link = itemLink + this.onClick = itemOnClick + this.id = -1 //initialized in initalize() + this.navObj = 0 //initialized in render() + this.iconImg = 0 //initialized in render() + //this.iconSrc = "ftv2doc.gif" + + // methods + this.initialize = initializeItem + this.createIndex = createEntryIndex + this.esconde = escondeBlock + this.mostra = mostra + this.renderOb = drawItem + this.totalHeight = totalHeight + this.blockStart = blockStart + this.blockEnd = blockEnd } - - function initializeItem(level, lastNode, leftSide) - { - this.createIndex() - - if (level>0) - if (lastNode) //the last 'brother' in the children array - { - this.renderOb(leftSide + "") - leftSide = leftSide + "" - } - else - { - this.renderOb(leftSide + "") - leftSide = leftSide + "" - } - else - this.renderOb("") - } - - function drawItem(leftSide) - { - this.blockStart("item") - - doc.write("") - doc.write(leftSide) - doc.write("") - doc.write("") - doc.write("") - doc.write("") + if (USETEXTLINKS) { +// alert('writing: [' + '' + this.desc + '' +']'); + doc.write('' + this.desc + ''); + } + else { + doc.write(this.desc); + } - if (USETEXTLINKS) - - doc.write("" + this.desc + "") - - else - - doc.write(this.desc) - - - this.blockEnd() - - if (browserVersion == 1) { - this.navObj = doc.all["item"+this.id] - this.iconImg = doc.all["itemIcon"+this.id] - } else if (browserVersion == 2) { - this.navObj = doc.layers["item"+this.id] - this.iconImg = this.navObj.document.images["itemIcon"+this.id] - doc.yPos=doc.yPos+this.navObj.clip.height - } else if (browserVersion == 3) { - this.navObj = doc.getElementById("item"+this.id) - this.iconImg = doc.getElementById("itemIcon"+this.id) - } - } - - - // Methods common to both objects (pseudo-inheritance) - // ******************************************************** - - function mostra() - { - if (browserVersion == 1 || browserVersion == 3) { - var str = new String(doc.links[0]) - // if (str.slice(16,20) != "ins.") - // return - } - - if (browserVersion == 1 || browserVersion == 3) - this.navObj.style.display = "block" - else - this.navObj.visibility = "show" - } - - function escondeBlock() - { - if (browserVersion == 1 || browserVersion == 3) { - if (this.navObj.style.display == "none") - return - this.navObj.style.display = "none" - } else { - if (this.navObj.visibility == "hiden") - return - this.navObj.visibility = "hiden" - } - } - - function blockStart(idprefix) { - var idParam = "id='" + idprefix + this.id + "'" - - if (browserVersion == 2) - doc.write("") - - if (browserVersion == 3) //N6 has bug on display property with tables - doc.write("
") - - doc.write("") - else - doc.write(">") - } - - function blockEnd() { - doc.write("
") - - if (browserVersion == 2) - doc.write("") - if (browserVersion == 3) - doc.write("
") - } - - function createEntryIndex() - { - this.id = nEntries - indexOfEntries[nEntries] = this - nEntries++ - } - - // total height of subEntries open - function totalHeight() //used with browserVersion == 2 - { - var h = this.navObj.clip.height - var i = 0 - - if (this.isOpen) //is a folder and _is_ open - for (i=0 ; i < this.nChildren; i++) - h = h + this.children[i].totalHeight() - - return h - } - - - // Events - // ********************************************************* - - -function clickOnFolder(folderId) - +function clickOnFolder(folderId, customOnClick) { - var clicked = indexOfEntries[folderId] + eval('function doClick() {'+customOnClick+'} var $clickResult = doClick();'); + + if (!$clickResult) { + return false; + } + + if (!clicked.isOpen) { + clickOnNode(folderId); + } + return true; - - if (!clicked.isOpen) - - clickOnNode(folderId) - - - - return - - - - if (clicked.isSelected) - - return - + if (clicked.isSelected) { + return true; + } } - - function clickOnNode(folderId) - { - var clickedFolder = 0 - var state = 0 - - clickedFolder = indexOfEntries[folderId] - state = clickedFolder.isOpen - - clickedFolder.setState(!state) //open<->close - } - - - // Auxiliary Functions for Folder-Tree backward compatibility - // *********************************************************** - - -function gFld(description, hreference) - +function gFld(description, hreference, onClick) { - - folder = new Folder(description, hreference) - - return folder - + return new Folder(description, hreference, onClick); } - - -function gLnk(target, description, linkData) - +function gLnk(target, description, linkData, onClick) { + var fullLink = ''; - fullLink = "" - - - - if (target==0) - - { - - fullLink = "'"+linkData+"' target=\"main\"" - - } - - else - - { - - if (target==1) - - fullLink = "'http://"+linkData+"' target=_blank" - - else - - fullLink = "'http://"+linkData+"' target=\"main\"" - - } - - - - linkItem = new Item(description, fullLink) - - return linkItem - + if (target == 0) { + fullLink = '"' + linkData + '" target="main"'; + } + else { + if (target == 1) { + fullLink = '"http://' + linkData + '" target="_blank"'; + } + else { + fullLink = '"http://' + linkData + '" target="main"'; + } + } + + return new Item(description, fullLink, onClick); } - - function insFld(parentFolder, childFolder) - { return parentFolder.addChild(childFolder); } - - function insDoc(parentFolder, document) - { return parentFolder.addChild(document) - } - - - // Global variables - // **************** - - //These two variables are overwriten on defineMyTree.js if needed be - USETEXTLINKS = 0 - STARTALLOPEN = 0 - indexOfEntries = new Array - nEntries = 0 - doc = document - browserVersion = 0 - selectedFolder=0 - - - // Main function - // ************* - - // This function uses an object (navigator) defined in - // ua.js, imported in the main html page (left frame). - function initializeDocument() - { - switch(navigator.family) - { - case 'ie4': - browserVersion = 1 //IE4 - break; - case 'nn4': - browserVersion = 2 //NS4 - break; - case 'gecko': - browserVersion = 3 //NS6 - break; - default: - browserVersion = 0 //other - break; - } - - //foldersTree (with the site's data) is created in an external .js - foldersTree.initialize(0, 1, ""); - - if (browserVersion == 2) - doc.write(" ") - - //The tree starts in full display - if (!STARTALLOPEN) - if (browserVersion > 0) { - // close the whole tree - clickOnNode(0) - // open the root folder - clickOnNode(0) - } - - if (browserVersion == 0) - doc.write("


This tree only expands or contracts with DHTML capable browsers
") +} +function checkEditMode() +{ + if (window.parent.getFrame('main').$edit_mode) { + return confirm($phrase_EditingInProgress) ? true : false; + } + + return true; } - - +function isset(variable) +{ + if(variable==null) return false; + return (typeof(variable)=='undefined')?false:true; +} \ No newline at end of file Index: trunk/admin/subitems.php =================================================================== diff -u -r4065 -r4199 --- trunk/admin/subitems.php (.../subitems.php) (revision 4065) +++ trunk/admin/subitems.php (.../subitems.php) (revision 4199) @@ -7,6 +7,7 @@ require_once FULL_PATH.'/kernel/startup.php'; // new startup: end + $jsURL = $adminURL.'/include/subitems'; //admin only util $pathtolocal = $pathtoroot.'kernel/'; require_once ($pathtoroot.$admin.'/include/elements.php');