From 6e2031f382f43b895375ad48c784573633af1049 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 20 Apr 2020 00:00:00 +0200 Subject: [PATCH] Added displayTitle() and displayDescription() for some entities. --- .../src/Api/Representation/AssetRepresentation.php | 5 +++++ .../src/Api/Representation/SitePageRepresentation.php | 10 ++++++++++ .../src/Api/Representation/SiteRepresentation.php | 10 ++++++++++ application/view/omeka/site/index/search.phtml | 3 +-- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/application/src/Api/Representation/AssetRepresentation.php b/application/src/Api/Representation/AssetRepresentation.php index 2026d6458b..f02f19da69 100644 --- a/application/src/Api/Representation/AssetRepresentation.php +++ b/application/src/Api/Representation/AssetRepresentation.php @@ -54,6 +54,11 @@ public function assetUrl() return $this->getFileUrl('asset', $this->filename()); } + public function displayTitle() + { + return $this->name(); + } + public function thumbnail() { return $this; diff --git a/application/src/Api/Representation/SitePageRepresentation.php b/application/src/Api/Representation/SitePageRepresentation.php index 3419f90b4f..934def7622 100644 --- a/application/src/Api/Representation/SitePageRepresentation.php +++ b/application/src/Api/Representation/SitePageRepresentation.php @@ -61,6 +61,16 @@ public function title() return $this->resource->getTitle(); } + /** + * Alias of title(). + * + * @return string + */ + public function displayTitle() + { + return $this->title(); + } + /** * Get the blocks assigned to this page. * diff --git a/application/src/Api/Representation/SiteRepresentation.php b/application/src/Api/Representation/SiteRepresentation.php index b67bd4577d..c53c51fadd 100644 --- a/application/src/Api/Representation/SiteRepresentation.php +++ b/application/src/Api/Representation/SiteRepresentation.php @@ -243,6 +243,16 @@ public function owner() ->getRepresentation($this->resource->getOwner()); } + public function displayTitle() + { + return $this->title(); + } + + public function displayDescription() + { + return $this->summary(); + } + public function siteUrl($siteSlug = null, $canonical = false) { if (!$siteSlug) { diff --git a/application/view/omeka/site/index/search.phtml b/application/view/omeka/site/index/search.phtml index 9d12b5d3e2..e235536974 100644 --- a/application/view/omeka/site/index/search.phtml +++ b/application/view/omeka/site/index/search.phtml @@ -28,10 +28,9 @@ $resourceControllers = [

-