You are here

function flexslider_page_optionset_list in Flex Slider 7

Menu callback; Listing of all current option sets.

1 string reference to 'flexslider_page_optionset_list'
flexslider_menu in ./flexslider.module
Implements hook_menu().

File

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

Code

function flexslider_page_optionset_list() {
  $optionsets = flexslider_optionset_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/flexslider/edit/' . $name),
      l(t('edit'), 'admin/config/media/flexslider/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/flexslider/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/flexslider/add'),
    )),
  ));
}