You are here

class views_plugin_exposed_form_asset_widget in Asset 7

Exposed form plugin that provides an specific exposed form for asset widget.

Hierarchy

Expanded class hierarchy of views_plugin_exposed_form_asset_widget

1 string reference to 'views_plugin_exposed_form_asset_widget'
asset_widget_views_plugins in modules/asset_widget/views/asset_widget.views.inc
Implements hook_views_plugins().

File

modules/asset_widget/views/plugins/views_plugin_exposed_form_asset_widget.inc, line 12
Definition of views_plugin_exposed_form_asset_widget.

View source
class views_plugin_exposed_form_asset_widget extends views_plugin_exposed_form {
  function render_exposed_form($block = FALSE) {

    // Deal with any exposed filters we may have, before building.
    $form_state = array(
      'view' => &$this->view,
      'display' => &$this->display,
      'method' => 'get',
      'rerender' => TRUE,
      'no_redirect' => TRUE,
      'always_process' => TRUE,
    );

    // Some types of displays (eg. attachments) may wish to use the exposed
    // filters of their parent displays instead of showing an additional
    // exposed filter form for the attachment as well as that for the parent.
    if (!$this->view->display_handler
      ->displays_exposed() || !$block && $this->view->display_handler
      ->get_option('exposed_block')) {
      unset($form_state['rerender']);
    }
    if (!empty($this->ajax)) {
      $form_state['ajax'] = TRUE;
    }
    $form_state['exposed_form_plugin'] = $this;
    $form = drupal_build_form('views_exposed_form', $form_state);

    // Show exposed form only on live preview, or in when flag manually setted.
    if (!empty($this->view->render_exposed_form) || !empty($this->view->live_preview)) {

      // We add special class to get our form in JS.
      $form['#attributes']['class'][] = 'asset-widget-search-exposed-form';

      // Move all field descriptions to tooltips.
      foreach (element_children($form) as $child_key) {
        if (isset($form[$child_key]['#name']) && isset($form['#info']['filter-' . $form[$child_key]['#name']])) {
          if (!empty($form[$child_key]['#description'])) {
            $widget =& $form['#info']['filter-' . $form[$child_key]['#name']];
            if (empty($widget['description'])) {
              $widget['description'] = $form[$child_key]['#description'];
            }
            unset($form[$child_key]['#description']);
          }
        }
      }
      $output = drupal_render($form);
      if (!$this->view->display_handler
        ->displays_exposed() || !$block && $this->view->display_handler
        ->get_option('exposed_block')) {
        return "";
      }
      else {
        return $output;
      }
    }
    return "";
  }

}

Members

Namesort descending Modifiers Type Description Overrides
views_object::$definition public property Handler's definition.
views_object::$options public property Except for displays, options for the object will be held here. 1
views_object::altered_option_definition function Collect this handler's option definition and alter them, ready for use.
views_object::construct public function Views handlers use a special construct function. 4
views_object::destroy public function Destructor. 2
views_object::export_option public function 1
views_object::export_options public function
views_object::export_option_always public function Always exports the option, regardless of the default value.
views_object::options Deprecated public function Set default options on this object. 1
views_object::set_default_options public function Set default options.
views_object::set_definition public function Let the handler know what its full definition is.
views_object::unpack_options public function Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away.
views_object::unpack_translatable public function Unpack a single option definition.
views_object::unpack_translatables public function Unpacks each handler to store translatable texts.
views_object::_set_option_defaults public function
views_plugin::$display public property The current used views display.
views_plugin::$plugin_name public property The plugin name of this plugin, for example table or full.
views_plugin::$plugin_type public property The plugin type of this plugin, for example style or query.
views_plugin::$view public property The top object of a view. Overrides views_object::$view 1
views_plugin::additional_theme_functions public function Provide a list of additional theme functions for the theme info page.
views_plugin::options_submit public function Handle any special handling on the validate form. 9
views_plugin::options_validate public function Validate the options form. 10
views_plugin::plugin_title public function Return the human readable name of the display.
views_plugin::summary_title public function Returns the summary of the settings in the display. 8
views_plugin::theme_functions public function Provide a full list of possible theme templates used by this style.
views_plugin::validate public function Validate that the plugin is correct and can be saved. 3
views_plugin_exposed_form::exposed_form_alter public function
views_plugin_exposed_form::exposed_form_submit public function This function is executed when exposed form is submited.
views_plugin_exposed_form::exposed_form_validate public function
views_plugin_exposed_form::init public function Initialize the plugin.
views_plugin_exposed_form::options_form public function Provide a form to edit options for this plugin. Overrides views_plugin::options_form 1
views_plugin_exposed_form::option_definition public function Information about options for all kinds of purposes will be held here. Overrides views_object::option_definition 1
views_plugin_exposed_form::post_execute public function
views_plugin_exposed_form::post_render public function
views_plugin_exposed_form::pre_execute public function
views_plugin_exposed_form::pre_render public function 1
views_plugin_exposed_form::query public function Add anything to the query that we might need to. Overrides views_plugin::query 1
views_plugin_exposed_form::reset_form public function
views_plugin_exposed_form_asset_widget::render_exposed_form function Render the exposed filter form. Overrides views_plugin_exposed_form::render_exposed_form