Skip to content

Commit f46745d

Browse files
Sam Tukemichield
authored andcommitted
Add link to subscriber's public preferences page from their subscriber details (#311)
* Added link from Subscriber Details to public preferences page * Removed unnecessary whitespace
1 parent 3de1f4a commit f46745d

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

public_html/lists/admin/user.php

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
if (!empty($_POST['change']) && ($access == 'owner' || $access == 'all')) {
6767
if (!verifyToken()) {
68-
echo Error($GLOBALS['I18N']->get('Invalid security token, please reload the page and try again'));
68+
echo Error(s('Invalid security token, please reload the page and try again'));
6969

7070
return;
7171
}
@@ -146,7 +146,7 @@
146146
Sql_Query(sprintf('replace into %s (userid,attributeid,value)
147147
values(%d,%d,"%s")', $tables['user_attribute'], $id, $key, base64_encode($avatar)));
148148
} elseif ($size) {
149-
echo Error($GLOBALS['I18N']->get('Uploaded avatar file too big'));
149+
echo Error(s('Uploaded avatar file too big'));
150150
}
151151
}
152152
}
@@ -230,7 +230,7 @@
230230
if (count($subscribed_to)) {
231231
foreach ($subscribed_to as $listID => $listName) {
232232
Sql_Query("insert into {$tables['listuser']} (userid,listid,entered,modified) values($id,$listID,now(),now())");
233-
$feedback .= '<br/>'.sprintf($GLOBALS['I18N']->get('Subscriber added to list %s'), $listName);
233+
$feedback .= '<br/>'.sprintf(s('Subscriber added to list %s'), $listName);
234234
}
235235
$feedback .= '<br/>';
236236
}
@@ -322,11 +322,19 @@
322322
}
323323

324324
if (!$membership) {
325-
$membership = $GLOBALS['I18N']->get('No Lists');
325+
$membership = s('No Lists');
326326
}
327327

328328
echo '<div class="actions">';
329-
echo '&nbsp;&nbsp;'.PageLinkButton("userhistory&amp;id=$id", $GLOBALS['I18N']->get('History'));
329+
echo PageLinkButton("userhistory&amp;id=$id", s('History'));
330+
echo
331+
'<a
332+
class="confirm btn btn-default"
333+
href="'.getConfig('preferencesurl')."&amp;uid=".$user['uniqid'].'">'.
334+
s('Preferences page').'
335+
</a>';
336+
337+
// Trigger hook to add additional buttons from plugins
330338
if (!empty($GLOBALS['config']['plugins']) && is_array($GLOBALS['config']['plugins'])) {
331339
foreach ($GLOBALS['config']['plugins'] as $pluginName => $plugin) {
332340
echo $plugin->userpageLink($id);
@@ -392,7 +400,7 @@
392400
if ($key == 'confirmed') {
393401
if (!$require_login || ($require_login && isSuperUser())) {
394402
$userdetailsHTML .= sprintf('<tr><td class="dataname">%s (1/0)</td><td><input type="text" name="%s" value="%s" size="5" /></td></tr>'."\n",
395-
$GLOBALS['I18N']->get($b), $key, htmlspecialchars(stripslashes($user[$key])));
403+
s($b), $key, htmlspecialchars(stripslashes($user[$key])));
396404
} else {
397405
$userdetailsHTML .= sprintf('<tr><td class="dataname">%s</td><td>%s</td></tr>', $b,
398406
stripslashes($user[$key]));
@@ -401,7 +409,7 @@
401409
$userdetailsHTML .= sprintf('<tr><td class="dataname">%s</td><td><input type="text" name="%s" value="%s" size="30" /></td></tr>'."\n",
402410
$val[1], $key, '');
403411
} elseif ($key == 'blacklisted') {
404-
$userdetailsHTML .= sprintf('<tr><td class="dataname">%s</td><td>%s', $GLOBALS['I18N']->get($b),
412+
$userdetailsHTML .= sprintf('<tr><td class="dataname">%s</td><td>%s', s($b),
405413
$user[$key] || isBlackListed($user['email']) ? s('Yes') : s('No'));
406414

407415
if (!($user[$key] || isBlackListed($user['email']))) {
@@ -416,10 +424,10 @@
416424
if (!strpos($key, '_')) {
417425
if (strpos($a, 'sys') !== false) {
418426
$userdetailsHTML .= sprintf('<tr><td class="dataname">%s</td><td>%s</td></tr>',
419-
$GLOBALS['I18N']->get($b), stripslashes($user[$key]));
427+
s($b), stripslashes($user[$key]));
420428
} elseif ($val[1]) {
421429
$userdetailsHTML .= sprintf('<tr><td class="dataname">%s</td><td><input type="text" name="%s" value="%s" size="30" /></td></tr>'."\n",
422-
$GLOBALS['I18N']->get($val[1]), $key, htmlspecialchars(stripslashes($user[$key])));
430+
s($val[1]), $key, htmlspecialchars(stripslashes($user[$key])));
423431
}
424432
}
425433
}
@@ -485,11 +493,11 @@
485493
}
486494

487495
if ($access != 'view') {
488-
$userdetailsHTML .= '<tr><td colspan="2" class="bgwhite"><input class="submit" type="submit" name="change" value="'.$GLOBALS['I18N']->get('Save Changes').'" /></td></tr>';
496+
$userdetailsHTML .= '<tr><td colspan="2" class="bgwhite"><input class="submit" type="submit" name="change" value="'.s('Save Changes').'" /></td></tr>';
489497
}
490498
$userdetailsHTML .= '</table>';
491499

492-
$mailinglistsHTML .= '<h3>'.$GLOBALS['I18N']->get('Mailinglist membership').':</h3>';
500+
$mailinglistsHTML .= '<h3>'.s('Mailinglist membership').':</h3>';
493501
// a dummy entry, to make the array show up in POST even if all checkboxes are unchecked
494502
$mailinglistsHTML .= '<input type="hidden" name="subscribe[]" value="-1" />';
495503
$mailinglistsHTML .= '<table class="userListing" border="1"><tr>';
@@ -512,15 +520,15 @@
512520
}
513521
$mailinglistsHTML .= '</tr>';
514522
if ($access != 'view') {
515-
$mailinglistsHTML .= '<tr><td class="bgwhite"><input class="submit" type="submit" name="change" value="'.$GLOBALS['I18N']->get('Save Changes').'" /></td></tr>';
523+
$mailinglistsHTML .= '<tr><td class="bgwhite"><input class="submit" type="submit" name="change" value="'.s('Save Changes').'" /></td></tr>';
516524
}
517525

518526
$mailinglistsHTML .= '</table>';
519527

520528
echo '<div class="tabbed">';
521529
echo '<ul>';
522-
echo '<li><a href="#details">'.ucfirst($GLOBALS['I18N']->get('Details')).'</a></li>';
523-
echo '<li><a href="#lists">'.ucfirst($GLOBALS['I18N']->get('Lists')).'</a></li>';
530+
echo '<li><a href="#details">'.ucfirst(s('Details')).'</a></li>';
531+
echo '<li><a href="#lists">'.ucfirst(s('Lists')).'</a></li>';
524532

525533
echo '</ul>';
526534

0 commit comments

Comments
 (0)