Commit 18ae2608 authored by Lily Yan's avatar Lily Yan
Browse files

Merge branch 'feature/ISTWCMS-4638-kpaxman-add_edit' into '8.x-1.x'

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

See merge request !7
parents 9568a04d b7926f11
......@@ -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