extremely important to turn off this feature on production websites.', array('!link' => url('admin/build/themes/settings/' . $GLOBALS['theme']))), 'warning', FALSE); } // Return nothing. return array(); } /** * Return the theme settings' default values from the .info and save them into the database. * * @param $theme * The name of theme. */ function zen_theme_get_default_settings($theme) { $themes = list_themes(); // Get the default values from the .info file. $defaults = !empty($themes[$theme]->info['settings']) ? $themes[$theme]->info['settings'] : array(); if (!empty($defaults)) { // Merge the defaults with the theme settings saved in the database. $settings = array_merge($defaults, variable_get('theme_'. $theme .'_settings', array())); // Save the settings back to the database. variable_set('theme_'. $theme .'_settings', $settings); // If the active theme has been loaded, force refresh of Drupal internals. if (!empty($GLOBALS['theme_key'])) { theme_get_setting('', TRUE); } } // Return the default settings. return $defaults; }