security update core+modules
This commit is contained in:
@@ -67,7 +67,7 @@ function page_manager_comment_reply_page($node, $pid = NULL){
|
||||
}
|
||||
|
||||
$output = ctools_context_handler_render($task, '', $contexts, array($node, $pid));
|
||||
if ($output != FALSE) {
|
||||
if ($output !== FALSE) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
@@ -126,7 +126,7 @@ function page_manager_node_add($type) {
|
||||
'language' => LANGUAGE_NONE,
|
||||
);
|
||||
|
||||
drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)));
|
||||
drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)), PASS_THROUGH);
|
||||
return page_manager_node_edit($node);
|
||||
}
|
||||
|
||||
|
@@ -78,6 +78,10 @@ function page_manager_node_view_menu_alter(&$items, $task) {
|
||||
* node view, which is node_page_view().
|
||||
*/
|
||||
function page_manager_node_view_page($node) {
|
||||
// Prep the node to be displayed so all of the regular hooks are triggered.
|
||||
// Also save the output for later, in case it is needed.
|
||||
$default_output = node_page_view($node);
|
||||
|
||||
// Load my task plugin
|
||||
$task = page_manager_get_task('node_view');
|
||||
|
||||
@@ -85,32 +89,26 @@ function page_manager_node_view_page($node) {
|
||||
ctools_include('context');
|
||||
ctools_include('context-task-handler');
|
||||
|
||||
// We need to mimic Drupal's behavior of setting the node title here.
|
||||
drupal_set_title($node->title);
|
||||
$uri = entity_uri('node', $node);
|
||||
// Set the node path as the canonical URL to prevent duplicate content.
|
||||
drupal_add_html_head_link(array('rel' => 'canonical', 'href' => url($uri['path'], $uri['options'])), TRUE);
|
||||
// Set the non-aliased path as a default shortlink.
|
||||
drupal_add_html_head_link(array('rel' => 'shortlink', 'href' => url($uri['path'], array_merge($uri['options'], array('alias' => TRUE)))), TRUE);
|
||||
// Load all contexts.
|
||||
$contexts = ctools_context_handler_get_task_contexts($task, '', array($node));
|
||||
|
||||
// Build the full output using the configured CTools plugin.
|
||||
$output = ctools_context_handler_render($task, '', $contexts, array($node->nid));
|
||||
if ($output != FALSE) {
|
||||
if ($output !== FALSE) {
|
||||
node_tag_new($node);
|
||||
return $output;
|
||||
}
|
||||
|
||||
$function = 'node_page_view';
|
||||
// Try loading an override plugin.
|
||||
foreach (module_implements('page_manager_override') as $module) {
|
||||
$call = $module . '_page_manager_override';
|
||||
if (($rc = $call('node_view')) && function_exists($rc)) {
|
||||
$function = $rc;
|
||||
break;
|
||||
return $rc($node);
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise, fall back.
|
||||
return $function($node);
|
||||
// Otherwise, fall back to the default output generated by node_page_view().
|
||||
return $default_output;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -38,7 +38,7 @@ function page_manager_page_menu(&$items, $task) {
|
||||
) + $base;
|
||||
if ($access_callback == 'user_access') {
|
||||
$items['admin/structure/pages/import']['access callback'] = 'ctools_access_multiperm';
|
||||
$items['admin/structure/pages/import']['access arguments'][] = 'use PHP for settings';
|
||||
$items['admin/structure/pages/import']['access arguments'][] = 'use ctools import';
|
||||
}
|
||||
|
||||
// AJAX callbacks for argument modal.
|
||||
@@ -237,7 +237,7 @@ function page_manager_page_add_subtask($task_name = NULL, $step = NULL) {
|
||||
if ($task_name) {
|
||||
$page = page_manager_get_page_cache($task_name);
|
||||
if (empty($page)) {
|
||||
return drupal_not_found();
|
||||
return MENU_NOT_FOUND;
|
||||
}
|
||||
|
||||
$form_info['path'] = "admin/structure/pages/add/$task_name/%step";
|
||||
@@ -443,7 +443,7 @@ function page_manager_page_form_basic($form, &$form_state) {
|
||||
'#type' => 'checkbox',
|
||||
'#default_value' => !empty($page->make_frontpage),
|
||||
'#title' => t('Make this your site home page.'),
|
||||
'#description' => t('To set this panel as your home page you must create a unique path name with no % placeholders in the path. The site home page is currently set to %homepage on the !siteinfo configuration form.', array('!siteinfo' => l(t('Site Information'), 'admin/settings/site-information'), '%homepage' => '/' . $frontpage)),
|
||||
'#description' => t('To set this panel as your home page you must create a unique path name with no % placeholders in the path. The site home page is currently set to %homepage on the !siteinfo configuration form.', array('!siteinfo' => l(t('Site Information'), 'admin/config/system/site-information'), '%homepage' => '/' . $frontpage)),
|
||||
);
|
||||
$form['admin_paths'] = array(
|
||||
'#type' => 'checkbox',
|
||||
@@ -769,12 +769,12 @@ function page_manager_page_form_menu($form, &$form_state) {
|
||||
);
|
||||
}
|
||||
$form['menu']['parent']['weight'] = array(
|
||||
'#title' => t('Tab weight'),
|
||||
'#title' => t('Parent weight'),
|
||||
'#type' => 'textfield',
|
||||
'#default_value' => $menu['parent']['weight'],
|
||||
'#size' => 5,
|
||||
'#description' => t('If the parent menu item is a tab, enter the weight of the tab. The lower the number, the more to the left it will be.'),
|
||||
'#dependency' => array('radio:menu[type]' => array('default tab'), 'radio:menu[parent][type]' => array('tab')),
|
||||
'#description' => t('Enter the weight of the parent item. The lower the number, the more to the left it will be.'),
|
||||
'#dependency' => array('radio:menu[type]' => array('default tab'), 'radio:menu[parent][type]' => array('tab', 'normal')),
|
||||
'#dependency_count' => 2,
|
||||
);
|
||||
|
||||
|
@@ -321,7 +321,7 @@ function page_manager_page_execute($subtask_id) {
|
||||
ctools_include('context-task-handler');
|
||||
$output = ctools_context_handler_render($task, $subtask, $contexts, $args);
|
||||
if ($output === FALSE) {
|
||||
return drupal_not_found();
|
||||
return MENU_NOT_FOUND;
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
@@ -138,7 +138,7 @@ function page_manager_term_view_page($term, $depth = NULL) {
|
||||
$contexts = ctools_context_handler_get_task_contexts($task, '', array($term, $depth));
|
||||
|
||||
if (empty($contexts)) {
|
||||
return drupal_not_found();
|
||||
return MENU_NOT_FOUND;
|
||||
}
|
||||
|
||||
// Build the full output using the configured CTools plugin.
|
||||
@@ -151,7 +151,7 @@ function page_manager_term_view_page($term, $depth = NULL) {
|
||||
foreach (module_implements('page_manager_override') as $module) {
|
||||
$call = $module . '_page_manager_override';
|
||||
if (($rc = $call('term_view')) && function_exists($rc)) {
|
||||
return $rc($node);
|
||||
return $rc($term, $depth);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -97,8 +97,8 @@ function page_manager_user_edit_page($account, $category = 'account') {
|
||||
$output = ctools_context_handler_render($task, '', $contexts, array($account->uid));
|
||||
if (is_array($output)) {
|
||||
$output = drupal_render($output);
|
||||
}
|
||||
if ($output != FALSE) {
|
||||
}
|
||||
if ($output !== FALSE) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ function page_manager_user_edit_page($account, $category = 'account') {
|
||||
//call drupal_build_form.
|
||||
$form_state = array();
|
||||
$form_id = 'user_profile_form';
|
||||
$args = array($account);
|
||||
$args = array($account, $category);
|
||||
$form_state['build_info']['args'] = $args;
|
||||
form_load_include($form_state, 'inc', 'user', 'user.pages');
|
||||
$output = drupal_build_form($form_id, $form_state);
|
||||
|
@@ -81,7 +81,7 @@ function page_manager_user_view_page($account) {
|
||||
user_build_content($account);
|
||||
|
||||
$output = ctools_context_handler_render($task, '', $contexts, array($account->uid));
|
||||
if ($output != FALSE) {
|
||||
if ($output !== FALSE) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user