You are here

function user_relationship_blocks_block in User Relationships 6

Same name and namespace in other branches
  1. 5.2 plugins/user_relationship_blocks/user_relationship_blocks.module \user_relationship_blocks_block()

Implementation for hook_block

File

user_relationship_blocks/user_relationship_blocks.module, line 42
User Relationship Blocks implementation @author Jeff Smick (creator) @author Alex Karshakevich (maintainer) http://drupal.org/user/183217

Code

function user_relationship_blocks_block($op = 'list', $bid = '', $edit = array()) {
  if ($op != 'list') {

    //pad array with nulls before calling list() to avoid php notices
    $exploded = explode(UR_BLOCK_SEPARATOR, $bid);
    while (count($exploded) < 3) {
      $exploded[] = NULL;
    }
    list($block, $rtid, $extra) = $exploded;
  }
  switch ($op) {
    case 'list':
      return _user_relationship_blocks_list();
    case 'configure':
      return _user_relationship_blocks_form($block, $rtid, $extra, $bid);
    case 'save':
      return _user_relationship_blocks_settings(NULL, $edit);
    case 'view':
      return _user_relationship_blocks_view($block, $rtid, $extra, $bid);
  }
}