Index: modules/shortcut/shortcut.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/shortcut/shortcut.module,v
retrieving revision 1.17
diff -u -p -r1.17 shortcut.module
--- modules/shortcut/shortcut.module 11 Jan 2010 00:06:58 -0000 1.17
+++ modules/shortcut/shortcut.module 11 Jan 2010 18:46:53 -0000
@@ -558,15 +558,17 @@ function shortcut_preprocess_page(&$vari
$link_path = 'admin/config/system/shortcut/link/' . $mlid . '/delete';
}
- $variables['title_suffix']['add_or_remove_shortcut'] = array(
- '#attached' => array('css' => array(drupal_get_path('module', 'shortcut') . '/shortcut.css')),
- '#prefix' => '
',
- '#type' => 'link',
- '#title' => '' . $link_text . '',
- '#href' => $link_path,
- '#options' => array('query' => $query, 'html' => TRUE),
- '#suffix' => '
',
- );
+ if (theme_get_setting('toggle_add_or_remove_shortcut')) {
+ $variables['title_suffix']['add_or_remove_shortcut'] = array(
+ '#attached' => array('css' => array(drupal_get_path('module', 'shortcut') . '/shortcut.css')),
+ '#prefix' => '',
+ '#type' => 'link',
+ '#title' => '' . $link_text . '',
+ '#href' => $link_path,
+ '#options' => array('query' => $query, 'html' => TRUE),
+ '#suffix' => '
',
+ );
+ }
}
}
Index: themes/seven/seven.info
===================================================================
RCS file: /cvs/drupal/drupal/themes/seven/seven.info,v
retrieving revision 1.4
diff -u -p -r1.4 seven.info
--- themes/seven/seven.info 4 Jan 2010 03:46:31 -0000 1.4
+++ themes/seven/seven.info 11 Jan 2010 18:46:54 -0000
@@ -7,6 +7,7 @@ core = 7.x
engine = phptemplate
stylesheets[screen][] = reset.css
stylesheets[screen][] = style.css
+settings[toggle_add_or_remove_shortcut] = 1
regions[content] = Content
regions[help] = Help
regions[page_top] = Page top
Index: themes/seven/template.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/seven/template.php,v
retrieving revision 1.12
diff -u -p -r1.12 template.php
--- themes/seven/template.php 4 Jan 2010 03:46:31 -0000 1.12
+++ themes/seven/template.php 11 Jan 2010 18:46:54 -0000
@@ -102,3 +102,23 @@ function seven_css_alter(&$css) {
$css['misc/vertical-tabs.css']['data'] = drupal_get_path('theme', 'seven') . '/vertical-tabs.css';
}
}
+
+/**
+ * Implements hook_form_system_theme_settings_alter().
+ */
+function seven_form_system_theme_settings_alter(&$form, &$form_state) {
+ // Add a theme setting which allows Seven to display the Shortcut module's
+ // "add or remove shortcut" link feature.
+ if (isset($form['var']['#value']) && $form['var']['#value'] == 'theme_seven_settings') {
+ $form['theme_settings']['toggle_add_or_remove_shortcut'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('"Add or remove shortcut" link'),
+ '#default_value' => theme_get_setting('toggle_add_or_remove_shortcut'),
+ // If the Shortcut module is not enabled, do not display the setting, but
+ // still add it to the form so as to preserve any previous value when the
+ // form is saved.
+ '#access' => module_exists('shortcut'),
+ );
+ }
+}
+