Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vendeeglobe committed Feb 12, 2022
1 parent ad3a420 commit 29ba0c5
Show file tree
Hide file tree
Showing 28 changed files with 81 additions and 35 deletions.
18 changes: 11 additions & 7 deletions wacko/action/files.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
$phrase = (string) ($_GET['phrase'] ?? '');
$type_id = (int) ($_GET['type_id'] ?? $type_id);
$category_id = (int) @$_GET['category_id'];
$filter = $_GET['files'] ?? null;
$file_link = (int) $linked;

$order_by = "file_name ASC";
Expand Down Expand Up @@ -202,7 +203,7 @@
if (($results || $phrase) && $form)
{
// search
$files_filter = (isset($_GET['files']) && in_array($_GET['files'], ['all', 'cluster', 'global', 'linked'])) ? $_GET['files'] : '';
$files_filter = (isset($filter) && in_array($filter, ['all', 'cluster', 'global', 'linked'])) ? $filter : '';

$tpl->s_filter = $files_filter;
$tpl->s_phrase = Ut::html($phrase);
Expand All @@ -216,10 +217,11 @@
$tpl->mark_results = $results . ' of ' . $count['n'] . ' ' . $title;
}

$tpl->style = $style;

if ($results)
{
$tpl->enter('r_');
$tpl->style = $style;

foreach ($files as $file)
{
// check for local file
Expand Down Expand Up @@ -264,7 +266,7 @@

$link = $this->link($path2 . $file_name, '', $text, '', $track);

$tpl->enter('r_');
$tpl->enter('n_');

// display file
$tpl->link = $link;
Expand All @@ -273,7 +275,7 @@
{
// get context for filter
$method_filter = $this->method == 'show' ? '' : $this->method;
$param_filter = (isset($_GET['files']) && in_array($_GET['files'], ['all', 'cluster', 'global', 'linked'])) ? ['files' => $_GET['files']] : [];
$param_filter = (isset($filter) && in_array($filter, ['all', 'cluster', 'global', 'linked'])) ? ['files' => $filter] : [];

// display picture meta data
#$tpl->p_file = $file; // result array: [ ' file.file_id ' ]
Expand Down Expand Up @@ -315,14 +317,16 @@
$tpl->i_class = $icon[1];
}

$tpl->leave(); // r_
$tpl->leave(); // n_

unset($link, $desc);
}

$tpl->leave(); // r_
}
else
{
$tpl->message = '<em>' . $this->_t('NoAttachments') . '</em><br><br>';
$tpl->message = '<em>' . $this->_t('NoAttachments') . '</em><br>';
}

