diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-07-28 20:46:11 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-07-28 20:46:11 +0200 |
commit | 301c7ab1a079d937ab41c6f52b8804e5731008e6 (patch) | |
tree | da6a5ed2a436fea87a3fe83fe72483c3f07c5826 /application/front/controller | |
parent | b725eb047d233d6c7a505f160b57ebc399a24d45 (diff) | |
download | Shaarli-301c7ab1a079d937ab41c6f52b8804e5731008e6.tar.gz Shaarli-301c7ab1a079d937ab41c6f52b8804e5731008e6.tar.zst Shaarli-301c7ab1a079d937ab41c6f52b8804e5731008e6.zip |
Better support for notes permalink
Diffstat (limited to 'application/front/controller')
-rw-r--r-- | application/front/controller/visitor/BookmarkListController.php | 6 | ||||
-rw-r--r-- | application/front/controller/visitor/DailyController.php | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/application/front/controller/visitor/BookmarkListController.php b/application/front/controller/visitor/BookmarkListController.php index 23c4fbae..2988bee6 100644 --- a/application/front/controller/visitor/BookmarkListController.php +++ b/application/front/controller/visitor/BookmarkListController.php | |||
@@ -32,6 +32,7 @@ class BookmarkListController extends ShaarliVisitorController | |||
32 | } | 32 | } |
33 | 33 | ||
34 | $formatter = $this->container->formatterFactory->getFormatter(); | 34 | $formatter = $this->container->formatterFactory->getFormatter(); |
35 | $formatter->addContextData('base_path', $this->container->basePath); | ||
35 | 36 | ||
36 | $searchTags = escape(normalize_spaces($request->getParam('searchtags') ?? '')); | 37 | $searchTags = escape(normalize_spaces($request->getParam('searchtags') ?? '')); |
37 | $searchTerm = escape(normalize_spaces($request->getParam('searchterm') ?? ''));; | 38 | $searchTerm = escape(normalize_spaces($request->getParam('searchterm') ?? ''));; |
@@ -145,11 +146,14 @@ class BookmarkListController extends ShaarliVisitorController | |||
145 | 146 | ||
146 | $this->updateThumbnail($bookmark); | 147 | $this->updateThumbnail($bookmark); |
147 | 148 | ||
149 | $formatter = $this->container->formatterFactory->getFormatter(); | ||
150 | $formatter->addContextData('base_path', $this->container->basePath); | ||
151 | |||
148 | $data = array_merge( | 152 | $data = array_merge( |
149 | $this->initializeTemplateVars(), | 153 | $this->initializeTemplateVars(), |
150 | [ | 154 | [ |
151 | 'pagetitle' => $bookmark->getTitle() .' - '. $this->container->conf->get('general.title', 'Shaarli'), | 155 | 'pagetitle' => $bookmark->getTitle() .' - '. $this->container->conf->get('general.title', 'Shaarli'), |
152 | 'links' => [$this->container->formatterFactory->getFormatter()->format($bookmark)], | 156 | 'links' => [$formatter->format($bookmark)], |
153 | ] | 157 | ] |
154 | ); | 158 | ); |
155 | 159 | ||
diff --git a/application/front/controller/visitor/DailyController.php b/application/front/controller/visitor/DailyController.php index 808ca5f7..54a4778f 100644 --- a/application/front/controller/visitor/DailyController.php +++ b/application/front/controller/visitor/DailyController.php | |||
@@ -54,6 +54,7 @@ class DailyController extends ShaarliVisitorController | |||
54 | } | 54 | } |
55 | 55 | ||
56 | $formatter = $this->container->formatterFactory->getFormatter(); | 56 | $formatter = $this->container->formatterFactory->getFormatter(); |
57 | $formatter->addContextData('base_path', $this->container->basePath); | ||
57 | // We pre-format some fields for proper output. | 58 | // We pre-format some fields for proper output. |
58 | foreach ($linksToDisplay as $key => $bookmark) { | 59 | foreach ($linksToDisplay as $key => $bookmark) { |
59 | $linksToDisplay[$key] = $formatter->format($bookmark); | 60 | $linksToDisplay[$key] = $formatter->format($bookmark); |