function theme_panels_common_context_item_form in Panels 5.2
Same name and namespace in other branches
- 6.2 includes/common-context.inc \theme_panels_common_context_item_form()
Add the contexts form to panel page settings
5 theme calls to theme_panels_common_context_item_form()
- panels_common_add_argument_form in includes/
common.inc - Add the argument table plus gadget plus javascript to the form.
- panels_common_add_context_form in includes/
common.inc - panels_common_add_relationship_form in includes/
common.inc - panels_common_add_required_context_form in includes/
common.inc - panels_common_ajax_context_item_add in includes/
common.inc - Ajax entry point to add an context
File
- includes/
common.inc, line 821 - Functions used by more than one panels client module.
Code
function theme_panels_common_context_item_form($form) {
$output = '';
$type = $form['#panels_context_type'];
$module = $form['#panels_context_module'];
$name = $form['#panel_name'];
$type_info = panels_common_context_info($type);
if (!empty($form[$type]) && empty($form['#only_buttons'])) {
$output .= '<table id="' . $type . '-table">';
$output .= '<thead>';
$output .= '<tr>';
$output .= '<th class="title">' . $type_info['title'] . '</th>';
$output .= '<th class="operation">' . t('Operation') . '</th>';
$output .= '</tr>';
$output .= '</thead>';
$output .= '<tbody>';
$count = 0;
foreach (array_keys($form[$type]) as $id) {
if (!is_numeric($id)) {
continue;
}
$output .= theme('panels_common_context_item_row', $type, $form[$type][$id], $id, $count++);
}
$output .= '</tbody>';
$output .= '</table>';
}
if (!empty($form['buttons'])) {
// Display the add context item.
$row = array();
$row[] = array(
'data' => drupal_render($form['buttons'][$type]['item']),
'class' => 'title',
);
$row[] = array(
'data' => drupal_render($form['buttons'][$type]['add']),
'class' => 'add',
'width' => "60%",
);
$output .= '<div class="buttons">';
$output .= theme('table', array(), array(
$row,
), array(
'id' => $type . '-add-table',
));
$output .= '</div>';
}
if (!empty($form['description'])) {
$output .= drupal_render($form['description']);
}
return $output;
}