Forked from anonymous/MemberProfileFieldExtension.php
Created
December 28, 2012 15:47
-
-
Save ivoba/4399001 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MemberProfileFieldExtension extends DataExtension { | |
public static $db = array( | |
'SortOrder' => 'Int' | |
); | |
function updateCMSFields(FieldList $fields) { | |
$fields->push(new NumericField('SortOrder', 'SortOrder')); | |
parent::updateCMSFields($fields); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SortableMemberProfilePage extends MemberProfilePage { | |
public function getCMSFields() { | |
$fields = parent::getCMSFields(); | |
$fields->dataFieldByName('Fields')->getConfig()->addComponent(new GridFieldSortableRows('SortOrder')); | |
return $fields; | |
} | |
} | |
class SortableMemberProfilePage_Controller extends MemberProfilePage_Controller { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment