You are here

function quicktabs_update_6004 in Quick Tabs 6.2

Same name and namespace in other branches
  1. 6.3 quicktabs.install \quicktabs_update_6004()

Update view args to the new format.

File

./quicktabs.install, line 177

Code

function quicktabs_update_6004() {
  $ret = array();
  $result = db_query('SELECT qtid, tabs FROM {quicktabs}');
  while ($row = db_fetch_object($result)) {
    $tabs_array = unserialize($row->tabs);
    foreach ($tabs_array as $key => $tab) {

      //$newtab = array();
      if ($tab['type'] == 'view') {
        $tab['args'] = str_replace(',', '/', $tab['args']);
        $tab['args'] = str_replace(' ', '', $tab['args']);
        $tabs_array[$key] = $tab;
      }
    }
    $serialized = serialize($tabs_array);
    db_query("UPDATE {quicktabs} SET tabs = '%s' WHERE qtid = %d", $serialized, $row->qtid);
  }
  return $ret;
}