You are here

function theme_rotor_admin_list in Rotor Banner 6

Same name and namespace in other branches
  1. 5.7 rotor.module \theme_rotor_admin_list()
  2. 5 rotor.module \theme_rotor_admin_list()

Theme the admin list to include in the rotor administration page.

Parameters

array $list The list of rotor_item nodes to display in the list.:

1 theme call to theme_rotor_admin_list()
rotor_admin_form in ./rotor.module
Admin settings form page.

File

./rotor.module, line 637
A rotor banner consists in a set of images that will be changing. This module is made using jquery.

Code

function theme_rotor_admin_list($list = array()) {
  $headers = array(
    t('Tab'),
    t('Content'),
    t('Actions'),
  );
  $rows = array();
  $count = 0;
  foreach ($list as $item) {
    if ($item->rotor_image) {
      $output = $item->url ? l(theme('rotor_image', $item), $item->url, array(
        'html' => TRUE,
        'attributes' => array(
          'title' => $item->alt_text,
        ),
      )) : theme('rotor_image', $item);
    }
    else {
      $output = check_markup($item->body);
    }
    $rows[] = array(
      l($item->title, 'node/' . $item->nid . '/edit'),
      $output,
      l(t('Edit'), 'node/' . $item->nid . '/edit') . ' | ' . l(t('Remove'), 'node/' . $item->nid . '/delete'),
    );
  }
  $output = l(t('Add new item'), 'node/add/rotor-item');
  $output .= theme('table', $headers, $rows, array(
    'class' => 'rotor_admin_list',
  ));
  return $output;
}