You are here

function homebox_update_6002 in Homebox 6.2

Same name and namespace in other branches
  1. 6.3 homebox.install \homebox_update_6002()
  2. 6 homebox.install \homebox_update_6002()

Replace page custom setting with a regular block.

File

./homebox.install, line 101
The install file for Homebox allows the module to install (and uninstall) itself. This is required as this module uses its own table.

Code

function homebox_update_6002() {
  $return = array();
  $result = db_query('SELECT name, settings FROM {homebox_pages}');
  while ($row = db_fetch_object($result)) {
    $row->settings = unserialize($row->settings);
    if ($row->settings['custom']) {
      unset($row->settings['custom']);
      $row->settings['blocks']['homebox_custom'] = array(
        'module' => 'homebox',
        'delta' => 'custom',
        'region' => 1,
        'movable' => 1,
        'status' => 0,
        'open' => 1,
        'closable' => 1,
        'title' => '',
        'weight' => -45,
      );
    }
    drupal_write_record('homebox_pages', $row, 'name');
  }
  return $return;
}