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/List.php';
00026
00027
00028
00029
00040
00041 class FF_Action_List_Filter extends FF_Action_List {
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_ADD)),
00054 sprintf(_('Add New %s'), $this->getSingularText())));
00055 }
00056
00057
00058
00059
00068 function getHighlightedRowUrl()
00069 {
00070 return FastFrame::selfURL(array('actionId' => ACTION_EDIT, 'objectId' => $this->o_model->getId()));
00071 }
00072
00073
00074
00075
00082 function getDefaultSortField()
00083 {
00084 return 'name';
00085 }
00086
00087
00088
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
00106
00113 function getSingularText()
00114 {
00115 return _('Filter');
00116 }
00117
00118
00119
00120
00127 function getPluralText()
00128 {
00129 return _('Filters');
00130 }
00131
00132
00133
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 ?>