Shorthand php echo

This commit is contained in:
Marcin Kurczewski 2014-04-27 14:44:06 +02:00
parent f495774be4
commit 60208407ea
35 changed files with 192 additions and 192 deletions

View file

@ -3,8 +3,8 @@ CustomAssetViewDecorator::setSubTitle('authentication form');
CustomAssetViewDecorator::addStylesheet('auth.css'); CustomAssetViewDecorator::addStylesheet('auth.css');
?> ?>
<form action="<?php echo \Chibi\UrlHelper::route('auth', 'login') ?>" class="auth" method="post"> <form action="<?= \Chibi\UrlHelper::route('auth', 'login') ?>" class="auth" method="post">
<p>If you don't have an account yet,<br/><a href="<?php echo \Chibi\UrlHelper::route('user', 'registration'); ?>">click here</a> to create a new one.</p> <p>If you don't have an account yet,<br/><a href="<?= \Chibi\UrlHelper::route('user', 'registration'); ?>">click here</a> to create a new one.</p>
<div class="form-row"> <div class="form-row">
<label for="name">User name:</label> <label for="name">User name:</label>
@ -38,9 +38,9 @@ CustomAssetViewDecorator::addStylesheet('auth.css');
<div> <div>
<p>Problems logging in?</p> <p>Problems logging in?</p>
<ul> <ul>
<li><a href="<?php echo \Chibi\UrlHelper::route('user', 'password-reset-proxy') ?>">I don't remember my password</a></li> <li><a href="<?= \Chibi\UrlHelper::route('user', 'password-reset-proxy') ?>">I don't remember my password</a></li>
<li><a href="<?php echo \Chibi\UrlHelper::route('user', 'activation-proxy') ?>">I haven't received activation e-mail</a></li> <li><a href="<?= \Chibi\UrlHelper::route('user', 'activation-proxy') ?>">I haven't received activation e-mail</a></li>
<li><a href="<?php echo \Chibi\UrlHelper::route('user', 'registration') ?>">I don't have an account</a></li> <li><a href="<?= \Chibi\UrlHelper::route('user', 'registration') ?>">I don't have an account</a></li>
</ul> </ul>
</div> </div>
</div> </div>

View file

@ -3,7 +3,7 @@ CustomAssetViewDecorator::addStylesheet('comment-edit.css');
CustomAssetViewDecorator::addScript('comment-edit.js'); CustomAssetViewDecorator::addScript('comment-edit.js');
?> ?>
<form action="<?php echo \Chibi\UrlHelper::route('comment', 'add', ['postId' => $this->context->transport->post->id]) ?>" method="post" class="add-comment"> <form action="<?= \Chibi\UrlHelper::route('comment', 'add', ['postId' => $this->context->transport->post->id]) ?>" method="post" class="add-comment">
<h1>add comment</h1> <h1>add comment</h1>
<div class="preview"></div> <div class="preview"></div>

View file

@ -3,13 +3,13 @@ CustomAssetViewDecorator::addStylesheet('comment-edit.css');
CustomAssetViewDecorator::addScript('comment-edit.js'); CustomAssetViewDecorator::addScript('comment-edit.js');
?> ?>
<form action="<?php echo \Chibi\UrlHelper::route('comment', 'edit', ['id' => $this->context->transport->comment->id]) ?>" method="post" class="edit-comment"> <form action="<?= \Chibi\UrlHelper::route('comment', 'edit', ['id' => $this->context->transport->comment->id]) ?>" method="post" class="edit-comment">
<h1>edit comment</h1> <h1>edit comment</h1>
<div class="preview"></div> <div class="preview"></div>
<div class="form-row text"> <div class="form-row text">
<div class="input-wrapper"><textarea name="text" cols="50" rows="3"><?php echo TextHelper::secureWhitespace($this->context->transport->comment->text) ?></textarea></div> <div class="input-wrapper"><textarea name="text" cols="50" rows="3"><?= TextHelper::secureWhitespace($this->context->transport->comment->text) ?></textarea></div>
</div> </div>
<input type="hidden" name="submit" value="1"/> <input type="hidden" name="submit" value="1"/>

View file

@ -18,17 +18,17 @@ CustomAssetViewDecorator::setSubTitle('comments');
<div class="comment-group"> <div class="comment-group">
<div class="post-wrapper"> <div class="post-wrapper">
<?php $this->context->post = $post ?> <?php $this->context->post = $post ?>
<?php echo $this->renderFile('post-small') ?> <?= $this->renderFile('post-small') ?>
</div> </div>
<div class="comments"> <div class="comments">
<?php $comments = array_reverse($post->getComments()) ?> <?php $comments = array_reverse($post->getComments()) ?>
<?php foreach (array_slice($comments, 0, $this->config->comments->maxCommentsInList) as $comment): ?> <?php foreach (array_slice($comments, 0, $this->config->comments->maxCommentsInList) as $comment): ?>
<?php $this->context->comment = $comment ?> <?php $this->context->comment = $comment ?>
<?php echo $this->renderFile('comment-small') ?> <?= $this->renderFile('comment-small') ?>
<?php endforeach ?> <?php endforeach ?>
<?php if (count($comments) > $this->config->comments->maxCommentsInList): ?> <?php if (count($comments) > $this->config->comments->maxCommentsInList): ?>
<a href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>"> <a href="<?= \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>">
<span class="hellip">(more&hellip;)</span> <span class="hellip">(more&hellip;)</span>
</a> </a>
<?php endif ?> <?php endif ?>

View file

@ -8,11 +8,11 @@ CustomAssetViewDecorator::addScript('comment-edit.js');
<div class="avatar"> <div class="avatar">
<?php $commenter = $this->context->comment->getCommenter() ?> <?php $commenter = $this->context->comment->getCommenter() ?>
<?php if ($commenter): ?> <?php if ($commenter): ?>
<a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $commenter->name]) ?>"> <a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $commenter->name]) ?>">
<img src="<?php echo htmlspecialchars($commenter->getAvatarUrl(40)) ?>" alt="<?php echo $commenter->name ?>"/> <img src="<?= htmlspecialchars($commenter->getAvatarUrl(40)) ?>" alt="<?= $commenter->name ?>"/>
</a> </a>
<?php else: ?> <?php else: ?>
<img src="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/img/pixel.gif') ?>" alt="<?php echo UserModel::getAnonymousName() ?>"> <img src="<?= \Chibi\UrlHelper::absoluteUrl('/media/img/pixel.gif') ?>" alt="<?= UserModel::getAnonymousName() ?>">
<?php endif ?> <?php endif ?>
</div> </div>
@ -20,21 +20,21 @@ CustomAssetViewDecorator::addScript('comment-edit.js');
<div class="header"> <div class="header">
<span class="nickname"> <span class="nickname">
<?php if ($commenter): ?> <?php if ($commenter): ?>
<a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $commenter->name]) ?>"> <a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $commenter->name]) ?>">
<?php echo $commenter->name ?> <?= $commenter->name ?>
</a> </a>
<?php else: ?> <?php else: ?>
<?php echo UserModel::getAnonymousName() ?> <?= UserModel::getAnonymousName() ?>
<?php endif ?> <?php endif ?>
</span> </span>
<span class="date" title="<?php echo TextHelper::formatDate($this->context->comment->commentDate, true) ?>"> <span class="date" title="<?= TextHelper::formatDate($this->context->comment->commentDate, true) ?>">
<?php echo TextHelper::formatDate($this->context->comment->commentDate, false) ?> <?= TextHelper::formatDate($this->context->comment->commentDate, false) ?>
</span> </span>
<?php if (PrivilegesHelper::confirm(Privilege::EditComment, PrivilegesHelper::getIdentitySubPrivilege($commenter))): ?> <?php if (PrivilegesHelper::confirm(Privilege::EditComment, PrivilegesHelper::getIdentitySubPrivilege($commenter))): ?>
<span class="edit"> <span class="edit">
<a href="<?php echo \Chibi\UrlHelper::route('comment', 'edit', ['id' => $this->context->comment->id]) ?>"> <a href="<?= \Chibi\UrlHelper::route('comment', 'edit', ['id' => $this->context->comment->id]) ?>">
edit edit
</a> </a>
</span> </span>
@ -42,7 +42,7 @@ CustomAssetViewDecorator::addScript('comment-edit.js');
<?php if (PrivilegesHelper::confirm(Privilege::DeleteComment, PrivilegesHelper::getIdentitySubPrivilege($commenter))): ?> <?php if (PrivilegesHelper::confirm(Privilege::DeleteComment, PrivilegesHelper::getIdentitySubPrivilege($commenter))): ?>
<span class="delete"> <span class="delete">
<a class="simple-action confirmable" href="<?php echo \Chibi\UrlHelper::route('comment', 'delete', ['id' => $this->context->comment->id]) ?>" data-confirm-text="Are you sure you want to delete this comment?"> <a class="simple-action confirmable" href="<?= \Chibi\UrlHelper::route('comment', 'delete', ['id' => $this->context->comment->id]) ?>" data-confirm-text="Are you sure you want to delete this comment?">
delete delete
</a> </a>
</span> </span>
@ -50,7 +50,7 @@ CustomAssetViewDecorator::addScript('comment-edit.js');
</div> </div>
<div class="content"> <div class="content">
<?php echo $this->context->comment->getText() ?> <?= $this->context->comment->getText() ?>
</div> </div>
</div> </div>

View file

