Case fix!

This commit is contained in:
Dennis Eichhorn 2016-03-26 18:59:38 +01:00
parent 6692842974
commit 24d7fdc1b9
9 changed files with 197 additions and 0 deletions

View File

@ -0,0 +1 @@
<span id="media-upload"></span>

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
$MODLANG['Navigation'] = [
'Create' => 'Create',
'List' => 'List',
'Media' => 'Media',
];

View File

@ -0,0 +1,18 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
$MODLANG[1] = [
'i:ModuleInstalled' => 'Installation of the module {$1} was successful.',
];

View File

@ -0,0 +1,36 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
$MODLANG['Media'] = [
'Account' => 'Account',
'Author' => 'Author',
'Changed' => 'Changed',
'Changedby' => 'Changed by',
'Created' => 'Created',
'Creator' => 'Creator',
'Data' => 'Data',
'Editability' => 'Editability',
'Extension' => 'Extension',
'Files' => 'Files',
'Media' => 'Media',
'Name' => 'Name',
'Permission' => 'Permission',
'Preview' => 'Preview',
'Settings' => 'Settings',
'Size' => 'Size',
'Type' => 'Type',
'Upload' => 'Upload',
'Visibility' => 'Visibility',
];

View File

@ -0,0 +1,34 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render(); ?>
<section class="box w-50">
<h1><?= $this->l11n->lang['Media']['Upload']; ?></h1>
<div class="inner">
<form method="POST" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/media/create'); ?>">
<table class="layout wf-100">
<tr><td><label for="iName"><?= $this->l11n->lang['Media']['Name']; ?></label>
<tr><td><input type="text" id="iName" name="name" placeholder="&#xf040;">
<tr><td><label for="iFiles"><?= $this->l11n->lang['Media']['Files']; ?></label>
<tr><td><input type="file" id="iFiles" name="files" multiple><input name="media" type="hidden">
<tr><td><input type="submit" value="<?= $this->l11n->lang[0]['Create']; ?>">
</table>
</form>
</div>
</section>

View File

@ -0,0 +1,56 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
$mediaMapper = new \Modules\Media\Models\MediaMapper($this->app->dbPool->get());
$media = $mediaMapper->getNewest(25);
$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(count($media) / 25);
$footerView->setPage(1);
echo $this->getData('nav')->render(); ?>
<section class="box">
<table class="table">
<caption><?= $this->l11n->lang['Media']['Media']; ?></caption>
<thead>
<tr>
<td class="wf-100"><?= $this->l11n->lang['Media']['Name']; ?>
<td><?= $this->l11n->lang['Media']['Type']; ?>
<td><?= $this->l11n->lang['Media']['Size']; ?>
<td><?= $this->l11n->lang['Media']['Creator']; ?>
<td><?= $this->l11n->lang['Media']['Created']; ?>
<tfoot>
<tr>
<td colspan="3"><?= $footerView->render(); ?>
<tbody>
<?php $count = 0; foreach($media as $key => $value) : $count++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getExtension(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getSize(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getCreatedBy(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getCreatedAt()->format('Y-m-d H:i:s'); ?></a>
<?php endforeach; ?>
<?php if($count === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->l11n->lang[0]['Empty']; ?>
<?php endif; ?>
</table>
</section>

View File

@ -0,0 +1,32 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
$media = $this->getData('media');
echo $this->getData('nav')->render();
?>
<section class="box w-100">
<h1><?= $media->getName() ?></h1>
<div class="inner">
<?php if(in_array($media->getExtension(), ['gif', 'bmp', 'jpg', 'jpeg', 'png'])) : ?>
<img src="<?= $media->getPath(); ?>">
<?php else : ?>
<pre><?= htmlspecialchars(file_get_contents(ROOT_PATH . '/' . $media->getPath())); ?></pre>
<?php endif; ?>
</div>
</section>