Skip to content

Commit 4fd2863

Browse files
bramleysuelaP
authored andcommitted
Use the standard processing to format some datetime values.
1 parent b08ffe7 commit 4fd2863

File tree

3 files changed

+30
-19
lines changed

3 files changed

+30
-19
lines changed

public_html/lists/admin/admin.php

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,11 @@
180180
list($a, $b) = explode(':', $val[1]);
181181
}
182182
if ($a == 'sys') {
183-
if ($b == 'Privileges') { //# this whole thing of using structure is getting silly, @@TODO rewrite without
184-
} else {
185-
//If key is 'password' and the passwords are encrypted, locate two radio buttons to allow an update.
186-
if ($b == 'Password') {
183+
switch ($b) {
184+
case 'Privileges':
185+
break;
186+
case 'Password':
187+
//If key is 'password' and the passwords are encrypted, locate two radio buttons to allow an update.
187188
$changeAdminPass = !empty($_SESSION['firstinstall']);
188189
if ($addAdmin===true){
189190

@@ -233,16 +234,26 @@
233234
s('Update it?'),
234235
$checkYes, s('Yes'), $checkNo, s('No'));
235236
}
236-
} else {
237-
if ($b != 'Password') {
238-
if ($addAdmin !==true) {
239-
printf('<tr><td>%s</td><td>%s</td></tr>', s($b), $data[$key]);
240-
}
241-
} else {
242-
printf('<tr><td>%s</td><td><input type="text" name="%s" value="%s" size="30" /></td></tr>'."\n",
243-
s('Password'), $key, stripslashes($data[$key]));
237+
break;
238+
default:
239+
if ($addAdmin) {
240+
break;
244241
}
245-
}
242+
243+
switch ($key) {
244+
case 'created':
245+
$value = formatDateTime($data[$key]);
246+
break;
247+
case 'modified':
248+
$value = formatDateTime($data[$key]);
249+
break;
250+
case 'passwordchanged':
251+
$value = formatDate($data[$key]);
252+
break;
253+
default:
254+
$value = $data[$key];
255+
}
256+
printf('<tr><td>%s</td><td>%s</td></tr>', s($b), $value);
246257
}
247258
} elseif ($key == 'loginname' && $data[$key] == 'admin') {
248259
printf('<tr><td>'.s('Login Name').'</td><td>admin</td>');

public_html/lists/admin/plugins.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,17 @@
171171
Info(s('PHP has no <a href="http://php.net/zip">Zip capability</a>. This is required to allow installation from a remote URL'));
172172
} else {
173173
echo '<h3>'.s('Install a new plugin').'</h3>';
174-
echo '<div class="jumbotron col-sm-12">';
174+
echo '<div class="jumbotron col-sm-12">';
175175
echo '<div class="col-sm-3 col-md-3 col-lg-3 row"><a class="resourceslink btn btn-info" href="http://resources.phplist.com/plugins/" title="'.s('Find plugins').'" target="_blank">'.s('Find plugins').'</a></div><div class="clearfix visible-xs visible-md"></div><br class="visible-xs visible-md" />';
176176
echo formStart('class="form-horizontal"');
177177
echo '<fieldset class="col-sm-9 col-md-9 col-lg-9 input-group">
178178
<label for="pluginurl" class="pull-left control-label">' .s('Plugin package URL').'</label>
179-
<div class="clearfix visible-xs visible-md"></div>
179+
<div class="clearfix visible-xs visible-md"></div>
180180
<div type="field" class="pull-left col-lg-7 col-md-9 input-group"><input type="text" id="pluginurl" name="pluginurl" /></div>
181181
<button type="submit" name="download">' .s('Install plugin').'</button>
182182
</fieldset>';
183-
echo '</form>';
184-
echo '</div>';
183+
echo '</form>';
184+
echo '</div>';
185185
}
186186

187187
$ls = new WebblerListing(s('Installed plugins'));
@@ -277,7 +277,7 @@
277277
if (!empty($pluginDetails['installDate'])) {
278278
// $ls->addColumn($pluginname,s('installed'),date('Y-m-d',$pluginDetails['installDate']));
279279
$details .= '<div class="detail"><span class="label">'.s('installed').'</span>';
280-
$details .= '<span class="value">'.date('Y-m-d', $pluginDetails['installDate']).'</span></div>';
280+
$details .= '<span class="value">'.formatDateTime(date('Y-m-d', $pluginDetails['installDate'])).'</span></div>';
281281
}
282282
if (!empty($pluginDetails['installUrl'])) {
283283
// $ls->addRow($pluginname,s('installation Url'),$pluginDetails['installUrl']);

public_html/lists/admin/send.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
$ls->addElement($element, PageUrl2('send&amp;id='.$row['id']));
110110
$ls->setClass($element, 'row1');
111111
// $ls->addColumn($element,$I18N->get('edit'),PageLink2('send&amp;id='.$row['id'],$I18N->get('edit')));
112-
$ls->addColumn($element, $I18N->get('entered'), $row['entered']);
112+
$ls->addColumn($element, $I18N->get('entered'), formatDateTime($row['entered']));
113113
$ls->addColumn($element, $I18N->get('age'), secs2time($row['age']));
114114
$ls->addRow($element, '',
115115
'<a class="del" href="'.PageUrl2('send&amp;delete='.$row['id']).'" title="'.$I18N->get('del').'">'.$I18N->get('del').'</a>');

0 commit comments

Comments
 (0)