You are here

function course_settings_overview in Course 6

Same name and namespace in other branches
  1. 7.2 includes/course.settings.inc \course_settings_overview()
  2. 7 includes/course.settings.inc \course_settings_overview()

Menu callback: Define the Course settings form.

Parameters

array $settings: (optional) The loaded settings handler.

1 string reference to 'course_settings_overview'
course_menu in ./course.module
Implements hook_menu().

File

includes/course.settings.inc, line 14
Administrative settings for Course module.

Code

function course_settings_overview() {

  // Course settings handler forms. This allows Course to ensure consistent
  // placement of forms from modules that define settings handlers through
  // hook_course_handlers().
  $form['course_extensions'] = array(
    '#type' => 'fieldset',
    '#title' => t('Settings overview'),
  );
  $modules = course_get_handlers('settings');
  $handlers = array();
  foreach ($modules as $settings) {
    if (is_array($settings)) {
      $handlers += $settings;
    }
  }
  $header = array(
    t('Package'),
    t('Description'),
    t('Operations'),
  );
  $rows = array();
  foreach ($handlers as $handler_key => $handler_info) {

    // Generate a list of each handler category.
    $package_key = isset($handler_info['package']) ? $handler_info['package'] : $handler_key;
    $package_info = $handlers[$package_key] ? $handlers[$package_key] : $handler_info;
    if (!isset($package_set[$package_key])) {
      $rows[] = array(
        $package_info['name'],
        $package_info['description'],
        l(t('Edit'), "admin/settings/course/{$package_key}", array(
          'query' => drupal_get_destination(),
        )),
      );
      $package_set[$package_key] = TRUE;
    }
  }
  $form['course_extensions']['course_extensions_table'] = array(
    '#value' => theme('table', $header, $rows),
  );
  return $form;
}