Beispiel #1
0
function smooth_form_element($variables)
{
    $element =& $variables['element'];
    if (in_array('search_block_form', $element['#parents'])) {
        $output = $element['#children'];
    } else {
        $output = theme_form_element($variables);
    }
    return $output;
}
function treetopstravel_form_element($variables)
{
    //$path = current_path();
    //$node = menu_get_object("node",1,$path);
    /*$path_alias = drupal_lookup_path('alias',$path);
      $node = menu_get_object("node", 1, $path_alias);*/
    //dpm($node);
    if (isset($variables['element']['#title']) && ($variables['element']['#type'] == 'checkbox' || $variables['element']['#type'] == 'radio')) {
        $variables['element']['#title'] = "<span></span>" . $variables['element']['#title'];
    }
    /*if($variables['element']['#field_name'] == 'the_field_name') {
      }*/
    return theme_form_element($variables);
}
Beispiel #3
0
function phptemplate_form_element($element, $value)
{
    if (empty($element['#comments_element'])) {
        return theme_form_element($element, $value);
    } else {
        $t = get_t();
        $output = '<div class="form-item container-inline comments-element"';
        if (!empty($element['#id'])) {
            $output .= ' id="' . $element['#id'] . '-wrapper"';
        }
        $output .= ">\n";
        $output .= " {$value}\n";
        $required = !empty($element['#required']) ? '<span class="form-required" title="' . $t('This field is required.') . '">(' . $t('required') . ')</span>' : '';
        if (!empty($element['#title'])) {
            $title = $element['#title'];
            if (!empty($element['#id'])) {
                $output .= ' <label for="' . $element['#id'] . '"><small>' . $t('!title !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . "</small></label>\n";
            } else {
                $output .= ' <label><small>' . $t('!title !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . "</small></label>\n";
            }
        }
        if (!empty($element['#description'])) {
            $output .= ' <div class="description">' . $element['#description'] . "</div>\n";
        }
        $output .= "</div>\n";
        return $output;
    }
}