コード例 #1
0
 function __construct($controller, $name, $talkID)
 {
     // Email Address Field
     $EmailAddressField = new TextField('Email', "Speaker's Email Address");
     $formData = Session::get("FormInfo.Form_CallForSpeakersRegistrationForm.data");
     if ($formData['Email']) {
         $email = $formData['Email'];
     } else {
         $email = Member::currentUser()->Email;
     }
     $EmailAddressField->setValue($email);
     // Talk ID
     $TalkField = new HiddenField('TalkID', "TalkID", $talkID);
     $fields = new FieldList($EmailAddressField, $TalkField);
     $talk = NULL;
     if ($talkID != NULL) {
         // Look to see if the presentation has at least one speaker attached
         $talkID = Convert::raw2sql($talkID);
         $talk = Talk::get()->byID($talkID);
     }
     if ($talk && $talk->HasSpeaker()) {
         $actions = new FieldList(new FormAction('addAction', 'Add New Speaker'), new FormAction('done', 'Done Editing Speakers'));
     } else {
         $actions = new FieldList(new FormAction('addAction', 'Add First Speaker'));
     }
     parent::__construct($controller, $name, $fields, $actions);
 }
コード例 #2
0
 public function talks($day)
 {
     $talks = Talk::get()->filter(array('Day' => $day))->sort('Start ASC');
     if ($day === 'Sat') {
         $talks = GroupedList::create($talks->sort('Start ASC, Room ASC'));
     }
     return $talks;
 }