Skip to content

Instantly share code, notes, and snippets.

@dustincurrie
Created April 23, 2011 17:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dustincurrie/938829 to your computer and use it in GitHub Desktop.
Save dustincurrie/938829 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