1 node.module | node_form_system_themes_admin_form_alter(&$form, &$form_state, $form_id) |
Implements hook_form_FORM_ID_alter().
Alters the theme form to use the admin theme on node editing.
See also
node_form_system_themes_admin_form_submit()
File
- core/
modules/ node/ node.module, line 2643 - The core module that allows content to be submitted to the site.
Code
function node_form_system_themes_admin_form_alter(&$form, &$form_state, $form_id) {
$form['admin_theme']['node_admin_theme'] = array(
'#type' => 'checkbox',
'#title' => t('Use the administration theme when editing or creating content'),
'#default_value' => config_get('system.core', 'node_admin_theme'),
'#states' => array(
'visible' => array(
array(
// Hide this checkbox if "Default theme" has been selected from the
// "Administration theme" dropdown menu.
':input[name="admin_theme"]' => array('!value' => 0),
),
),
),
);
$form['#submit'][] = 'node_form_system_themes_admin_form_submit';
}