Changeset 1517:055caf38ee9f for inc/admin/class.dc.form.php
- Timestamp:
- 08/21/13 15:33:12 (12 years ago)
- Branch:
- twig
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/class.dc.form.php
r1507 r1517 162 162 'form_field', 163 163 array($this,'renderField'), 164 array('is_safe' => array('html')) 165 ), 166 new Twig_SimpleFunction( 167 'form_hidden', 168 array($this,'renderHiddenWidgets'), 164 169 array('is_safe' => array('html')) 165 170 ), … … 299 304 } 300 305 } 301 306 302 307 /** 303 308 * getFieldAttributes - binding for 'form_field_attr' twig function; returns all field attributes … … 337 342 */ 338 343 public function renderHiddenWidgets() 339 { 344 { 345 if ($this->currentForm->areHiddenfieldsDisplayed()) { 346 return; 347 } 340 348 foreach ($this->currentForm->getHiddenFields() as $h) { 341 349 $this->renderField($h->getName()); 342 350 } 351 $this->currentForm->setHiddenfieldsDisplayed(); 343 352 } 344 353 … … 433 442 protected $properties; 434 443 444 protected $hiddendisplayed; 435 445 436 446 /** … … 461 471 $this->addNonce(); 462 472 } 463 } 464 473 $this->hiddendisplayed = false; 474 } 475 476 /** 477 * areHiddenFieldsDisplayed - tells whether hidden fields have been rendered or not 478 * 479 * @return boolean true if hidden fields have already been displayed, false otherwise 480 * @access public 481 */ 482 public function areHiddenFieldsDisplayed() { 483 return $this->hiddendisplayed; 484 } 485 486 /** 487 * setHiddenFieldsDisplayed - sets whether hidden fields have been rendered or not 488 * 489 * @param boolean true (default) if hidden fields are to be set as displayed, false otherwise 490 * @access public 491 */ 492 public function setHiddenFieldsDisplayed($value=true) { 493 $this->hiddendisplayed = $value; 494 } 465 495 466 496 /**
Note: See TracChangeset
for help on using the changeset viewer.