Same name in other branches
- 7.x-2.x includes/admin.inc \_quicktabs_form()
- 8.x-1.x quicktabs.admin.inc \_quicktabs_form()
1 call to _quicktabs_form()
- quicktabs_form dans ./
quicktabs.admin.inc - Build the quicktab creation and edit form.
Fichier
-
./
quicktabs.admin.inc, line 292
Code
function _quicktabs_form(array $tab, $qt) {
$form['#tree'] = TRUE;
$delta = $tab['delta'];
$form['weight'] = array(
'#type' => 'weight',
'#default_value' => isset($tab['weight']) ? $tab['weight'] : $delta - 100,
'#delta' => 100,
);
$form['title'] = array(
'#type' => 'textfield',
'#size' => '10',
'#default_value' => isset($tab['title']) ? $tab['title'] : '',
);
// Load all "contents" plugins to display a choice of content types.
ctools_include('plugins');
$contents = ctools_get_plugins('quicktabs', 'contents');
foreach ($contents as $name => $info) {
if (isset($info['dependencies'])) {
foreach ($info['dependencies'] as $dep) {
// Do not load the options form for any plugin that is missing dependencies.
if (!module_exists($dep)) {
continue 2;
}
}
}
$tabtypes[$name] = $name;
$content_provider = quick_content_factory($name, $tab);
if (is_object($content_provider)) {
$form = array_merge_recursive($form, $content_provider->optionsForm($delta, $qt));
}
}
$form['type'] = array(
'#type' => 'radios',
'#options' => $tabtypes,
'#default_value' => isset($tab['type']) ? $tab['type'] : key($tabtypes),
);
$form['remove'] = array(
'#type' => 'submit',
'#prefix' => '<div>',
'#suffix' => '<label for="edit-remove">' . t('Delete') . '</label></div>',
'#value' => 'remove_' . $delta,
'#attributes' => array(
'class' => array(
'delete-tab',
),
'title' => t('Click here to delete this tab.'),
),
'#submit' => array(
'quicktabs_remove_tab_submit',
),
'#ajax' => array(
'callback' => 'quicktabs_ajax_callback',
'wrapper' => 'quicktab-tabs',
'method' => 'replace',
'effect' => 'fade',
),
'#limit_validation_errors' => array(),
);
return $form;
}