1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-15 20:55:56 +00:00

prefs system: markup cleanup

This commit is contained in:
Andrew Dolgov
2021-02-13 13:50:53 +03:00
parent aa63014073
commit 5127c29297
2 changed files with 72 additions and 70 deletions

View File

@@ -139,7 +139,7 @@ class Pref_Labels extends Handler_Protected {
$sth->execute([$caption, $old_caption, $_SESSION['uid']]); $sth->execute([$caption, $old_caption, $_SESSION['uid']]);
print clean($_REQUEST["value"]); print clean($_REQUEST["caption"]);
} else { } else {
print $old_caption; print $old_caption;
} }

View File

@@ -31,7 +31,7 @@ class Pref_System extends Handler_Protected {
$info = ob_get_contents(); $info = ob_get_contents();
ob_end_clean(); ob_end_clean();
print preg_replace( '%^.*<body>(.*)</body>.*$%ms','$1', $info); print preg_replace( '%^.*<body>(.*)</body>.*$%ms','$1', (string)$info);
} }
private function log_viewer(int $page, int $severity) { private function log_viewer(int $page, int $severity) {
@@ -71,54 +71,58 @@ class Pref_System extends Handler_Protected {
$total_pages = 0; $total_pages = 0;
} }
print "<div dojoType='dijit.layout.BorderContainer' gutters='false'>"; ?>
<div dojoType='dijit.layout.BorderContainer' gutters='false'>
<div region='top' dojoType='fox.Toolbar'>
print "<div region='top' dojoType='fox.Toolbar'>"; <button dojoType='dijit.form.Button' onclick='Helpers.EventLog.refresh()'>
<?php echo __('Refresh') ?>
</button>
print "<button dojoType='dijit.form.Button' <button dojoType='dijit.form.Button' <?php echo ($page <= 0 ? "disabled" : "") ?>
onclick='Helpers.EventLog.refresh()'>".__('Refresh')."</button>"; onclick='Helpers.EventLog.prevPage()'>
<?php echo __('&lt;&lt;') ?>
</button>
$prev_page_disabled = $page <= 0 ? "disabled" : ""; <button dojoType='dijit.form.Button' disabled>
<?php echo T_sprintf('Page %d of %d', $page+1, $total_pages+1) ?>
</button>
print "<button dojoType='dijit.form.Button' $prev_page_disabled <button dojoType='dijit.form.Button' <?php echo ($page >= $total_pages ? "disabled" : "") ?>
onclick='Helpers.EventLog.prevPage()'>".__('&lt;&lt;')."</button>"; onclick='Helpers.EventLog.nextPage()'>
<?php echo __('&gt;&gt;') ?>
</button>
print "<button dojoType='dijit.form.Button' disabled>".T_sprintf('Page %d of %d', $page+1, $total_pages+1)."</button>"; <button dojoType='dijit.form.Button'
onclick='Helpers.EventLog.clear()'>
<?php echo __('Clear') ?>
</button>
$next_page_disabled = $page >= $total_pages ? "disabled" : ""; <div class='pull-right'>
<?php echo __("Severity:") ?>
print "<button dojoType='dijit.form.Button' $next_page_disabled <?php print_select_hash("severity", $severity,
onclick='Helpers.EventLog.nextPage()'>".__('&gt;&gt;')."</button>";
print "<button dojoType='dijit.form.Button'
onclick='Helpers.EventLog.clear()'>".__('Clear')."</button>";
print "<div class='pull-right'>";
print __("Severity:") . " ";
print_select_hash("severity", $severity,
[ [
E_USER_ERROR => __("Errors"), E_USER_ERROR => __("Errors"),
E_USER_WARNING => __("Warnings"), E_USER_WARNING => __("Warnings"),
E_USER_NOTICE => __("Everything") E_USER_NOTICE => __("Everything")
], 'dojoType="fox.form.Select" onchange="Helpers.EventLog.refresh()"'); ], 'dojoType="fox.form.Select" onchange="Helpers.EventLog.refresh()"') ?>
</div>
</div>
print "</div>"; # pull-right <div style="padding : 0px" dojoType="dijit.layout.ContentPane" region="center">
print "</div>"; # toolbar <table width='100%' class='event-log'>
print '<div style="padding : 0px" dojoType="dijit.layout.ContentPane" region="center">'; <tr class='title'>
<td width='5%'><?php echo __("Error") ?></td>
print "<table width='100%' class='event-log'>"; <td><?php echo __("Filename") ?></td>
<td><?php echo __("Message") ?></td>
print "<tr class='title'> <td width='5%'><?php echo __("User") ?></td>
<td width='5%'>".__("Error")."</td> <td width='5%'><?php echo __("Date") ?></td>
<td>".__("Filename")."</td> </tr>
<td>".__("Message")."</td>
<td width='5%'>".__("User")."</td>
<td width='5%'>".__("Date")."</td>
</tr>";
<?php
$sth = $this->pdo->prepare("SELECT $sth = $this->pdo->prepare("SELECT
errno, errstr, filename, lineno, created_at, login, context errno, errstr, filename, lineno, created_at, login, context
FROM FROM
@@ -132,26 +136,24 @@ class Pref_System extends Handler_Protected {
$sth->execute($errno_values); $sth->execute($errno_values);
while ($line = $sth->fetch()) { while ($line = $sth->fetch()) {
print "<tr>"; foreach ($line as $k => $v) { $line[$k] = htmlspecialchars($v); }
?>
foreach ($line as $k => $v) { <tr>
$line[$k] = htmlspecialchars($v); <td class='errno'>
} <?php echo Logger::$errornames[$line["errno"]] . " (" . $line["errno"] . ")" ?>
</td>
print "<td class='errno'>" . Logger::$errornames[$line["errno"]] . " (" . $line["errno"] . ")</td>"; <td class='filename'><?php echo $line["filename"] . ":" . $line["lineno"] ?></td>
print "<td class='filename'>" . $line["filename"] . ":" . $line["lineno"] . "</td>"; <td class='errstr'><?php echo $line["errstr"] . "\n" . $line["context"] ?></td>
print "<td class='errstr'>" . $line["errstr"] . "\n" . $line["context"] . "</td>"; <td class='login'><?php echo $line["login"] ?></td>
print "<td class='login'>" . $line["login"] . "</td>"; <td class='timestamp'>
<?php TimeHelper::make_local_datetime($line["created_at"], false) ?>
print "<td class='timestamp'>" . </td>
TimeHelper::make_local_datetime($line["created_at"], false) . "</td>"; </tr>
<?php } ?>
print "</tr>"; </table>
} </div>
</div>
print "</table>"; <?php
print "</div>";
print "</div>";
} }
function index() { function index() {