mlanthaler: Changed the name of DataObject::add_extension() to DataObject::addExtension() (to have consistent method names) and added the a Member::addRole().

ischommer: Functionality moved to Object, and DataObject::addExtension is NOT consistent naming! (static methods coding conventions)
Now everything is as described in http://doc.silverstripe.com/doku.php?id=member#new_ideamember_role_decorator. 
(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41841 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-15 00:40:28 +00:00
parent 00cb1546db
commit 3b5a0862f3

View File

@ -460,7 +460,7 @@ class Member extends DataObject {
*/
public function Groups() {
$groups = $this->getManyManyComponents("Groups");
$unsecure = DataObject::get("Group_Unsecure", "");
if($unsecure) {
foreach($unsecure as $unsecureItem) {
@ -636,14 +636,30 @@ class Member extends DataObject {
//new TextField( "Organisation", "Organisation" ),
//new OptionsetField("HTMLEmail","Mail Format", array( 1 => 'HTML', 0 => 'Text only' ) )
);
$this->extend('updateCMSFields', $fields);
// if($this->hasMethod('updateCMSFields')) $this->updateCMSFields($fields);
return $fields;
}
/**
* Add an extension to the Member class
*
* This method can be used to add behaviour to Member class. The extension
* affects the entire class - all members will get the additional
* behaviour. However, if you want to restrict things, you should add
* appropriate Permission::checkMember() calls to the extensions's
* methods.
*
* @param string $extensionName Class name of the extension to add
*/
public static function add_role($extensionName) {
DataObject::add_extension('Member', $extensionName);
}
/**
* Unsubscribe from newsletter
*