function panels_common_add_argument_form in Panels 6.2
Same name and namespace in other branches
- 5.2 includes/common.inc \panels_common_add_argument_form()
Add the argument table plus gadget plus javascript to the form.
1 call to panels_common_add_argument_form()
- panels_page_context_form in panels_page/
panels_page.admin.inc - The form to edit the context settings of a panel page.
File
- includes/
common-context.inc, line 83 - includes/common-context.inc Provide API for adding contexts for modules that embed displays.
Code
function panels_common_add_argument_form($module, &$form, &$form_state, &$form_location, $object) {
$form_location = array(
'#prefix' => '<div id="panels-arguments-table">',
'#suffix' => '</div>',
'#theme' => 'panels_common_context_item_form',
'#panel_name' => $object->name,
'#panels_context_type' => 'argument',
'#panels_context_module' => $module,
);
$args = panels_get_arguments();
$choices = array();
foreach ($args as $name => $arg) {
$choices[$name] = $arg['title'];
}
asort($choices);
if (!empty($choices) || !empty($object->arguments)) {
panels_common_add_item_table('argument', $form_location, $choices, $object->arguments);
}
}