unset($files);
Expand Down
6 changes: 4 additions & 2 deletions wacko/action/template/files.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[ === main === ]
[ ' message ' ]
[ '' pagination '' ]
[= s =
<form action="[ ' href: attachments ' ]" method="get" name="file_search">
Expand All @@ -24,8 +23,10 @@
<div class="layout-box">
<p><span>[ ' results ' ]: </span></p>
=]
[ ' message ' ]
[= r =
<table class="[ ' style ' ]">
[= r =
[= n =
<tr>
<td class="file-">[ ' link ' ]</td>
[= p =
Expand Down Expand Up @@ -54,6 +55,7 @@
</tr>
=]
</table>
=]
[= emark _ =
[ ' nonstatic ' ]
</div>
Expand Down
2 changes: 1 addition & 1 deletion wacko/admin/module/user_groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ function admin_user_groups(&$engine, &$module)
echo '<tr>' . "\n" .
'<td><input type="radio" name="change" value="' . $row['group_id'] . '"></td>' .
'<td>' . $row['group_id'] . '</td>' .
'<td class="t-left" style="padding: 0px 5px;"><strong><a href="' . $engine->href('', '', ['group_id' => $row['group_id']]) . '">' . $row['group_name'] . '</a></strong></td>' .
'<td><a href="' . $engine->href('', '', ['group_id' => $row['group_id']]) . '">' . $row['group_name'] . '</a></td>' .
'<td>' . $row['description'] . '</td>' .
'<td><small><a href="' . $engine->href('', '', ['moderator' => $row['moderator_id']]) . '">' . $row['user_name'] . '</a></small></td>' .
'<td>' . $row['members'] . '</td>' .
Expand Down
8 changes: 4 additions & 4 deletions wacko/admin/module/user_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -970,22 +970,22 @@ function admin_user_users(&$engine, &$module)
<th><a href="<?php echo $engine->href('', '', ['order' => $signup_time]); ?>"><?php echo $engine->_t('UsersSignup');?></a></th>
<th><a href="<?php echo $engine->href('', '', ['order' => $last_visit]); ?>"><?php echo $engine->_t('UsersLastSession');?></a></th>
</tr>
<thead>
</thead>
<tbody>
<?php
if ($users)
{
foreach ($users as $row)
{
echo '<tr>
<td class="label a-middle" style="width:10px;">
<input type="checkbox" name="' . $row['user_id'] . '" value="id" ' . ( in_array($row['user_id'], $set) ? ' checked' : '') . '/>
<td class="label">
<input type="checkbox" name="' . $row['user_id'] . '" value="id" ' . (in_array($row['user_id'], $set) ? ' checked' : '') . '/>
</td>
<td>
<input type="radio" name="user_id" value="' . $row['user_id'] . '">
</td>
<td>' . $row['user_id'] . '</td>
<td><strong><a href="' . $engine->href('', '', ['user_id' => $row['user_id']]) . '">' . $row['user_name'] . '</a></strong></td>
<td><a href="' . $engine->href('', '', ['user_id' => $row['user_id']]) . '">' . $row['user_name'] . '</a></td>
<td>' . $row['email'] . '</td>
<td>' . $row['total_pages'] . '</td>
<td>' . $row['total_comments'] . '</td>
Expand Down
16 changes: 12 additions & 4 deletions wacko/admin/style/backend.css
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ table.forum th {
.groups col:nth-child(n+5) {
width: 20px;
}
.groups td:nth-child(3) {
padding: 0 5px;
font-weight: bold;
}

/* users table */
.users col:nth-child(n+1):nth-child(-n+3) {
Expand All @@ -330,9 +334,13 @@ table.forum th {
.users col:nth-child(n+6) {
width: 20px;
}
.users td:nth-child(-n+2) {
width: 10px;
vertical-align: middle;
}
.users td:nth-child(4) {
padding-left: 5px;
padding-right: 5px;
padding: 0 5px;
font-weight: bold;
}
/* restore table */
table.restore {
Expand Down Expand Up @@ -998,8 +1006,8 @@ div#loginbox {
}

.listcenter td {
vertical-align:top;
text-align:center;
vertical-align: top;
text-align: center;
}

a.button {
Expand Down
28 changes: 20 additions & 8 deletions wacko/handler/page/new.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@

// TODO: exclude service and system pages
// either by user 'SYSTEM' or better via service: namespace
$option = (int) ($_POST['option'] ?? 0);

// process input
if (isset($_POST['tag']) && $new_tag = utf8_trim($_POST['tag'], '.-/ '))
{
switch ((int) $_POST['option'])
switch ($option)
{
case 1:
$prefix = $this->tag . '/';
Expand Down Expand Up @@ -80,19 +81,29 @@
}
}

// create a peer page
// create a sub-page
if ($this->has_access('create', $this->get_page_id($this->tag)))
{
$tpl->p_f_base = (mb_strlen($this->tag) > 50 ? '...' . mb_substr($this->tag, -50) : $this->tag);
$tpl->p_f_tag = (isset($_POST['option']) && $_POST['option'] === 1 ? $new_tag : '');
if ($this->tag != $this->db->root_page)
{
$tpl->p_f_base = (mb_strlen($this->tag) > 50 ? '...' . mb_substr($this->tag, -50) : $this->tag);
$tpl->p_f_tag = ($option === 1 ? $new_tag : '');
#$tpl->p_f_pattern = $this->language['TAG'] . '+';
}
else
{
$tpl->p = true; // Why does it fail without it?
// TODO: show message
// users adding sub pages to HomePage/subpage, possible but probably misguided and on the wrong path
}
}
else
{
$message = '<em>' . $this->_t('CreatePageDenied') . '</em>';
$tpl->p_d_message = $this->show_message($message, 'note', false);
}

// create a child page only inside a cluster
// create a peer-page, only inside a cluster
if (mb_substr_count($this->tag, '/') > 0)
{
$parent = mb_substr($this->tag, 0, mb_strrpos($this->tag, '/'));
Expand All @@ -103,7 +114,8 @@
if ($parent != $this->db->users_page)
{
$tpl->c_f_base = (mb_strlen($parent) > 50 ? '...' . mb_substr($parent, -50) : $parent);
$tpl->c_f_tag = (isset($_POST['option']) && $_POST['option'] === 2 ? $new_tag : '');
$tpl->c_f_tag = ($option === 2 ? $new_tag : '');
#$tpl->c_f_pattern = $this->language['TAG'] . '+';
}
}
else
Expand All @@ -114,5 +126,5 @@
}

// create a random page
$tpl->tag;

$tpl->tag = ($option === 3 ? $new_tag : '');
#$tpl->pattern = $this->language['TAG'] . '+';
2 changes: 1 addition & 1 deletion wacko/handler/page/remove.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
// remove SINGLE revision
if ($this->remove_revision($this->page['page_id'], $revision_id, $dontkeep))
{
$tpl->noundo = $dontkeep;
$tpl->r_noundo = $dontkeep;
$tpl->r_tag = $this->tag;
$tpl->r_l_notice = Ut::perc_replace($this->_t('RevisionRemoved'), '<code>' . $revision['version_id'] . '</code>');
$tpl->r_return = $this->compose_link_to_page('', 'revisions', '« ' . $this->_t('CancelReturnButton'), '', false);
Expand Down
14 changes: 7 additions & 7 deletions wacko/handler/page/template/new.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
<form action="[ ' href: new ' ]" method="post" name="parent_cluster_page">
[ ' csrf: parent_cluster_page ' ]
<input type="hidden" name="option" value="2">
<label for="create_pageparentcluster">[ ' _t: CreatePageParentCluster ' ]:</label><br>
<label for="create_parent_cluster_page">[ ' _t: CreatePageParentCluster ' ]:</label><br>
<code>[ ' base ' ]/</code>
<input type="text" id="create_pageparentcluster" name="tag" value="[ ' tag | e attr ' ]" size="20" maxlength="255">
<button type="submit" id="submit_pageparentcluster">[ ' _t: CreateButton ' ]</button>
<input type="text" id="create_parent_cluster_page" name="tag" value="[ ' tag | e attr ' ]" size="20" maxlength="255">
<button type="submit" id="submit_parent_cluster_page">[ ' _t: CreateButton ' ]</button>
</form>
<br>
=]
=]
<form action="[ ' href: new ' ]" method="post" name="random_page">
[ ' csrf: random_page ' ]
<input type="hidden" name="option" value="3">
<label for="create_randompage">[ ' _t: CreateRandomPage ' ]:</label><br>
<input type="text" id="create_randompage" name="tag" value="[ ' tag | e attr ' ]" size="60" maxlength="255">
<button type="submit" id="submit_randompage">[ ' _t: CreateButton ' ]</button>
<label for="create_random_page">[ ' _t: CreateRandomPage ' ]:</label><br>
<input type="text" id="create_random_page" name="tag" value="[ ' tag | e attr ' ]" size="60" maxlength="255">
<button type="submit" id="submit_random_page">[ ' _t: CreateButton ' ]</button>
</form>
</div>
</div>
1 change: 1 addition & 0 deletions wacko/lang/wacko.bg.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'You have been denied access to %1.',

'RegistrationThreshold' => 'Времето за попълване на формуляра трябва да е не по-малко от %1 секунди.',
'Language' => 'Език',

// login panel
'LoginWelcome' => 'Вход',
Expand Down
1 change: 1 addition & 0 deletions wacko/lang/wacko.da.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'You have been denied access to %1.',

'RegistrationThreshold' => 'Den tid, det tager at udfylde formularen, bør ikke være mindre end %1 sekunder.',
'Language' => 'Sprog',

// login panel
'LoginWelcome' => 'Log ind',
Expand Down
1 change: 1 addition & 0 deletions wacko/lang/wacko.de.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'Der Zugang zu %1 wurde abgelehnt.',

'RegistrationThreshold' => 'Die Zeit zum Ausfüllen des Formulars sollte nicht %1 Sekunden unterschreiten.',
'Language' => 'Sprache',

// login panel
'LoginWelcome' => 'Anmeldung',
Expand Down
1 change: 1 addition & 0 deletions wacko/lang/wacko.el.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'You have been denied access to %1.',

'RegistrationThreshold' => 'Ο χρόνος συμπλήρωσης της φόρμας δεν πρέπει να είναι μικρότερος από %1 δευτερόλεπτα.',
'Language' => 'Γλώσσα',

// login panel
'LoginWelcome' => 'Σύνδεση',
Expand Down
1 change: 1 addition & 0 deletions wacko/lang/wacko.en.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'You have been denied access to %1.',

'RegistrationThreshold' => 'The time for filling out the form should not be less than %1 seconds.',
'Language' => 'Language',

// login panel
'LoginWelcome' => 'Login',
Expand Down
1 change: 1 addition & 0 deletions wacko/lang/wacko.es.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'Se le denegó permiso para acceder %1.',

'RegistrationThreshold' => 'El tiempo para rellenar el formulario no debe ser inferior a %1 segundos.',
'Language' => 'Language',

// login panel
'LoginWelcome' => 'Conectar',
Expand Down
1 change: 1 addition & 0 deletions wacko/lang/wacko.et.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'You have been denied access to %1.',

'RegistrationThreshold' => 'Vormi täitmiseks kuluv aeg ei tohiks olla alla %1 sekundi.',
'Language' => 'Keel',

// login panel
'LoginWelcome' => 'Logi sisse',
Expand Down
1 change: 1 addition & 0 deletions wacko/lang/wacko.fa.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'You have been denied access to %1.',

'RegistrationThreshold' => 'زمان پر کردن فرم نباید کمتر از %1 ثانیه باشد.',
'Language' => 'زبان',

// login panel
'LoginWelcome' => 'ورود به سامانه',
Expand Down
3 changes: 2 additions & 1 deletion wacko/lang/wacko.fr.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'NewAccountSubject' => 'Enregistrement de compte',
'NewAccountAdminCreated' => 'L’utilisateur %1 vous a créé un compte avec le nom d’utilisateur « %2 ». Pour terminer la création, visitez l’URL suivante (soyez sûr qu’elle soit entrée comme une seule ligne) et définissez votre mot de passe :',
'NewAccountUsername' => 'Utilisateur :',
'AccountLanguage' => 'Langue:',
'AccountLanguage' => 'Langue :',
'NewAccountEmail' => 'Courriel :',
'NewAccountIP' => 'Adresse IP distante :',
'NewAccountSignupInfo' => 'Le compte suivant a été créé :',
Expand All @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'Votre accès à %1 a été refusé.',

'RegistrationThreshold' => 'Le temps nécessaire pour remplir le formulaire ne doit pas être inférieur à %1 secondes.',
'Language' => 'Langue',

// login panel
'LoginWelcome' => 'Connexion',
Expand Down
1 change: 1 addition & 0 deletions wacko/lang/wacko.hi.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'You have been denied access to %1.',

'RegistrationThreshold' => 'फॉर्म भरने का समय %1 सेकंड से कम नहीं होना चाहिए। ',
'Language' => 'भाषा',

// login panel
'LoginWelcome' => 'प्रवेश',
Expand Down
1 change: 1 addition & 0 deletions wacko/lang/wacko.hu.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'You have been denied access to %1.',

'RegistrationThreshold' => 'Az űrlap kitöltésének ideje nem lehet kevesebb, mint %1 másodperc.',
'Language' => 'Nyelv',

// login panel
'LoginWelcome' => 'Bejelentkezés',
Expand Down
1 change: 1 addition & 0 deletions wacko/lang/wacko.it.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'Ti è stato negato l\'accesso %1.',

'RegistrationThreshold' => 'Il tempo di compilazione del modulo non deve essere inferiore a %1 secondi.',
'Language' => 'Lingua',

// login panel
'LoginWelcome' => 'Connessione',
Expand Down
1 change: 1 addition & 0 deletions wacko/lang/wacko.ja.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'You have been denied access to %1.',

'RegistrationThreshold' => 'フォームに入力する時間は、%1秒以下であってはなりません',
'Language' => '言語',

// login panel
'LoginWelcome' => 'ログイン',
Expand Down
1 change: 1 addition & 0 deletions wacko/lang/wacko.ko.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'You have been denied access to %1.',

'RegistrationThreshold' => '양식을 채우는 시간은 %1 초 이상이어야합니다.',
'Language' => '언어',

// login panel
'LoginWelcome' => '로그인',
Expand Down
1 change: 1 addition & 0 deletions wacko/lang/wacko.nl.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'UserDeniedInfo' => 'Je hebt geen toegang tot %1.',

'RegistrationThreshold' => 'De tijd voor het invullen van het formulier mag niet korter zijn dan %1 seconden.',
'Language' => 'Taal',

// login panel
'LoginWelcome' => 'Inloggen',
Expand Down
Loading

0 comments on commit 29ba0c5

Please sign in to comment.