LocationForm.php

Go to the documentation of this file.
00001 <?php
00003 // {{{ license
00004 
00005 // +----------------------------------------------------------------------+
00006 // | FastFrame Application Framework                                      |
00007 // +----------------------------------------------------------------------+
00008 // | Copyright (c) 2002-2006 The Codejanitor Group                        |
00009 // +----------------------------------------------------------------------+
00010 // | This source file is subject to the GNU Lesser Public License (LGPL), |
00011 // | that is bundled with this package in the file LICENSE, and is        |
00012 // | available at through the world-wide-web at                           |
00013 // | http://www.fsf.org/copyleft/lesser.html                              |
00014 // | If you did not receive a copy of the LGPL and are unable to          |
00015 // | obtain it through the world-wide-web, you can get it by writing the  |
00016 // | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
00017 // | MA 02111-1307, USA.                                                  |
00018 // +----------------------------------------------------------------------+
00019 // | Authors: Jason Rust <jrust@codejanitor.com>                          |
00020 // +----------------------------------------------------------------------+
00021 
00022 // }}}
00023 // {{{ requires
00024 
00025 require_once FASTFRAME_ROOT . 'lib/FastFrame/Action/Form.php';
00026 
00027 // }}}
00028 // {{{ class FF_Action_Form_Location
00029 
00040 // }}}
00041 class FF_Action_Form_Location extends FF_Action_Form {
00042     // {{{ renderAdditionalLinks()
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     // {{{ createFormElements()
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     // {{{ getSingularText()
00079 
00086     function getSingularText()
00087     {
00088         return _('Location');
00089     }
00090 
00091     // }}}
00092     // {{{ getPluralText()
00093 
00101     function getPluralText()
00102     {
00103         return _('Locations');
00104     }
00105 
00106     // }}}
00107     // {{{ getTableData()
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     // {{{ getFormDefaults()
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 ?>

Generated on Fri Jun 23 11:38:16 2006 for FastFrame by  doxygen 1.4.4