예제 #1
0
function dispManageTable($arrBoards, $indent = 0)
{
    global $mysqli, $MAIN_ROOT, $THEME, $cID;
    $boardObj = new ForumBoard($mysqli);
    $counter = 0;
    $x = 0;
    foreach ($arrBoards as $boardID) {
        $boardObj->select($boardID);
        $boardInfo = $boardObj->get_info_filtered();
        $dispUpArrow = "<a href='javascript:void(0)' onclick=\"moveBoard('up', '" . $boardInfo['forumboard_id'] . "')\"><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/uparrow.png' width='24' height='24' title='Move Up'></a>";
        $dispDownArrow = "<a href='javascript:void(0)' onclick=\"moveBoard('down', '" . $boardInfo['forumboard_id'] . "')\"><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/downarrow.png' width='24' height='24' title='Move Down'></a>";
        if ($x == 0) {
            $dispUpArrow = "<img src='" . $MAIN_ROOT . "images/transparent.png' width='24' height='24'>";
        }
        if ($boardObj->getHighestSortNum() == $boardInfo['sortnum']) {
            $dispDownArrow = "<img src='" . $MAIN_ROOT . "images/transparent.png' width='24' height='24'>";
        }
        if ($counter == 1) {
            $addCSS = " alternateBGColor";
            $counter = 0;
        } else {
            $addCSS = "";
            $counter = 1;
        }
        echo "\n\t\t\t<tr>\n\t\t\t\t<td class='dottedLine main" . $addCSS . "' style='width: 76%; padding-left: 10px'>" . str_repeat("&nbsp;&nbsp;", $indent) . "<b><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "&bID=" . $boardInfo['forumboard_id'] . "&action=edit'>" . $boardInfo['name'] . "</a></b></td>\n\t\t\t\t<td class='dottedLine main" . $addCSS . "' style='width: 6%' align='center'>" . $dispUpArrow . "</td>\n\t\t\t\t<td class='dottedLine main" . $addCSS . "' style='width: 6%' align='center'>" . $dispDownArrow . "</td>\n\t\t\t\t<td class='dottedLine main" . $addCSS . "' style='width: 6%' align='center'><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "&bID=" . $boardInfo['forumboard_id'] . "&action=edit'><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/edit.png' width='24' height='24' title='Edit Board'></a></td>\n\t\t\t\t<td class='dottedLine main" . $addCSS . "' style='width: 6%' align='center'><a href='javascript:void(0)' onclick=\"deleteBoard('" . $boardInfo['forumboard_id'] . "')\"><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/delete.png' width='24' height='24' title='Delete Board'></a></td>\n\t\t\t</tr>\n\t\t";
        $x++;
        $arrSubForums = $boardObj->getSubForums();
        if (count($arrSubForums) > 0) {
            dispManageTable($arrSubForums, $indent + 1);
        }
    }
}