PriorityList.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/List.php';
00026 
00027 // }}}
00028 // {{{ class FF_Action_List_Priority
00029 
00040 // }}}
00041 class FF_Action_List_Priority extends FF_Action_List {
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_ADD)),
00054                     sprintf(_('Add New %s'), $this->getSingularText())));
00055     }
00056 
00057     // }}}
00058     // {{{ getHighlightedRowUrl()
00059 
00068     function getHighlightedRowUrl()
00069     {
00070         return FastFrame::selfURL(array('actionId' => ACTION_EDIT, 'objectId' => $this->o_model->getId()));
00071     }
00072 
00073     // }}}
00074     // {{{ getDefaultSortField()
00075     
00082     function getDefaultSortField()
00083     {
00084         return 'points';
00085     }
00086 
00087     // }}}
00088     //{{{ getFieldMap()
00089 
00096     function getFieldMap()
00097     {
00098         return array(
00099             array('description' => _('Options'), 'method' => 'getOptions'),
00100             array('field' => 'name', 'description' => _('Name'), 'method' => 'getName'),
00101             array('field' => 'points', 'description' => _('Points'), 'method' => 'getPoints'),
00102             array('field' => 'is_default', 'description' => _('Default'), 'method' => 'getIsDefault', 'args' => array(true)),
00103             array('description' => _('Alert Message'), 'method' => 'getAlertMessage'),
00104         );
00105     }
00106 
00107     // }}}
00108     // {{{ getSingularText()
00109 
00116     function getSingularText()
00117     {
00118         return _('Priority');
00119     }
00120 
00121     // }}}
00122     // {{{ getPluralText()
00123 
00130     function getPluralText()
00131     {
00132         return _('Priorities');
00133     }
00134 
00135     // }}}
00136     // {{{ getOptions()
00137 
00145     function getOptions()
00146     {
00147         $tmp_text = '';
00148         $tmp_text .= $this->o_output->link(
00149                 FastFrame::selfURL(array(
00150                         'actionId' => ACTION_EDIT, 'objectId' => $this->o_model->getId())),
00151                 $this->o_output->imgTag('edit.gif', 'actions'),
00152                 array('title' => sprintf (_('Edit %s'), $this->getSingularText())));
00153         $tmp_text .= ' ';
00154         $tmp_text .= $this->o_output->link(
00155                 FastFrame::selfURL(array(
00156                         'actionId' => ACTION_DELETE, 'objectId' => $this->o_model->getId())),
00157                 $this->o_output->imgTag('delete.gif', 'actions'),
00158                 array('title' => sprintf (_('Delete %s'), $this->getSingularText()), 
00159                     'confirm' => sprintf(_('Are you sure you want to delete this %s?'), $this->getSingularText()))); 
00160 
00161         return $tmp_text;
00162     }
00163 
00164     // }}}
00165 }
00166 ?>

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