You are here

public function MenuViews::tokenize_arguments in Menu Views 7

Filters arguments and tokens for view argument. Render a view inside a menu link.

File

includes/menu_views.class.inc, line 30
Provides methods for attaching a view to a menu item.

Class

MenuViews
Implements MenuViews() class.

Code

public function tokenize_arguments($human_readable = FALSE) {
  $args = explode('/', $this->arguments);
  if (count($args) && $this->mlid) {
    $context['menu-link'] = menu_link_load($this->mlid);
    $options = array(
      'callback' => '_menu_views_tokens_callback',
      'clear' => TRUE,
      'human_readable' => $human_readable,
    );
    foreach ($args as $key => $arg) {
      $args[$key] = token_replace($arg, $context, $options);
    }
  }
  return implode('/', $args);
}