function views_plugin_style_jump_menu::render

cis7 views_plugin_style_jump_menu.inc views_plugin_style_jump_menu::render()
cle7 views_plugin_style_jump_menu.inc views_plugin_style_jump_menu::render()
elmsmedia7 views_plugin_style_jump_menu.inc views_plugin_style_jump_menu::render()
icor7 views_plugin_style_jump_menu.inc views_plugin_style_jump_menu::render()
meedjum_blog7 views_plugin_style_jump_menu.inc views_plugin_style_jump_menu::render()
mooc7 views_plugin_style_jump_menu.inc views_plugin_style_jump_menu::render()

Render the display in this style.

This is overridden so that we can render our grouping specially.

Overrides views_plugin_style::render

File

sites/all/modules/ulmus/views/plugins/views_plugin_style_jump_menu.inc, line 106
Contains the table style plugin.

Class

views_plugin_style_jump_menu
Style plugin to render each item as a row in a table.

Code

function render() {
  $sets = $this->render_grouping($this->view->result, $this->options['grouping']);

  // Turn this all into an $options array for the jump menu.
  $this->view->row_index = 0;
  $options = array();
  $paths = array();

  foreach ($sets as $title => $records) {
    foreach ($records as $row_index => $row) {
      $this->view->row_index = $row_index;
      $path = strip_tags(decode_entities($this->get_field($this->view->row_index, $this->options['path'])));
      // Putting a '/' in front messes up url() so let's take that out
      // so users don't shoot themselves in the foot.
      $base_path = base_path();
      if (strpos($path, $base_path) === 0) {
        $path = drupal_substr($path, drupal_strlen($base_path));
      }

      // use drupal_parse_url() to preserve query and fragment in case the user
      // wants to do fun tricks.
      $url_options = drupal_parse_url($path);

      $path = url($url_options['path'], $url_options);
      $field = strip_tags(decode_entities($this->row_plugin->render($row)));
      $key = md5($path . $field) . "::" . $path;
      if ($title) {
        $options[$title][$key] = $field;
      }
      else {
        $options[$key] = $field;
      }
      $paths[$path] = $key;
      $this->view->row_index++;
    }
  }
  unset($this->view->row_index);

  $default_value = '';
  if ($this->options['default_value'] && !empty($paths[url($_GET['q'])])) {
    $default_value = $paths[url($_GET['q'])];
  }

  ctools_include('jump-menu');
  $settings = array(
    'hide' => $this->options['hide'],
    'button' => $this->options['text'],
    'title' => $this->options['label'],
    'choose' => $this->options['choose'],
    'inline' => $this->options['inline'],
    'default_value' => $default_value,
  );

  $form = drupal_get_form('ctools_jump_menu', $options, $settings);
  return $form;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.