From 3cf6d283daec117cae2df9087386fdc172299d85 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 25 Nov 2008 23:40:28 +0000 Subject: [PATCH] forward porting assetmanager crumb trail more menu --- docs/changelog/7.x.x.txt | 21 ++++++ lib/WebGUI/Content/AssetManager.pm | 2 +- .../build/assetManager/assetManager.js | 64 +++++++++++++------ 3 files changed, 68 insertions(+), 19 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 76abb39d9..f1584c4fd 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,8 @@ - fixed: #9149: Account: default templates do not work right - fixed: Adding a file extension for URLs in the system settings now properly affects newly created Assets. It still does not update existing asset URL's. - fixed #9152: Pagination broken in Contribs Section of new Account System + - fixed #4159: more menu doesn't appear for current asset on crumb trail + - fixed: Adding a file extension for URLs in the system settings now properly affects newly created Assets. It still does not update existing asset URL's. 7.6.4 - Survey now will show progress and time limit. @@ -71,6 +73,25 @@ - fixed #4213: Can see "edit" tab even tho i am not logged in - fixed #9139: Updating a workflow property causes workflow to be disabled - fixed #9140: Date format error when adding tasks to PM + - fixed #8800: Errors in POD of Asset-related mix-in modules (Bernd Kalbfuß-Zimmermann) + - fixed #9143: Yes No user profile fields problem when default == 1 + +7.5.34 + - fixed: Regression with ProfileField->formField. Added tests to prevent future regression + - fixed #8849: More missing i18n + - fixed: Performance issue with Stow. Added a way to bypass safety for speed. + - fixed #4182: Edit links show in asset manager for locked assets + - fixed #8971: UserList shows accounts that have been self-deactivated (Bernd Kalbfuß-Zimmermann) + - fixed #4199: Default values of user profile fields are not filled in correctly when shown by the UserList asset (Bernd Kalbfuß-Zimmerman) + - fixed #9068: field.inTab + - fixed #8845: Workflows refusing to show edit screen + - fixed #4198: Namespace of Template "Newsletter (Manager)" set to "Collaboration + - fixed #9106: Calendar Feed Workflow Creating Version Tags w/o Updates + - fixed #8914: epoch for calendar/List View for Calendar + - fixed #8822: Password Recovery Tempalte not working + - fixed: DataForm times out when exporting large data sets + - fixed: DataForm entry data field is too small +>>>>>>> .merge-right.r8665 7.6.3 diff --git a/lib/WebGUI/Content/AssetManager.pm b/lib/WebGUI/Content/AssetManager.pm index d9b6b2e17..8fa11d41a 100644 --- a/lib/WebGUI/Content/AssetManager.pm +++ b/lib/WebGUI/Content/AssetManager.pm @@ -428,7 +428,7 @@ ENDHTML } # And ourself - $output .= sprintf q{
  • %s
  • }, + $output .= sprintf q{
  • %s
  • }, $currentAsset->getUrl, $currentAsset->get( "menuTitle" ), ; diff --git a/www/extras/yui-webgui/build/assetManager/assetManager.js b/www/extras/yui-webgui/build/assetManager/assetManager.js index 40c20a17c..fbb6271b8 100644 --- a/www/extras/yui-webgui/build/assetManager/assetManager.js +++ b/www/extras/yui-webgui/build/assetManager/assetManager.js @@ -41,6 +41,33 @@ WebGUI.AssetManager.addHighlightToRow } }; +/*--------------------------------------------------------------------------- + WebGUI.AssetManager.buildMoreMenu ( url, linkElement ) + Build a WebGUI style "More" menu for the asset referred to by url +*/ +WebGUI.AssetManager.buildMoreMenu += function ( url, linkElement ) { + // Build a more menu + var rawItems = WebGUI.AssetManager.MoreMenuItems; + var menuItems = []; + for ( var i = 0; i < rawItems.length; i++ ) { + var itemUrl = rawItems[i].url.match( // ) + ? rawItems[i].url.replace( /(?:\?(.*))?/, WebGUI.AssetManager.appendToUrl(url, "$1") ) + : url + rawItems[i].url + ; + menuItems.push( { "url" : itemUrl, "text" : rawItems[i].label } ); + } + var options = { + "zindex" : 1000, + "clicktohide" : true, + "position" : "dynamic", + "context" : [ linkElement, "tl", "bl" ], + "itemdata" : menuItems + }; + + return options; +}; + /*--------------------------------------------------------------------------- WebGUI.AssetManager.findRow ( child ) Find the row that contains this child element. @@ -82,24 +109,7 @@ WebGUI.AssetManager.formatActions = function ( elCell, oRecord, oColumn, orderNu oldMenu.parentNode.removeChild( oldMenu ); } - // Build a more menu - var rawItems = WebGUI.AssetManager.MoreMenuItems; - var menuItems = []; - for ( var i = 0; i < rawItems.length; i++ ) { - var itemUrl = rawItems[i].url.match( // ) - ? rawItems[i].url.replace( /(?:\?(.*))?/, WebGUI.AssetManager.appendToUrl(oRecord.getData( 'url' ), "$1") ) - : oRecord.getData( 'url' ) + rawItems[i].url - ; - menuItems.push( { "url" : itemUrl, "text" : rawItems[i].label } ); - } - - var options = { - "zindex" : 1000, - "clicktohide" : true, - "position" : "dynamic", - "context" : [ more, "tl", "bl" ], - "itemdata" : menuItems - }; + var options = WebGUI.AssetManager.buildMoreMenu(oRecord.getData( 'url' ), more); var menu = new YAHOO.widget.Menu( "moreMenu" + oRecord.getData( 'assetId' ), options ); YAHOO.util.Event.onDOMReady( function () { menu.render( document.getElementById( 'assetManager' ) ) } ); @@ -329,6 +339,24 @@ WebGUI.AssetManager.selectRow = function ( child ) { } }; +/*--------------------------------------------------------------------------- + WebGUI.AssetManager.showMoreMenu ( url, linkTextId ) + Build a More menu for the last element of the Crumb trail +*/ +WebGUI.AssetManager.showMoreMenu += function ( url, linkTextId ) { + var more = document.getElementById(linkTextId); + + var options = WebGUI.AssetManager.buildMoreMenu(url, more); + + var menu = new YAHOO.widget.Menu( "crumbMoreMenu", options ); + menu.render( document.getElementById( 'assetManager' ) ); + menu.show(); + menu.focus(); + //YAHOO.util.Event.onDOMReady( function () { menu.render( document.getElementById( 'assetManager' ) ) } ); + //YAHOO.util.Event.addListener( more, "click", function (e) { menu.show(); menu.focus(); YAHOO.util.Event.stopEvent(e); }, null, menu ); +}; + /*--------------------------------------------------------------------------- WebGUI.AssetManager.toggleHighlightForRow ( checkbox ) Toggle the highlight for the row based on the state of the checkbox