function schools_menu

7.x schools.module schools_menu()
6.x schools.module schools_menu()

Implements hook_menu

1 string reference to 'schools_menu'

File

modules/schools/schools.module, line 171
Schools module.

Code

function schools_menu() {

  $items = array();

  $items ['admin/config/schools'] = array(
    'title' => 'Schools settings',
    'description' => 'Administer and define the Schools at your institution',
    'page_callback' => 'fp_render_form',
    'page_arguments' => array('schools_administer_schools_form'),
    'access_arguments' => array('administer_schools'),
    "page_settings" => array(
      "page_show_title" => TRUE,
      "menu_icon" => fp_get_module_path('system') . "/icons/building.png",
      "menu_links" => array(
        0 => array(
          "text" => "Admin Console",
          "path" => "admin-tools/admin",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
      ),
    ),
    'type' => MENU_TYPE_NORMAL_ITEM,
  );


  // For each school we have defined, let's create a menu item for configuring
  // school-specific settings.
  $defs = schools_get_school_definitions(TRUE);
  $weight = 0;
  foreach ($defs as $cur) {

    $school_name = $cur ['name'];
    $school_id = intval($cur ['school_id']);
    if ($school_id === 0) {
      continue; // skip default since that wil be there already
    }

    $items ["admin/config/school-data/$school_id"] = array(
      "title" => $school_name,
      "page_callback" => "fp_render_form",
      "page_arguments" => array("system_school_data_form", "system_settings", 3),
      "access_arguments" => array("de_can_administer_school_data"), // TODO: make sure we can administer THIS school data.  Add new perms.
      "page_settings" => array(
        "page_hide_report_error" => TRUE,
        "menu_icon" => fp_get_module_path('system') . "/icons/cog_edit.png",
        "menu_links" => array(
          0 => array(
            "text" => "Admin Console",
            "path" => "admin-tools/admin",
            "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
          ),
        ),
      ),
      "type" => MENU_TYPE_TAB,
      "tab_family" => "config_school_settings",
      "weight" => $weight,
    );



    $items ["admin/edit-advising-settings/$school_id"] = array(
      "title" => $school_name,
      "page_callback" => "fp_render_form",
      "page_arguments" => array("admin_advising_settings_form", "system_settings", 2),
      "access_arguments" => array("can_edit_advising_settings"),
      "page_settings" => array(
        "page_hide_report_error" => TRUE,
        "menu_links" => array(
          0 => array(
            "text" => "Admin Console",
            "path" => "admin-tools/admin",
            "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
          ),
        ),
      ),
      "type" => MENU_TYPE_TAB,
      "tab_family" => "edit_advising_settings",
      "weight" => $weight,
    );


    $items ["admin/config/course-search/$school_id"] = array(
      "title" => $school_name,
      "page_callback" => "fp_render_form",
      "page_arguments" => array("course_search_settings_form", "system_settings", 3),
      "access_arguments" => array("administer_course_search"),
      "page_settings" => array(
        "page_hide_report_error" => TRUE,
        "menu_links" => array(
          0 => array(
            "text" => "Admin Console",
            "path" => "admin-tools/admin",
            "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
          ),
        ),
      ),
      "type" => MENU_TYPE_TAB,
      "tab_family" => "course_search_settings",
      "weight" => $weight,
    );


    $items ["admin/config/appointments/$school_id"] = array(
      'title' => $school_name,
      'page_callback' => 'fp_render_form',
      'page_arguments' => array('calendar_appointment_settings_form', 'system_settings', 3),
      'access_arguments' => array('administer_appointment_settings'),
      "page_settings" => array(
        "page_hide_report_error" => TRUE,
        "menu_links" => array(
          0 => array(
            "text" => "Admin Console",
            "path" => "admin-tools/admin",
            "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
          ),
        ),
      ),
      'type' => MENU_TYPE_TAB,
      "tab_family" => "appointment_settings", // REMEMBER TO ALSO EDIT SCHOOLS_MENU_ALTER
      'weight' => $weight,
    );





    $items ["admin/config/alerts-settings/$school_id"] = array(
      "title" => $school_name,
      "page_callback" => "fp_render_form",
      "page_arguments" => array("alerts_settings_form", "system_settings", 3),
      "access_arguments" => array("administer_alerts"),
      "page_settings" => array(
        "page_hide_report_error" => TRUE,
        "menu_links" => array(
          0 => array(
            "text" => "Admin Console",
            "path" => "admin-tools/admin",
            "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
          ),
        ),
      ),
      "type" => MENU_TYPE_TAB,
      "tab_family" => "alerts_settings",
      "weight" => $weight,
    );




    $items ["admin/config/audit-settings/$school_id"] = array(
      "title" => $school_name,
      "page_callback" => "fp_render_form",
      "page_arguments" => array("audit_settings_form", "system_settings", 3),
      "access_arguments" => array("administer_audit"),
      "page_settings" => array(
        "page_hide_report_error" => TRUE,
        "menu_links" => array(
          0 => array(
            "text" => "Admin Console",
            "path" => "admin-tools/admin",
            "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
          ),
        ),
      ),
      "type" => MENU_TYPE_TAB,
      "tab_family" => "audit_settings",
      "weight" => $weight,
    );




    $weight = $weight + 10;

  }





  return $items;

}