Community Documentation

Required changes

Last updated February 19, 2008. Created by puregin on May 30, 2005.
Edited by ax. Log in to edit this page.

Modified block hook:
Drupal 4.0:

function *_block() {
  $blocks[0]["info"] = "First block info";
  $blocks[0]["subject"] = "First block subject";
  $blocks[0]["content"] = "First block content";

  $blocks[1]["info"] = "Second block info";
  $blocks[1]["subject"] = "Second block subject";
  $blocks[1]["content"] = "Second block content";

  // return array of blocks
  return $blocks;
  }
}

Drupal 4.1:

function *_block($op = "list", $delta = 0) {
  if ($op == "list") {
    $blocks[0]["info"] = "First block info";
    $blocks[1]["info"] = "Second block info";
    return $blocks; // return array of block infos
  }
  else {
    switch($delta) {
      case 0:
        $block["subject"] = "First block subject";
        $block["content"] = "First block content";
        return $block; 
      case 1:
        $block["subject"] = "Second block subject";
        $block["content"] = "Second block content";
        return $block;
    }
  }
}

Modified taxonomy API:

Changes: in function taxonomy_get_tree()

  • there is no longer a "parent" property; rather "parents" is an array
  • the result tree is now returned instead of being passed by reference

Drupal 4.0:

function taxonomy_get_tree($vocabulary_id, &$tree, $parent = 0, $depth = -1, $key = "tid")

Drupal 4.1:

<b>$tree =</b> taxonomy_get_tree($vocabulary_id, <b>$parents</b> = 0, $depth = -1, $key = "tid")

Archive

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.
nobody click here