summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/system.api.php46
-rw-r--r--modules/system/system.module31
2 files changed, 73 insertions, 4 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).
diff --git a/modules/system/system.module b/modules/system/system.module
index 33219edcf..1d4d90ff3 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1082,6 +1082,16 @@ function system_library() {
),
);
+ // jQuery BBQ plugin.
+ $libraries['jquery-bbq'] = array(
+ 'title' => 'jQuery BBQ',
+ 'website' => 'http://benalman.com/projects/jquery-bbq-plugin/',
+ 'version' => '1.0.2',
+ 'js' => array(
+ 'misc/jquery.ba-bbq.js',
+ ),
+ );
+
// Contextual links.
$libraries['contextual-links'] = array(
'title' => 'Contextual links',
@@ -3069,13 +3079,16 @@ function system_page_build(&$page) {
'#markup' => theme('system_run_cron_image', array('image_path' => 'system/run-cron-image')),
);
}
+}
- // Find all block regions so they can be rendered.
+/**
+ * Implements hook_page_alter().
+ */
+function system_page_alter(&$page) {
+ // Find all non-empty page regions, and add a theme wrapper function that
+ // allows them to be consistently themed.
$regions = system_region_list($GLOBALS['theme']);
-
- // Load all region content assigned via blocks.
foreach (array_keys($regions) as $region) {
- // Don't render empty regions.
if (!empty($page[$region])) {
$page[$region]['#theme_wrappers'][] = 'region';
$page[$region]['#region'] = $region;
@@ -3661,3 +3674,13 @@ function system_build_contextual_links($element) {
return $build;
}
+/**
+ * Implement hook_admin_paths().
+ */
+function system_admin_paths() {
+ $paths = array(
+ 'admin' => TRUE,
+ 'admin/*' => TRUE,
+ );
+ return $paths;
+}