You are here

function hook_magic_alter in Magic 7

Allows altering of the magic settings array.

Magic has to change it's weight to be far lower than other modules in the system to allow for the CSS / JS alter hooks to work correctly. As such, we need to allow other modules to alter or add their own settings into the magic module hook. We created this alter hook just for that purpose.

THIS CAN ONLY BE USED BY THE THEME ACTIVELY BEING EDITIED AND ITS BASE THEME.

Parameters

array $magic_settings: The renderable form array of the magic module theme settings.

string $theme: The theme that the settings will be editing.

File

./magic.api.php, line 53
Hooks provided by the Magic module

Code

function hook_magic_alter(&$magic_settings, $theme) {
  $magic_settings['css']['my_own_css_settings'] = array(
    '#type' => 'checkbox',
    '#title' => t('Do you want to?'),
  );

  // Add in your own submit handlers.
  $magic_settings['#submit'][] = 'my_module_magic_custom_submit_function';
}