1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Userclasses admin - fix a couple of things broken by other changes

This commit is contained in:
e107steved
2009-02-01 15:18:30 +00:00
parent 297d4c7212
commit 66f7b472bf
2 changed files with 37 additions and 27 deletions

View File

@@ -9,9 +9,9 @@
* Administration Area - User classes
*
* $Source: /cvs_backup/e107_0.8/e107_admin/userclass2.php,v $
* $Revision: 1.20 $
* $Date: 2009-01-18 19:02:07 $
* $Author: secretr $
* $Revision: 1.21 $
* $Date: 2009-02-01 15:18:30 $
* $Author: e107steved $
*
*/
@@ -437,7 +437,7 @@ switch ($action)
<tr id='userclass_type_standard' ".(UC_TYPE_GROUP == $userclass_type ? " style='display:none'" : "").">
<td class='forumheader3'>".UCSLAN_24."</td>
<td class='forumheader3'>";
$text .= "<select name='userclass_editclass' class='tbox'>".$e_userclass->vetted_tree('userclass_editclass',array($e_userclass,'select'), $userclass_editclass,"nobody,public,main,admin,classes,matchclass,member").'</select>';
$text .= "<select name='userclass_editclass' class='tbox'>".$e_userclass->vetted_tree('userclass_editclass',array($e_userclass,'select'), $userclass_editclass,'nobody,public,main,admin,classes,matchclass,member').'</select>';
$text .= "</td>
<td class='forumheader3'>".UCSLAN_32."</td>
</tr>
@@ -459,7 +459,7 @@ switch ($action)
<tr>
<td class='forumheader3'>".UCSLAN_34."</td>
<td class='forumheader3'>";
$text .= "<select name='userclass_visibility' class='tbox'>".$e_userclass->vetted_tree('userclass_visibility',array($e_userclass,'select'), $userclass_visibility,"main,admin,classes,matchclass,public,member,nobody").'</select>';
$text .= "<select name='userclass_visibility' class='tbox'>".$e_userclass->vetted_tree('userclass_visibility',array($e_userclass,'select'), $userclass_visibility,'main,admin,classes,matchclass,public,member,nobody').'</select>';
$text .= "</td>
<td class='forumheader3'>".UCSLAN_33."</td>
</tr>
@@ -469,7 +469,7 @@ switch ($action)
<tr>
<td class='forumheader3'>".UCSLAN_35."</td>
<td class='forumheader3'>";
$text .= "<select name='userclass_parent' class='tbox'>".$e_userclass->vetted_tree('userclass_parent',array($e_userclass,'select'), $userclass_parent,"main,admin,nobody,classes,matchclass,member").'</select>';
$text .= "<select name='userclass_parent' class='tbox'>".$e_userclass->vetted_tree('userclass_parent',array($e_userclass,'select'), $userclass_parent,'main,admin,nobody,classes,matchclass,member').'</select>';
// .r_userclass("userclass_parent", $userclass_parent, "off", "admin,classes,matchclass,public,member").
$text .= "</td>
<td class='forumheader3'>".UCSLAN_36."</td>

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/userclass_class.php,v $
| $Revision: 1.30 $
| $Date: 2009-01-20 22:37:49 $
| $Author: secretr $
| $Revision: 1.31 $
| $Date: 2009-02-01 15:18:30 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -121,7 +121,8 @@ class user_class
// Add in any fixed classes that aren't already defined
foreach ($this->fixed_classes as $c => $d)
{
if (!isset($this->class_tree[$c]) && ($c != e_UC_PUBLIC))
// if (!isset($this->class_tree[$c]) && ($c != e_UC_PUBLIC))
if (!isset($this->class_tree[$c]))
{
switch ($c)
{
@@ -151,16 +152,23 @@ class user_class
}
// Now build the tree
// Now build the tree.
// There are just two top-level classes - 'Everybody' and 'Nobody'
$this->class_parents[e_UC_PUBLIC] = e_UC_PUBLIC;
$this->class_parents[e_UC_NOBODY] = e_UC_NOBODY;
foreach ($this->class_tree as $uc)
{
/*
if ($uc['userclass_parent'] == e_UC_PUBLIC)
{ // Note parent (top level) classes
$this->class_parents[$uc['userclass_id']] = $uc['userclass_id'];
}
else
*/
if (($uc['userclass_id'] != e_UC_PUBLIC) && ($uc['userclass_id'] != e_UC_NOBODY))
{
if (!array_key_exists($uc['userclass_parent'],$this->class_tree))
// if (!array_key_exists($uc['userclass_parent'],$this->class_tree))
if (!isset($this->class_tree[$uc['userclass_parent']]))
{
echo "Orphaned class record: ID=".$uc['userclass_id']." Name=".$uc['userclass_name']." Parent=".$uc['userclass_parent']."<br />";
}
@@ -526,6 +534,7 @@ class user_class
function select($treename, $classnum, $current_value, $nest_level)
{
if ($classnum == e_UC_BLANK) return "<option value=''>&nbsp;</option>\n";
// echo "Display: {$classnum}, {$current_value}, {$nest_level}<br />";
$tmp = explode(',',$current_value);
$sel = in_array($classnum,$tmp) ? " selected='selected'" : '';
if ($nest_level == 0)
@@ -559,7 +568,6 @@ class user_class
}
else
{
// $style = " style='text-indent:".(12*$nest_level)."px'";
$style = " style='text-indent:".(1.2*$nest_level)."em'";
}
return "<div {$style}><input type='checkbox' class='checkbox' name='{$treename}[]' id='{$treename}_{$classnum}' value='{$classnum}'{$chk} />".$this->class_tree[$classnum]['userclass_name']."</div>\n";
@@ -1061,10 +1069,12 @@ class user_class_admin extends user_class
{
$this->graph_debug = $show_debug;
$indent_images = array();
$ret = "<div class='uclass_tree' style='height:16px'>
<img src='".UC_ICON_DIR."topicon.png' alt='class icon' style='vertical-align: bottom' />
<span style='top:3px'>".UC_LAN_0."</span>
</div>"; // 'Everyone' link
<span style='top:3px'></span>
</div>"; // Just a generic icon here to provide a visual anchor
$num_parents = count($this->class_parents);
foreach ($this->class_parents as $p)
{