You are here

function panels_sections_list in Panels Sections 6.2

Same name and namespace in other branches
  1. 6 panels_sections.module \panels_sections_list()

Declare administrative settings for a module.

This hook provides an administrative interface for controlling various settings for this module. A menu item for the module under "site configuration > modules" will appear in the administrative menu when this hook is implemented.

Return value

An HTML string containing form items to place on the module settings page.

The form items defined on the settings page will be saved with variable_set(), and can be later retrieved with variable_get(). If you need to store more complicated data (for example, in a separate table), define your own administration page and link to it using hook_menu().

1 string reference to 'panels_sections_list'
panels_sections_menu in ./panels_sections.module
Implementation of hook_menu().

File

./panels_sections.module, line 96
Allows you to define panels_sections of your site and apply s to those panels_sections.

Code

function panels_sections_list() {
  $header = array(
    t('Section'),
    t('Status'),
    t('Panels Page'),
    t('Weight'),
    array(
      'data' => t('Operations'),
    ),
  );
  $rows = array();
  foreach (_panels_sections_load() as $section) {
    $rows[] = array(
      $section->name,
      $section->status ? t('Enabled') : t('Disabled'),
      $section->panels_page_name,
      $section->weight,
      l(t('Edit'), 'admin/panels/panels_sections/edit/' . $section->sid) . ' · ' . l(t('Delete'), 'admin/panels/panels_sections/delete/' . $section->sid),
    );
  }
  $output = theme('table', $header, $rows);
  return $output;
}