You are here

flickr_block.install in Flickr 5

Same filename and directory in other branches
  1. 6 block/flickr_block.install
  2. 7 block/flickr_block.install

File

block/flickr_block.install
View source
<?php

function flickr_block_uninstall() {
  foreach (range(0, 6) as $delta) {
    variable_del("flickr_block_{$delta}");
  }
}

/**
 * Move all the block settings into a single variable per block.
 */
function flickr_block_update_1() {
  foreach (range(0, 6) as $delta) {
    $user = variable_get("flickr_block_{$delta}_user_id", FALSE);
    $show = variable_get("flickr_block_{$delta}_show_n", FALSE);
    $size = variable_get("flickr_block_{$delta}_size", FALSE);
    if ($user || $show || $size) {
      variable_set('flickr_block_' . $delta, array(
        'user_id' => $user,
        'show_n' => (int) $show,
        'size' => $size,
      ));
    }
    variable_del("flickr_block_{$delta}_user_id");
    variable_del("flickr_block_{$delta}_show_n");
    variable_del("flickr_block_{$delta}_size");
  }
  return array();
}

Functions

Namesort descending Description
flickr_block_uninstall
flickr_block_update_1 Move all the block settings into a single variable per block.