Exemplo n.º 1
0
function ForumPermTable($fid, $fpl = array())
{
    global $permCats, $permDescs;
    if (!$fid) {
        echo '
			<tr class="header0">
				<th colspan="2">' . __('Add permission set') . '</th>
			</tr>
			<tr>
				<td class="cell2 center">Forum</td>
				<td class="cell1">' . makeForumList('newforumid', 0) . '</td>
			</tr>
			<tr class="header0">
				<th colspan="2" style="height:6px;"></th>
			</tr>';
    } else {
        echo '
			<tr class="header0">
				<th colspan="2">' . htmlspecialchars($fpl['_ftitle']) . '</th>
			</tr>';
        unset($fpl['_ftitle']);
    }
    $lastcat = -1;
    $pd = array('forum' => $permDescs['forum'], 'mod' => $permDescs['mod']);
    foreach ($pd as $cat => $perms) {
        if ($lastcat != $cat) {
            if ($lastcat != -1) {
                echo '
			<tr class="header0">
				<th colspan="2" style="height:6px;"></th>
			</tr>';
            }
            $lastcat = $cat;
        }
        foreach ($perms as $permid => $permname) {
            $pkey = 'fperm_' . $fid . '_' . str_replace('.', '_', $permid);
            echo '
			<tr>
				<td class="cell2 center" style="width: 250px;">' . htmlspecialchars($permname) . '</td>
				<td class="cell1">' . (CanEditPerm($permid, $fid) ? PermSwitch($pkey, true, $fpl[$permid]) : PermLabel($fpl[$permid])) . '</td>
			</tr>';
        }
    }
    if (!$fid) {
        echo '
			<tr class="header0">
				<th colspan="2" style="height:6px;"></th>
			</tr>
			<tr>
				<td class="cell2">&nbsp;</td>
				<td class="cell1"><input type="submit" name="addfpermaction" value="' . __('Add permissions') . '"></td>
			</tr>';
    }
}
function ForumPermTable($gid, $fpl = array())
{
    global $permCats, $permDescs, $id;
    echo '
		<tr class="header0">
			<th colspan="2"><span' . ($fpl['_gcolor'] ? ' style="color: ' . $fpl['_gcolor'] . ';"' : '') . '>' . htmlspecialchars($fpl['_gname']) . '</span></th>
		</tr>';
    unset($fpl['_gname']);
    unset($fpl['_gcolor']);
    $lastcat = -1;
    $pd = array('forum' => $permDescs['forum'], 'mod' => $permDescs['mod']);
    foreach ($pd as $cat => $perms) {
        if ($lastcat != $cat) {
            if ($lastcat != -1) {
                echo '
			<tr class="header0">
				<th colspan="2" style="height:6px;"></th>
			</tr>';
            }
            $lastcat = $cat;
        }
        foreach ($perms as $permid => $permname) {
            $pkey = 'fperm_' . $gid . '_' . str_replace('.', '_', $permid);
            echo '
			<tr>
				<td class="cell2 center" style="width: 250px;">' . htmlspecialchars($permname) . '</td>
				<td class="cell1">' . (CanEditPerm($permid, $id) ? PermSwitch($pkey, $fpl[$permid]) : PermLabel($fpl[$permid])) . '</td>
			</tr>';
        }
    }
}