diff --git a/Controller/BackendController.php b/Controller/BackendController.php index eafad28..cca6eb3 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -171,7 +171,7 @@ final class BackendController extends Controller if ($media->extension === 'collection') { $media = MediaMapper::getByVirtualPath( $media->getVirtualPath() . ($media->getVirtualPath() !== '/' ? '/' : '') . $media->name - )->with('tags/title/language', $request->getLanguage())->execute(); + )->where('tags/title/language', $request->getLanguage())->execute(); $collection = CollectionMapper::get()->where('id', $id)->execute(); $media = \array_merge($media, $collection->getSources()); diff --git a/Models/MediaMapper.php b/Models/MediaMapper.php index acb6380..1f80f34 100755 --- a/Models/MediaMapper.php +++ b/Models/MediaMapper.php @@ -36,23 +36,23 @@ class MediaMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'media_id' => ['name' => 'media_id', 'type' => 'int', 'internal' => 'id'], - 'media_name' => ['name' => 'media_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true], - 'media_type' => ['name' => 'media_type', 'type' => 'int', 'internal' => 'type'], - 'media_description' => ['name' => 'media_description', 'type' => 'string', 'internal' => 'description', 'autocomplete' => true], - 'media_description_raw' => ['name' => 'media_description_raw', 'type' => 'string', 'internal' => 'descriptionRaw'], - 'media_versioned' => ['name' => 'media_versioned', 'type' => 'bool', 'internal' => 'isVersioned'], - 'media_hidden' => ['name' => 'media_hidden', 'type' => 'bool', 'internal' => 'isHidden'], - 'media_file' => ['name' => 'media_file', 'type' => 'string', 'internal' => 'path', 'autocomplete' => true], - 'media_virtual' => ['name' => 'media_virtual', 'type' => 'string', 'internal' => 'virtualPath', 'autocomplete' => true], - 'media_absolute' => ['name' => 'media_absolute', 'type' => 'bool', 'internal' => 'isAbsolute'], - 'media_nonce' => ['name' => 'media_nonce', 'type' => 'string', 'internal' => 'nonce'], - 'media_password' => ['name' => 'media_password', 'type' => 'string', 'internal' => 'password'], - 'media_extension' => ['name' => 'media_extension', 'type' => 'string', 'internal' => 'extension'], - 'media_size' => ['name' => 'media_size', 'type' => 'int', 'internal' => 'size'], - 'media_collection' => ['name' => 'media_collection', 'type' => 'bool', 'internal' => 'collection'], - 'media_created_by' => ['name' => 'media_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], - 'media_created_at' => ['name' => 'media_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], + 'media_id' => ['name' => 'media_id', 'type' => 'int', 'internal' => 'id'], + 'media_name' => ['name' => 'media_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true], + 'media_type' => ['name' => 'media_type', 'type' => 'int', 'internal' => 'type'], + 'media_description' => ['name' => 'media_description', 'type' => 'string', 'internal' => 'description', 'autocomplete' => true], + 'media_description_raw' => ['name' => 'media_description_raw', 'type' => 'string', 'internal' => 'descriptionRaw'], + 'media_versioned' => ['name' => 'media_versioned', 'type' => 'bool', 'internal' => 'isVersioned'], + 'media_hidden' => ['name' => 'media_hidden', 'type' => 'bool', 'internal' => 'isHidden'], + 'media_file' => ['name' => 'media_file', 'type' => 'string', 'internal' => 'path', 'autocomplete' => true], + 'media_virtual' => ['name' => 'media_virtual', 'type' => 'string', 'internal' => 'virtualPath', 'autocomplete' => true], + 'media_absolute' => ['name' => 'media_absolute', 'type' => 'bool', 'internal' => 'isAbsolute'], + 'media_nonce' => ['name' => 'media_nonce', 'type' => 'string', 'internal' => 'nonce'], + 'media_password' => ['name' => 'media_password', 'type' => 'string', 'internal' => 'password'], + 'media_extension' => ['name' => 'media_extension', 'type' => 'string', 'internal' => 'extension'], + 'media_size' => ['name' => 'media_size', 'type' => 'int', 'internal' => 'size'], + 'media_collection' => ['name' => 'media_collection', 'type' => 'bool', 'internal' => 'collection'], + 'media_created_by' => ['name' => 'media_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], + 'media_created_at' => ['name' => 'media_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], ]; /** @@ -63,8 +63,8 @@ class MediaMapper extends DataMapperFactory */ public const BELONGS_TO = [ 'createdBy' => [ - 'mapper' => AccountMapper::class, - 'external' => 'media_created_by', + 'mapper' => AccountMapper::class, + 'external' => 'media_created_by', ], ]; @@ -76,8 +76,8 @@ class MediaMapper extends DataMapperFactory */ public const OWNS_ONE = [ 'type' => [ - 'mapper' => MediaTypeMapper::class, - 'external' => 'media_type', + 'mapper' => MediaTypeMapper::class, + 'external' => 'media_type', ], ]; diff --git a/Models/MediaTypeL11nMapper.php b/Models/MediaTypeL11nMapper.php index d9c05a7..792b86e 100644 --- a/Models/MediaTypeL11nMapper.php +++ b/Models/MediaTypeL11nMapper.php @@ -33,10 +33,10 @@ final class MediaTypeL11nMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'media_type_l11n_id' => ['name' => 'media_type_l11n_id', 'type' => 'int', 'internal' => 'id'], - 'media_type_l11n_title' => ['name' => 'media_type_l11n_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true], - 'media_type_l11n_type' => ['name' => 'media_type_l11n_type', 'type' => 'int', 'internal' => 'type'], - 'media_type_l11n_language' => ['name' => 'media_type_l11n_language', 'type' => 'string', 'internal' => 'language'], + 'media_type_l11n_id' => ['name' => 'media_type_l11n_id', 'type' => 'int', 'internal' => 'id'], + 'media_type_l11n_title' => ['name' => 'media_type_l11n_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true], + 'media_type_l11n_type' => ['name' => 'media_type_l11n_type', 'type' => 'int', 'internal' => 'type'], + 'media_type_l11n_language' => ['name' => 'media_type_l11n_language', 'type' => 'string', 'internal' => 'language'], ]; /** diff --git a/Models/MediaTypeMapper.php b/Models/MediaTypeMapper.php index eafff44..96882f5 100644 --- a/Models/MediaTypeMapper.php +++ b/Models/MediaTypeMapper.php @@ -33,9 +33,9 @@ final class MediaTypeMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'media_type_id' => ['name' => 'media_type_id', 'type' => 'int', 'internal' => 'id'], - 'media_type_name' => ['name' => 'media_type_name', 'type' => 'string', 'internal' => 'name'], - 'media_type_isvisible' => ['name' => 'media_type_isvisible', 'type' => 'bool', 'internal' => 'isVisible'], + 'media_type_id' => ['name' => 'media_type_id', 'type' => 'int', 'internal' => 'id'], + 'media_type_name' => ['name' => 'media_type_name', 'type' => 'string', 'internal' => 'name'], + 'media_type_isvisible' => ['name' => 'media_type_isvisible', 'type' => 'bool', 'internal' => 'isVisible'], ]; /** @@ -46,11 +46,11 @@ final class MediaTypeMapper extends DataMapperFactory */ public const HAS_MANY = [ 'title' => [ - 'mapper' => MediaTypeL11nMapper::class, - 'table' => 'media_type_l11n', - 'self' => 'media_type_l11n_type', - 'column' => 'title', - 'external' => null, + 'mapper' => MediaTypeL11nMapper::class, + 'table' => 'media_type_l11n', + 'self' => 'media_type_l11n_type', + 'column' => 'title', + 'external'=> null, ], ]; diff --git a/Theme/Backend/Components/Media/archive.tpl.php b/Theme/Backend/Components/Media/archive.tpl.php index 221ef16..ce25b6d 100755 --- a/Theme/Backend/Components/Media/archive.tpl.php +++ b/Theme/Backend/Components/Media/archive.tpl.php @@ -1,4 +1,16 @@ -
diff --git a/Theme/Backend/Components/Media/audio.tpl.php b/Theme/Backend/Components/Media/audio.tpl.php index 30a99f3..4980e0e 100755 --- a/Theme/Backend/Components/Media/audio.tpl.php +++ b/Theme/Backend/Components/Media/audio.tpl.php @@ -1,4 +1,16 @@ -getFileContent(($this->media->isAbsolute ? '' : __DIR__ . '/../../../../../../') . $this->media->getPath()), true); ?> diff --git a/Theme/Backend/Components/Media/markdown.tpl.php b/Theme/Backend/Components/Media/markdown.tpl.php index e61fdd7..1b22eb5 100755 --- a/Theme/Backend/Components/Media/markdown.tpl.php +++ b/Theme/Backend/Components/Media/markdown.tpl.php @@ -1,4 +1,16 @@ -load(($this->media->isAbsolute ? '' : __DIR__ . '/../../../../../../') . $this->media->getPath()); diff --git a/Theme/Backend/Components/Media/spreadsheet.tpl.php b/Theme/Backend/Components/Media/spreadsheet.tpl.php index efb9fe9..5bae88b 100755 --- a/Theme/Backend/Components/Media/spreadsheet.tpl.php +++ b/Theme/Backend/Components/Media/spreadsheet.tpl.php @@ -1,4 +1,16 @@ -getData('media'); $view = $this->getData('view'); @@ -24,7 +25,8 @@ $view = $this->getData('view'); /** @var \Modules\Tag\Models\Tag[] $tag */ $tags = $media->getTags(); -/** @var \Modules\Media\Views\MediaView $this */ +/** @var \phpOMS\Message\Http\HttpRequest $this->request */ + echo $this->getData('nav')->render(); ?>