function theme_panels_common_context_item_form in Panels 6.2
Same name and namespace in other branches
- 5.2 includes/common.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_ajax_context_item_add in includes/
common-context.inc - Ajax entry point to add an context
- panels_common_add_argument_form in includes/
common-context.inc - Add the argument table plus gadget plus javascript to the form.
- panels_common_add_context_form in includes/
common-context.inc - panels_common_add_relationship_form in includes/
common-context.inc - panels_common_add_required_context_form in includes/
common-context.inc
File
- includes/
common-context.inc, line 300 - includes/common-context.inc Provide API for adding contexts for modules that embed displays.
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'])) {
$count = 0;
$rows = '';
foreach (array_keys($form[$type]) as $id) {
if (!is_numeric($id)) {
continue;
}
$rows .= theme('panels_common_context_item_row', $type, $form[$type][$id], $id, $count++);
}
$output .= '<table id="' . $type . '-table">';
$output .= '<thead>';
$output .= '<tr>';
$output .= '<th class="title">' . $type_info['title'] . '</th>';
if (!empty($type_info['sortable']) && $count) {
$output .= '<th class="position">' . t('Weight') . '</th>';
}
$output .= '<th class="operation">' . t('Operation') . '</th>';
$output .= '</tr>';
$output .= '</thead>';
$output .= '<tbody>';
$output .= $rows;
$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 .= drupal_render($form['buttons'][$type]);
$output .= theme('table', array(), array(
$row,
), array(
'id' => $type . '-add-table',
));
$output .= '</div>';
}
if (!empty($form['description'])) {
$output .= drupal_render($form['description']);
}
if (!empty($type_info['sortable'])) {
drupal_add_tabledrag($type . '-table', 'order', 'sibling', 'drag-position');
}
return $output;
}