Source of file MemberProfileFieldsSection.php
Size: 0,988 Bytes - Last Modified: 2021-12-23T10:32:51+00:00
/var/www/docs.ssmods.com/process/src/code/dataobjects/MemberProfileFieldsSection.php
123456789101112131415161718192021222324252627282930313233343536373839404142 | <?php /** * A profile section that displays a list of fields that have been marked as * public. * * @package silverstripe-memberprofiles * @subpackage dataobjects */ class MemberProfileFieldsSection extends MemberProfileSection { public function getDefaultTitle() { return _t('MemberProfiles.PROFILEFIELDSLIST', 'Profile Fields List'); } public function forTemplate() { return $this->renderWith('MemberProfileFieldsSection'); } public function Fields() { $fields = $this->Parent()->Fields()->where('"PublicVisibility" <> \'Hidden\''); $public = $this->member->getPublicFields(); $result = new ArrayList(); foreach($fields as $field) { if($field->PublicVisibility == 'MemberChoice') { if(!in_array($field->MemberField, $public)) continue; } $result->push(new ArrayData(array( 'Title' => $field->Title, 'Value' => $this->member->{$field->MemberField} ))); } return $result; } public function ShowTitle() { return false; } } |