0

I created a custom quicktabs module in drupal 6 that adds a block, and it is working just fine. Before moving it over to drupal 7, I edited the module and info files accordingly, but the module displays no block on admin/structure/block and the version of the module doesn't appear on admin/modules.

I have added the feeds and their blocks are displaying content and the bids are identical in both versions of the site.

I have read this and this and even tried this, but haven't found the solution. I have run cron and cleared cache when you would be expected to.

If I add a print_r($tabs) I get an array with all of the array pieces as designated below for the right days.

quicktab_custom.info file

name = quicktab custom
description = custom quicktab block for event data
core = 7.x

quicktab_custom.module file

/**
 * Implements hook_block().
 * 
 * We want to define a quicktabs block.
 */
function quicktab_custom_block($op = 'list', $delta = 0, $edit = array()) {

switch($op) {
// 'list' shows the items in admin/build/block admin page
// we alsohave: configure, save, view
case 'list':
  $blocks['quicktab_custom_quicktabs'] = array(
    'info' => t('events this week'),
    'cache' => BLOCK_NO_CACHE,
  );
  return $blocks;
  break;
case 'view':

  switch ($delta) {
    case 'quicktab_custom_quicktabs':
     $today = date('D');

      //set tab content
      $tabs[] = array(
        'title' => t($today),
        'type' => 'block',
        'bid' => 'aggregator_delta_feed-14',

      );
      $tabs[] = array(
        'title' => t(date('D',strtotime($today . ' +1 day'))),
        'type' => 'block',
        'bid' => 'aggregator_delta_feed-15',

      );
      $tabs[] = array(
        'title' => t(date('D',strtotime($today . ' +2 day'))),
        'type' => 'block',
        'bid' => 'aggregator_delta_feed-16',

      );
      $tabs[] = array(
        'title' => t(date('D',strtotime($today . ' +3 day'))),
        'type' => 'block',
        'bid' => 'aggregator_delta_feed-17',

      );
      $tabs[] = array(
        'title' => t(date('D',strtotime($today . ' +4 day'))),
        'type' => 'block',
        'bid' => 'aggregator_delta_feed-18',

      );
      $tabs[] = array(
        'title' => t(date('D',strtotime($today . ' +5 day'))),
        'type' => 'block',
        'bid' => 'aggregator_delta_feed-19',

      );
      $tabs[] = array(
        'title' => t(date('D',strtotime($today . ' +6 day'))),
        'type' => 'block',
        'bid' => 'aggregator_delta_feed-20',

      );

      $quicktabs['qtid'] = 'quicktab_custom_quicktabs'; // machine readable name
      $quicktabs['hide_empty_tags'] = TRUE;     // hide tabs that are empty
      $quicktabs['default_tab'] = $today;   // set the default tab
      $quicktabs['tabs'] = $tabs;       // all tabs with content
      $quicktabs['style'] = 'Navlist';      // tabs theme -- originally set to Sky
      $quicktabs['ajax'] = FALSE;       // ajax or not
      $block = array('subject' => '', 'content' => theme('quicktabs', $quicktabs));

      return $block;
      break;
  }
 } 
}
1

According to this comment on the hook_block() docs,

Drupal 7 doesn't use anymore hook_block(), but it uses a set of new hooks; see Converting 6.x modules to 7.x for more details.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.