You are here

function me_views_pre_execute in me aliases 6

Same name and namespace in other branches
  1. 8 includes/views/me.views.inc \me_views_pre_execute()
  2. 6.2 includes/me.views.inc \me_views_pre_execute()
  3. 7 includes/views/me.views.inc \me_views_pre_execute()

Implementation of Views' hook_views_pre_execute().

See http://drupal.org/project/views for module and hook information.

File

includes/me.views.inc, line 38
Provides views intergration for the me module.

Code

function me_views_pre_execute(&$view) {

  // Check if we need to do a redirect.
  if (!empty($view->me_redirect)) {

    // We should always be able to redirect here regardless, as our handler has to
    // have run for our option to be set, which means we need to redirect anyway.
    // Loop over the argument handlers to get the arguments we need. We also keep this
    // consistent with any extra arguments that may have been passed in.
    $arguments = $view->args;
    foreach (array_values($view->argument) as $key => $argument) {
      if (isset($argument->argument)) {
        $arguments[$key] = $argument->argument;
      }
    }

    // Redirect to the path.
    drupal_goto($view
      ->get_url($arguments));
  }
}