Advertisement
Punk_UnDeaD

Untitled

Nov 12th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php
  2. function fita_button($variables) {
  3.   $element = $variables['element'];
  4.   $element['#attributes']['type'] = 'submit';
  5.   element_set_attributes($element, array('id', 'name', 'value'));
  6.   $element['#attributes']['class'][] = 'form-' . $element['#button_type'];
  7.   $element['#attributes']['class'][] = 'btn';
  8.   if (!empty($element['#attributes']['disabled'])) {
  9.     $element['#attributes']['class'][] = 'form-button-disabled';
  10.   }
  11.   if (strpos($element['#attributes']['id'], 'panel') === FALSE) {
  12.     return ' <button' . drupal_attributes($element['#attributes']) . ' >' . $element["#value"] . '</button> ';
  13.   }
  14.   else {
  15.     return '<input type=submit' . drupal_attributes($element['#attributes']) . ' />';
  16.   }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement