From c912008307dd49b5e3e85c78069153f2f9f70411 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Wed, 2 Dec 2009 07:28:22 +0000 Subject: =?UTF-8?q?#610234=20by=20G=C3=A1bor=20Hojtsy,=20ksenzee,=20cwgord?= =?UTF-8?q?on7,=20David=5FRothstein,=20seutje,=20marcvangend,=20sun,=20Jos?= =?UTF-8?q?huaRogers,=20markus=5Fpetrux,=20Bojhan,=20Rob=20Loach,=20Everet?= =?UTF-8?q?t=20Zufelt,=20drifter,=20markboulton,=20leisareichelt,=20et=20a?= =?UTF-8?q?l:=20Added=20Overlay=20module=20to=20core,=20which=20shows=20ad?= =?UTF-8?q?ministrative=20pages=20in=20a=20JS=20overlay,=20retaining=20con?= =?UTF-8?q?text=20on=20the=20front-end=20site.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/system/system.api.php | 46 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'modules/system/system.api.php') diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 24643966a..f85c014a1 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -165,6 +165,52 @@ function hook_entity_load($entities, $type) { } } +/** + * Define administrative paths. + * + * Modules may specify whether or not the paths they define in hook_menu() are + * to be considered administrative. Other modules may use this information to + * display those pages differently (e.g. in a modal overlay, or in a different + * theme). + * + * To change the administrative status of menu items defined in another module's + * hook_menu(), modules should implement hook_admin_paths_alter(). + * + * @return + * An associative array. For each item, the key is the path in question, in + * a format acceptable to drupal_match_path(). The value for each item should + * be TRUE (for paths considered administrative) or FALSE (for non- + * administrative paths). + * + * @see hook_menu() + * @see drupal_match_path() + * @see hook_admin_paths_alter() + */ +function hook_admin_paths() { + $paths = array( + 'mymodule/*/add' => TRUE, + 'mymodule/*/edit' => TRUE, + ); + return $paths; +} + +/** + * Redefine administrative paths defined by other modules. + * + * @param $paths + * An associative array of administrative paths, as defined by implementations + * of hook_admin_paths(). + * + * @see hook_admin_paths() + */ +function hook_admin_paths_alter(&$paths) { + // Treat all user pages as administrative. + $paths['user'] = TRUE; + $paths['user/*'] = TRUE; + // Treat the forum topic node form as a non-administrative page. + $paths['node/add/forum'] = FALSE; +} + /** * Perform periodic actions. * -- cgit v1.2.3