FilterList.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_Filter
00029 
00040 // }}}
00041 class FF_Action_List_Filter 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 'name';
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         );
00102     }
00103 
00104     // }}}
00105     // {{{ getSingularText()
00106 
00113     function getSingularText()
00114     {
00115         return _('Filter');
00116     }
00117 
00118     // }}}
00119     // {{{ getPluralText()
00120 
00127     function getPluralText()
00128     {
00129         return _('Filters');
00130     }
00131 
00132     // }}}
00133     // {{{ getOptions()
00134 
00142     function getOptions()
00143     {
00144         $tmp_text = '';
00145         $tmp_text .= $this->o_output->link(
00146                 FastFrame::selfURL(array(
00147                         'actionId' => ACTION_EDIT, 'objectId' => $this->o_model->getId())),
00148                 $this->o_output->imgTag('edit.gif', 'actions'),
00149                 array('title' => sprintf (_('Edit %s'), $this->getSingularText())));
00150         $tmp_text .= ' ';
00151         $tmp_text .= $this->o_output->link(
00152                 FastFrame::selfURL(array(
00153                         'actionId' => ACTION_DELETE, 'objectId' => $this->o_model->getId())),
00154                 $this->o_output->imgTag('delete.gif', 'actions'),
00155                 array('title' => sprintf (_('Delete %s'), $this->getSingularText()), 
00156                     'confirm' => sprintf(_('Are you sure you want to delete this %s?'), $this->getSingularText()))); 
00157 
00158         return $tmp_text;
00159     }
00160 
00161     // }}}
00162 }
00163 ?>

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