Simplify htmlescape

This commit is contained in:
Dennis Eichhorn 2017-09-14 20:39:58 +02:00
parent 712f6f6872
commit b10a6fb0d8
8 changed files with 24 additions and 24 deletions

View File

@ -41,10 +41,10 @@ echo $this->getData('nav')->render(); ?>
<?php $c = 0; foreach ($this->getData('list:elements') as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/organization/department/profile?{?}&id=' . $value->getId()); ?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getId(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getName(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getParent()->getName(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getUnit()->getName(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getParent()->getName()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getUnit()->getName()); ?></a>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr>

View File

@ -27,9 +27,9 @@ echo $this->getData('nav')->render(); ?>
<form>
<table class="layout wf-100">
<tr><td><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td><input type="text" name="name" id="iName" value="<?= htmlspecialchars($department->getName(), ENT_COMPAT, 'utf-8'); ?>">
<tr><td><input type="text" name="name" id="iName" value="<?= $this->printHtml($department->getName()); ?>">
<tr><td><label for="iParent"><?= $this->getHtml('Parent') ?></label>
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" name="parent" id="iParent" value="<?= htmlspecialchars($department->getParent()->getName(), ENT_COMPAT, 'utf-8'); ?>"></span>
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" name="parent" id="iParent" value="<?= $this->printHtml($department->getParent()->getName()); ?>"></span>
<tr><td><label for="iUnit"><?= $this->getHtml('Unit') ?></label>
<tr><td><select name="unit" id="iUnit">
</select>
@ -39,7 +39,7 @@ echo $this->getData('nav')->render(); ?>
<option><?= $this->getHtml('Inactive') ?>
</select>
<tr><td><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td><textarea name="description" id="iDescription"><?= htmlspecialchars($department->getDescription(), ENT_COMPAT, 'utf-8'); ?></textarea>
<tr><td><textarea name="description" id="iDescription"><?= $this->printHtml($department->getDescription()); ?></textarea>
<tr><td><input type="submit" value="<?= $this->getHtml('Save', 0); ?>">
</table>
</form>

View File

@ -32,8 +32,8 @@ echo $this->getData('nav')->render(); ?>
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" name="department" id="iDepartment"></span>
<tr><td><label for="iStatus"><?= $this->getHtml('Status') ?></label>
<tr><td><select name="status" id="iStatus">
<option value="<?= htmlspecialchars(\Modules\Organization\Models\Status::ACTIVE, ENT_COMPAT, 'utf-8'); ?>"><?= $this->getHtml('Active') ?>
<option value="<?= htmlspecialchars(\Modules\Organization\Models\Status::INACTIVE, ENT_COMPAT, 'utf-8'); ?>"><?= $this->getHtml('Inactive') ?>
<option value="<?= $this->printHtml(\Modules\Organization\Models\Status::ACTIVE); ?>"><?= $this->getHtml('Active') ?>
<option value="<?= $this->printHtml(\Modules\Organization\Models\Status::INACTIVE); ?>"><?= $this->getHtml('Inactive') ?>
</select>
<tr><td><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td><textarea name="description" id="iDescription" placeholder="&#xf040;"></textarea>

View File

@ -43,10 +43,10 @@ echo $this->getData('nav')->render(); ?>
<?php $count = 0; foreach($listElements as $key => $value) : $count++;
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/organization/position/profile?{?}&id=' . $value->getId()); ?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getId(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getName(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getParent()->getName(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getDepartment()->getName(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getParent()->getName()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getDepartment()->getName()); ?></a>
<?php endforeach; ?>
<?php if($count === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>

View File

@ -27,9 +27,9 @@ echo $this->getData('nav')->render(); ?>
<form>
<table class="layout wf-100">
<tr><td><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td><input type="text" name="name" id="iName" value="<?= htmlspecialchars($position->getName(), ENT_COMPAT, 'utf-8'); ?>">
<tr><td><input type="text" name="name" id="iName" value="<?= $this->printHtml($position->getName()); ?>">
<tr><td><label for="iParent"><?= $this->getHtml('Parent') ?></label>
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" name="parent" id="iParent" value="<?= htmlspecialchars($position->getParent()->getName(), ENT_COMPAT, 'utf-8'); ?>"></span>
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" name="parent" id="iParent" value="<?= $this->printHtml($position->getParent()->getName()); ?>"></span>
<tr><td><label for="iDepartment"><?= $this->getHtml('Department') ?></label>
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" name="department" id="iDepartment"></span>
<tr><td><label for="iStatus"><?= $this->getHtml('Status') ?></label>
@ -38,7 +38,7 @@ echo $this->getData('nav')->render(); ?>
<option><?= $this->getHtml('Inactive') ?>
</select>
<tr><td><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td><textarea name="description" id="iDescription"><?= htmlspecialchars($position->getDescription(), ENT_COMPAT, 'utf-8'); ?></textarea>
<tr><td><textarea name="description" id="iDescription"><?= $this->printHtml($position->getDescription()); ?></textarea>
<tr><td><input type="submit" value="<?= $this->getHtml('Save', 0); ?>">
</table>
</form>

View File

@ -30,8 +30,8 @@ echo $this->getData('nav')->render(); ?>
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" name="parent" id="iParent"></span>
<tr><td><label for="iStatus"><?= $this->getHtml('Status') ?></label>
<tr><td><select name="status" id="iStatus">
<option value="<?= htmlspecialchars(\Modules\Organization\Models\Status::ACTIVE, ENT_COMPAT, 'utf-8'); ?>"><?= $this->getHtml('Active') ?>
<option value="<?= htmlspecialchars(\Modules\Organization\Models\Status::INACTIVE, ENT_COMPAT, 'utf-8'); ?>"><?= $this->getHtml('Inactive') ?>
<option value="<?= $this->printHtml(\Modules\Organization\Models\Status::ACTIVE); ?>"><?= $this->getHtml('Active') ?>
<option value="<?= $this->printHtml(\Modules\Organization\Models\Status::INACTIVE); ?>"><?= $this->getHtml('Inactive') ?>
</select>
<tr><td><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td><textarea name="description" id="iDescription" placeholder="&#xf040;"></textarea>

View File

@ -40,9 +40,9 @@ echo $this->getData('nav')->render(); ?>
<?php foreach ($this->getData('list:elements') as $key => $value) :
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/organization/unit/profile?{?}&id=' . $value->getId()); ?>
<tr data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('ID', 0, 0); ?>"><a href="<?= $url; ?>"><?= htmlspecialchars($value->getId()); ?></a>
<td data-label="<?= $this->getHtml('Name') ?>"><a href="<?= $url; ?>"><?= htmlspecialchars($value->getName(), ENT_COMPAT, 'utf-8'); ?></a>
<td data-label="<?= $this->getHtml('Parent') ?>"><a href="<?= $url; ?>"><?= htmlspecialchars($value->getParent()->getName(), ENT_COMPAT, 'utf-8'); ?></a>
<td data-label="<?= $this->getHtml('ID', 0, 0); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td data-label="<?= $this->getHtml('Name') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<td data-label="<?= $this->getHtml('Parent') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getParent()->getName()); ?></a>
<?php endforeach; ?>
</table>
</div>

View File

@ -27,16 +27,16 @@ echo $this->getData('nav')->render(); ?>
<form>
<table class="layout wf-100">
<tr><td><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td><input type="text" name="name" id="iName" value="<?= htmlspecialchars($unit->getName(), ENT_COMPAT, 'utf-8'); ?>">
<tr><td><input type="text" name="name" id="iName" value="<?= $this->printHtml($unit->getName()); ?>">
<tr><td><label for="iParent"><?= $this->getHtml('Parent') ?></label>
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" name="parent" id="iParent" value="<?= htmlspecialchars($unit->getParent()->getName(), ENT_COMPAT, 'utf-8'); ?>" required></span>
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" name="parent" id="iParent" value="<?= $this->printHtml($unit->getParent()->getName()); ?>" required></span>
<tr><td><label for="iStatus"><?= $this->getHtml('Status') ?></label>
<tr><td><select name="status" id="iStatus">
<option><?= $this->getHtml('Active') ?>
<option><?= $this->getHtml('Inactive') ?>
</select>
<tr><td><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td><textarea name="description" id="iDescription"><?= htmlspecialchars($unit->getDescription(), ENT_COMPAT, 'utf-8'); ?></textarea>
<tr><td><textarea name="description" id="iDescription"><?= $this->printHtml($unit->getDescription()); ?></textarea>
<tr><td><input type="submit" value="<?= $this->getHtml('Save', 0); ?>">
</table>
</form>