function bulletin_init()
{
    nav_add('Bulletin', 'Announcements', 'bulletin', 'announce');
    nav_add('Bulletin', 'Shoutbox', 'bulletin', 'public');
    nav_add('Bulletin', 'Analysis', 'bulletin', 'analysis');
    if (auth_user_in_group('Administrators')) {
        nav_add('Bulletin', 'Admin Chat', 'bulletin', 'admin');
    }
}
示例#2
0
function admin_init()
{
    view_set('admin');
    nav_add('Administration', 'Contests', 'admin', 'contests');
    nav_add('Administration', 'Users', 'admin', 'users');
    nav_add('Administration', 'Groups', 'admin', 'groups');
    nav_add('Administration', 'Views', 'admin', 'views');
    nav_add('Administration', 'Shell', 'admin', 'shell');
    nav_add('Administration', 'Uploader', 'admin', 'uploader');
}
function manage_init()
{
    global $db, $cfg;
    $res =& db_query('contests_by_manager', $_SESSION['user_id']);
    // Add menu links for all contests managed by current user
    while ($res->fetchInto($row)) {
        $name = 'Manage <i>' . $row['name'] . '</i> contest';
        nav_add($name, 'Status', 'manage', 'status', '&amp;id=' . $row['contest_id']);
        nav_add($name, 'Problems', 'manage', 'problems', '&amp;id=' . $row['contest_id']);
        nav_add($name, 'Settings', 'manage', 'settings', '&amp;id=' . $row['contest_id']);
        nav_add($name, 'Submissions', 'manage', 'submissions', '&amp;id=' . $row['contest_id']);
    }
}
示例#4
0
function login_init()
{
    view_set('login');
    // attempt to make this the default view
    if (auth_logged_in()) {
        nav_add('Account', 'Profile', 'login', 'profile');
        nav_add('Account', 'Logout', 'login', 'logout');
    } else {
        nav_add('Account', 'Login', 'login', 'login');
        nav_add('Account', 'Register', 'login', 'register');
        nav_add('Account', 'Forgot Password', 'login', 'forgot');
    }
}
function statistics_init() {
    global $db, $cfg;
    nav_add('Rankings', 'Members', 'statistics', 'overall');

	$current = false;
    $res =& db_query('running_contests_list');
    while ($res->fetchInto($row)) {
        nav_add('Rankings', '<b>'.$row['name'].'</b>', 'statistics', 'contest', '&amp;id='.$row['contest_id']);
        $current = true;
    }

    $res =& db_query('past_contests_list');
    # Add menu links for all upcoming & current contests
    while ($res->fetchInto($row)) {
    	if ($current == false) {
	        nav_add('Rankings', '<b>'.$row['name'].'</b>', 'statistics', 'contest', '&amp;id='.$row['contest_id']);
	        $current = true;
        } else {    	
    	    nav_add('Rankings', $row['name'], 'statistics', 'contest', '&amp;id='.$row['contest_id']);
        }
    }
}