@ -7,17 +7,17 @@
$query = str_replace('(', '<span>(', $query); $query = str_replace('(', '<span>(', $query);
$query = str_replace(')', ')</span>', $query); $query = str_replace(')', ')</span>', $query);
?> ?>
<pre class="query"><?php echo $query ?></pre> <pre class="query"><?= $query ?></pre>
<pre class="bindings"><?php echo join(', ', array_map(function($key) use ($log) <pre class="bindings"><?= join(', ', array_map(function($key) use ($log)
{ {
return $key . '=<span class="value">' . $log->getStatement()->getBindings()[$key] . '</span>'; return $key . '=<span class="value">' . $log->getStatement()->getBindings()[$key] . '</span>';
}, },
array_keys($log->getStatement()->getBindings()))) ?></pre> array_keys($log->getStatement()->getBindings()))) ?></pre>
<table> <table>
<tr><td>Execution:</td><td><?php echo sprintf('%.05fs', $log->getExecutionTime()) ?></td></tr> <tr><td>Execution:</td><td><?= sprintf('%.05fs', $log->getExecutionTime()) ?></td></tr>
<tr><td>Retrieval:</td><td><?php echo sprintf('%.05fs', $log->getRetrievalTime()) ?></td></tr> <tr><td>Retrieval:</td><td><?= sprintf('%.05fs', $log->getRetrievalTime()) ?></td></tr>
</table> </table>
</div> </div>
<?php endforeach ?> <?php endforeach ?>

View file

@ -1,2 +1,2 @@
<h1>Error</h1> <h1>Error</h1>
<?php echo $this->context->query ?> not found. <?= $this->context->query ?> not found.

View file

@ -12,12 +12,12 @@ $showTabs = count($tabs) > 1;
<ul> <ul>
<?php foreach ($tabs as $tab => $text): ?> <?php foreach ($tabs as $tab => $text): ?>
<?php if ($tab == $this->context->tab): ?> <?php if ($tab == $this->context->tab): ?>
<li class="selected <?php echo $tab ?>"> <li class="selected <?= $tab ?>">
<?php else: ?> <?php else: ?>
<li class="<?php echo $tab ?>"> <li class="<?= $tab ?>">
<?php endif ?> <?php endif ?>
<a href="<?php echo \Chibi\UrlHelper::route('index', 'help', $tab == $firstTab ? [] : ['tab' => $tab]) ?>"> <a href="<?= \Chibi\UrlHelper::route('index', 'help', $tab == $firstTab ? [] : ['tab' => $tab]) ?>">
<?php echo $text ?> <?= $text ?>
</a> </a>
</li> </li>
<?php endforeach ?> <?php endforeach ?>
@ -27,7 +27,7 @@ $showTabs = count($tabs) > 1;
<div class="tab-content"> <div class="tab-content">
<?php endif ?> <?php endif ?>
<?php echo TextHelper::parseMarkdown(file_get_contents($this->context->path)) ?> <?= TextHelper::parseMarkdown(file_get_contents($this->context->path)) ?>
<?php if ($showTabs): ?> <?php if ($showTabs): ?>
</div> </div>

View file

@ -4,9 +4,9 @@ CustomAssetViewDecorator::addStylesheet('index-index.css');
?> ?>
<div id="welcome"> <div id="welcome">
<h1><?php echo $this->config->main->title ?></h1> <h1><?= $this->config->main->title ?></h1>
<p> <p>
<span>serving <?php echo $this->context->transport->postCount ?> posts</span> <span>serving <?= $this->context->transport->postCount ?> posts</span>
</p> </p>
</div> </div>
@ -14,7 +14,7 @@ CustomAssetViewDecorator::addStylesheet('index-index.css');
<div class="body"> <div class="body">
<?php $this->context->imageLink = \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->featuredPost->id]) ?> <?php $this->context->imageLink = \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->featuredPost->id]) ?>
<?php $this->context->transport->post = $this->context->featuredPost ?> <?php $this->context->transport->post = $this->context->featuredPost ?>
<?php echo $this->renderFile('post-file-render') ?> <?= $this->renderFile('post-file-render') ?>
</div> </div>
<div class="footer"> <div class="footer">
@ -25,8 +25,8 @@ CustomAssetViewDecorator::addStylesheet('index-index.css');
<?php uasort($tags, function($a, $b) { return strnatcasecmp($a->name, $b->name); }) ?> <?php uasort($tags, function($a, $b) { return strnatcasecmp($a->name, $b->name); }) ?>
<?php foreach ($tags as $tag): ?> <?php foreach ($tags as $tag): ?>
<li> <li>
<a href="<?php echo \Chibi\UrlHelper::route('post', 'list', ['query' => $tag->name]) ?>"> <a href="<?= \Chibi\UrlHelper::route('post', 'list', ['query' => $tag->name]) ?>">
<?php echo $tag->name ?> <?= $tag->name ?>
</a> </a>
</li> </li>
<?php endforeach ?> <?php endforeach ?>
@ -36,7 +36,7 @@ CustomAssetViewDecorator::addStylesheet('index-index.css');
<div class="right"> <div class="right">
Featured&#32; Featured&#32;
<?php if ($this->context->featuredPostUser): ?> <?php if ($this->context->featuredPostUser): ?>
by <a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->featuredPostUser->name]) ?>"><?php echo $this->context->featuredPostUser->name ?></a>,&#32; by <a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->featuredPostUser->name]) ?>"><?= $this->context->featuredPostUser->name ?></a>,&#32;
<?php endif ?> <?php endif ?>
<?php $x = round((time() - $this->context->featuredPostDate) / (24 * 3600.)) ?> <?php $x = round((time() - $this->context->featuredPostDate) / (24 * 3600.)) ?>
<?php if ($x == 0): ?> <?php if ($x == 0): ?>

View file

@ -16,7 +16,7 @@ CustomAssetViewDecorator::addScript('core.js');
<body> <body>
<script type="text/javascript"> <script type="text/javascript">
var lastSearchQuery = <?php echo json_encode(isset($this->context->transport->lastSearchQuery) ? $this->context->transport->lastSearchQuery : '') ?>; var lastSearchQuery = <?= json_encode(isset($this->context->transport->lastSearchQuery) ? $this->context->transport->lastSearchQuery : '') ?>;
</script> </script>
<nav id="top-nav"> <nav id="top-nav">
@ -28,7 +28,7 @@ CustomAssetViewDecorator::addScript('core.js');
<section id="content"> <section id="content">
<div class="main-wrapper"> <div class="main-wrapper">
<?php echo $this->renderView() ?> <?= $this->renderView() ?>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</section> </section>
@ -36,18 +36,18 @@ CustomAssetViewDecorator::addScript('core.js');
<footer> <footer>
<div class="main-wrapper"> <div class="main-wrapper">
<hr> <hr>
<span>Load:&nbsp;<?php echo sprintf('%.05f', microtime(true) - $this->context->startTime) ?>s</span> <span>Load:&nbsp;<?= sprintf('%.05f', microtime(true) - $this->context->startTime) ?>s</span>
<span>Queries:&nbsp;<?php echo count(\Chibi\Database::getLogs()) ?></span> <span>Queries:&nbsp;<?= count(\Chibi\Database::getLogs()) ?></span>
<span><a href="<?php echo SZURU_LINK ?>">szurubooru&nbsp;v<?php echo SZURU_VERSION ?></a></span> <span><a href="<?= SZURU_LINK ?>">szurubooru&nbsp;v<?= SZURU_VERSION ?></a></span>
<?php if (PrivilegesHelper::confirm(Privilege::ListLogs)): ?> <?php if (PrivilegesHelper::confirm(Privilege::ListLogs)): ?>
<span><a href="<?php echo \Chibi\UrlHelper::route('log', 'list') ?>">Logs</a></span> <span><a href="<?= \Chibi\UrlHelper::route('log', 'list') ?>">Logs</a></span>
<?php endif ?> <?php endif ?>
<hr> <hr>
</div> </div>
</footer> </footer>
<?php if ($this->config->misc->debugQueries): ?> <?php if ($this->config->misc->debugQueries): ?>
<?php echo $this->renderFile('debug') ?> <?= $this->renderFile('debug') ?>
<?php endif ?> <?php endif ?>
<div id="small-screen"></div> <div id="small-screen"></div>

View file

@ -8,8 +8,8 @@ $this->context->subTitle = 'latest logs';
<ul> <ul>
<?php foreach ($this->context->transport->logs as $log): ?> <?php foreach ($this->context->transport->logs as $log): ?>
<li> <li>
<a href="<?php echo \Chibi\UrlHelper::route('log', 'view', ['name' => $log]) ?>"> <a href="<?= \Chibi\UrlHelper::route('log', 'view', ['name' => $log]) ?>">
<?php echo $log ?> <?= $log ?>
</a> </a>
</li> </li>
<?php endforeach ?> <?php endforeach ?>

View file

