Commit b7926f11 authored by Kevin Paxman's avatar Kevin Paxman
Browse files

ISTWCMS-4638: change Add/edit to sentence case, refactor how it was done, and...

ISTWCMS-4638: change Add/edit to sentence case, refactor how it was done, and modify special alert the same way.
parent 9568a04d
......@@ -96,8 +96,18 @@ class ContentManagementMenuBlock extends BlockBase implements ContainerFactoryPl
'#links' => [],
];
// Use "Add/edit" text when there is only 1 item permitted.
if (in_array($sec_id, [
'uw_content_management.content_types.site_footer',
'uw_content_management.content_types.special_alert',
])) {
$add_text = $this->t('Add/edit');
}
else {
$add_text = $this->t('Add');
}
$build[$id]['table'][$sec_id]['operations']['#links']['add'] = [
'title' => $this->t('Add'),
'title' => $add_text,
'url' => $item->link->getUrlObject(),
];
......@@ -115,8 +125,6 @@ class ContentManagementMenuBlock extends BlockBase implements ContainerFactoryPl
}
}
// Rename site footer 'Add' link to 'Add/Edit'.
$build['uw_content_management.content_types']['table']['uw_content_management.content_types.site_footer']['operations']['#links']['add']['title'] = $this->t('Add/Edit');
$build['#attached']['library'][] = 'uw_dashboard/uw-styles';
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment