1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| <?php $_LW->REGISTERED_APPS['my_app']=[ 'title'=>'My App', 'handlers'=>['onValidatePublicSubmission'], ];
class LiveWhaleApplicationMyApp {
public function onValidatePublicSubmission($data_type) { global $_LW; if ($data_type=='events') { if (empty($_LW->_POST['event_location'])) { $_LW->REGISTERED_MESSAGES['failure'][]='An event location must be specified.'; }; if (empty($_LW->_POST['event_types'])) { $_LW->REGISTERED_MESSAGES['failure'][]='At least one event type must be specified.'; }; if (empty($_LW->_POST['event_description'])) { $_LW->REGISTERED_MESSAGES['failure'][]='You must enter a description for your event.'; }; }; }
} ?>
|