@ -3,21 +3,21 @@ CustomAssetViewDecorator::setSubTitle('logs (' . $name . ')');
?> ?>
<?php if (empty($this->context->transport->lines)): ?> <?php if (empty($this->context->transport->lines)): ?>
<p class="alert alert-warning">This log is empty. <a href="<?php echo \Chibi\UrlHelper::route('log', 'list') ?>">Go back</a></p> <p class="alert alert-warning">This log is empty. <a href="<?= \Chibi\UrlHelper::route('log', 'list') ?>">Go back</a></p>
<?php else: ?> <?php else: ?>
<?php <?php
CustomAssetViewDecorator::addStylesheet('logs.css'); CustomAssetViewDecorator::addStylesheet('logs.css');
CustomAssetViewDecorator::addScript('logs.js'); CustomAssetViewDecorator::addScript('logs.js');
?> ?>
<form action="<?php echo \Chibi\UrlHelper::route('log', 'view', ['name' => $this->context->transport->name]) ?>" method="get"> <form action="<?= \Chibi\UrlHelper::route('log', 'view', ['name' => $this->context->transport->name]) ?>" method="get">
Keep only lines that contain: Keep only lines that contain:
<input type="text" name="query" value="<?php echo htmlspecialchars($this->context->transport->filter) ?>" placeholder="any text&hellip;"/> <input type="text" name="query" value="<?= htmlspecialchars($this->context->transport->filter) ?>" placeholder="any text&hellip;"/>
</form> </form>
<div class="paginator-content"> <div class="paginator-content">
<pre><?php echo $this->context->transport->lines ?></pre> <pre><?= $this->context->transport->lines ?></pre>
</div> </div>
<?php $this->renderFile('paginator') ?> <?php $this->renderFile('paginator') ?>

View file

@ -1,5 +1,5 @@
<?php if (!empty($this->context->transport->message)): ?> <?php if (!empty($this->context->transport->message)): ?>
<p class="alert <?php echo $this->context->transport->success ? 'alert-success' : 'alert-error'; ?>"> <p class="alert <?= $this->context->transport->success ? 'alert-success' : 'alert-error'; ?>">
<?php echo $this->context->transport->messageHtml ?> <?= $this->context->transport->messageHtml ?>
</p> </p>
<?php endif ?> <?php endif ?>

View file

@ -54,7 +54,7 @@ if (!function_exists('pageUrl'))
<?php else: ?> <?php else: ?>
<li class="prev disabled"> <li class="prev disabled">
<?php endif ?> <?php endif ?>
<a href="<?php echo pageUrl($page - 1) ?>"> <a href="<?= pageUrl($page - 1) ?>">
&laquo; &laquo;
</a> </a>
</li> </li>
@ -68,8 +68,8 @@ if (!function_exists('pageUrl'))
<?php else: ?> <?php else: ?>
<li> <li>
<?php endif ?> <?php endif ?>
<a href="<?php echo pageUrl($subPage) ?>"> <a href="<?= pageUrl($subPage) ?>">
<?php echo $subPage ?> <?= $subPage ?>
</a> </a>
</li> </li>
<?php endif ?> <?php endif ?>
@ -80,7 +80,7 @@ if (!function_exists('pageUrl'))
<?php else: ?> <?php else: ?>
<li class="next disabled"> <li class="next disabled">
<?php endif ?> <?php endif ?>
<a href="<?php echo pageUrl($page + 1) ?>"> <a href="<?= pageUrl($page + 1) ?>">
&raquo; &raquo;
</a> </a>
</li> </li>

View file

