diff --git a/Admin/Activate.php b/Admin/Activate.php index 8838b87..96a1f4e 100644 --- a/Admin/Activate.php +++ b/Admin/Activate.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -16,7 +16,7 @@ namespace Modules\Media\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\ActivateAbstract; use phpOMS\Module\InfoManager; @@ -37,7 +37,7 @@ class Activate extends ActivateAbstract /** * {@inheritdoc} */ - public static function activate(Pool $dbPool, InfoManager $info) + public static function activate(DatabasePool $dbPool, InfoManager $info) { parent::activate($dbPool, $info); } diff --git a/Admin/Deactivate.php b/Admin/Deactivate.php index 54c0846..071b772 100644 --- a/Admin/Deactivate.php +++ b/Admin/Deactivate.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -16,7 +16,7 @@ namespace Modules\Media\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\DeactivateAbstract; use phpOMS\Module\InfoManager; @@ -37,7 +37,7 @@ class Deactivate extends DeactivateAbstract /** * {@inheritdoc} */ - public static function deactivate(Pool $dbPool, InfoManager $info) + public static function deactivate(DatabasePool $dbPool, InfoManager $info) { parent::deactivate($dbPool, $info); } diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 9f4d3ba..c25ae81 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -14,7 +14,7 @@ * @link http://orange-management.com */ namespace Modules\Media\Admin\Install; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; /** * Navigation class. @@ -29,7 +29,7 @@ use phpOMS\DataStorage\Database\Pool; */ class Navigation { - public static function install(Pool $dbPool) + public static function install(string $path, DatabasePool $dbPool) { $navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); diff --git a/Admin/Installer.php b/Admin/Installer.php index 5ba23b7..0fab011 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -16,7 +16,7 @@ namespace Modules\Media\Admin; use phpOMS\DataStorage\Database\DatabaseType; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\InfoManager; use phpOMS\Module\InstallerAbstract; @@ -37,9 +37,9 @@ class Installer extends InstallerAbstract /** * {@inheritdoc} */ - public static function install(Pool $dbPool, InfoManager $info) + public static function install(string $path, DatabasePool $dbPool, InfoManager $info) { - parent::install($dbPool, $info); + parent::install($path, $dbPool, $info); switch ($dbPool->get('core')->getType()) { case DatabaseType::MYSQL: diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php new file mode 100644 index 0000000..d9cc200 --- /dev/null +++ b/Admin/Routes/Web/Api.php @@ -0,0 +1,24 @@ + [ + [ + 'dest' => '\Modules\Media\Controller:apiCollectionCreate', + 'verb' => RouteVerb::SET, + ], + ], + '^.*/api/media$' => [ + [ + 'dest' => '\Modules\Media\Controller:apiMediaUpload', + 'verb' => RouteVerb::SET, + ], + ], + '^.*/api/media/create.*$' => [ + [ + 'dest' => '\Modules\Media\Controller:apiMediaCreate', + 'verb' => RouteVerb::SET, + ], + ], +]; diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 5c381b1..8931213 100644 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -25,22 +25,4 @@ return [ 'verb' => RouteVerb::GET, ], ], - '^.*/api/media/collection.*$' => [ - [ - 'dest' => '\Modules\Media\Controller:apiCollectionCreate', - 'verb' => RouteVerb::SET, - ], - ], - '^.*/api/media$' => [ - [ - 'dest' => '\Modules\Media\Controller:apiMediaUpload', - 'verb' => RouteVerb::SET, - ], - ], - '^.*/api/media/create.*$' => [ - [ - 'dest' => '\Modules\Media\Controller:apiMediaCreate', - 'verb' => RouteVerb::SET, - ], - ], ]; diff --git a/Admin/Uninstall.php b/Admin/Uninstall.php index 0338a33..3500533 100644 --- a/Admin/Uninstall.php +++ b/Admin/Uninstall.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -16,7 +16,7 @@ namespace Modules\Media\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\DataStorage\Database\Schema\Builder; use phpOMS\Module\UninstallAbstract; @@ -37,7 +37,7 @@ class Uninstall extends UninstallAbstract /** * {@inheritdoc} */ - public static function uninstall(Pool $dbPool, InfoManager $info) + public static function uninstall(DatabasePool $dbPool, InfoManager $info) { parent::uninstall($dbPool, $info); diff --git a/Admin/Update.php b/Admin/Update.php index 0305a22..c5f9a12 100644 --- a/Admin/Update.php +++ b/Admin/Update.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -16,7 +16,7 @@ namespace Modules\Media\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\UpdateAbstract; use phpOMS\System\File\Directory; @@ -37,7 +37,7 @@ class Update extends UpdateAbstract /** * {@inheritdoc} */ - public static function update(Pool $dbPool, array $info) + public static function update(DatabasePool $dbPool, array $info) { Directory::deletePath(__DIR__ . '/Update'); mkdir('Update'); diff --git a/Controller.js b/Controller.js index 591a249..8542c49 100644 --- a/Controller.js +++ b/Controller.js @@ -40,7 +40,7 @@ uploader.setSuccess(e.id, function (type, response) { e.querySelector('input[type=file]+input[type=hidden]').value = JSON.stringify(response.uploads); - self.app.eventManager.trigger(requestId, requestGroup); + self.app.eventManager.trigger(requestGroup, requestId); }); uploader.setUri(Url + '{/lang}/api/media'); diff --git a/Controller.php b/Controller.php index 6c2d8f5..287ff93 100644 --- a/Controller.php +++ b/Controller.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -48,7 +48,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var string * @since 1.0.0 */ - const MODULE_PATH = __DIR__; + /* public */ const MODULE_PATH = __DIR__; /** * Module version. @@ -56,7 +56,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var string * @since 1.0.0 */ - const MODULE_VERSION = '1.0.0'; + /* public */ const MODULE_VERSION = '1.0.0'; /** * Module name. @@ -64,7 +64,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var string * @since 1.0.0 */ - const MODULE_NAME = 'Media'; + /* public */ const MODULE_NAME = 'Media'; /** * Providing. @@ -117,6 +117,9 @@ class Controller extends ModuleAbstract implements WebInterface $view->setTemplate('/Modules/Media/Theme/Backend/media-list'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000401001, $request, $response)); + $media = MediaMapper::getNewest(25); + $view->addData('media', $media); + return $view; } @@ -176,8 +179,13 @@ class Controller extends ModuleAbstract implements WebInterface { $uploads = $this->uploadFiles($request->getFiles(), $request->getAccount(), $request->getData('path') ?? '/Modules/Media/Files'); + $ids = []; + foreach($uploads as $file) { + $ids[] = $file->getId(); + } + $response->getHeader()->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true); - $response->set($request->__toString(), [['uploads' => $uploads, 'type' => 'UI']]); + $response->set($request->__toString(), [['uploads' => $ids, 'type' => 'UI']]); } /** @@ -207,24 +215,29 @@ class Controller extends ModuleAbstract implements WebInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function uploadFiles(array $files, int $account, string $basePath = '/Modules/Media/Files') : array + public function uploadFiles(array $files, int $account, string $basePath = 'Modules/Media/Files') : array { $mediaCreated = []; if (!empty($files)) { $upload = new UploadFile(); - $rndPath = str_pad(dechex(rand(0, 65535)), 4, '0', STR_PAD_LEFT); - $path = '/' . trim($basePath, '/\\.') . '/' . $rndPath[0] . $rndPath[1] . '/' . $rndPath[2] . $rndPath[3]; + $path = self::createMediaPath($basePath); $upload->setOutputDir($path); $upload->setFileName(false); $status = $upload->upload($files); - $mediaCreated = $this->createDbEntries($status, $account); + $mediaCreated = self::createDbEntries($status, $account); } return $mediaCreated; } + public static function createMediaPath(string $basePath = 'Modules/Media/Files') : string + { + $rndPath = str_pad(dechex(rand(0, 65535)), 4, '0', STR_PAD_LEFT); + return $basePath . '/' . $rndPath[0] . $rndPath[1] . '/' . $rndPath[2] . $rndPath[3]; + } + /** * @param array $status Files * @param int $account Uploader @@ -234,25 +247,36 @@ class Controller extends ModuleAbstract implements WebInterface * @since 1.0.0 * @author Dennis Eichhorn */ - public function createDbEntries(array $status, int $account) : array + public static function createDbEntries(array $status, int $account) : array { $mediaCreated = []; foreach ($status as $uFile) { - if ($uFile['status'] === UploadStatus::OK) { - $media = new Media(); - $media->setPath(trim($uFile['path'], '/') . '/' . $uFile['filename']); - $media->setName($uFile['filename']); - $media->setSize($uFile['size']); - $media->setCreatedBy($account); - $media->setCreatedAt(new \DateTime('NOW')); - $media->setExtension($uFile['extension']); - - $mediaCreated[] = MediaMapper::create($media); + if(!is_null($created = self::createDbEntry($uFile, $account))) { + $mediaCreated[] = $created; } } return $mediaCreated; } + public static function createDbEntry(array $status, int $account) + { + $media = null; + + if ($status['status'] === UploadStatus::OK) { + $media = new Media(); + $media->setPath(trim($status['path'], '/') . '/' . $status['filename']); + $media->setName($status['name']); + $media->setSize($status['size']); + $media->setCreatedBy($account); + $media->setCreatedAt(new \DateTime('NOW')); + $media->setExtension($status['extension']); + + MediaMapper::create($media); + } + + return $media; + } + } diff --git a/Models/Collection.php b/Models/Collection.php index bb3ffd5..b6cea9a 100644 --- a/Models/Collection.php +++ b/Models/Collection.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -15,7 +15,6 @@ */ namespace Modules\Media\Models; - /** * Media class. * diff --git a/Models/CollectionMapper.php b/Models/CollectionMapper.php index c009af9..ae56ead 100644 --- a/Models/CollectionMapper.php +++ b/Models/CollectionMapper.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -15,6 +15,7 @@ */ namespace Modules\Media\Models; +use Modules\Media\Models\MediaMapper; use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\DataStorage\Database\Query\Column; @@ -22,8 +23,7 @@ class CollectionMapper extends MediaMapper { protected static $hasMany = [ 'sources' => [ - 'mapper' => \Modules\Media\Models\MediaMapper::class, /* mapper of the related object */ - 'relationmapper' => null, /* if the relation itself is a more complex object that has it's own mapper */ + 'mapper' => MediaMapper::class, /* mapper of the related object */ 'table' => 'media_relation', /* table of the related object, null if no relation table is used (many->1) */ 'dst' => 'media_relation_dst', 'src' => 'media_relation_src', diff --git a/Models/FileStorageInterface.php b/Models/FileStorageInterface.php index f3840fe..79b6cb7 100644 --- a/Models/FileStorageInterface.php +++ b/Models/FileStorageInterface.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/FileUploaderTrait.php b/Models/FileUploaderTrait.php index 8702fa5..872d0ff 100644 --- a/Models/FileUploaderTrait.php +++ b/Models/FileUploaderTrait.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/FtpFileStorage.php b/Models/FtpFileStorage.php index 973b6e8..d006114 100644 --- a/Models/FtpFileStorage.php +++ b/Models/FtpFileStorage.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/LocalFileStorage.php b/Models/LocalFileStorage.php index 720fb8e..e78bc86 100644 --- a/Models/LocalFileStorage.php +++ b/Models/LocalFileStorage.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/Media.php b/Models/Media.php index 939330a..3a8b2ae 100644 --- a/Models/Media.php +++ b/Models/Media.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -330,4 +330,9 @@ class Media { $this->versioned = $versioned; } + + public function toArray() + { + return []; + } } diff --git a/Models/MediaMapper.php b/Models/MediaMapper.php index 4ddb5dc..f1ea92e 100644 --- a/Models/MediaMapper.php +++ b/Models/MediaMapper.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -26,7 +26,7 @@ class MediaMapper extends DataMapperAbstract /** * Columns. * - * @var array + * @var array * @since 1.0.0 */ protected static $columns = [ diff --git a/Models/NullCollection.php b/Models/NullCollection.php index b487a0f..3a805ac 100644 --- a/Models/NullCollection.php +++ b/Models/NullCollection.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/NullMedia.php b/Models/NullMedia.php index e7a03e3..49672c7 100644 --- a/Models/NullMedia.php +++ b/Models/NullMedia.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/UploadFile.php b/Models/UploadFile.php index e0f0ae7..c825da9 100644 --- a/Models/UploadFile.php +++ b/Models/UploadFile.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -15,7 +15,7 @@ */ namespace Modules\Media\Models; -use phpOMS\System\File\Directory; +use phpOMS\System\File\Local\Directory; /** @@ -31,6 +31,15 @@ use phpOMS\System\File\Directory; */ class UploadFile { + /* public */ const PATH_GENERATION_LIMIT = 1000; + + /** + * Image interlaced. + * + * @var int + * @since 1.0.0 + */ + private $interlaced = true; /** * Upload max size. @@ -54,7 +63,7 @@ class UploadFile * @var string * @since 1.0.0 */ - private $outputDir = '/Modules/Media/Files'; + private $outputDir = 'Modules/Media/Files'; /** * Output file name. @@ -79,6 +88,8 @@ class UploadFile * * @return array * + * @throws \Exception + * * @since 1.0.0 * @author Dennis Eichhorn */ @@ -130,6 +141,7 @@ class UploadFile } $split = explode('.', $f['name']); + $result[$key]['name'] = $split[0]; $extension = count($split) > 1 ? $split[count($split) - 1] : ''; $result[$key]['extension'] = $extension; @@ -138,9 +150,9 @@ class UploadFile if (!$this->fileName || empty($this->fileName) || file_exists($path . '/' . $this->fileName)) { $rnd = ''; + $limit = 0; do { $sha = sha1_file($f['tmp_name'] . $rnd); - $sha .= '.' . $extension; if ($sha === false) { $result[$key]['status'] = UploadStatus::FAILED_HASHING; @@ -148,13 +160,20 @@ class UploadFile return $result; } + $sha .= '.' . $extension; + $this->fileName = $sha; $rnd = mt_rand(); - } while (file_exists($path . '/' . $this->fileName)); + $limit++; + } while (file_exists($path . '/' . $this->fileName) && $limit < self::PATH_GENERATION_LIMIT); + + if($limit >= self::PATH_GENERATION_LIMIT) { + throw new \Exception('No file path could be found. Potential attack!'); + } } if (!is_dir($path)) { - Directory::create($path, '0655', true); + Directory::create($path, 0655, true); } if (!is_uploaded_file($f['tmp_name'])) { @@ -163,18 +182,46 @@ class UploadFile return $result; } - if (!move_uploaded_file($f['tmp_name'], $path . '/' . $this->fileName)) { + if (!move_uploaded_file($f['tmp_name'], $dest = $path . '/' . $this->fileName)) { $result[$key]['status'] = UploadStatus::NOT_MOVABLE; return $result; } + if($this->interlaced && in_array($extension, ['png', 'jpg', 'jpeg', 'gif'])) { + $this->interlace($extension, $dest); + } + $result[$key]['path'] = $this->outputDir; } return $result; } + private function interlace(string $extension, string $path) /* : void */ + { + + if($extension === 'png') { + $img = imagecreatefrompng($path); + } elseif($extension === 'jpg' || $extension === 'jpeg') { + $img = imagecreatefromjpeg($path); + } else { + $img = imagecreatefromgif($path); + } + + imageinterlace($img, (int) $this->interlaced); + + if($extension === 'png') { + imagepng($img, $path); + } elseif($extension === 'jpg' || $extension === 'jpeg') { + imagejpeg($img, $path); + } else { + imagegif($img, $path); + } + + imagedestroy($img); + } + /** * Find unique output path for batch of files * @@ -231,6 +278,11 @@ class UploadFile return $this->maxSize; } + public function setInterlaced(bool $interlaced) /* : void */ + { + $this->interlaced = $interlaced; + } + /** * @param int $maxSize * diff --git a/Models/UploadStatus.php b/Models/UploadStatus.php index 49a5f89..e9e1bb5 100644 --- a/Models/UploadStatus.php +++ b/Models/UploadStatus.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -30,14 +30,14 @@ use phpOMS\Datatypes\Enum; */ abstract class UploadStatus extends Enum { - const OK = 0; - const WRONG_PARAMETERS = -1; - const NOTHING_UPLOADED = -2; - const UPLOAD_SIZE = -3; - const UNKNOWN_ERROR = -4; - const CONFIG_SIZE = -5; - const WRONG_EXTENSION = -6; - const NOT_UPLOADED = -7; - const NOT_MOVABLE = -8; - const FAILED_HASHING = -9; + /* public */ const OK = 0; + /* public */ const WRONG_PARAMETERS = -1; + /* public */ const NOTHING_UPLOADED = -2; + /* public */ const UPLOAD_SIZE = -3; + /* public */ const UNKNOWN_ERROR = -4; + /* public */ const CONFIG_SIZE = -5; + /* public */ const WRONG_EXTENSION = -6; + /* public */ const NOT_UPLOADED = -7; + /* public */ const NOT_MOVABLE = -8; + /* public */ const FAILED_HASHING = -9; } diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php index 7877e84..9c362ce 100644 --- a/Theme/Backend/Lang/Navigation.en.lang.php +++ b/Theme/Backend/Lang/Navigation.en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/Lang/api.en.lang.php b/Theme/Backend/Lang/api.en.lang.php index e593bf9..a82e530 100644 --- a/Theme/Backend/Lang/api.en.lang.php +++ b/Theme/Backend/Lang/api.en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 18a98f3..c9c1e27 100644 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/media-create.tpl.php b/Theme/Backend/media-create.tpl.php index cbb4cae..92eeb44 100644 --- a/Theme/Backend/media-create.tpl.php +++ b/Theme/Backend/media-create.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/media-list.tpl.php b/Theme/Backend/media-list.tpl.php index 0e57553..b8c6fb1 100644 --- a/Theme/Backend/media-list.tpl.php +++ b/Theme/Backend/media-list.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -17,7 +17,7 @@ * @var \phpOMS\Views\View $this */ -$media = \Modules\Media\Models\MediaMapper::getNewest(25); +$media = $this->getData('media'); $footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response); $footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig'); $footerView->setPages(count($media) / 25); diff --git a/Theme/Backend/media-single.tpl.php b/Theme/Backend/media-single.tpl.php index f9baf8a..74b2374 100644 --- a/Theme/Backend/media-single.tpl.php +++ b/Theme/Backend/media-single.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/Lang/Navigation.en.lang.php b/Theme/backend/Lang/Navigation.en.lang.php index 7877e84..9c362ce 100644 --- a/Theme/backend/Lang/Navigation.en.lang.php +++ b/Theme/backend/Lang/Navigation.en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/media-create.tpl.php b/Theme/backend/media-create.tpl.php index cbb4cae..92eeb44 100644 --- a/Theme/backend/media-create.tpl.php +++ b/Theme/backend/media-create.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/media-list.tpl.php b/Theme/backend/media-list.tpl.php index 0e57553..b8c6fb1 100644 --- a/Theme/backend/media-list.tpl.php +++ b/Theme/backend/media-list.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -17,7 +17,7 @@ * @var \phpOMS\Views\View $this */ -$media = \Modules\Media\Models\MediaMapper::getNewest(25); +$media = $this->getData('media'); $footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response); $footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig'); $footerView->setPages(count($media) / 25); diff --git a/Theme/backend/media-single.tpl.php b/Theme/backend/media-single.tpl.php index f9baf8a..74b2374 100644 --- a/Theme/backend/media-single.tpl.php +++ b/Theme/backend/media-single.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Views/MediaCreateView.php b/Views/MediaCreateView.php index 88d5178..943278f 100644 --- a/Views/MediaCreateView.php +++ b/Views/MediaCreateView.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD