From 84c72d06f03163115ae9bbc939e6ab2dbc65eb28 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 27 Nov 2010 20:25:44 +0000 Subject: =?UTF-8?q?-=20Patch=20#669510=20by=20quicksketch,=20David=5FRoths?= =?UTF-8?q?tein,=20Dave=20Reid,=20casey,=20G=C3=A1bor=20Hojtsy,=20mrfelton?= =?UTF-8?q?,=20effulgentsia:=20merge=20administration=20theme=20with=20hoo?= =?UTF-8?q?k=5Fadmin=5Fpaths().?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/node/node.module | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) (limited to 'modules/node') 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; } -- cgit v1.2.3