summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-11-27 20:25:44 +0000
committerDries Buytaert <dries@buytaert.net>2010-11-27 20:25:44 +0000
commit84c72d06f03163115ae9bbc939e6ab2dbc65eb28 (patch)
tree70506c548713a51c9f9e51e866849b5858de46fd /modules/node
parent22cfc5bb2cf84d88356b50ab8f497add152d1858 (diff)
downloadbrdo-84c72d06f03163115ae9bbc939e6ab2dbc65eb28.tar.gz
brdo-84c72d06f03163115ae9bbc939e6ab2dbc65eb28.tar.bz2
- Patch #669510 by quicksketch, David_Rothstein, Dave Reid, casey, Gábor Hojtsy, mrfelton, effulgentsia: merge administration theme with hook_admin_paths().
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/node.module39
1 files changed, 12 insertions, 27 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 062078908..9a5651350 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -255,16 +255,18 @@ function node_uri($node) {
* Implements hook_admin_paths().
*/
function node_admin_paths() {
- $paths = array(
- 'node/*/edit' => TRUE,
- 'node/*/delete' => TRUE,
- 'node/*/revisions' => TRUE,
- 'node/*/revisions/*/revert' => TRUE,
- 'node/*/revisions/*/delete' => TRUE,
- 'node/add' => TRUE,
- 'node/add/*' => TRUE,
- );
- return $paths;
+ if (variable_get('node_admin_theme')) {
+ $paths = array(
+ 'node/*/edit' => TRUE,
+ 'node/*/delete' => TRUE,
+ 'node/*/revisions' => TRUE,
+ 'node/*/revisions/*/revert' => TRUE,
+ 'node/*/revisions/*/delete' => TRUE,
+ 'node/add' => TRUE,
+ 'node/add/*' => TRUE,
+ );
+ return $paths;
+ }
}
/**
@@ -1932,7 +1934,6 @@ function node_menu() {
'title' => 'Add content',
'page callback' => 'node_add_page',
'access callback' => '_node_add_access',
- 'theme callback' => '_node_custom_theme',
'file' => 'node.pages.inc',
);
$items['rss.xml'] = array(
@@ -1979,7 +1980,6 @@ function node_menu() {
'page arguments' => array(1),
'access callback' => 'node_access',
'access arguments' => array('update', 1),
- 'theme callback' => '_node_custom_theme',
'weight' => 0,
'type' => MENU_LOCAL_TASK,
'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
@@ -1991,7 +1991,6 @@ function node_menu() {
'page arguments' => array('node_delete_confirm', 1),
'access callback' => 'node_access',
'access arguments' => array('delete', 1),
- 'theme callback' => '_node_custom_theme',
'weight' => 1,
'type' => MENU_LOCAL_TASK,
'context' => MENU_CONTEXT_INLINE,
@@ -2003,7 +2002,6 @@ function node_menu() {
'page arguments' => array(1),
'access callback' => '_node_revision_access',
'access arguments' => array(1),
- 'theme callback' => '_node_custom_theme',
'weight' => 2,
'type' => MENU_LOCAL_TASK,
'file' => 'node.pages.inc',
@@ -2023,7 +2021,6 @@ function node_menu() {
'page arguments' => array('node_revision_revert_confirm', 1),
'access callback' => '_node_revision_access',
'access arguments' => array(1, 'update'),
- 'theme callback' => '_node_custom_theme',
'file' => 'node.pages.inc',
);
$items['node/%node/revisions/%/delete'] = array(
@@ -2033,7 +2030,6 @@ function node_menu() {
'page arguments' => array('node_revision_delete_confirm', 1),
'access callback' => '_node_revision_access',
'access arguments' => array(1, 'delete'),
- 'theme callback' => '_node_custom_theme',
'file' => 'node.pages.inc',
);
return $items;
@@ -2069,17 +2065,6 @@ function node_page_title($node) {
return $node->title;
}
-/**
- * Theme callback for creating and editing nodes.
- */
-function _node_custom_theme() {
- // Use the administration theme if the site is configured to use it for
- // nodes.
- if (variable_get('node_admin_theme')) {
- return variable_get('admin_theme');
- }
-}
-
function node_last_changed($nid) {
return db_query('SELECT changed FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetch()->changed;
}