You are here

function panels_common_add_item_table_buttons in Panels 5.2

Same name and namespace in other branches
  1. 6.2 includes/common-context.inc \panels_common_add_item_table_buttons()
2 calls to panels_common_add_item_table_buttons()
panels_common_add_item_table in includes/common.inc
Add the context table to the page.
panels_common_ajax_context_item_add in includes/common.inc
Ajax entry point to add an context

File

includes/common.inc, line 739
Functions used by more than one panels client module.

Code

function panels_common_add_item_table_buttons($type, &$form, $available_contexts) {
  $form['buttons'] = array(
    '#tree' => TRUE,
  );
  if (!empty($available_contexts)) {
    $form['buttons'][$type]['item'] = array(
      '#type' => 'select',
      '#options' => $available_contexts,
    );
    $type_info = panels_common_context_info($type);
    $form['buttons'][$type]['add'] = array(
      '#type' => 'submit',
      '#attributes' => array(
        'class' => $type . '-add',
      ),
      '#value' => $type_info['add button'],
    );
  }
}