finder_views_plugin_style_php_array_finder.inc

  1. finder
    1. 6.x-1.x
    2. 7.x-1.x

Version 1.1.2.48 (checked in on 2011/02/12 at 06:55:19 by danielb)

Handler for 'finder_views_php_array_finder' style.

Classes

NameDescription
finder_views_plugin_style_php_array_finder@file Handler for 'finder_views_php_array_finder' style.
View source
<?php
// $Id: finder_views_plugin_style_php_array_finder.inc,v 1.1.2.48 2011/02/12 06:55:19 danielb Exp $

/**
 * @file
 * Handler for 'finder_views_php_array_finder' style.
 */
class finder_views_plugin_style_php_array_finder extends views_plugin_style {

  function render() {
    $results = array();
    // Group the rows according to the grouping field, if specified.
    $sets = $this->render_grouping($this->view->result, $this->options['grouping']);
    $base_field = $this->view->base_field;
    $options = $this->display->display_options['finder_views_options'];
    $field_info = $this->display->display_options['finder_views_field_info'];
    $this->view->row_index = 0;
    foreach ($sets as $title => $records) {
      foreach ($records as $label => $row) {
        $row->base_table = $this->view->base_table;
        $row->base_field = $this->view->base_field;
        $row->set = $title;
        if ($options['mode'] == 'choices' && isset($field_info[$options['finder_element_id']])) {
          foreach ($field_info[$options['finder_element_id']] as $key => $field) {
            $field_alias = finder_field_alias($options['finder_element_id'], $field['table'], $field['field']);
            $alias = &$this->view->field[$field_alias]->field_alias;
            if ($alias) {
              $row->$field_alias = $row->$alias;
            }
          }
        }
        elseif ($options['mode'] == 'results') {
          foreach ($field_info as $feid => $info) {
            foreach ($info as $key => $field) {
              if (isset($field['field_alias'])) {
                foreach ($field['field_alias'] as $field_alias) {
                  $row->field_names[$feid][] = $field_alias;
                }
              }
              $alias = &$this->view->field[$field_alias]->field_alias;
              if ($alias) {
                $row->$field_alias = $row->$alias;
              }
            }
          }
        }
        $results[] = $row;
        $this->view->row_index++;
      }
    }
    unset($this->view->row_index);
    return $results;
  }

}

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.