You are here

function bootstrap_tour_list in Bootstrap Tour 7

Callback function for admin/build/tours

1 string reference to 'bootstrap_tour_list'
bootstrap_tour_menu in ./bootstrap_tour.module
Implementation of hook_menu()

File

./bootstrap_tour.module, line 426

Code

function bootstrap_tour_list() {
  $names = bootstrap_tour_load_all(TRUE);
  $header = array(
    t('Name'),
    array(
      'data' => t('Operations'),
      'colspan' => '2',
    ),
  );
  $rows = array();
  foreach ($names as $name => $tour) {
    $row = array();
    $row[] = array(
      'data' => check_plain($tour->title),
    );
    $row[] = array(
      'data' => l(t('edit'), 'admin/structure/tours/manage/' . $name),
    );
    if (!bootstrap_tour_is_default($tour->name)) {
      $row[] = array(
        'data' => l(t('delete'), 'admin/structure/tours/manage/' . $name . '/delete'),
      );
    }
    else {
      if (empty($tour->disabled)) {
        $row[] = array(
          'data' => l(t('disable'), 'admin/structure/tours/manage/' . $name . '/toggle'),
        );
      }
      else {
        $row[] = array(
          'data' => l(t('enable'), 'admin/structure/tours/manage/' . $name . '/toggle'),
        );
      }
    }
    $rows[] = $row;
  }
  $build['tours_table'] = array(
    '#theme' => 'table',
    '#header' => $header,
    '#rows' => $rows,
    '#empty' => t('No site tours available. <a href="@link">Add a site tour</a>.', array(
      '@link' => url('admin/structure/tours/add'),
    )),
  );
  return $build;
}