mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #1467 from open-sausages/pulls/4.0/menu-title-override
API set menu title without editing transifex masters
This commit is contained in:
commit
ba2c84109c
@ -599,8 +599,17 @@ class AssetAdmin extends LeftAndMain implements PermissionProvider{
|
|||||||
return $items;
|
return $items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function menu_title($class = null, $localised = true) {
|
||||||
|
// Deprecate this menu title if installed alongside new asset admin
|
||||||
|
if($localised && class_exists('SilverStripe\AssetAdmin\Controller\AssetAdmin')) {
|
||||||
|
// Don't conflict with legacy translations
|
||||||
|
return _t('AssetAdmin.CMSMENU_OLD', 'Files (old)');
|
||||||
|
}
|
||||||
|
return parent::menu_title(null, $localised);
|
||||||
|
}
|
||||||
|
|
||||||
public function providePermissions() {
|
public function providePermissions() {
|
||||||
$title = _t("AssetAdmin.MENUTITLE", LeftAndMain::menu_title_for_class($this->class));
|
$title = static::menu_title();
|
||||||
return array(
|
return array(
|
||||||
"CMS_ACCESS_AssetAdmin" => array(
|
"CMS_ACCESS_AssetAdmin" => array(
|
||||||
'name' => _t('CMSMain.ACCESS', "Access to '{title}' section", array('title' => $title)),
|
'name' => _t('CMSMain.ACCESS', "Access to '{title}' section", array('title' => $title)),
|
||||||
|
@ -1428,7 +1428,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function providePermissions() {
|
public function providePermissions() {
|
||||||
$title = _t("CMSPagesController.MENUTITLE", LeftAndMain::menu_title_for_class('CMSPagesController'));
|
$title = CMSPagesController::menu_title();
|
||||||
return array(
|
return array(
|
||||||
"CMS_ACCESS_CMSMain" => array(
|
"CMS_ACCESS_CMSMain" => array(
|
||||||
'name' => _t('CMSMain.ACCESS', "Access to '{title}' section", array('title' => $title)),
|
'name' => _t('CMSMain.ACCESS', "Access to '{title}' section", array('title' => $title)),
|
||||||
|
Loading…
Reference in New Issue
Block a user