1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 21:57:51 +02:00

admin news comments were displaying in reverse. added 'reverse=1' read/write parm to admin-ui.

This commit is contained in:
CaMer0n
2012-08-02 23:37:20 +00:00
parent bf450949db
commit 1601a07bba
3 changed files with 22 additions and 5 deletions

View File

@@ -315,7 +315,7 @@ class news_admin_ui extends e_admin_ui
'news_class' => array('title' => NWSLAN_22, 'type' => 'userclasses', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'batch'=>true, 'filter'=>true),
'news_render_type' => array('title' => LAN_NEWS_49, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'thclass' => 'center', 'class' => null, 'nosort' => false, 'batch'=>true, 'filter'=>true),
'news_sticky' => array('title' => LAN_NEWS_28, 'type' => 'boolean', 'width' => 'auto', 'thclass' => 'center', 'class' => 'center', 'nosort' => false, 'batch'=>true, 'filter'=>true),
'news_allow_comments' => array('title' => NWSLAN_15, 'type' => 'boolean', 'width' => 'auto', 'thclass' => 'center', 'class' => 'center', 'nosort' => false),
'news_allow_comments' => array('title' => NWSLAN_15, 'type' => 'boolean', 'width' => 'auto', 'thclass' => 'center', 'class' => 'center', 'nosort' => false,'batch'=>true, 'filter'=>true,'readParms'=>'reverse=1','writeParms'=>'reverse=1'),
'news_comment_total' => array('title' => LAN_NEWS_60, 'type' => 'number', 'width' => '10%', 'thclass' => '', 'class' => null, 'nosort' => false),
'options' => array('title' => LAN_OPTIONS, 'type' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center', 'nosort' => true, 'forced' => TRUE)

View File

@@ -4614,8 +4614,17 @@ class e_admin_form_ui extends e_form
{
case 'bool':
case 'boolean': //TODO modify description based on $val['parm]
$option['bool__'.$key.'__1'] = LAN_YES;
$option['bool__'.$key.'__0'] = LAN_NO;
if(vartrue($parms['reverse'])) // reverse true/false values;
{
$option['bool__'.$key.'__0'] = LAN_YES; // see newspost.php : news_allow_comments for an example.
$option['bool__'.$key.'__1'] = LAN_NO;
}
else
{
$option['bool__'.$key.'__1'] = LAN_YES;
$option['bool__'.$key.'__0'] = LAN_NO;
}
if($type == 'batch')
{
$option['boolreverse__'.$key] = LAN_BOOL_REVERSE;

View File

@@ -1921,7 +1921,15 @@ class e_form
case 'bool':
case 'boolean':
$false = vartrue($parms['trueonly']) ? "" : ADMIN_FALSE_ICON;
$value = $value ? ADMIN_TRUE_ICON : $false;
if(vartrue($parms['reverse']))
{
$value = ($value) ? $false : ADMIN_TRUE_ICON;
}
else
{
$value = $value ? ADMIN_TRUE_ICON : $false;
}
break;
case 'url':
@@ -2223,7 +2231,7 @@ class e_form
$lenabled = vartrue($parms['enabled'], 'LAN_ENABLED');
$ldisabled = vartrue($parms['disabled'], 'LAN_DISABLED');
unset($parms['enabled'], $parms['disabled']);
$ret = $this->radio_switch($key, $value, defset($lenabled, $lenabled), defset($ldisabled, $ldisabled));
$ret = $this->radio_switch($key, $value, defset($lenabled, $lenabled), defset($ldisabled, $ldisabled),$parms);
break;
case 'method': // Custom Function