Same name in other branches
  1. 7.x-3.x quicktabs.module \quicktabs_ajax()
  2. 8.x-1.x quicktabs.module \quicktabs_ajax()

Ajax callback for tab content.

1 string reference to 'quicktabs_ajax'
quicktabs_menu dans ./quicktabs.module
Implements hook_menu().

Fichier

./quicktabs.module, line 314

Code

function quicktabs_ajax($type) {
    $args = func_get_args();
    $type = array_shift($args);
    $tabpage = array(
        'type' => $type,
    );
    switch ($type) {
        case 'node':
            list($tabpage['nid'], $tabpage['teaser'], $tabpage['hide_title']) = $args;
            break;
        case 'block':
            list($tabpage['qt_name'], $tabpage['bid'], $tabpage['hide_title']) = $args;
            break;
        case 'qtabs':
            $tabpage['machine_name'] = $args[0];
            break;
    }
    $output = quicktabs_render_tab_content($tabpage);
    $data = !empty($output) ? drupal_render($output) : '';
    drupal_json_output(array(
        'status' => 0,
        'data' => $data,
    ));
}