cobalt_admin.inc.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. function cobalt_settings() {
  3. $form = array();
  4. $themes = cobalt_themes();
  5. $theme_options = array();
  6. foreach ($themes as $key => $info) {
  7. $theme_options[$key] = $info['name'];
  8. }
  9. $form['cobalt_theme'] = array(
  10. '#type' => 'select',
  11. '#options' => $theme_options,
  12. '#default_value' => variable_get('cobalt_theme', ''),
  13. '#title' => t('Select a theme for Cobalt'),
  14. );
  15. $form['cobalt_shortcuts'] = array(
  16. '#type' => 'textfield',
  17. '#default_value' => variable_get('cobalt_shortcuts', 'Alt+space, Ctrl+space'),
  18. '#title' => t('Shortcuts for activating cobalt'),
  19. '#description' => t('The shortcuts that can be used to activate Cobalt should be separated by a comma, like this: "Alt+space, Ctrl+space".') . ' ' . l(t('See the live demo for jshotkeys to get some help'), 'http://jshotkeys.googlepages.com/test-static-01.html'),
  20. );
  21. $form['javascript_includes'] = array(
  22. '#type' => 'fieldset',
  23. '#title' => t('Javascript includes'),
  24. '#description' => t('All the following libraries are needed for Cobalt to function properly. These options are here if you need Cobalt to play nice with any other modules or themes that use the same javascript libraries.'),
  25. );
  26. $form['javascript_includes']['cobalt_jquery_hotkeys'] = array(
  27. '#type' => 'checkbox',
  28. '#default_value' => variable_get('cobalt_jquery_hotkeys', 1),
  29. '#title' => t('Include the jQuery Hotkeys plugin'),
  30. );
  31. return system_settings_form($form);
  32. }
  33. function _cobalt_clear_cache() {
  34. drupal_flush_all_caches();
  35. drupal_set_message(t('Cache cleared.'));
  36. drupal_goto();
  37. }
  38. function _cobalt_rebuild_permissions() {
  39. node_access_rebuild();
  40. drupal_goto();
  41. }