theme_trigger_display

Versions
6
theme_trigger_display($element)
7
theme_trigger_display($variables)

Displays actions assigned to this hook in a table.

Parameters

$variables An associative array containing:

  • element: The fieldset including all assigned actions.

Return value

The rendered form with the table prepended.

Related topics

Code

modules/trigger/trigger.admin.inc, line 274

<?php
function theme_trigger_display($variables) {
  $element = $variables['element'];

  $header = array();
  $rows = array();
  if (isset($element['assigned']) && count($element['assigned']['#value'])) {
    $header = array(array('data' => t('Name')), array('data' => t('Operation')));
    $rows = array();
    foreach ($element['assigned']['#value'] as $aid => $info) {
      $rows[] = array(
        $info['label'],
        $info['link']
      );
    }
  }

  if (count($rows)) {
    $output = theme('table', array('header' => $header, 'rows' => $rows)) . drupal_render_children($element);
  }
  else {
    $output = drupal_render_children($element);
  }
  return $output;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.