From 74c536012014261ceb6291cf724df0537181187e 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 | 7 +++---- 4 files changed, 28 insertions(+), 4 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 96b87cde50..4fe4a22807 100644 --- a/application/src/Api/Representation/SitePageRepresentation.php +++ b/application/src/Api/Representation/SitePageRepresentation.php @@ -72,6 +72,16 @@ public function isPublic() return $this->resource->isPublic(); } + /** + * 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 793374e483..5c6f38dde9 100644 --- a/application/view/omeka/site/index/search.phtml +++ b/application/view/omeka/site/index/search.phtml @@ -28,12 +28,10 @@ $resourceControllers = [

- + +