mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-10 13:58:41 +00:00
Fix if for foreach while spacing
This commit is contained in:
parent
d2631f9a7d
commit
e22dc71546
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\News\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\News\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\News\Admin\Install;
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\News\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabaseType;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\News\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\News\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\News;
|
||||
|
||||
use Model\Message\FormValidation;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\News\Models;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\News\Models;
|
||||
|
||||
use Modules\Admin\Models\AccountMapper;
|
||||
|
|
@ -65,7 +65,7 @@ class BadgeMapper extends DataMapperAbstract
|
|||
try {
|
||||
$objId = parent::create($obj, $relations);
|
||||
|
||||
if($objId === null || !is_scalar($objId)) {
|
||||
if ($objId === null || !is_scalar($objId)) {
|
||||
return $objId;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\News\Models;
|
||||
|
||||
use phpOMS\Contract\ArrayableInterface;
|
||||
|
|
@ -240,7 +240,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
|
|||
*/
|
||||
public function setLanguage(string $language)
|
||||
{
|
||||
if(!ISO639x1Enum::isValidValue($language)) {
|
||||
if (!ISO639x1Enum::isValidValue($language)) {
|
||||
throw new InvalidEnumValue($language);
|
||||
}
|
||||
|
||||
|
|
@ -332,7 +332,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
|
|||
*/
|
||||
public function setType(int $type)
|
||||
{
|
||||
if(!NewsType::isValidValue($type)) {
|
||||
if (!NewsType::isValidValue($type)) {
|
||||
throw new InvalidEnumValue((string) $type);
|
||||
}
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
|
|||
*/
|
||||
public function setStatus(int $status)
|
||||
{
|
||||
if(!NewsStatus::isValidValue($status)) {
|
||||
if (!NewsStatus::isValidValue($status)) {
|
||||
throw new InvalidEnumValue((string) $status);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\News\Models;
|
||||
|
||||
use Modules\Admin\Models\AccountMapper;
|
||||
|
|
@ -89,7 +89,7 @@ class NewsArticleMapper extends DataMapperAbstract
|
|||
try {
|
||||
$objId = parent::create($obj, $relations);
|
||||
|
||||
if($objId === null || !is_scalar($objId)) {
|
||||
if ($objId === null || !is_scalar($objId)) {
|
||||
return $objId;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\News\Models;
|
||||
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\News\Models;
|
||||
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
|
||||
namespace Modules\News\Models;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,19 +27,19 @@ $newsList = $this->getData('news');
|
|||
<td><?= $this->getHtml('Type', 'News') ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Title', 'News') ?>
|
||||
<tbody>
|
||||
<?php $count = 0; foreach($newsList as $key => $news) : $count++;
|
||||
<?php $count = 0; foreach ($newsList as $key => $news) : $count++;
|
||||
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/news/article?{?}&id=' . $news->getId());
|
||||
$color = 'darkred';
|
||||
if($news->getType() === \Modules\News\Models\NewsType::ARTICLE) { $color = 'green'; }
|
||||
elseif($news->getType() === \Modules\News\Models\NewsType::HEADLINE) { $color = 'purple'; }
|
||||
elseif($news->getType() === \Modules\News\Models\NewsType::LINK) { $color = 'yellow'; }
|
||||
if ($news->getType() === \Modules\News\Models\NewsType::ARTICLE) { $color = 'green'; }
|
||||
elseif ($news->getType() === \Modules\News\Models\NewsType::HEADLINE) { $color = 'purple'; }
|
||||
elseif ($news->getType() === \Modules\News\Models\NewsType::LINK) { $color = 'yellow'; }
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td data-label=""><a href="<?= $url; ?>"><?= $news->isFeatured() ? '<i class="fa fa-star favorite"></i>' : ''; ?></a>
|
||||
<td data-label="<?= $this->getHtml('Type', 'News') ?>"><a href="<?= $url; ?>"><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('TYPE' . $news->getType(), 'News') ?></span></a>
|
||||
<td data-label="<?= $this->getHtml('Title', 'News') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($news->getTitle()); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if($count === 0) : ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -39,11 +39,11 @@ echo $this->getData('nav')->render(); ?>
|
|||
<tr>
|
||||
<td colspan="4"><?= $footerView->render(); ?>
|
||||
<tbody>
|
||||
<?php $count = 0; foreach($articles as $key => $news) : $count++; $url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/news/article?{?}&id=' . $news->getId());
|
||||
<?php $count = 0; foreach ($articles as $key => $news) : $count++; $url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/news/article?{?}&id=' . $news->getId());
|
||||
$color = 'darkred';
|
||||
if($news->getType() === \Modules\News\Models\NewsType::ARTICLE) { $color = 'green'; }
|
||||
elseif($news->getType() === \Modules\News\Models\NewsType::HEADLINE) { $color = 'purple'; }
|
||||
elseif($news->getType() === \Modules\News\Models\NewsType::LINK) { $color = 'yellow'; }
|
||||
if ($news->getType() === \Modules\News\Models\NewsType::ARTICLE) { $color = 'green'; }
|
||||
elseif ($news->getType() === \Modules\News\Models\NewsType::HEADLINE) { $color = 'purple'; }
|
||||
elseif ($news->getType() === \Modules\News\Models\NewsType::LINK) { $color = 'yellow'; }
|
||||
?>
|
||||
<tr>
|
||||
<td><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('TYPE' . $news->getType()) ?></span></a>
|
||||
|
|
@ -51,7 +51,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->getCreatedBy()->getName1()); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->getPublish()->format('Y-m-d')); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if($count === 0) : ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -32,12 +32,12 @@ echo $this->getData('nav')->render(); ?>
|
|||
<td><?= $this->getHtml('Author') ?>
|
||||
<td><?= $this->getHtml('Date') ?>
|
||||
<tbody>
|
||||
<?php $count = 0; foreach($newsList as $key => $news) : $count++;
|
||||
<?php $count = 0; foreach ($newsList as $key => $news) : $count++;
|
||||
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/news/article?{?}&id=' . $news->getId());
|
||||
$color = 'darkred';
|
||||
if($news->getType() === \Modules\News\Models\NewsType::ARTICLE) { $color = 'green'; }
|
||||
elseif($news->getType() === \Modules\News\Models\NewsType::HEADLINE) { $color = 'purple'; }
|
||||
elseif($news->getType() === \Modules\News\Models\NewsType::LINK) { $color = 'yellow'; }
|
||||
if ($news->getType() === \Modules\News\Models\NewsType::ARTICLE) { $color = 'green'; }
|
||||
elseif ($news->getType() === \Modules\News\Models\NewsType::HEADLINE) { $color = 'purple'; }
|
||||
elseif ($news->getType() === \Modules\News\Models\NewsType::LINK) { $color = 'yellow'; }
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td data-label=""><a href="<?= $url; ?>"><?= $news->isFeatured() ? '<i class="fa fa-star favorite"></i>' : ''; ?></a>
|
||||
|
|
@ -46,7 +46,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
<td data-label="<?= $this->getHtml('Author') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($news->getCreatedBy()->getName1()); ?></a>
|
||||
<td data-label="<?= $this->getHtml('Date') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($news->getPublish()->format('Y-m-d')); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if($count === 0) : ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user