1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-20 12:41:51 +02:00

Don't display userclass batch options unless userclasses have been defined.

This commit is contained in:
CaMer0n 2009-11-23 01:17:29 +00:00
parent 89b6c2dc33
commit 70fa5dbb71
2 changed files with 41 additions and 23 deletions

View File

@ -9,8 +9,8 @@
* Administration Area - User classes
*
* $Source: /cvs_backup/e107_0.8/e107_admin/userclass2.php,v $
* $Revision: 1.34 $
* $Date: 2009-11-18 01:04:26 $
* $Revision: 1.35 $
* $Date: 2009-11-23 01:17:29 $
* $Author: e107coders $
*
*/
@ -330,7 +330,8 @@ class uclassFrm extends e_form
if(!e_QUERY || $action == 'list')
{
$ns->tablerender(UCSLAN_21, $emessage->render(). $uc->show_existing());
$uc->show_existing();
}
if(varset($_GET['id']) && varset($_GET['action'])=='edit')
{
@ -891,10 +892,15 @@ class uclass_manager
$tp = e107::getParser();
$sql = e107::getDb();
$frm = new uclassFrm;
$ns = e107::getRender();
if (!$total = $sql->db_Select('userclass_classes', '*'))
{
$text .= UCSLAN_7;
$text = "";
$mes = e107::getMessage();
$mes->add(UCSLAN_7, E_MESSAGE_INFO);
}
else
{
@ -912,11 +918,11 @@ class uclass_manager
{
$text .= $frm->renderTableRow($this->fields, $this->fieldpref, $row, 'userclass_id');
}
$text .= "</tbody></table></fieldset></form>";
}
$text .= "</tbody></table></fieldset></form>";
return $text;
$ns->tablerender(UCSLAN_21, $mes->render().$text );
}
}

View File

@ -10,8 +10,8 @@
* Administration Area - Users
*
* $Source: /cvs_backup/e107_0.8/e107_admin/users.php,v $
* $Revision: 1.70 $
* $Date: 2009-11-22 14:10:06 $
* $Revision: 1.71 $
* $Date: 2009-11-23 01:17:29 $
* $Author: e107coders $
*
*/
@ -1045,7 +1045,7 @@ class users
{
$uqry[e_UC_ADMIN] = " u.user_admin = 1 ";
$uqry[e_UC_MEMBER] = " u.user_ban = '0' ";
$uqry[e_UC_MAINADMIN] = " u.user_perms = '0' ";
$uqry[e_UC_MAINADMIN] = " (u.user_perms = '0' OR u.user_perms = '0.') ";
$uqry['unverified'] = " u.user_ban = 2 ";
$uqry['banned'] = " u.user_ban = 1 ";
$uqry['bounced'] = " u.user_ban = 3 ";
@ -1249,18 +1249,30 @@ class users
$removeClasses = $assignClasses; // Userclass list of userclasses that can be removed
$removeClasses[0] = array('userclass_name'=>array('userclass_id'=>0, 'userclass_name'=>USRLAN_220));
return $frm->batchoptions(
array(
'ban_selected' =>USRLAN_30,
'unban_selected' =>USRLAN_33,
'activate_selected' =>USRLAN_32,
'delete_selected' =>LAN_DELETE
),
array(
'userclass' =>array('Assign Userclass...',$assignClasses),
'remuserclass' =>array('Remove Userclass..', $removeClasses)
)
);
if(count($assignClasses))
{
$uclasses = array(
'userclass' =>array('Assign Userclass...',$assignClasses),
'remuserclass' =>array('Remove Userclass..', $removeClasses)
);
}
else
{
$uclasses = FALSE;
}
return $frm->batchoptions(
array(
'ban_selected' =>USRLAN_30,
'unban_selected' =>USRLAN_33,
'activate_selected' =>USRLAN_32,
'delete_selected' =>LAN_DELETE
),$uclasses
);
}