function theme_image_anchor

Returns HTML for a 3x3 grid of checkboxes for image anchors.

Parameters

$variables: An associative array containing:

  • element: A render element containing radio buttons.

Related topics

1 theme call to theme_image_anchor()
image_crop_form in modules/image/image.admin.inc
Form structure for the image crop form.

File

modules/image/image.admin.inc, line 862

Code

function theme_image_anchor($variables) {
    $element = $variables['element'];
    $rows = array();
    $row = array();
    foreach (element_children($element) as $n => $key) {
        $element[$key]['#attributes']['title'] = $element[$key]['#title'];
        unset($element[$key]['#title']);
        $row[] = drupal_render($element[$key]);
        if ($n % 3 == 3 - 1) {
            $rows[] = $row;
            $row = array();
        }
    }
    return theme('table', array(
        'header' => array(),
        'rows' => $rows,
        'attributes' => array(
            'class' => array(
                'image-anchor',
            ),
        ),
    ));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.