Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rescue Master Branch Commit ENH Prefer ::class syntax over class strings #372

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/GridFieldRestoreAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ public function getRestoreAction($gridField, $record, $columnName)
$restoreToRoot = RestoreAction::shouldRestoreToRoot($record);

$title = $restoreToRoot
? _t('SilverStripe\\Versioned\\RestoreAction.RESTORE_TO_ROOT', 'Restore to draft at top level')
: _t('SilverStripe\\Versioned\\RestoreAction.RESTORE', 'Restore to draft');
? _t(RestoreAction::class . '.RESTORE_TO_ROOT', 'Restore to draft at top level')
: _t(RestoreAction::class . '.RESTORE', 'Restore to draft');
$description = $restoreToRoot
? _t('SilverStripe\\Versioned\\RestoreAction.RESTORE_TO_ROOT_DESC', 'Restore the archived version to draft as a top level item')
: _t('SilverStripe\\Versioned\\RestoreAction.RESTORE_DESC', 'Restore the archived version to draft');
? _t(RestoreAction::class . '.RESTORE_TO_ROOT_DESC', 'Restore the archived version to draft as a top level item')
: _t(RestoreAction::class . '.RESTORE_DESC', 'Restore the archived version to draft');

$field = GridField_FormAction::create(
$gridField,
Expand Down
7 changes: 4 additions & 3 deletions src/VersionedGridFieldItemRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace SilverStripe\Versioned;

use SilverStripe\CMS\Controllers\CMSMain;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Core\Convert;
use SilverStripe\Forms\FieldList;
Expand Down Expand Up @@ -323,7 +324,7 @@ protected function addVersionedButtons(DataObject $record, FieldList $actions)
->addExtraClass('btn-outline-primary font-icon-tick')
->setAttribute('data-btn-alternate-add', 'btn-primary font-icon-save')
->setAttribute('data-btn-alternate-remove', 'btn-outline-primary font-icon-tick')
->setAttribute('data-text-alternate', _t('SilverStripe\\CMS\\Controllers\\CMSMain.SAVEDRAFT', 'Save draft'));
->setAttribute('data-text-alternate', _t(CMSMain::class . '.SAVEDRAFT', 'Save draft'));
}

// "publish" action
Expand Down Expand Up @@ -370,8 +371,8 @@ protected function addVersionedButtons(DataObject $record, FieldList $actions)
// Replace "delete" action
$actions->removeByName('action_doDelete');
$title = $isPublished
? _t('SilverStripe\\CMS\\Controllers\\CMSMain.UNPUBLISH_AND_ARCHIVE', 'Unpublish and archive')
: _t('SilverStripe\\CMS\\Controllers\\CMSMain.ARCHIVE', 'Archive');
? _t(CMSMain::class . '.UNPUBLISH_AND_ARCHIVE', 'Unpublish and archive')
: _t(CMSMain::class . '.ARCHIVE', 'Archive');

$actionArchive = FormAction::create('doArchive', $title)
->addExtraClass('delete btn btn-secondary')
Expand Down