From 02f4ff232fadb1453fc1fe3cfc248c0206a996b2 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Wed, 19 Aug 2009 05:47:02 +0000 Subject: [PATCH] ENHANCMENT: get svn merged revision 84806:84808 from branches/iss git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84814 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/SelectionGroup.js | 42 ++++++++++++++++++++---------------- security/Permission.php | 1 + 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/javascript/SelectionGroup.js b/javascript/SelectionGroup.js index 00319f38b..8949b4595 100755 --- a/javascript/SelectionGroup.js +++ b/javascript/SelectionGroup.js @@ -1,21 +1,27 @@ -Behaviour.register({ - 'ul.SelectionGroup input.selector' : { - onclick : function() { - var prnt = this.parentNodeWithTag('ul'); - var li = this.parentNodeWithTag('li'); - var i, item, allItems = prnt.childNodes; - for(i=0;item=allItems[i];i++) if(item.tagName) { - if(item == li) { - Element.addClassName(item, 'selected') - } else { - Element.removeClassName(item, 'selected') - } +(function($) { +$(document).ready(function() { + $('ul.SelectionGroup input.selector').livequery('click', function(){ + var prnt = this.parentNodeWithTag('ul'); + var li = this.parentNodeWithTag('li'); + var i, item, allItems = prnt.childNodes; + for(i=0;item=allItems[i];i++) if(item.tagName) { + if(item == li) { + Element.addClassName(item, 'selected') + } else { + Element.removeClassName(item, 'selected') } - }, - parentNodeWithTag: function(tagName) { - var el = this.parentNode; - while(el.parentNode && el.tagName.toLowerCase() != tagName) el = el.parentNode; - return el; } + }); +}) +})(jQuery); + +SelectionGroupSelector = Class.create(); +SelectionGroupSelector.prototype = { + parentNodeWithTag: function(tagName){ + var el = this.parentNode; + while(el.parentNode && el.tagName.toLowerCase() != tagName) el = el.parentNode; + return el; } -}); \ No newline at end of file +} + +SelectionGroupSelector.applyTo('ul.SelectionGroup input.selector'); \ No newline at end of file diff --git a/security/Permission.php b/security/Permission.php index c08fbda74..dd6c61f6b 100755 --- a/security/Permission.php +++ b/security/Permission.php @@ -227,6 +227,7 @@ class Permission extends DataObject { /** * Get all the 'any' permission codes available to the given member. + * @return array(); */ public static function permissions_for_member($memberID) { $groupList = self::groupList($memberID);