You are here

function panels_mini_ui::list_form in Panels 7.3

Same name and namespace in other branches
  1. 6.3 panels_mini/plugins/export_ui/panels_mini_ui.class.php \panels_mini_ui::list_form()

Create the filter/sort form at the top of a list of exports.

This handles the very default conditions, and most lists are expected to override this and call through to parent::list_form() in order to get the base form and then modify it as necessary to add search gadgets for custom fields.

Overrides ctools_export_ui::list_form

File

panels_mini/plugins/export_ui/panels_mini_ui.class.php, line 12

Class

panels_mini_ui
@file

Code

function list_form(&$form, &$form_state) {
  ctools_include('plugins', 'panels');
  $this->layouts = panels_get_layouts();
  parent::list_form($form, $form_state);
  $categories = $layouts = array(
    'all' => t('- All -'),
  );
  foreach ($this->items as $item) {
    $categories[$item->category] = $item->category ? $item->category : t('Mini panels');
  }
  $form['top row']['category'] = array(
    '#type' => 'select',
    '#title' => t('Category'),
    '#options' => $categories,
    '#default_value' => 'all',
    '#weight' => -10,
  );
  foreach ($this->layouts as $name => $plugin) {
    $layouts[$name] = $plugin['title'];
  }
  $form['top row']['layout'] = array(
    '#type' => 'select',
    '#title' => t('Layout'),
    '#options' => $layouts,
    '#default_value' => 'all',
    '#weight' => -9,
  );
}