You are here

function views_ui_add_template_page in Views (for Drupal 7) 7.3

1 string reference to 'views_ui_add_template_page'
views_ui_menu in ./views_ui.module
Implements hook_menu().

File

includes/admin.inc, line 5493
Provides the Views' administrative interface.

Code

function views_ui_add_template_page() {
  $templates = views_get_all_templates();
  if (empty($templates)) {
    return t('There are no templates available.');
  }
  $header = array(
    t('Name'),
    t('Description'),
    t('Operation'),
  );
  $rows = array();
  foreach ($templates as $name => $template) {
    $rows[] = array(
      array(
        'data' => check_plain($template
          ->get_human_name()),
      ),
      array(
        'data' => check_plain($template->description),
      ),
      array(
        'data' => l('add', 'admin/structure/views/template/' . $template->name . '/add'),
      ),
    );
  }
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
  return $output;
}