1 node.install node_update_1003()

Move theme settings to global site configuration.

Related topics

File

core/modules/node/node.install, line 420
Install, update and uninstall functions for the node module.

Code

function node_update_1003() {
  $types = db_query('SELECT type FROM {node_type}')->fetchCol();
  $theme = update_variable_get('theme_default', 'stark');
  $settings = update_variable_get('theme_' . $theme . '_settings', array());

  // Each setting defaults to TRUE if not set at all.
  $comment_picture = !isset($settings['toggle_comment_user_picture']) || $settings['toggle_comment_user_picture'];
  $node_picture = !isset($settings['toggle_node_user_picture']) || $settings['toggle_node_user_picture'];

  // These variables will be converted to be node type settings when converted
  // to saving in config.
  foreach ($types as $type_name) {
    update_variable_set('node_user_picture_' . $type_name, $node_picture);
    update_variable_set('comment_user_picture_' . $type_name, $comment_picture);
  }
}