Changeset 4005
- Timestamp:
- 05/15/07 01:22:54 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfDataGridPlugin/lib/BasesfDataGrid.class.php
r3945 r4005 298 298 299 299 /** 300 * Title Row Content Getter Vars301 *302 * Array of variables to be passed to the content getter303 *304 * @var array305 * @access public306 */307 public $titleRowContentGetterVars = array();308 309 310 /**311 300 * Footer Row Content Getter 312 301 * … … 324 313 */ 325 314 public $footerRowContentGetter; 326 327 /** 328 * Footer Row Content Getter Vars 329 * 330 * Array of variables to be passed to the content getter 331 * 332 * @var array 333 * @access public 334 */ 335 public $footerRowContentGetterVars = array(); 336 337 /** 315 316 /** 338 317 * Holds the Doctrine_Query object 339 318 * … … 705 684 foreach($this AS $key => $value) 706 685 { 707 $newValue = sfConfig::get('app_ tabbed_content_'.sfInflector::underscore($key));686 $newValue = sfConfig::get('app_data_grid_'.sfInflector::underscore($key)); 708 687 709 688 if( isset($newValue) && $newValue != $value ) … … 896 875 } 897 876 } 898 899 public function setTitleRowContentGetter($contentGetter, $vars = null)900 {901 $this->titleRowContentGetter = $contentGetter;902 903 if( $vars )904 {905 $this->setTitleRowContentGetterVars($vars);906 }907 }908 909 public function setFooterRowContentGetter($contentGetter, $vars = null)910 {911 $this->footerRowContentGetter = $contentGetter;912 913 if( $vars )914 {915 $this->setFooterRowContentGetterVars($vars);916 }917 }918 877 919 878 /** … … 1205 1164 if( $this->getShowFooter() ) 1206 1165 { 1207 if( !$this->getFooterRowContentGetter() )1166 if( $this->getFooterRowContentGetter() ) 1208 1167 { 1209 $html = "\n\n".'<div class="data_grid_form_footer" id="'.$this->getFormId().'_form_footer">'."\n"; 1168 $html = sfContentGetter::getInstance($this->getFooterRowContentGetter(), array('dataGrid' => $this), $this->getModuleName())->output(); 1169 } else { 1170 $html = "\n\n".'<div class="data_grid_form_footer" id="'.$this->getFormId().'_form_footer">'."\n"; 1210 1171 1211 1172 if( !empty($this->array) ) … … 1216 1177 1217 1178 $html .= '<br/></div>'."\n\n"; 1218 } else { 1219 $vars = array_merge(array('dataGrid' => $this), $this->getFooterRowContentGetterVars()); 1220 1221 $html = sfContentGetter::getInstance($this->getFooterRowContentGetter(), $vars, $this->getModuleName())->output(); 1222 } 1223 1224 return $html; 1179 } 1180 1181 return $html; 1225 1182 } 1226 1183 } … … 1569 1526 if( $this->getShowTitle() ) 1570 1527 { 1571 if( !$this->getTitleRowContentGetter() AND $title = $this->getRenderedTitle() )1528 if( $this->getTitleRowContentGetter() ) 1572 1529 { 1573 return '<div class="data_grid_title_row" id="'.$this->getId().'_data_grid_title_row">'.$this->getCollapseIcon().'<div class="data_grid_title_wrapper">'.$title.'</div></div>'."\n"; 1530 return sfContentGetter::getInstance($this->getTitleRowContentGetter(), array('dataGrid' => $this), $this->getModuleName())->output(); 1531 } else { 1532 return '<div class="data_grid_title_row" id="'.$this->getId().'_data_grid_title_row">'.$this->getCollapseIcon().'<div class="data_grid_title_wrapper">'.$this->getRenderedTitle($this->getTitle()).'</div></div>'."\n"; 1574 1533 } 1575 else if( $contentGetter = $this->getTitleRowContentGetter() )1576 {1577 $vars = array_merge(array('dataGrid' => $this, 'title' => $this->getRenderedTitle()), $this->getTitleRowContentGetterVars());1578 1579 return sfContentGetter::getInstance($contentGetter, $vars, $this->getModuleName())->output();1580 }1581 1534 } 1582 1535 }