multipage_form_restore_attributes

Versions
4.7 – 6
multipage_form_restore_attributes(&$element)

Restore any form attributes which have been set using multipage_form_set_attribute().

Parameters

$element The form element array to restore.

▾ 1 function calls multipage_form_restore_attributes()

multipage_form_set_element_visibility in developer/examples/multipage_form_example.module
Set an element's visibility. Elements are gnerally changed to hidden elements. Visibility may be set and reset any number of times.

Code

developer/examples/multipage_form_example.module, line 445

<?php
function multipage_form_restore_attributes(&$element) {
  foreach (array_filter(array_keys($element), create_function('$key', 'return (strpos($key, "#multipage_form_original_") === 0);')) as $key) {
    $element[str_replace('#multipage_form_original_', '', $key)] = $element[$key];
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.