00001 <?php
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 require_once FASTFRAME_ROOT . 'lib/FastFrame/Action/Form.php';
00026
00027
00028
00029
00040
00041 class FF_Action_Form_Location extends FF_Action_Form {
00042
00043
00050 function renderAdditionalLinks()
00051 {
00052 $this->o_output->o_tpl->append('page_links', $this->o_output->link(
00053 FastFrame::selfURL(array('actionId' => ACTION_LIST)),
00054 sprintf(_('Return to %s List'), $this->getSingularText())));
00055 }
00056
00057
00058
00059
00067 function createFormElements()
00068 {
00069 $this->o_form->addElement('hidden', 'actionId');
00070 $this->o_form->addElement('hidden', 'objectId');
00071 $this->o_form->addElement('submit', 'submitbutton');
00072 $this->o_form->addElement('text', 'name', null, array('maxlength' => 150, 'size' => 30));
00073 $this->o_form->addElement('checkbox', 'is_default');
00074 $this->o_form->addRule('name', _('Name cannot be blank.'), 'required', null, 'client');
00075 }
00076
00077
00078
00079
00086 function getSingularText()
00087 {
00088 return _('Location');
00089 }
00090
00091
00092
00093
00101 function getPluralText()
00102 {
00103 return _('Locations');
00104 }
00105
00106
00107
00108
00117 function getTableData()
00118 {
00119 $a_headers = array();
00120 $tmp_help = _('Enter a descriptive name for this location. Locations are used to specify where the mayday is located.');
00121 $a_headers[] = array(
00122 'title' => '* ' . sprintf(_('Name %s'), $this->o_output->getHelpLink($tmp_help)),
00123 'titleStyle' => 'style="font-weight: bold;"',
00124 'data' => $this->o_renderer->elementToHtml('name'),
00125 );
00126 $tmp_help = sprintf(_('If this is to be the default %s for new maydays then check this box.'), $this->getSingularText());
00127 $a_headers[] = array(
00128 'title' => sprintf(_('Default %s'), $this->o_output->getHelpLink($tmp_help)),
00129 'data' => $this->o_renderer->elementToHtml('is_default'),
00130 );
00131 return $a_headers;
00132 }
00133
00134
00135
00136
00144 function getFormDefaults()
00145 {
00146 $a_fields = array();
00147 $a_fields['objectId'] = $this->o_model->getId();
00148 $a_fields['name'] = $this->o_model->getName();
00149 $a_fields['is_default'] = $this->o_model->getIsDefault();
00150 return $a_fields;
00151 }
00152
00153
00154 }
00155 ?>