Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
303
Merge Requests
303
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
cf98e43a
Commit
cf98e43a
authored
Aug 30, 2013
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2066145
by mtift: Convert node_admin_theme() to the configuration system.
parent
ec9b2e80
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
29 additions
and
13 deletions
+29
-13
core/modules/book/book.module
core/modules/book/book.module
+1
-1
core/modules/node/config/node.settings.yml
core/modules/node/config/node.settings.yml
+1
-0
core/modules/node/config/schema/node.schema.yml
core/modules/node/config/schema/node.schema.yml
+3
-0
core/modules/node/node.install
core/modules/node/node.install
+11
-1
core/modules/node/node.module
core/modules/node/node.module
+6
-4
core/modules/overlay/lib/Drupal/overlay/Tests/OverlayCloseTest.php
...les/overlay/lib/Drupal/overlay/Tests/OverlayCloseTest.php
+1
-1
core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
.../shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
+1
-1
core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
...dules/system/lib/Drupal/system/Tests/System/ThemeTest.php
+3
-3
core/modules/translation/translation.module
core/modules/translation/translation.module
+1
-1
core/profiles/standard/standard.install
core/profiles/standard/standard.install
+1
-1
No files found.
core/modules/book/book.module
View file @
cf98e43a
...
...
@@ -272,7 +272,7 @@ function _book_node_is_removable(EntityInterface $node) {
* Implements hook_admin_paths().
*/
function
book_admin_paths
()
{
if
(
variable_get
(
'nod
e_admin_theme'
))
{
if
(
Drupal
::
config
(
'node.settings'
)
->
get
(
'us
e_admin_theme'
))
{
$paths
=
array
(
'node/*/outline'
=>
TRUE
,
'node/*/outline/remove'
=>
TRUE
,
...
...
core/modules/node/config/node.settings.yml
View file @
cf98e43a
items_per_page
:
'
10'
use_admin_theme
:
'
0'
core/modules/node/config/schema/node.schema.yml
View file @
cf98e43a
...
...
@@ -7,6 +7,9 @@ node.settings:
items_per_page
:
type
:
integer
label
:
'
Number
of
posts
on
front
page'
use_admin_theme
:
type
:
boolean
label
:
'
Use
admin
theme
when
editing
or
creating
content'
node.type.*
:
type
:
mapping
...
...
core/modules/node/node.install
View file @
cf98e43a
...
...
@@ -430,7 +430,6 @@ function node_uninstall() {
// Delete remaining general module variables.
Drupal
::
state
()
->
delete
(
'node.node_access_needs_rebuild'
);
variable_del
(
'node_admin_theme'
);
variable_del
(
'node_recent_block_count'
);
// Delete any stored state.
...
...
@@ -1114,6 +1113,17 @@ function node_update_8020() {
Drupal
::
state
()
->
set
(
'node.type.locked'
,
$locked
);
}
/**
* Converts node_admin_theme variable to config.
*
* @ingroup config_upgrade
*/
function
node_update_8021
()
{
update_variables_to_config
(
'node.settings'
,
array
(
'node_admin_theme'
=>
'use_admin_theme'
));
}
/**
* @} End of "addtogroup updates-7.x-to-8.x"
* The next series of updates should start at 9000.
...
...
core/modules/node/node.module
View file @
cf98e43a
...
...
@@ -223,7 +223,7 @@ function node_uri(EntityInterface $node) {
* Implements hook_admin_paths().
*/
function
node_admin_paths
()
{
if
(
variable_get
(
'nod
e_admin_theme'
))
{
if
(
Drupal
::
config
(
'node.settings'
)
->
get
(
'us
e_admin_theme'
))
{
$paths
=
array
(
'node/*/edit'
=>
TRUE
,
'node/*/delete'
=>
TRUE
,
...
...
@@ -1900,10 +1900,10 @@ function node_form_system_site_information_settings_form_submit($form, &$form_st
* @see node_form_system_themes_admin_form_submit()
*/
function
node_form_system_themes_admin_form_alter
(
&
$form
,
&
$form_state
,
$form_id
)
{
$form
[
'admin_theme'
][
'
nod
e_admin_theme'
]
=
array
(
$form
[
'admin_theme'
][
'
us
e_admin_theme'
]
=
array
(
'#type'
=>
'checkbox'
,
'#title'
=>
t
(
'Use the administration theme when editing or creating content'
),
'#default_value'
=>
variable_get
(
'node_admin_theme'
,
'0
'
),
'#default_value'
=>
Drupal
::
config
(
'node.settings'
)
->
get
(
'use_admin_theme
'
),
);
$form
[
'#submit'
][]
=
'node_form_system_themes_admin_form_submit'
;
}
...
...
@@ -1914,7 +1914,9 @@ function node_form_system_themes_admin_form_alter(&$form, &$form_state, $form_id
* @see node_form_system_themes_admin_form_alter()
*/
function
node_form_system_themes_admin_form_submit
(
$form
,
&
$form_state
)
{
variable_set
(
'node_admin_theme'
,
$form_state
[
'values'
][
'node_admin_theme'
]);
Drupal
::
config
(
'node.settings'
)
->
set
(
'use_admin_theme'
,
$form_state
[
'values'
][
'use_admin_theme'
])
->
save
();
}
/**
...
...
core/modules/overlay/lib/Drupal/overlay/Tests/OverlayCloseTest.php
View file @
cf98e43a
...
...
@@ -35,7 +35,7 @@ public static function getInfo() {
function
testNodeCreation
()
{
// Make sure the node creation page is considered an administrative path
// (which will appear in the overlay).
variable_set
(
'node_admin_theme'
,
TRUE
);
$this
->
container
->
get
(
'config.factory'
)
->
get
(
'node.settings'
)
->
set
(
'use_admin_theme'
,
'1'
)
->
save
(
);
// Create a content type and a user who has permission to create it inside
// the overlay.
...
...
core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
View file @
cf98e43a
...
...
@@ -74,7 +74,7 @@ function testShortcutLinkAdd() {
function
testShortcutQuickLink
()
{
theme_enable
(
array
(
'seven'
));
\
Drupal
::
config
(
'system.theme'
)
->
set
(
'admin'
,
'seven'
)
->
save
();
variable_set
(
'node_admin_theme'
,
TRUE
);
$this
->
container
->
get
(
'config.factory'
)
->
get
(
'node.settings'
)
->
set
(
'use_admin_theme'
,
'1'
)
->
save
(
);
$link
=
reset
(
$this
->
set
->
links
);
...
...
core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
View file @
cf98e43a
...
...
@@ -183,7 +183,7 @@ function testAdministrationTheme() {
// Enable an administration theme and show it on the node admin pages.
$edit
=
array
(
'admin_theme'
=>
'seven'
,
'
nod
e_admin_theme'
=>
TRUE
,
'
us
e_admin_theme'
=>
TRUE
,
);
$this
->
drupalPost
(
'admin/appearance'
,
$edit
,
t
(
'Save configuration'
));
...
...
@@ -201,7 +201,7 @@ function testAdministrationTheme() {
// Disable the admin theme on the node admin pages.
$edit
=
array
(
'
nod
e_admin_theme'
=>
FALSE
,
'
us
e_admin_theme'
=>
FALSE
,
);
$this
->
drupalPost
(
'admin/appearance'
,
$edit
,
t
(
'Save configuration'
));
...
...
@@ -217,7 +217,7 @@ function testAdministrationTheme() {
->
save
();
$edit
=
array
(
'admin_theme'
=>
'0'
,
'
nod
e_admin_theme'
=>
FALSE
,
'
us
e_admin_theme'
=>
FALSE
,
);
$this
->
drupalPost
(
'admin/appearance'
,
$edit
,
t
(
'Save configuration'
));
...
...
core/modules/translation/translation.module
View file @
cf98e43a
...
...
@@ -98,7 +98,7 @@ function _translation_tab_access(NodeInterface $node) {
* Implements hook_admin_paths().
*/
function
translation_admin_paths
()
{
if
(
variable_get
(
'nod
e_admin_theme'
))
{
if
(
Drupal
::
config
(
'node.settings'
)
->
get
(
'us
e_admin_theme'
))
{
$paths
=
array
(
'node/*/translate'
=>
TRUE
,
);
...
...
core/profiles/standard/standard.install
View file @
cf98e43a
...
...
@@ -85,5 +85,5 @@ function standard_install() {
// Enable the admin theme.
theme_enable
(
array
(
'seven'
));
Drupal
::
config
(
'system.theme'
)
->
set
(
'admin'
,
'seven'
)
->
save
();
variable_set
(
'node_admin_theme'
,
'1'
);
Drupal
::
config
(
'node.settings'
)
->
set
(
'use_admin_theme'
,
'1'
)
->
save
(
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment