Skip to content

Instantly share code, notes, and snippets.

@pau1m
Forked from dustincurrie/gist:938829
Last active August 29, 2015 14:28
Show Gist options
  • Save pau1m/aa09497e819de410196f to your computer and use it in GitHub Desktop.
Save pau1m/aa09497e819de410196f to your computer and use it in GitHub Desktop.
Programmatically create quicktabs
<?php
function mymodule_block($op = 'list', $delta = 0, $edit = array()) {
switch($op) {
case 'list':
$blocks['mymodule_quicktabs'] = array('info' => t('[mymodule] Quicktabs'));
return $blocks;
break;
case 'view':
switch ($delta) {
case 'mymodule_quicktabs':
//set tab content
$tabs['tabcontent'] = array(
'title' => t('Tab 1'),
'type' => 'freetext',
'text' => t('Free Text'),
);
$quicktabs['qtid'] = 'mymodule_quicktabs';
$quicktabs['tabs'] = $tabs;
$quicktabs['style'] = 'Zen';
$quicktabs['ajax'] = FALSE;
$block = array('subject' => '', 'content' => theme('quicktabs', $quicktabs));
return $block;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment