You are here

function readmorecontrol_update_7002 in Read More Control 7

Refreshes the menu and updates internal settings to support multiple entities and view modes.

File

./readmorecontrol.install, line 70
Standand installation functions.

Code

function readmorecontrol_update_7002() {
  if ($value = variable_get('readmorecontrol_default_node_behaviour', FALSE)) {
    variable_set('readmorecontrol_behaviour__node', $value);
    variable_del('readmorecontrol_default_node_behaviour');
  }
  foreach (node_type_get_types() as $key => $type) {

    // Only update if it is set so that the defaults still work.
    if ($value = variable_get('readmorecontrol_node_' . $key, FALSE)) {
      variable_set('readmorecontrol_behaviour__node__' . $key, $value);
      variable_del('readmorecontrol_node_' . $key);
    }
  }
  variable_set('menu_rebuild_needed', TRUE);
  return t('Menu links are queued to be rebuilt.');
}