You are here

function galleria_page_optionset_list in Galleria 7

Menu callback; Listing of all current option sets.

1 string reference to 'galleria_page_optionset_list'
galleria_menu in ./galleria.module
Implements hook_menu().

File

includes/galleria.admin.inc, line 11
Administrative page callbacks for the galleria module.

Code

function galleria_page_optionset_list() {
  $optionsets = galleria_optionsets_load_all();
  $header = array(
    t('Option Set Name'),
    array(
      'data' => t('Operations'),
      'colspan' => 2,
    ),
  );
  $rows = array();
  foreach ($optionsets as $name => $optionset) {
    $is_overridden = $optionset->export_type & EXPORT_IN_CODE ? TRUE : FALSE;
    $rows[] = array(
      l($optionset->title, 'admin/config/media/galleria/edit/' . $name),
      l(t('edit'), 'admin/config/media/galleria/edit/' . $name),
      // Only print revert/delete links if we have something in the db to delete
      !isset($optionset->in_code_only) ? l(t($is_overridden ? 'revert' : 'delete'), 'admin/config/media/galleria/delete/' . $name) : '',
    );
  }
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'empty' => t('There are currently no option sets. <a href="!url">Add a new one</a>.', array(
      '!url' => url('admin/config/media/galleria/add'),
    )),
  ));
}