function iwebkit_textfield($element) { $size = empty($element['#size']) ? '' : ' size="' . $element['#size'] . '"'; $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="' . $element['#maxlength'] . '"'; $class = array('form-text'); $extra = ''; $output = ''; if ($element['#autocomplete_path'] && menu_valid_path(array('link_path' => $element['#autocomplete_path']))) { drupal_add_js('misc/autocomplete.js'); $class[] = 'form-autocomplete'; $extra = '<input class="autocomplete" type="hidden" id="' . $element['#id'] . '-autocomplete" value="' . check_url(url($element['#autocomplete_path'], array('absolute' => TRUE))) . '" disabled="disabled" />'; } _form_set_class($element, $class); if (isset($element['#field_prefix'])) { $output .= '<span class="field-prefix">' . $element['#field_prefix'] . '</span> '; } $output .= '<ul class="pageitem"><li class="form"><input placeholder="' . $element['#title'] . '" type="text"' . $maxlength . ' name="' . $element['#name'] . '" id="' . $element['#id'] . '"' . $size . ' value="' . check_plain($element['#value']) . '"' . drupal_attributes($element['#attributes']) . ' /></li></ul>'; if (isset($element['#field_suffix'])) { $output .= ' <span class="field-suffix">' . $element['#field_suffix'] . '</span>'; } return theme('form_element', $element, $output) . $extra; }
function iwebkit_format_bigfield($element, $type) { $size = empty($element['#size']) ? '' : ' size="' . $element['#size'] . '"'; $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="' . $element['#maxlength'] . '"'; $class = array('form-text'); $extra = ''; $output = ''; $placeholder = ''; /* Wrap in iWebKit li */ $output .= '<li class="bigfield">'; if (!empty($element['#title'])) { $title = filter_xss_admin($element['#title']); $placeholder = 'placeholder="' . $title . '"'; } if ($element['#autocomplete_path'] && menu_valid_path(array('link_path' => $element['#autocomplete_path']))) { drupal_add_js('misc/autocomplete.js'); $class[] = 'form-autocomplete'; $extra = '<input class="autocomplete" type="hidden" id="' . $element['#id'] . '-autocomplete" value="' . check_url(url($element['#autocomplete_path'], array('absolute' => TRUE))) . '" disabled="disabled" />'; } _form_set_class($element, $class); if (isset($element['#field_prefix'])) { $output .= '<span class="field-prefix">' . $element['#field_prefix'] . '</span> '; } $output .= '<input type="' . $type . '"' . $maxlength . ' name="' . $element['#name'] . '" id="' . $element['#id'] . '"' . $size . ' value="' . check_plain($element['#value']) . '"' . drupal_attributes($element['#attributes']) . ' ' . $placeholder . ' />'; if (isset($element['#field_suffix'])) { $output .= ' <span class="field-suffix">' . $element['#field_suffix'] . '</span>'; } $output .= '</li>'; return $output . $extra; }