You are here

function _update_to_view_modes in Service links 7.2

Switch the old variables to the news based on view modes.

1 call to _update_to_view_modes()
service_links_update_7201 in ./service_links.install
Update to view mode display.

File

./service_links.install, line 57
Service Links install file.

Code

function _update_to_view_modes($old_var, $new_var) {
  $old_val = variable_get($old_var, 0);
  $new_val = variable_get($new_var, NULL);
  if (!isset($new_val)) {
    switch ($old_val) {
      case 0:
        $modes = array();
        break;
      case 1:
        $modes = array(
          'teaser' => 'teaser',
        );
        break;
      case 2:
        $modes = array(
          'full' => 'full',
        );
        break;
      case 3:
        $modes = array(
          'teaser' => 'teaser',
          'full' => 'full',
        );
        break;
    }
    variable_set($new_var, $modes);
  }
  variable_del($old_var);
}