You are here

function strongarm_init in Strongarm 6

Implementation of hook_init().

File

./strongarm.module, line 22

Code

function strongarm_init() {
  $var_conf = strongarm_get_conf();
  strongarm_set_conf($var_conf);

  // Display a status message if any variables are overridden.
  if ($_GET['q'] != 'admin/settings/strongarm' && variable_get('strongarm_mode', STRONGARM_MODE_STRONG) == STRONGARM_MODE_WEAK) {
    $overridden = strongarm_overridden_vars();
    if (arg(0) == 'admin' && !empty($overridden) && user_access('administer site configuration') && variable_get('strongarm_show_messages', TRUE)) {
      drupal_set_message(t('The following variables have overridden values: !vars. Manage these variables on the !strongarm_page.', array(
        '!vars' => implode(', ', $overridden),
        '!strongarm_page' => l(t('Strongarm admin page'), 'admin/settings/strongarm'),
      )), 'warning', FALSE);
    }
  }
}