summaryrefslogtreecommitdiff
path: root/modules/system/system.api.php
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-12-02 07:28:22 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-12-02 07:28:22 +0000
commitc912008307dd49b5e3e85c78069153f2f9f70411 (patch)
tree6e219858505bd38130a7d679488d3a41e689ce1d /modules/system/system.api.php
parentcfc96df9a7181526cb1c71cf4e39886026c668fe (diff)
downloadbrdo-c912008307dd49b5e3e85c78069153f2f9f70411.tar.gz
brdo-c912008307dd49b5e3e85c78069153f2f9f70411.tar.bz2
#610234 by Gábor Hojtsy, ksenzee, cwgordon7, David_Rothstein, seutje, marcvangend, sun, JoshuaRogers, markus_petrux, Bojhan, Rob Loach, Everett Zufelt, drifter, markboulton, leisareichelt, et al: Added Overlay module to core, which shows administrative pages in a JS overlay, retaining context on the front-end site.
Diffstat (limited to 'modules/system/system.api.php')
-rw-r--r--modules/system/system.api.php46
1 files changed, 46 insertions, 0 deletions
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
@@ -166,6 +166,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.
*
* This hook will only be called if cron.php is run (e.g. by crontab).