From 697bcf58b2f2887d0b63352b47464eefd32bf51b Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 2 Apr 2024 21:40:47 +0000 Subject: [PATCH] template fixes + bug fixes + style fixes --- Admin/Installer.php | 2 +- Controller/BackendController.php | 6 +++--- Controller/SearchController.php | 4 ++-- Models/MediaMapper.php | 4 ++-- Theme/Backend/media-list.tpl.php | 4 ++-- Theme/Backend/media-upload.tpl.php | 4 ++-- Theme/Backend/media-view.tpl.php | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Admin/Installer.php b/Admin/Installer.php index cfddcb9..dd30645 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -68,7 +68,7 @@ final class Installer extends InstallerAbstract // Because of this, the directory needs to be created manually after the Media installation // The admin account should be the only DB account, but we use a loop of all accounts to avoid bugs /** @var \Modules\Admin\Models\Account[] $accounts */ - $accounts = AccountMapper::getAll()->execute(); + $accounts = AccountMapper::getAll()->executeGetArray(); foreach ($accounts as $account) { $collection = new Collection(); diff --git a/Controller/BackendController.php b/Controller/BackendController.php index e694eb8..7bda55a 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -385,10 +385,10 @@ final class BackendController extends Controller $id = $request->getDataString('id') ?? ''; - $settings = SettingMapper::getAll()->where('module', $id)->execute(); + $settings = SettingMapper::getAll()->where('module', $id)->executeGetArray(); $view->data['settings'] = $settings; - $types = MediaTypeMapper::getAll()->with('title')->where('title/language', $response->header->l11n->language)->execute(); + $types = MediaTypeMapper::getAll()->with('title')->where('title/language', $response->header->l11n->language)->executeGetArray(); $view->data['types'] = $types; $view->setTemplate('/Modules/' . static::NAME . '/Admin/Settings/Theme/Backend/settings'); @@ -423,7 +423,7 @@ final class BackendController extends Controller $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response); $view->data['type'] = $type; - $l11n = MediaTypeL11nMapper::getAll()->where('type', $type->id)->execute(); + $l11n = MediaTypeL11nMapper::getAll()->where('type', $type->id)->executeGetArray(); $view->data['l11n'] = $l11n; return $view; diff --git a/Controller/SearchController.php b/Controller/SearchController.php index 1fbb3e8..e2a2ea7 100644 --- a/Controller/SearchController.php +++ b/Controller/SearchController.php @@ -62,7 +62,7 @@ final class SearchController extends Controller ->where('tags/title/content', $pattern) ->sort('createdAt', OrderType::DESC) ->limit(8) - ->execute(); + ->executeGetArray(); $results = []; foreach ($media as $file) { @@ -111,7 +111,7 @@ final class SearchController extends Controller ->where('tags/title/language', $response->header->l11n->language) ->sort('createdAt', OrderType::DESC) ->limit(8) - ->execute(); + ->executeGetArray(); $results = []; foreach ($media as $file) { diff --git a/Models/MediaMapper.php b/Models/MediaMapper.php index 3b231ab..4bfe03c 100755 --- a/Models/MediaMapper.php +++ b/Models/MediaMapper.php @@ -190,8 +190,8 @@ class MediaMapper extends DataMapperFactory */ public static function getParentCollection(string $path = '/') : ReadMapper { - $path = \dirname($path); - $name = \basename($path); + $path = \dirname($path); + $name = \basename($path); $virtualPath = '/' . \trim(\dirname($path), '/'); //$virtualPath = '/' . \trim(\substr($path, 0, \strripos($path, '/') + 1), '/'); diff --git a/Theme/Backend/media-list.tpl.php b/Theme/Backend/media-list.tpl.php index 5094050..ed7bc4d 100755 --- a/Theme/Backend/media-list.tpl.php +++ b/Theme/Backend/media-list.tpl.php @@ -30,8 +30,8 @@ $media = $this->data['media'] ?? []; $account = $this->data['account']; $accountDir = $account->id . ' ' . $account->login; -$previous = empty($media) ? '{/base}/media/list' : '{/base}/media/list?{?}&id=' . \reset($media)->id . '&ptype=p'; -$next = empty($media) ? '{/base}/media/list' : '{/base}/media/list?{?}&id=' . \end($media)->id . '&ptype=n'; +$previous = empty($media) ? '{/base}/media/list' : '{/base}/media/list?{?}&offset=' . \reset($media)->id . '&ptype=p'; +$next = empty($media) ? '{/base}/media/list' : '{/base}/media/list?{?}&offset=' . \end($media)->id . '&ptype=n'; ?>
diff --git a/Theme/Backend/media-upload.tpl.php b/Theme/Backend/media-upload.tpl.php index 3412b6b..8424826 100755 --- a/Theme/Backend/media-upload.tpl.php +++ b/Theme/Backend/media-upload.tpl.php @@ -60,7 +60,7 @@ use phpOMS\Uri\UriFactory;
- -
+ + \ No newline at end of file diff --git a/Theme/Backend/media-view.tpl.php b/Theme/Backend/media-view.tpl.php index ea879ae..f29488f 100644 --- a/Theme/Backend/media-view.tpl.php +++ b/Theme/Backend/media-view.tpl.php @@ -106,7 +106,7 @@ echo $this->data['nav']->render(); getHtml('Description'); ?> - description; ?> + printHtml($media->description); ?>