You are here

function biblio_update_6026 in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 biblio.install \biblio_update_6026()
  2. 6 biblio.install \biblio_update_6026()
  3. 7 biblio.install \biblio_update_6026()

File

./biblio.install, line 1522

Code

function biblio_update_6026() {
  $result = array();

  // move custom block titles stored in variable "biblio_block_title" to the block table if the title has not already been overriden
  $custom_title = variable_get('biblio_block_title', '');
  if (!empty($custom_title)) {
    $db_result = db_query("SELECT bid,title FROM {blocks} b where module='biblio' ");
    while ($block = db_fetch_object($db_result)) {
      if (empty($block->title)) {
        $block->title = $custom_title;
        $result[] = update_sql("UPDATE {blocks} SET title='" . $block->title . "' WHERE bid=" . $block->bid);
      }
    }
    variable_del('biblio_block_title');
  }
  return $result;
}