@ -1,4 +1,4 @@
<form action="<?php echo \Chibi\UrlHelper::route('post', 'edit', ['id' => $this->context->transport->post->id]) ?>" method="post" enctype="multipart/form-data" class="edit-post"> <form action="<?= \Chibi\UrlHelper::route('post', 'edit', ['id' => $this->context->transport->post->id]) ?>" method="post" enctype="multipart/form-data" class="edit-post">
<h1>edit post</h1> <h1>edit post</h1>
<?php if (PrivilegesHelper::confirm(Privilege::EditPostSafety, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?> <?php if (PrivilegesHelper::confirm(Privilege::EditPostSafety, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
<div class="form-row safety"> <div class="form-row safety">
@ -6,8 +6,8 @@
<div class="input-wrapper"> <div class="input-wrapper">
<?php foreach (PostSafety::getAll() as $safety): ?> <?php foreach (PostSafety::getAll() as $safety): ?>
<label> <label>
<input type="radio" name="safety" value="<?php echo $safety ?>" <?php if ($this->context->transport->post->safety == $safety) echo 'checked="checked"' ?>/> <input type="radio" name="safety" value="<?= $safety ?>" <?php if ($this->context->transport->post->safety == $safety) echo 'checked="checked"' ?>/>
&nbsp;<?php echo ucfirst(PostSafety::toDisplayString($safety)) ?> &nbsp;<?= ucfirst(PostSafety::toDisplayString($safety)) ?>
</label> </label>
<?php endforeach ?> <?php endforeach ?>
</div> </div>
@ -17,22 +17,22 @@
<?php if (PrivilegesHelper::confirm(Privilege::EditPostTags, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?> <?php if (PrivilegesHelper::confirm(Privilege::EditPostTags, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
<div class="form-row tags"> <div class="form-row tags">
<label for="tags">Tags:</label> <label for="tags">Tags:</label>
<div class="input-wrapper"><input type="text" name="tags" id="tags" placeholder="enter some tags&hellip;" value="<?php echo join(',', array_map(function($tag) { return htmlspecialchars($tag->name); }, $this->context->transport->post->getTags())) ?>"/></div> <div class="input-wrapper"><input type="text" name="tags" id="tags" placeholder="enter some tags&hellip;" value="<?= join(',', array_map(function($tag) { return htmlspecialchars($tag->name); }, $this->context->transport->post->getTags())) ?>"/></div>
</div> </div>
<input type="hidden" name="edit-token" id="edit-token" value="<?php echo htmlspecialchars($this->context->transport->post->getEditToken()) ?>"/> <input type="hidden" name="edit-token" id="edit-token" value="<?= htmlspecialchars($this->context->transport->post->getEditToken()) ?>"/>
<?php endif ?> <?php endif ?>
<?php if (PrivilegesHelper::confirm(Privilege::EditPostSource, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?> <?php if (PrivilegesHelper::confirm(Privilege::EditPostSource, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
<div class="form-row source"> <div class="form-row source">
<label for="source">Source:</label> <label for="source">Source:</label>
<div class="input-wrapper"><input type="text" name="source" id="source" value="<?php echo htmlspecialchars($this->context->transport->post->source) ?>"/></div> <div class="input-wrapper"><input type="text" name="source" id="source" value="<?= htmlspecialchars($this->context->transport->post->source) ?>"/></div>
</div> </div>
<?php endif ?> <?php endif ?>
<?php if (PrivilegesHelper::confirm(Privilege::EditPostRelations, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?> <?php if (PrivilegesHelper::confirm(Privilege::EditPostRelations, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
<div class="form-row thumb"> <div class="form-row thumb">
<label for="relations">Relations:</label> <label for="relations">Relations:</label>
<div class="input-wrapper"><input type="text" name="relations" id="relations" placeholder="id1,id2,&hellip;" value="<?php echo join(',', array_map(function($post) { return $post->id; }, $this->context->transport->post->getRelations())) ?>"/></div> <div class="input-wrapper"><input type="text" name="relations" id="relations" placeholder="id1,id2,&hellip;" value="<?= join(',', array_map(function($post) { return $post->id; }, $this->context->transport->post->getRelations())) ?>"/></div>
</div> </div>
<?php endif ?> <?php endif ?>

View file

@ -4,10 +4,10 @@
<?php if ($post->type == PostType::Image): ?> <?php if ($post->type == PostType::Image): ?>
<?php if (!empty($this->context->imageLink)): ?> <?php if (!empty($this->context->imageLink)): ?>
<a href="<?php echo $this->context->imageLink ?>"> <a href="<?= $this->context->imageLink ?>">
<?php endif ?> <?php endif ?>
<img src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>" alt="<?php echo $post->name ?>"/> <img src="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>" alt="<?= $post->name ?>"/>
<?php if (!empty($this->context->imageLink)): ?> <?php if (!empty($this->context->imageLink)): ?>
</a> </a>
@ -15,14 +15,14 @@
<?php elseif ($post->type == PostType::Flash): ?> <?php elseif ($post->type == PostType::Flash): ?>
<object type="<?php echo $post->mimeType ?>" width="<?php echo $post->imageWidth ?>" height="<?php echo $post->imageHeight ?>" data="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>"> <object type="<?= $post->mimeType ?>" width="<?= $post->imageWidth ?>" height="<?= $post->imageHeight ?>" data="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>">
<param name="movie" value="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>"/> <param name="movie" value="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>"/>
<param name="wmode" value="opaque"/> <param name="wmode" value="opaque"/>
</object> </object>
<?php elseif ($post->type == PostType::Youtube): ?> <?php elseif ($post->type == PostType::Youtube): ?>
<iframe style="width: 800px; height: 600px; border: 0;" src="//www.youtube.com/embed/<?php echo $post->fileHash ?>?wmode=opaque" allowfullscreen></iframe> <iframe style="width: 800px; height: 600px; border: 0;" src="//www.youtube.com/embed/<?= $post->fileHash ?>?wmode=opaque" allowfullscreen></iframe>
<?php elseif ($post->type == PostType::Video): ?> <?php elseif ($post->type == PostType::Video): ?>

View file

@ -44,12 +44,12 @@ if (PrivilegesHelper::confirm(Privilege::MassTag))
<?php foreach ($tabs as $i => $tab): ?> <?php foreach ($tabs as $i => $tab): ?>
<?php list($name, $url) = $tab ?> <?php list($name, $url) = $tab ?>
<?php if ($i == $activeTab): ?> <?php if ($i == $activeTab): ?>
<li class="selected <?php echo TextCaseConverter::convert($name, TextCaseConverter::BLANK_CASE, TextCaseConverter::SPINAL_CASE) ?>"> <li class="selected <?= TextCaseConverter::convert($name, TextCaseConverter::BLANK_CASE, TextCaseConverter::SPINAL_CASE) ?>">
<?php else: ?> <?php else: ?>
<li class="<?php echo TextCaseConverter::convert($name, TextCaseConverter::BLANK_CASE, TextCaseConverter::SPINAL_CASE) ?>"> <li class="<?= TextCaseConverter::convert($name, TextCaseConverter::BLANK_CASE, TextCaseConverter::SPINAL_CASE) ?>">
<?php endif ?> <?php endif ?>
<a href="<?php echo $url ?>"> <a href="<?= $url ?>">
<?php echo $name ?> <?= $name ?>
</a> </a>
</li> </li>
<?php endforeach ?> <?php endforeach ?>

View file

@ -17,7 +17,7 @@ CustomAssetViewDecorator::addScript('post-list.js');
<div class="posts paginator-content"> <div class="posts paginator-content">
<?php foreach ($this->context->transport->posts as $post): ?> <?php foreach ($this->context->transport->posts as $post): ?>
<?php $this->context->post = $post ?> <?php $this->context->post = $post ?>
<?php echo $this->renderFile('post-small') ?> <?= $this->renderFile('post-small') ?>
<?php endforeach ?> <?php endforeach ?>
</div> </div>
<div class="clear"></div> <div class="clear"></div>

View file

@ -25,19 +25,19 @@ if ($masstag)
} }
?> ?>
<div class="<?php echo implode(' ', $classNames) ?>"> <div class="<?= implode(' ', $classNames) ?>">
<?php if ($masstag): ?> <?php if ($masstag): ?>
<a class="toggle-tag" href="<?php echo \Chibi\UrlHelper::route('post', 'toggle-tag', ['id' => $this->context->post->id, 'tag' => $this->context->additionalInfo, 'enable' => '_enable_']) ?>" data-text-tagged="Tagged" data-text-untagged="Untagged"> <a class="toggle-tag" href="<?= \Chibi\UrlHelper::route('post', 'toggle-tag', ['id' => $this->context->post->id, 'tag' => $this->context->additionalInfo, 'enable' => '_enable_']) ?>" data-text-tagged="Tagged" data-text-untagged="Untagged">
<?php echo in_array('tagged', $classNames) ? 'Tagged' : 'Untagged' ?> <?= in_array('tagged', $classNames) ? 'Tagged' : 'Untagged' ?>
</a> </a>
<?php endif ?> <?php endif ?>
<?php if ($this->context->user->hasEnabledPostTagTitles()): ?> <?php if ($this->context->user->hasEnabledPostTagTitles()): ?>
<a title="<?php echo TextHelper::reprTags($this->context->post->getTags()) ?>" class="link" href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>"> <a title="<?= TextHelper::reprTags($this->context->post->getTags()) ?>" class="link" href="<?= \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>">
<?php else: ?> <?php else: ?>
<a class="link" href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>"> <a class="link" href="<?= \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>">
<?php endif ?> <?php endif ?>
<img class="thumb" src="<?php echo \Chibi\UrlHelper::route('post', 'thumb', ['name' => $this->context->post->name]) ?>" alt="@<?php echo $this->context->post->id ?>"/> <img class="thumb" src="<?= \Chibi\UrlHelper::route('post', 'thumb', ['name' => $this->context->post->name]) ?>" alt="@<?= $this->context->post->id ?>"/>
<?php <?php
$x = $x =
[ [
@ -54,8 +54,8 @@ if ($masstag)
<?php else: ?> <?php else: ?>
<span> <span>
<?php endif ?> <?php endif ?>
<i class="icon-<?php echo $key ?>"></i> <i class="icon-<?= $key ?>"></i>
&nbsp;<?php echo $val ?> &nbsp;<?= $val ?>
</span> </span>
<?php endforeach ?> <?php endforeach ?>
</div> </div>

View file

@ -36,7 +36,7 @@ CustomAssetViewDecorator::addScript('../lib/tagit/jquery.tagit.js');
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div id="upload-step2" data-redirect-url="<?php echo \Chibi\UrlHelper::route('post', 'list') ?>"> <div id="upload-step2" data-redirect-url="<?= \Chibi\UrlHelper::route('post', 'list') ?>">
<hr> <hr>
<div class="posts"> <div class="posts">
@ -50,7 +50,7 @@ CustomAssetViewDecorator::addScript('../lib/tagit/jquery.tagit.js');
<div id="post-template" class="post"> <div id="post-template" class="post">
<p class="alert alert-error">Some kind of error</p> <p class="alert alert-error">Some kind of error</p>
<img class="thumbnail" src="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/img/pixel.gif') ?>" alt="Thumbnail"/> <img class="thumbnail" src="<?= \Chibi\UrlHelper::absoluteUrl('/media/img/pixel.gif') ?>" alt="Thumbnail"/>
<div class="form-wrapper"> <div class="form-wrapper">
<div class="ops"> <div class="ops">
@ -67,7 +67,7 @@ CustomAssetViewDecorator::addScript('../lib/tagit/jquery.tagit.js');
</a> </a>
</div> </div>
<form action="<?php echo \Chibi\UrlHelper::route('post', 'upload') ?>" method="post"> <form action="<?= \Chibi\UrlHelper::route('post', 'upload') ?>" method="post">
<div class="form-row file-name"> <div class="form-row file-name">
<label>File:</label> <label>File:</label>
<strong>filename.jpg</strong> <strong>filename.jpg</strong>
@ -79,8 +79,8 @@ CustomAssetViewDecorator::addScript('../lib/tagit/jquery.tagit.js');
<?php $checked = false ?> <?php $checked = false ?>
<?php foreach (PostSafety::getAll() as $safety): ?> <?php foreach (PostSafety::getAll() as $safety): ?>
<label> <label>
<input type="radio" name="safety" value="<?php echo $safety ?>"<?php if (!$checked) echo ' checked="checked"' ?>/> <input type="radio" name="safety" value="<?= $safety ?>"<?php if (!$checked) echo ' checked="checked"' ?>/>
<?php echo ucfirst(PostSafety::toDisplayString($safety)) ?> <?= ucfirst(PostSafety::toDisplayString($safety)) ?>
<?php $checked = true ?> <?php $checked = true ?>
</label> </label>
<?php endforeach ?> <?php endforeach ?>
@ -108,4 +108,4 @@ CustomAssetViewDecorator::addScript('../lib/tagit/jquery.tagit.js');
</div> </div>
</div> </div>
<img id="lightbox" src="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/img/pixel.gif') ?>" alt="Preview"/> <img id="lightbox" src="<?= \Chibi\UrlHelper::absoluteUrl('/media/img/pixel.gif') ?>" alt="Preview"/>

View file

@ -24,7 +24,7 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
<nav id="around"> <nav id="around">
<div class="left"> <div class="left">
<?php if ($this->context->transport->nextPostId): ?> <?php if ($this->context->transport->nextPostId): ?>
<a href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->transport->nextPostId]) ?>"> <a href="<?= \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->transport->nextPostId]) ?>">
<?php else: ?> <?php else: ?>
<a class="disabled"> <a class="disabled">
<?php endif ?> <?php endif ?>
@ -35,7 +35,7 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
<div class="right"> <div class="right">
<?php if ($this->context->transport->prevPostId): ?> <?php if ($this->context->transport->prevPostId): ?>
<a href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->transport->prevPostId]) ?>"> <a href="<?= \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->transport->prevPostId]) ?>">
<?php else: ?> <?php else: ?>
<a class="disabled"> <a class="disabled">
<?php endif ?> <?php endif ?>
@ -49,23 +49,23 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
<?php if (!empty($this->context->transport->lastSearchQuery)): ?> <?php if (!empty($this->context->transport->lastSearchQuery)): ?>
<div class="text"> <div class="text">
Current&nbsp;search:<br/> Current&nbsp;search:<br/>
<a href="<?php echo \Chibi\UrlHelper::route('post', 'list', ['query' => $this->context->transport->lastSearchQuery]) ?>"><?php echo $this->context->transport->lastSearchQuery ?></a> <a href="<?= \Chibi\UrlHelper::route('post', 'list', ['query' => $this->context->transport->lastSearchQuery]) ?>"><?= $this->context->transport->lastSearchQuery ?></a>
</div> </div>
<?php endif ?> <?php endif ?>
</nav> </nav>
<div class="unit tags"> <div class="unit tags">
<?php $tags = $this->context->transport->post->getTags() ?> <?php $tags = $this->context->transport->post->getTags() ?>
<h1>tags (<?php echo count($tags) ?>)</h1> <h1>tags (<?= count($tags) ?>)</h1>
<ul> <ul>
<?php uasort($tags, function($a, $b) { return strnatcasecmp($a->name, $b->name); }) ?> <?php uasort($tags, function($a, $b) { return strnatcasecmp($a->name, $b->name); }) ?>
<?php foreach ($tags as $tag): ?> <?php foreach ($tags as $tag): ?>
<li title="<?php echo $tag->name ?>"> <li title="<?= $tag->name ?>">
<a href="<?php echo \Chibi\UrlHelper::route('post', 'list', ['query' => $tag->name]) ?>"> <a href="<?= \Chibi\UrlHelper::route('post', 'list', ['query' => $tag->name]) ?>">
<?php echo $tag->name ?> <?= $tag->name ?>
</a> </a>
<span class="count"> <span class="count">
<?php echo TextHelper::useDecimalUnits($tag->getPostCount()) ?> <?= TextHelper::useDecimalUnits($tag->getPostCount()) ?>
</span> </span>
</li> </li>
<?php endforeach ?> <?php endforeach ?>
@ -78,38 +78,38 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
<div class="uploader"> <div class="uploader">
<?php $uploader = $this->context->transport->post->getUploader() ?> <?php $uploader = $this->context->transport->post->getUploader() ?>
<?php if ($uploader): ?> <?php if ($uploader): ?>
<span class="value" title="<?php echo $val = $uploader->name ?>"> <span class="value" title="<?= $val = $uploader->name ?>">
<a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $uploader->name]) ?>"> <a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $uploader->name]) ?>">
<img src="<?php echo htmlentities($uploader->getAvatarUrl(24)) ?>" alt="<?php echo $uploader->name ?>"/> <img src="<?= htmlentities($uploader->getAvatarUrl(24)) ?>" alt="<?= $uploader->name ?>"/>
<?php echo $val ?> <?= $val ?>
</a> </a>
</span> </span>
<?php else: ?> <?php else: ?>
<span class="value" title="<?php echo UserModel::getAnonymousName() ?>"> <span class="value" title="<?= UserModel::getAnonymousName() ?>">
<img src="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/img/pixel.gif') ?>" alt="<?php echo UserModel::getAnonymousName() ?>"/> <img src="<?= \Chibi\UrlHelper::absoluteUrl('/media/img/pixel.gif') ?>" alt="<?= UserModel::getAnonymousName() ?>"/>
<?php echo UserModel::getAnonymousName() ?> <?= UserModel::getAnonymousName() ?>
</span> </span>
<?php endif ?> <?php endif ?>
<br> <br>
<span class="date" title="<?php echo TextHelper::formatDate($this->context->transport->post->uploadDate, true) ?>"> <span class="date" title="<?= TextHelper::formatDate($this->context->transport->post->uploadDate, true) ?>">
<?php echo TextHelper::formatDate($this->context->transport->post->uploadDate, false) ?> <?= TextHelper::formatDate($this->context->transport->post->uploadDate, false) ?>
</span> </span>
</div> </div>
<div class="key-value safety"> <div class="key-value safety">
<span class="key">Safety:</span> <span class="key">Safety:</span>
<span class="value safety-<?php echo $val = PostSafety::toDisplayString($this->context->transport->post->safety) ?>" title="<?php echo $val ?>"> <span class="value safety-<?= $val = PostSafety::toDisplayString($this->context->transport->post->safety) ?>" title="<?= $val ?>">
<?php echo $val ?> <?= $val ?>
</span> </span>
</div> </div>
<div class="key-value source"> <div class="key-value source">
<span class="key">Source:</span> <span class="key">Source:</span>
<span class="value" title="<?php echo $val = htmlspecialchars($this->context->transport->post->source ?: 'unknown') ?>"> <span class="value" title="<?= $val = htmlspecialchars($this->context->transport->post->source ?: 'unknown') ?>">
<?php if (preg_match('/^((https?|ftp):|)\/\//', $this->context->transport->post->source)): ?> <?php if (preg_match('/^((https?|ftp):|)\/\//', $this->context->transport->post->source)): ?>
<a href="<?php echo $val ?>"><?php echo $val ?></a> <a href="<?= $val ?>"><?= $val ?></a>
<?php else: ?> <?php else: ?>
<?php echo $val ?> <?= $val ?>
<?php endif ?> <?php endif ?>
</span> </span>
</div> </div>
@ -117,10 +117,10 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
<?php if ($this->context->transport->post->imageWidth > 0): ?> <?php if ($this->context->transport->post->imageWidth > 0): ?>
<div class="key-value dim"> <div class="key-value dim">
<span class="key">Dimensions:</span> <span class="key">Dimensions:</span>
<span class="value" title="<?php echo $val = sprintf('%dx%d', <span class="value" title="<?= $val = sprintf('%dx%d',
$this->context->transport->post->imageWidth, $this->context->transport->post->imageWidth,
$this->context->transport->post->imageHeight) ?>"> $this->context->transport->post->imageHeight) ?>">
<?php echo $val ?> <?= $val ?>
</span> </span>
</div> </div>
<?php endif ?> <?php endif ?>
@ -128,16 +128,16 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
<div class="key-value score"> <div class="key-value score">
<span class="key">Score:</span> <span class="key">Score:</span>
<span class="value"> <span class="value">
<?php echo $this->context->transport->post->score ?> <?= $this->context->transport->post->score ?>
<?php if (PrivilegesHelper::confirm(Privilege::ScorePost, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?> <?php if (PrivilegesHelper::confirm(Privilege::ScorePost, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
&nbsp;[ &nbsp;[
<?php $scoreLink = function($score) { return \Chibi\UrlHelper::route('post', 'score', ['id' => $this->context->transport->post->id, 'score' => $score]); } ?> <?php $scoreLink = function($score) { return \Chibi\UrlHelper::route('post', 'score', ['id' => $this->context->transport->post->id, 'score' => $score]); } ?>
<?php if ($this->context->score === 1): ?> <?php if ($this->context->score === 1): ?>
<a class="simple-action selected" href="<?php echo $scoreLink(0) ?>"> <a class="simple-action selected" href="<?= $scoreLink(0) ?>">
<?php else: ?> <?php else: ?>
<a class="simple-action" href="<?php echo $scoreLink(1) ?>"> <a class="simple-action" href="<?= $scoreLink(1) ?>">
<?php endif ?> <?php endif ?>
vote up vote up
</a> </a>
@ -145,9 +145,9 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
,&nbsp; ,&nbsp;
<?php if ($this->context->score === -1): ?> <?php if ($this->context->score === -1): ?>
<a class="simple-action selected" href="<?php echo $scoreLink(0) ?>"> <a class="simple-action selected" href="<?= $scoreLink(0) ?>">
<?php else: ?> <?php else: ?>
<a class="simple-action" href="<?php echo $scoreLink(-1) ?>"> <a class="simple-action" href="<?= $scoreLink(-1) ?>">
<?php endif ?> <?php endif ?>
down down
</a>] </a>]
@ -159,7 +159,7 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
<div class="unit hl-options"> <div class="unit hl-options">
<?php if ($this->context->transport->post->type != PostType::Youtube): ?> <?php if ($this->context->transport->post->type != PostType::Youtube): ?>
<div class="hl-option"> <div class="hl-option">
<a href="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>" title="Download"> <a href="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>" title="Download">
<i class="icon-dl"></i> <i class="icon-dl"></i>
<span> <span>
<?php <?php
@ -176,12 +176,12 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
<?php if (PrivilegesHelper::confirm(Privilege::FavoritePost, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?> <?php if (PrivilegesHelper::confirm(Privilege::FavoritePost, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
<div class="hl-option"> <div class="hl-option">
<?php if (!$this->context->favorite): ?> <?php if (!$this->context->favorite): ?>
<a class="add-fav icon simple-action" href="<?php echo \Chibi\UrlHelper::route('post', 'add-favorite', ['id' => $this->context->transport->post->id]) ?>"> <a class="add-fav icon simple-action" href="<?= \Chibi\UrlHelper::route('post', 'add-favorite', ['id' => $this->context->transport->post->id]) ?>">
<i class="icon-fav"></i> <i class="icon-fav"></i>
<span>Add to favorites</span> <span>Add to favorites</span>
</a> </a>
<?php else: ?> <?php else: ?>
<a class="rem-fav icon simple-action" href="<?php echo \Chibi\UrlHelper::route('post', 'rem-favorite', ['id' => $this->context->transport->post->id]) ?>"> <a class="rem-fav icon simple-action" href="<?= \Chibi\UrlHelper::route('post', 'rem-favorite', ['id' => $this->context->transport->post->id]) ?>">
<i class="icon-fav"></i> <i class="icon-fav"></i>
<span>Remove from favorites</span> <span>Remove from favorites</span>
</a> </a>
@ -201,12 +201,12 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
<?php if (count($this->context->transport->post->getFavorites()) > 0): ?> <?php if (count($this->context->transport->post->getFavorites()) > 0): ?>
<div class="unit favorites"> <div class="unit favorites">
<h1>favorites (<?php echo count($this->context->transport->post->getFavorites()) ?>)</h1> <h1>favorites (<?= count($this->context->transport->post->getFavorites()) ?>)</h1>
<ul> <ul>
<?php foreach ($this->context->transport->post->getFavorites() as $user): ?> <?php foreach ($this->context->transport->post->getFavorites() as $user): ?>
<li> <li>
<a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $user->name]) ?>" title="<?php echo $user->name ?>"> <a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $user->name]) ?>" title="<?= $user->name ?>">
<img src="<?php echo htmlspecialchars($user->getAvatarUrl()) ?>" alt="<?php echo $user->name ?>"> <img src="<?= htmlspecialchars($user->getAvatarUrl()) ?>" alt="<?= $user->name ?>">
</a> </a>
</li> </li>
<?php endforeach ?> <?php endforeach ?>
@ -220,8 +220,8 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
<ul> <ul>
<?php foreach ($this->context->transport->post->getRelations() as $relatedPost): ?> <?php foreach ($this->context->transport->post->getRelations() as $relatedPost): ?>
<li> <li>
<a href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $relatedPost->id]) ?>"> <a href="<?= \Chibi\UrlHelper::route('post', 'view', ['id' => $relatedPost->id]) ?>">
@<?php echo $relatedPost->id ?> @<?= $relatedPost->id ?>
</a> </a>
</li> </li>
<?php endforeach ?> <?php endforeach ?>
@ -313,8 +313,8 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
</div> </div>
<?php endif ?> <?php endif ?>
<div class="post-wrapper post-type-<?php echo PostType::toString($this->context->transport->post->type) ?>"> <div class="post-wrapper post-type-<?= PostType::toString($this->context->transport->post->type) ?>">
<?php echo $this->renderFile('post-file-render') ?> <?= $this->renderFile('post-file-render') ?>
</div> </div>
<?php <?php
@ -324,11 +324,11 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
<div class="comments-wrapper"> <div class="comments-wrapper">
<?php if (!empty($this->context->transport->post->getComments())): ?> <?php if (!empty($this->context->transport->post->getComments())): ?>
<div class="unit comments"> <div class="unit comments">
<h1>comments (<?php echo count($this->context->transport->post->getComments()) ?>)</h1> <h1>comments (<?= count($this->context->transport->post->getComments()) ?>)</h1>
<div class="comments"> <div class="comments">
<?php foreach ($this->context->transport->post->getComments() as $comment): ?> <?php foreach ($this->context->transport->post->getComments() as $comment): ?>
<?php $this->context->comment = $comment ?> <?php $this->context->comment = $comment ?>
<?php echo $this->renderFile('comment-small') ?> <?= $this->renderFile('comment-small') ?>
<?php endforeach ?> <?php endforeach ?>
</div> </div>
</div> </div>

View file

@ -4,7 +4,7 @@
<ul> <ul>
<?php foreach ($this->context->options as $option): ?> <?php foreach ($this->context->options as $option): ?>
<li class="<?php echo $option['class']; if (isset($option['inactive'])) echo ' inactive' ?>"> <li class="<?= $option['class']; if (isset($option['inactive'])) echo ' inactive' ?>">
<?php <?php
$class = []; $class = [];

View file

@ -15,12 +15,12 @@ $showTabs = count($tabs) > 1;
<ul> <ul>
<?php foreach ($tabs as $tab => $name): ?> <?php foreach ($tabs as $tab => $name): ?>
<?php if ($this->context->route->simpleActionName == $tab): ?> <?php if ($this->context->route->simpleActionName == $tab): ?>
<li class="selected <?php echo $tab ?>"> <li class="selected <?= $tab ?>">
<?php else: ?> <?php else: ?>
<li class="<?php echo $tab ?>"> <li class="<?= $tab ?>">
<?php endif ?> <?php endif ?>
<a href="<?php echo \Chibi\UrlHelper::route('tag', $tab) ?>"> <a href="<?= \Chibi\UrlHelper::route('tag', $tab) ?>">
<?php echo $name ?> <?= $name ?>
</a> </a>
</li> </li>
<?php endforeach ?> <?php endforeach ?>

View file

@ -16,7 +16,7 @@
<?php else: ?> <?php else: ?>
<li> <li>
<?php endif ?> <?php endif ?>
<a href="<?php echo \Chibi\UrlHelper::route('tag', 'list', ['filter' => $key]) ?>"><?php echo $text ?></a> <a href="<?= \Chibi\UrlHelper::route('tag', 'list', ['filter' => $key]) ?>"><?= $text ?></a>
</li> </li>
<?php endforeach ?> <?php endforeach ?>
</ul> </ul>
@ -34,9 +34,9 @@
<?php foreach ($this->context->transport->tags as $tag): ?> <?php foreach ($this->context->transport->tags as $tag): ?>
<?php $name = $tag['name'] ?> <?php $name = $tag['name'] ?>
<?php $count = $tag['post_count'] ?> <?php $count = $tag['post_count'] ?>
<li class="tag" title="<?php echo $name ?> (<?php echo $count ?>)"> <li class="tag" title="<?= $name ?> (<?= $count ?>)">
<a href="<?php echo str_replace('_query_', $name, $url) ?>" class="frequency<?php printf('%1.0f', $add + $mul * log($count)) ?>"> <a href="<?= str_replace('_query_', $name, $url) ?>" class="frequency<?php printf('%1.0f', $add + $mul * log($count)) ?>">
<?php echo $name . ' (' . $count . ')' ?> <?= $name . ' (' . $count . ')' ?>
</a> </a>
</li> </li>
<?php endforeach ?> <?php endforeach ?>

View file

@ -1,19 +1,19 @@
<div class="form-wrapper"> <div class="form-wrapper">
<form method="post" action="<?php echo \Chibi\UrlHelper::route('tag', 'mass-tag-redirect') ?>"> <form method="post" action="<?= \Chibi\UrlHelper::route('tag', 'mass-tag-redirect') ?>">
<h1>mass tag</h1> <h1>mass tag</h1>
<div class="form-row"> <div class="form-row">
<label for="mass-tag-query">Search query:</label> <label for="mass-tag-query">Search query:</label>
<div class="input-wrapper"><input class="autocomplete" type="text" name="query" id="mass-tag-query" value="<?php echo isset($this->context->massTagQuery) ? htmlspecialchars($this->context->massTagQuery) : '' ?>"/></div> <div class="input-wrapper"><input class="autocomplete" type="text" name="query" id="mass-tag-query" value="<?= isset($this->context->massTagQuery) ? htmlspecialchars($this->context->massTagQuery) : '' ?>"/></div>
</div> </div>
<div class="form-row"> <div class="form-row">
<label for="mass-tag-tag">Tag:</label> <label for="mass-tag-tag">Tag:</label>
<div class="input-wrapper"><input class="autocomplete" type="text" name="tag" id="mass-tag-tag" value="<?php echo isset($this->context->massTagTag) ? htmlspecialchars($this->context->massTagTag) : '' ?>"/></div> <div class="input-wrapper"><input class="autocomplete" type="text" name="tag" id="mass-tag-tag" value="<?= isset($this->context->massTagTag) ? htmlspecialchars($this->context->massTagTag) : '' ?>"/></div>
</div> </div>
<input type="hidden" name="old-page" value="<?php echo isset($this->context->transport->paginator) ? htmlspecialchars($this->context->transport->paginator->page) : '' ?>"/> <input type="hidden" name="old-page" value="<?= isset($this->context->transport->paginator) ? htmlspecialchars($this->context->transport->paginator->page) : '' ?>"/>
<input type="hidden" name="old-query" value="<?php echo isset($this->context->massTagQuery) ? htmlspecialchars($this->context->massTagQuery) : '' ?>"/> <input type="hidden" name="old-query" value="<?= isset($this->context->massTagQuery) ? htmlspecialchars($this->context->massTagQuery) : '' ?>"/>
<input type="hidden" name="submit" value="1"/> <input type="hidden" name="submit" value="1"/>
<div class="form-row"> <div class="form-row">

View file

@ -1,5 +1,5 @@
<div class="form-wrapper"> <div class="form-wrapper">
<form method="post" action="<?php echo \Chibi\UrlHelper::route('tag', 'merge') ?>"> <form method="post" action="<?= \Chibi\UrlHelper::route('tag', 'merge') ?>">
<h1>merge tags</h1> <h1>merge tags</h1>
<div class="form-row"> <div class="form-row">

View file

@ -1,5 +1,5 @@
<div class="form-wrapper"> <div class="form-wrapper">
<form method="post" action="<?php echo \Chibi\UrlHelper::route('tag', 'rename') ?>"> <form method="post" action="<?= \Chibi\UrlHelper::route('tag', 'rename') ?>">
<h1>rename tags</h1> <h1>rename tags</h1>
<div class="form-row"> <div class="form-row">

View file

@ -114,9 +114,9 @@
<ul> <ul>
<?php foreach (PostSafety::getAll() as $safety): ?> <?php foreach (PostSafety::getAll() as $safety): ?>
<?php if (PrivilegesHelper::confirm(Privilege::ListPosts, PostSafety::toString($safety))): ?> <?php if (PrivilegesHelper::confirm(Privilege::ListPosts, PostSafety::toString($safety))): ?>
<li class="safety-<?php echo TextCaseConverter::convert(PostSafety::toString($safety), TextCaseConverter::CAMEL_CASE, TextCaseConverter::SPINAL_CASE) ?>"> <li class="safety-<?= TextCaseConverter::convert(PostSafety::toString($safety), TextCaseConverter::CAMEL_CASE, TextCaseConverter::SPINAL_CASE) ?>">
<a href="<?php echo \Chibi\UrlHelper::route('user', 'toggle-safety', ['safety' => $safety]) ?>" class="<?php echo $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>" title="Searching <?php echo PostSafety::toDisplayString($safety) ?> posts: <?php echo $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>"> <a href="<?= \Chibi\UrlHelper::route('user', 'toggle-safety', ['safety' => $safety]) ?>" class="<?= $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>" title="Searching <?= PostSafety::toDisplayString($safety) ?> posts: <?= $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>">
<span><?php echo ucfirst(PostSafety::toDisplayString($safety)) ?></span> <span><?= ucfirst(PostSafety::toDisplayString($safety)) ?></span>
</a> </a>
</li> </li>
<?php endif ?> <?php endif ?>
@ -126,8 +126,8 @@
<?php endif ?> <?php endif ?>
<li class="search"> <li class="search">
<form name="search" action="<?php echo \Chibi\UrlHelper::route('post', 'list') ?>" method="get"> <form name="search" action="<?= \Chibi\UrlHelper::route('post', 'list') ?>" method="get">
<input class="autocomplete" type="search" name="query" placeholder="Search&hellip;" value="<?php echo isset($this->context->transport->searchQuery) ? htmlspecialchars($this->context->transport->searchQuery) : '' ?>"/> <input class="autocomplete" type="search" name="query" placeholder="Search&hellip;" value="<?= isset($this->context->transport->searchQuery) ? htmlspecialchars($this->context->transport->searchQuery) : '' ?>"/>
</form> </form>
</li> </li>
</ul> </ul>

View file

@ -1,4 +1,4 @@
<form action="<?php echo \Chibi\UrlHelper::route('user', 'delete', ['name' => $this->context->transport->user->name]) ?>" method="post" class="delete confirmable" autocomplete="off" data-confirm-text="Are you sure you want to delete your account?"> <form action="<?= \Chibi\UrlHelper::route('user', 'delete', ['name' => $this->context->transport->user->name]) ?>" method="post" class="delete confirmable" autocomplete="off" data-confirm-text="Are you sure you want to delete your account?">
<?php if ($this->context->user->id == $this->context->transport->user->id): ?> <?php if ($this->context->user->id == $this->context->transport->user->id): ?>
<div class="form-row current-password"> <div class="form-row current-password">
<label for="current-password">Current password:</label> <label for="current-password">Current password:</label>

View file

@ -1,4 +1,4 @@
<form action="<?php echo \Chibi\UrlHelper::route('user', 'edit', ['name' => $this->context->transport->user->name]) ?>" method="post" class="edit" autocomplete="off"> <form action="<?= \Chibi\UrlHelper::route('user', 'edit', ['name' => $this->context->transport->user->name]) ?>" method="post" class="edit" autocomplete="off">
<?php if ($this->context->user->id == $this->context->transport->user->id): ?> <?php if ($this->context->user->id == $this->context->transport->user->id): ?>
<div class="form-row current-password"> <div class="form-row current-password">
<label for="current-password">Current password:</label> <label for="current-password">Current password:</label>
@ -10,25 +10,25 @@
<?php if (PrivilegesHelper::confirm(Privilege::ChangeUserName, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?> <?php if (PrivilegesHelper::confirm(Privilege::ChangeUserName, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
<div class="form-row nickname"> <div class="form-row nickname">
<label for="name">Name:</label> <label for="name">Name:</label>
<div class="input-wrapper"><input type="text" name="name" id="name" placeholder="New name&hellip;" value="<?php echo htmlspecialchars($this->context->suppliedName) ?>"/></div> <div class="input-wrapper"><input type="text" name="name" id="name" placeholder="New name&hellip;" value="<?= htmlspecialchars($this->context->suppliedName) ?>"/></div>
</div> </div>
<?php endif ?> <?php endif ?>
<?php if (PrivilegesHelper::confirm(Privilege::ChangeUserEmail, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?> <?php if (PrivilegesHelper::confirm(Privilege::ChangeUserEmail, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
<div class="form-row email"> <div class="form-row email">
<label for="name">E-mail:</label> <label for="name">E-mail:</label>
<div class="input-wrapper"><input type="text" name="email" id="email" placeholder="New e-mail&hellip;" value="<?php echo htmlspecialchars($this->context->suppliedEmail) ?>"/></div> <div class="input-wrapper"><input type="text" name="email" id="email" placeholder="New e-mail&hellip;" value="<?= htmlspecialchars($this->context->suppliedEmail) ?>"/></div>
</div> </div>
<?php endif ?> <?php endif ?>
<?php if (PrivilegesHelper::confirm(Privilege::ChangeUserPassword, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?> <?php if (PrivilegesHelper::confirm(Privilege::ChangeUserPassword, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
<div class="form-row password1"> <div class="form-row password1">
<label for="password1">New password:</label> <label for="password1">New password:</label>
<div class="input-wrapper"><input type="password" name="password1" id="password1" placeholder="New password&hellip;" value="<?php echo htmlspecialchars($this->context->suppliedPassword1) ?>"/></div> <div class="input-wrapper"><input type="password" name="password1" id="password1" placeholder="New password&hellip;" value="<?= htmlspecialchars($this->context->suppliedPassword1) ?>"/></div>
</div> </div>
<div class="form-row password2"> <div class="form-row password2">
<label for="password2"></label> <label for="password2"></label>
<div class="input-wrapper"><input type="password" name="password2" id="password2" placeholder="New password&hellip; (repeat)" value="<?php echo htmlspecialchars($this->context->suppliedPassword2) ?>"/></div> <div class="input-wrapper"><input type="password" name="password2" id="password2" placeholder="New password&hellip; (repeat)" value="<?= htmlspecialchars($this->context->suppliedPassword2) ?>"/></div>
</div> </div>
<?php endif ?> <?php endif ?>
@ -39,11 +39,11 @@
<?php foreach (AccessRank::getAll() as $rank): ?> <?php foreach (AccessRank::getAll() as $rank): ?>
<?php if ($rank == AccessRank::Nobody) continue ?> <?php if ($rank == AccessRank::Nobody) continue ?>
<?php if (($this->context->suppliedAccessRank != '' and $rank == $this->context->suppliedAccessRank) or ($this->context->suppliedAccessRank == '' and $rank == $this->context->transport->user->accessRank)): ?> <?php if (($this->context->suppliedAccessRank != '' and $rank == $this->context->suppliedAccessRank) or ($this->context->suppliedAccessRank == '' and $rank == $this->context->transport->user->accessRank)): ?>
<option value="<?php echo $rank ?>" selected="selected"> <option value="<?= $rank ?>" selected="selected">
<?php else: ?> <?php else: ?>
<option value="<?php echo $rank ?>"> <option value="<?= $rank ?>">
<?php endif ?> <?php endif ?>
<?php echo AccessRank::toDisplayString($rank) ?> <?= AccessRank::toDisplayString($rank) ?>
</option> </option>
<?php endforeach ?> <?php endforeach ?>
</select></div> </select></div>

View file

@ -27,7 +27,7 @@ if ($this->context->user->hasEnabledEndlessScrolling())
<?php else: ?> <?php else: ?>
<li> <li>
<?php endif ?> <?php endif ?>
<a href="<?php echo \Chibi\UrlHelper::route('user', 'list', ['filter' => $key]) ?>"><?php echo $text ?></a> <a href="<?= \Chibi\UrlHelper::route('user', 'list', ['filter' => $key]) ?>"><?= $text ?></a>
</li> </li>
<?php endforeach ?> <?php endforeach ?>
</ul> </ul>
@ -40,26 +40,26 @@ if ($this->context->user->hasEnabledEndlessScrolling())
<div class="users paginator-content"> <div class="users paginator-content">
<?php foreach ($this->context->transport->users as $user): ?> <?php foreach ($this->context->transport->users as $user): ?>
<div class="user"> <div class="user">
<a class="avatar" href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $user->name]) ?>"> <a class="avatar" href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $user->name]) ?>">
<img src="<?php echo htmlspecialchars($user->getAvatarUrl(100)) ?>" alt="<?php echo $user->name ?>"/> <img src="<?= htmlspecialchars($user->getAvatarUrl(100)) ?>" alt="<?= $user->name ?>"/>
</a> </a>
<div class="details"> <div class="details">
<h1> <h1>
<a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $user->name]) ?>"> <a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $user->name]) ?>">
<?php echo $user->name ?> <?= $user->name ?>
</a> </a>
</h1> </h1>
<div class="date-registered" title="<?php echo TextHelper::formatDate($user->joinDate, true) ?>"> <div class="date-registered" title="<?= TextHelper::formatDate($user->joinDate, true) ?>">
Registered: <?php echo TextHelper::formatDate($user->joinDate, false) ?> Registered: <?= TextHelper::formatDate($user->joinDate, false) ?>
</div> </div>
<div class="post-count"> <div class="post-count">
Uploaded: <?php echo TextHelper::useDecimalUnits($user->getPostCount()) ?> Uploaded: <?= TextHelper::useDecimalUnits($user->getPostCount()) ?>
</div> </div>
<div class="fav-count"> <div class="fav-count">
Favorites: <?php echo TextHelper::useDecimalUnits($user->getFavoriteCount()) ?> Favorites: <?= TextHelper::useDecimalUnits($user->getFavoriteCount()) ?>
</div> </div>
</div> </div>
</div> </div>

View file

@ -9,27 +9,27 @@ CustomAssetViewDecorator::setSubTitle('registration form');
CustomAssetViewDecorator::addStylesheet('auth.css'); CustomAssetViewDecorator::addStylesheet('auth.css');
?> ?>
<form action="<?php echo \Chibi\UrlHelper::route('auth', 'register') ?>" class="auth register" method="post"> <form action="<?= \Chibi\UrlHelper::route('auth', 'register') ?>" class="auth register" method="post">
<p>Registered users can view more content,<br/>upload files and add posts to favorites.</p> <p>Registered users can view more content,<br/>upload files and add posts to favorites.</p>
<div class="form-row"> <div class="form-row">
<label for="name">User name:</label> <label for="name">User name:</label>
<div class="input-wrapper"><input type="text" id="name" name="name" value="<?php echo htmlspecialchars($this->context->suppliedName) ?>" placeholder="e.g. darth_vader" autocomplete="off"/></div> <div class="input-wrapper"><input type="text" id="name" name="name" value="<?= htmlspecialchars($this->context->suppliedName) ?>" placeholder="e.g. darth_vader" autocomplete="off"/></div>
</div> </div>
<div class="form-row"> <div class="form-row">
<label for="password1">Password:</label> <label for="password1">Password:</label>
<div class="input-wrapper"><input type="password" id="password1" name="password1" value="<?php echo htmlspecialchars($this->context->suppliedPassword1) ?>" placeholder="e.g. <?php echo str_repeat('&#x25cf;', 8) ?>" autocomplete="off"/></div> <div class="input-wrapper"><input type="password" id="password1" name="password1" value="<?= htmlspecialchars($this->context->suppliedPassword1) ?>" placeholder="e.g. <?= str_repeat('&#x25cf;', 8) ?>" autocomplete="off"/></div>
</div> </div>
<div class="form-row"> <div class="form-row">
<label for="password2">Password (repeat):</label> <label for="password2">Password (repeat):</label>
<div class="input-wrapper"><input type="password" id="password2" name="password2" value="<?php echo htmlspecialchars($this->context->suppliedPassword2) ?>" placeholder="e.g. <?php echo str_repeat('&#x25cf;', 8) ?>" autocomplete="off"/></div> <div class="input-wrapper"><input type="password" id="password2" name="password2" value="<?= htmlspecialchars($this->context->suppliedPassword2) ?>" placeholder="e.g. <?= str_repeat('&#x25cf;', 8) ?>" autocomplete="off"/></div>
</div> </div>
<div class="form-row"> <div class="form-row">
<label for="email">E-mail address:</label> <label for="email">E-mail address:</label>
<div class="input-wrapper"><input type="text" id="email" name="email" value="<?php echo htmlspecialchars($this->context->suppliedEmail) ?>" placeholder="e.g. vader@empire.gov" autocomplete="off"/></div> <div class="input-wrapper"><input type="text" id="email" name="email" value="<?= htmlspecialchars($this->context->suppliedEmail) ?>" placeholder="e.g. vader@empire.gov" autocomplete="off"/></div>
</div> </div>
<p id="email-info">Your e-mail will be used to show your <a href="http://gravatar.com/">Gravatar</a>.<br/>Leave blank for random Gravatar.</p> <p id="email-info">Your e-mail will be used to show your <a href="http://gravatar.com/">Gravatar</a>.<br/>Leave blank for random Gravatar.</p>

View file

@ -5,7 +5,7 @@
CustomAssetViewDecorator::addStylesheet('auth.css'); CustomAssetViewDecorator::addStylesheet('auth.css');
?> ?>
<form action="<?php echo \Chibi\UrlHelper::route($this->context->route->simpleControllerName, $this->context->route->simpleActionName) ?>" method="post" class="auth" autocomplete="off"> <form action="<?= \Chibi\UrlHelper::route($this->context->route->simpleControllerName, $this->context->route->simpleActionName) ?>" method="post" class="auth" autocomplete="off">
<div class="form-row"> <div class="form-row">
<label>User:</label> <label>User:</label>
<div class="input-wrapper"> <div class="input-wrapper">

View file

@ -1,4 +1,4 @@
<form action="<?php echo \Chibi\UrlHelper::route('user', 'settings', ['name' => $this->context->transport->user->name]) ?>" method="post" class="settings"> <form action="<?= \Chibi\UrlHelper::route('user', 'settings', ['name' => $this->context->transport->user->name]) ?>" method="post" class="settings">
<div class="form-row safety"> <div class="form-row safety">
<label>Safety:</label> <label>Safety:</label>
<div class="input-wrapper"> <div class="input-wrapper">
@ -15,7 +15,7 @@
echo TextHelper::htmlTag('input', TextHelper::HTML_LEAF, $attrs); echo TextHelper::htmlTag('input', TextHelper::HTML_LEAF, $attrs);
?> ?>
<?php echo ucfirst(PostSafety::toDisplayString($safety)) ?> <?= ucfirst(PostSafety::toDisplayString($safety)) ?>
</label> </label>
<?php endif ?> <?php endif ?>
<?php endforeach ?> <?php endforeach ?>

View file

@ -5,10 +5,10 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
<div id="sidebar"> <div id="sidebar">
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->transport->user->name]) ?>"> <a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->transport->user->name]) ?>">
<img src="<?php echo htmlspecialchars($this->context->transport->user->getAvatarUrl(140)) ?>" alt="<?php echo $this->context->transport->user->name ?>"> <img src="<?= htmlspecialchars($this->context->transport->user->getAvatarUrl(140)) ?>" alt="<?= $this->context->transport->user->name ?>">
</a> </a>
<h1><?php echo $this->context->transport->user->name ?></h1> <h1><?= $this->context->transport->user->name ?></h1>
</div> </div>
<div class="unit details"> <div class="unit details">
@ -16,32 +16,32 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
<div class="key-value join-date"> <div class="key-value join-date">
<span class="key">Joined:</span> <span class="key">Joined:</span>
<span class="value" title="<?php echo TextHelper::formatDate($this->context->transport->user->joinDate, true) ?>"> <span class="value" title="<?= TextHelper::formatDate($this->context->transport->user->joinDate, true) ?>">
<?php echo TextHelper::formatDate($this->context->transport->user->joinDate, false) ?> <?= TextHelper::formatDate($this->context->transport->user->joinDate, false) ?>
</span> </span>
</div> </div>
<div class="key-value last-login"> <div class="key-value last-login">
<span class="key">Last login:</span> <span class="key">Last login:</span>
<span class="value" title="<?php echo TextHelper::formatDate($this->context->transport->user->lastLoginDate, true) ?>"> <span class="value" title="<?= TextHelper::formatDate($this->context->transport->user->lastLoginDate, true) ?>">
<?php echo TextHelper::formatDate($this->context->transport->user->lastLoginDate, false) ?> <?= TextHelper::formatDate($this->context->transport->user->lastLoginDate, false) ?>
</span> </span>
</div> </div>
<div class="key-value access-rank"> <div class="key-value access-rank">
<span class="key">Access rank:</span> <span class="key">Access rank:</span>
<span class="value" title="<?php echo $val = AccessRank::toDisplayString($this->context->transport->user->accessRank) ?>"> <span class="value" title="<?= $val = AccessRank::toDisplayString($this->context->transport->user->accessRank) ?>">
<?php echo $val ?> <?= $val ?>
</span> </span>
</div> </div>
<?php if (PrivilegesHelper::confirm(Privilege::ViewUserEmail, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?> <?php if (PrivilegesHelper::confirm(Privilege::ViewUserEmail, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
<div class="key-value email"> <div class="key-value email">
<span class="key">E-mail:</span> <span class="key">E-mail:</span>
<span class="value" title="<?php echo $val = ($this->context->transport->user->emailUnconfirmed <span class="value" title="<?= $val = ($this->context->transport->user->emailUnconfirmed
? '(unconfirmed) ' . $this->context->transport->user->emailUnconfirmed ? '(unconfirmed) ' . $this->context->transport->user->emailUnconfirmed
: $this->context->transport->user->emailConfirmed ?: 'none specified') ?>"> : $this->context->transport->user->emailConfirmed ?: 'none specified') ?>">
<?php echo $val ?> <?= $val ?>
</span> </span>
<br>(only you and staff can see this) <br>(only you and staff can see this)
</div> </div>
@ -156,7 +156,7 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
<?php else: ?> <?php else: ?>
<li class="favs"> <li class="favs">
<?php endif ?> <?php endif ?>
<a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->transport->user->name, 'tab' => 'favs', 'page' => 1]) ?>"> <a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->transport->user->name, 'tab' => 'favs', 'page' => 1]) ?>">
Favs Favs
</a> </a>
</li> </li>
@ -166,7 +166,7 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
<?php else: ?> <?php else: ?>
<li class="uploads"> <li class="uploads">
<?php endif ?> <?php endif ?>
<a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->transport->user->name, 'tab' => 'uploads', 'page' => 1]) ?>"> <a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->transport->user->name, 'tab' => 'uploads', 'page' => 1]) ?>">
Uploads Uploads
</a> </a>
</li> </li>
@ -177,7 +177,7 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
<?php else: ?> <?php else: ?>
<li class="settings"> <li class="settings">
<?php endif ?> <?php endif ?>
<a href="<?php echo \Chibi\UrlHelper::route('user', 'settings', ['name' => $this->context->transport->user->name]) ?>"> <a href="<?= \Chibi\UrlHelper::route('user', 'settings', ['name' => $this->context->transport->user->name]) ?>">
Browsing settings Browsing settings
</a> </a>
</li> </li>
@ -189,7 +189,7 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
<?php else: ?> <?php else: ?>
<li class="edit"> <li class="edit">
<?php endif ?> <?php endif ?>
<a href="<?php echo \Chibi\UrlHelper::route('user', 'edit', ['name' => $this->context->transport->user->name]) ?>"> <a href="<?= \Chibi\UrlHelper::route('user', 'edit', ['name' => $this->context->transport->user->name]) ?>">
Account settings Account settings
</a> </a>
</li> </li>
@ -201,7 +201,7 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
<?php else: ?> <?php else: ?>
<li class="delete"> <li class="delete">
<?php endif ?> <?php endif ?>
<a href="<?php echo \Chibi\UrlHelper::route('user', 'delete', ['name' => $this->context->transport->user->name]) ?>"> <a href="<?= \Chibi\UrlHelper::route('user', 'delete', ['name' => $this->context->transport->user->name]) ?>">
Delete account Delete account
</a> </a>
</li> </li>