function views_plugin_display_i18n_page::execute_hook_menu in i18n page views 6
Same name and namespace in other branches
- 6.0 views_plugin_display_i18n_page.inc \views_plugin_display_i18n_page::execute_hook_menu()
- 7 views_plugin_display_i18n_page.inc \views_plugin_display_i18n_page::execute_hook_menu()
Add this display's path information to Drupal's menu system.
File
- ./
views_plugin_display_i18n_page.inc, line 36 - Contains the i18n page display plugin.
Class
- views_plugin_display_i18n_page
- The plugin that handles a full page.
Code
function execute_hook_menu($callbacks) {
$items = array();
// Replace % with the link to our standard views argument loader
// views_arg_load -- which lives in views.module
$languages = locale_language_list();
foreach ($languages as $key => $value) {
$bits = explode('/', $this
->get_option('path_' . $key));
$page_arguments = array(
$this->view->name,
$this->display->id,
);
// Replace % with %views_arg for menu autoloading and add to the
// page arguments so the argument actually comes through.
foreach ($bits as $pos => $bit) {
if ($bit == '%') {
$bits[$pos] = '%views_arg';
$page_arguments[] = $pos;
}
}
$path = implode('/', $bits);
if (method_exists($this, 'get_access_plugin')) {
// views 2.x
$access_plugin = $this
->get_access_plugin();
}
elseif (method_exists($this, 'get_plugin')) {
// views 3.x
$access_plugin = $this
->get_plugin('access');
}
if (!isset($access_plugin)) {
$access_plugin = views_get_plugin('access', 'none');
}
if ($path) {
$items[$path] = array(
// default views page entry
'page callback' => 'views_page',
'page arguments' => $page_arguments,
// Default access check (per display)
'access callback' => 'views_access',
'access arguments' => array(
$access_plugin
->get_access_callback(),
),
// Identify URL embedded arguments and correlate them to a handler
'load arguments' => array(
$this->view->name,
$this->display->id,
'%index',
),
);
$menu = array(
'type' => 'none',
);
$items[$path]['type'] = MENU_CALLBACK;
}
}
return $items;
}