You are here

function panelizer_defaults_ui::list_filter in Panelizer 7.3

Same name and namespace in other branches
  1. 7.2 plugins/export_ui/panelizer_defaults_ui.class.php \panelizer_defaults_ui::list_filter()

Determine if a row should be filtered out.

This handles the default filters for the export UI list form. If you added additional filters in list_form() then this is where you should handle them.

Return value

TRUE if the item should be excluded.

Overrides ctools_export_ui::list_filter

File

plugins/export_ui/panelizer_defaults_ui.class.php, line 65
Contains the administrative UI for selectable panelizer defaults.

Class

panelizer_defaults_ui
@file Contains the administrative UI for selectable panelizer defaults.

Code

function list_filter($form_state, $item) {

  // Reminder: This returns TRUE to exclude the item.
  if ($this->entity_handler->entity_type != $item->panelizer_type) {
    return TRUE;
  }
  if ($this->entity_bundle != $item->panelizer_key) {
    return TRUE;
  }
  if ($this->entity_view_mode != $item->view_mode) {
    return TRUE;
  }
  if (!$this->entity_handler
    ->access_default_panelizer_object($item)) {
    return TRUE;
  }
  if (empty($item->title) && $item->name == implode(':', array(
    $this->entity_handler->entity_type,
    $this->entity_bundle,
    'default',
  ))) {
    $item->title = t('Default');
  }
  return parent::list_filter($form_state, $item);
}