Cleaned config page
This commit is contained in:
parent
62e97732e8
commit
02e990979a
17
mod.php
17
mod.php
@ -100,15 +100,24 @@
|
|||||||
$data = '';
|
$data = '';
|
||||||
foreach($constants as $name => $value) {
|
foreach($constants as $name => $value) {
|
||||||
if(MOD_NEVER_REAL_PASSWORD && $name == 'MY_PASSWORD')
|
if(MOD_NEVER_REAL_PASSWORD && $name == 'MY_PASSWORD')
|
||||||
$value = '********';
|
$value = '<em>hidden</em>';
|
||||||
else {
|
else {
|
||||||
// For some reason PHP is only giving me the first defined value (the default), so use constant()
|
// For some reason PHP is only giving me the first defined value (the default), so use constant()
|
||||||
$value = constant($name);
|
$value = constant($name);
|
||||||
if(gettype($value) == 'boolean') {
|
if(gettype($value) == 'boolean') {
|
||||||
$value = $value ? '<span style="color:green;">On</span>' : '<span style="color:red;">Off</span>';
|
$value = $value ? '<span style="color:green;">On</span>' : '<span style="color:red;">Off</span>';
|
||||||
} elseif(gettype($value) == 'string') {
|
} elseif(gettype($value) == 'string') {
|
||||||
$value = '<span style="color:maroon;">' . utf8tohtml($value) . '</span>';
|
$value = '<span style="color:maroon;">' . utf8tohtml(substr($value, 0, 110) . (strlen($value) > 110 ? '…' : '')) . '</span>';
|
||||||
} elseif(gettype($value) == 'integer') {
|
} elseif(gettype($value) == 'integer') {
|
||||||
|
// Show permissions in a cleaner way
|
||||||
|
if(preg_match('/^MOD_/', $name) && $name != 'MOD_JANITOR' && $name != 'MOD_MOD' && $name != 'MOD_ADMIN') {
|
||||||
|
if($value == MOD_JANITOR)
|
||||||
|
$value = 'Janitor';
|
||||||
|
elseif($value == MOD_MOD)
|
||||||
|
$value = 'Mod';
|
||||||
|
elseif($value == MOD_ADMIN)
|
||||||
|
$value = 'Admin';
|
||||||
|
}
|
||||||
$value = '<span style="color:black;">' . $value . '</span>';
|
$value = '<span style="color:black;">' . $value . '</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -117,9 +126,7 @@
|
|||||||
'<tr><th style="text-align:left;">' .
|
'<tr><th style="text-align:left;">' .
|
||||||
$name .
|
$name .
|
||||||
'</th><td>' .
|
'</th><td>' .
|
||||||
substr($value, 0, 120) .
|
$value .
|
||||||
'' .
|
|
||||||
(strlen($value) > 120 ? '…' : '') .
|
|
||||||
'</td></tr>';
|
'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user