You are here

function theme_canvasactions_perspective_anchor in ImageCache Actions 7

Implements theme_hook().

Parameters

array $variables: An associative array containing:

  • element: A render element containing radio buttons.

Return value

string The HTML for a 3x3 grid of checkboxes for image anchors.

1 theme call to theme_canvasactions_perspective_anchor()
canvasactions_perspective_form in canvasactions/canvasactions.inc
Image effect form callback for the Perspective effect.

File

canvasactions/canvasactions.inc, line 1651

Code

function theme_canvasactions_perspective_anchor($variables) {
  $element = $variables['element'];
  $rows = $row = $option = array();
  $blank = array(
    '#markup' => '',
  );
  $blank = drupal_render($blank);

  /** @noinspection PhpUnhandledExceptionInspection */
  $image = array(
    '#markup' => theme('image', array(
      'path' => drupal_get_path('module', 'image') . '/sample.png',
      'attributes' => array(
        'width' => "40",
        'height' => "40",
      ),
    )),
  );
  $image = drupal_render($image);
  foreach (element_children($element) as $key) {
    $element[$key]['#attributes']['title'] = $element[$key]['#title'];
    unset($element[$key]['#title']);
    $option[] = drupal_render($element[$key]);
  }
  $row[] = $blank;
  $row[] = $option[0];
  $row[] = $blank;
  $rows[] = $row;
  $row = array();
  $row[] = $option[1];
  $row[] = $image;
  $row[] = $option[2];
  $rows[] = $row;
  $row = array();
  $row[] = $blank;
  $row[] = $option[3];
  $row[] = $blank;
  $rows[] = $row;

  /** @noinspection PhpUnhandledExceptionInspection */
  return theme('table', array(
    'header' => array(),
    'rows' => $rows,
    'attributes' => array(
      'class' => array(
        'image-anchor',
      ),
    ),
  ));
}