Skip to content
Snippets Groups Projects
Commit 527f6dbe authored by Alex Pott's avatar Alex Pott
Browse files

Issue #1331852 by droplet, franz: template_preprocess_menu_local_task localized_options is optional

parent bc7c79c6
No related branches found
No related tags found
No related merge requests found
......@@ -23,8 +23,8 @@
* @param array $variables
* An associative array containing:
* - element: A render element containing:
* - #link: A menu link array with 'title', 'href', and 'localized_options'
* keys.
* - #link: A menu link array with 'title', 'url', and (optionally)
* 'localized_options' keys.
* - #active: A boolean indicating whether the local task is active.
*/
function template_preprocess_menu_local_task(&$variables) {
......@@ -42,10 +42,10 @@ function template_preprocess_menu_local_task(&$variables) {
// If the link does not contain HTML already, String::checkPlain() it now.
// After we set 'html'=TRUE the link will not be sanitized by l().
if (empty($link['localized_options']['html'])) {
$link['title'] = String::checkPlain($link['title']);
$link_text = String::checkPlain($link_text);
}
$link['localized_options']['html'] = TRUE;
$link_text = t('!local-task-title!active', array('!local-task-title' => $link['title'], '!active' => $active));
$link_text = t('!local-task-title!active', array('!local-task-title' => $link_text, '!active' => $active));
}
$link['localized_options']['set_active_class'] = TRUE;
......@@ -65,8 +65,8 @@ function template_preprocess_menu_local_task(&$variables) {
* @param array $variables
* An associative array containing:
* - element: A render element containing:
* - #link: A menu link array with 'title', 'href', and 'localized_options'
* keys.
* - #link: A menu link array with 'title', 'url', and (optionally)
* 'localized_options' keys.
*/
function template_preprocess_menu_local_action(&$variables) {
$link = $variables['element']['#link'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment