Skip to content
Snippets Groups Projects
Commit 9d460a91 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

use consistent page titles, fixes #3

parent fb155894
No related branches found
No related tags found
No related merge requests found
......@@ -22,10 +22,10 @@ class StatisticsController extends PluginController
$this->semester = Semester::findByTimestamp(strtotime('+8 weeks'));
}
PageLayout::setTitle(sprintf(
$this->setTitle(
_('Plugin-Statistiken (StandardPlugins der Veranstaltungen) für das %s'),
$this->semester->name
));
);
$this->getCached($this->semester->id, function () {
$query = "SELECT plugins.pluginid AS id,
......@@ -85,7 +85,7 @@ class StatisticsController extends PluginController
public function semesters_action()
{
PageLayout::setTitle(_('Statistik der Semester'));
$this->setTitle(_('Semester'));
$this->getCached('semesters', function () {
// TODO: This query is slow due to missing indices either on
......@@ -125,6 +125,8 @@ class StatisticsController extends PluginController
public function files_action ()
{
$this->setTitle(_('Dateien'));
$this->additional_labels = [
'institute' => _('Einrichtungen'),
'message' => _('Nachrichten'),
......@@ -279,6 +281,8 @@ class StatisticsController extends PluginController
public function widgets_action()
{
$this->setTitle(_('Widgets'));
$query = "SELECT plu.pluginid,
plu.enabled = 'yes' AS `enabled`,
plu.pluginname AS `name`,
......@@ -306,6 +310,8 @@ class StatisticsController extends PluginController
public function archive_action()
{
$this->setTitle(_('Archiv'));
$query = "SELECT COUNT(DISTINCT semester) AS semesters,
COUNT(name) AS courses,
SUM(archiv_file_id != '') AS files,
......@@ -318,6 +324,8 @@ class StatisticsController extends PluginController
public function database_action()
{
$this->setTitle(_('Datenbank'));
$query = "SELECT `TABLE_NAME`, `TABLE_ROWS`,
`DATA_LENGTH`,
`INDEX_LENGTH`,
......@@ -477,4 +485,13 @@ class StatisticsController extends PluginController
$this->$key = $value;
}
}
private function setTitle($title)
{
$args = func_get_args();
$title = vsprintf(array_shift($args), $args);
$title = "{$this->plugin->getPluginname()} - {$title}";
PageLayout::setTitle($title);
}
}
......@@ -3,7 +3,6 @@
<col width="200px">
<col>
</colgroup>
<caption><?= _('Archiv-Statistik') ?></caption>
<thead>
<tr>
<th colspan="2"><?= _('Informationen') ?></th>
......
......@@ -11,7 +11,6 @@ $relsize = function ($number) use ($numberReady) {
};
?>
<table class="default statistics sortable-table">
<caption><?= _('Datenbank-Statistik') ?></caption>
<thead>
<tr>
<th data-sort="text"><?= _('Tabelle') ?></th>
......
<table class="default statistics">
<caption><?= strftime('Dateiübersicht vom %x %X', $timestamp) ?></caption>
<caption>
<?= _('Stand') ?>:
<?= strftime('%x %X', $timestamp) ?>
</caption>
<thead>
<tr>
<th rowspan="2"><?= _('Semester') ?></th>
......
......@@ -16,8 +16,8 @@ $numberReady = function ($number) {
<thead>
<tr>
<th><?= _('Semester') ?></th>
<th><?= _('Studenten') ?></th>
<th><?= _('Dozenten') ?></th>
<th><?= _('Studierende') ?></th>
<th><?= _('Lehrende') ?></th>
<th><?= _('Seminare') ?></th>
</tr>
</thead>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment