Skip to content

Commit

Permalink
pkp/pkp-lib#9976 Display Galley language in Galleys Grid
Browse files Browse the repository at this point in the history
  • Loading branch information
Antti-Jussi Nygård authored and Antti-Jussi Nygård committed May 24, 2024
1 parent dfea39b commit b3f1e90
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use PKP\controllers\api\file\linkAction\DownloadFileLinkAction;
use PKP\controllers\grid\DataObjectGridCellProvider;
use PKP\controllers\grid\GridHandler;
use PKP\facades\Locale;
use PKP\galley\Galley;

class ArticleGalleyGridCellProvider extends DataObjectGridCellProvider
Expand Down Expand Up @@ -64,6 +65,10 @@ public function getTemplateVarsFromRowColumn($row, $column)
return [
'label' => !$element->getData('urlRemote') && $element->getData('submissionFileId') ? '' : $element->getLabel()
];
case 'language':
return [
'label' => Locale::getSubmissionLocaleDisplayNames([$element->getLocale()], $this->getLocale())[$element->getLocale()]
];
default: assert(false);
}
return parent::getTemplateVarsFromRowColumn($row, $column);
Expand Down
8 changes: 8 additions & 0 deletions controllers/grid/articleGalleys/ArticleGalleyGridHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ public function initialize($request, $args = null)
$cellProvider
));

$this->addColumn(new GridColumn(
'language',
'common.language',
null,
null,
$cellProvider
));

if ($this->canEdit()) {
$this->addAction(new LinkAction(
'addGalley',
Expand Down

0 comments on commit b3f1e90

Please sign in to comment.