Simplify htmlescape

This commit is contained in:
Dennis Eichhorn 2017-09-14 20:39:58 +02:00
parent b2cede5526
commit 55566853bd
5 changed files with 18 additions and 18 deletions

View File

@ -36,8 +36,8 @@ $newsList = $this->getData('news');
?>
<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 <?= htmlspecialchars($color, ENT_COMPAT, 'utf-8'); ?>"><?= $this->getHtml('TYPE' . $news->getType(), 'News') ?></span></a>
<td data-label="<?= $this->getHtml('Title', 'News') ?>"><a href="<?= $url; ?>"><?= htmlspecialchars($news->getTitle(), ENT_COMPAT, 'utf-8'); ?></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) : ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>

View File

@ -46,10 +46,10 @@ echo $this->getData('nav')->render(); ?>
elseif($news->getType() === \Modules\News\Models\NewsType::LINK) { $color = 'yellow'; }
?>
<tr>
<td><span class="tag <?= htmlspecialchars($color, ENT_COMPAT, 'utf-8'); ?>"><?= $this->getHtml('TYPE' . $news->getType()) ?></span></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($news->getTitle(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($news->getCreatedBy()->getName1(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($news->getPublish()->format('Y-m-d'), ENT_COMPAT, 'utf-8'); ?></a>
<td><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('TYPE' . $news->getType()) ?></span></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->getTitle()); ?></a>
<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) : ?>
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>

View File

@ -44,10 +44,10 @@ echo $this->getData('nav')->render(); ?>
<table class="layout wf-100">
<tr><td colspan="2"><label for="publish"><?= $this->getHtml('Status'); ?></label>
<tr><td colspan="2"><select name="status">
<option value="<?= htmlspecialchars(Modules\News\Models\NewsStatus::DRAFT, ENT_COMPAT, 'utf-8'); ?>" selected><?= $this->getHtml('Draft'); ?>
<option value="<?= htmlspecialchars(Modules\News\Models\NewsStatus::VISIBLE, ENT_COMPAT, 'utf-8'); ?>"><?= $this->getHtml('Visible'); ?>
<option value="<?= $this->printHtml(Modules\News\Models\NewsStatus::DRAFT); ?>" selected><?= $this->getHtml('Draft'); ?>
<option value="<?= $this->printHtml(Modules\News\Models\NewsStatus::VISIBLE); ?>"><?= $this->getHtml('Visible'); ?>
<tr><td colspan="2"><label for="publish"><?= $this->getHtml('Publish'); ?></label>
<tr><td colspan="2"><input type="datetime-local" id="publish" value="<?= htmlspecialchars((new \DateTime('NOW'))->format('Y-m-d\TH:i:s'), ENT_COMPAT, 'utf-8'); ?>">
<tr><td colspan="2"><input type="datetime-local" id="publish" value="<?= $this->printHtml((new \DateTime('NOW'))->format('Y-m-d\TH:i:s')); ?>">
<tr><td><input type="submit" value="<?= $this->getHtml('Delete', 0); ?>"><td class="rightText"><input type="submit" value="<?= $this->getHtml('Save', 0); ?>"> <input type="submit" value="<?= $this->getHtml('Publish'); ?>">
</table>
</form>
@ -57,9 +57,9 @@ echo $this->getData('nav')->render(); ?>
<div class="inner">
<table class="layout wf-100">
<tr><td colspan="2"><label><?= $this->getHtml('Type'); ?></label>
<tr><td colspan="2"><span class="radio"><input type="radio" name="type" form="docForm" value="<?= htmlspecialchars(Modules\News\Models\NewsType::ARTICLE, ENT_COMPAT, 'utf-8'); ?>" id="news" checked><label for="news"><?= $this->getHtml('News'); ?></label></span>
<tr><td colspan="2"><span class="radio"><input type="radio" name="type" form="docForm" value="<?= htmlspecialchars(Modules\News\Models\NewsType::HEADLINE, ENT_COMPAT, 'utf-8'); ?>" id="headline"><label for="headline"><?= $this->getHtml('Headline'); ?></label></span>
<tr><td colspan="2"><span class="radio"><input type="radio" name="type" form="docForm" value="<?= htmlspecialchars(Modules\News\Models\NewsType::LINK, ENT_COMPAT, 'utf-8'); ?>" id="link"><label for="link"><?= $this->getHtml('Link'); ?></label></span>
<tr><td colspan="2"><span class="radio"><input type="radio" name="type" form="docForm" value="<?= $this->printHtml(Modules\News\Models\NewsType::ARTICLE); ?>" id="news" checked><label for="news"><?= $this->getHtml('News'); ?></label></span>
<tr><td colspan="2"><span class="radio"><input type="radio" name="type" form="docForm" value="<?= $this->printHtml(Modules\News\Models\NewsType::HEADLINE); ?>" id="headline"><label for="headline"><?= $this->getHtml('Headline'); ?></label></span>
<tr><td colspan="2"><span class="radio"><input type="radio" name="type" form="docForm" value="<?= $this->printHtml(Modules\News\Models\NewsType::LINK); ?>" id="link"><label for="link"><?= $this->getHtml('Link'); ?></label></span>
</table>
</div>
</section>

View File

@ -41,10 +41,10 @@ echo $this->getData('nav')->render(); ?>
?>
<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') ?>"><a href="<?= $url; ?>"><span class="tag <?= htmlspecialchars($color, ENT_COMPAT, 'utf-8'); ?>"><?= $this->getHtml('TYPE' . $news->getType()) ?></span></a>
<td data-label="<?= $this->getHtml('Title') ?>"><a href="<?= $url; ?>"><?= htmlspecialchars($news->getTitle(), ENT_COMPAT, 'utf-8'); ?></a>
<td data-label="<?= $this->getHtml('Author') ?>"><a href="<?= $url; ?>"><?= htmlspecialchars($news->getCreatedBy()->getName1(), ENT_COMPAT, 'utf-8'); ?></a>
<td data-label="<?= $this->getHtml('Date') ?>"><a href="<?= $url; ?>"><?= htmlspecialchars($news->getPublish()->format('Y-m-d'), ENT_COMPAT, 'utf-8'); ?></a>
<td data-label="<?= $this->getHtml('Type') ?>"><a href="<?= $url; ?>"><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('TYPE' . $news->getType()) ?></span></a>
<td data-label="<?= $this->getHtml('Title') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($news->getTitle()); ?></a>
<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) : ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>

View File

@ -21,10 +21,10 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12">
<section class="box wf-100">
<header><h1><?= htmlspecialchars($news->getTitle(), ENT_COMPAT, 'utf-8'); ?></h1></header>
<header><h1><?= $this->printHtml($news->getTitle()); ?></h1></header>
<div class="inner">
<article>
<?= htmlspecialchars($news->getContent(), ENT_COMPAT, 'utf-8'); ?>
<?= $this->printHtml($news->getContent()); ?>
</article>
</div>
</section>