You are here

function quicktabs_block in Quick Tabs 6.3

Same name and namespace in other branches
  1. 5 quicktabs.module \quicktabs_block()
  2. 6 quicktabs.module \quicktabs_block()
  3. 6.2 quicktabs.module \quicktabs_block()

Implementation of hook_block().

File

./quicktabs.module, line 154

Code

function quicktabs_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks = array();
      foreach (quicktabs_get_all_quicktabs() as $qt_name => $quicktabs) {
        $blocks[$qt_name]['info'] = $quicktabs['title'];
        $blocks[$qt_name]['cache'] = BLOCK_NO_CACHE;
      }
      return $blocks;
      break;
    case 'view':
      $mainblock = array();
      if ($quicktabs = quicktabs_load($delta)) {
        $mainblock['subject'] = $quicktabs['title'];
        $mainblock['content'] = theme('quicktabs', $quicktabs);
      }
      return $mainblock;
      break;
  }
}