Пример #1
0
function wrap_layout($template)
{
    if ($template) {
        $template = realpath($template);
        if (!file_exists($template)) {
            trigger_error('Could not locate layout: (' . $template . ')', E_USER_ERROR);
            return false;
        }
        view_set('layout', $template);
        if (!in_array('layout_capture_content', ob_list_handlers())) {
            ob_start('layout_capture_content');
            register_shutdown_function('render_layout');
        }
    } else {
        // clear all pre-existing layout handling
        while (ob_list_handlers()) {
            @ob_get_clean();
        }
        view_set('layout', $template);
        view_set('content', '');
        ob_start();
        //echo "hi patrick [$template]"; global $mf_view; print_r($mf_view);
    }
    return true;
}
Пример #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');
}
Пример #3
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');
    }
}
Пример #4
0
                return $title;
            }
        }
    }
    // try again with the referer param, if it exists
    $uri = parse_url($uri);
    $params = array();
    if (array_key_exists('query', $uri)) {
        parse_str($uri['query'], $params);
    }
    if (isset($params['referer']) && $params['referer'] != '') {
        return admin_find_title($menu, $params['referer']);
    }
    return false;
}
view_set('title', get_configured_title());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"  dir="ltr" lang="en-US">
  <head>
    <title><?php 
echo view('title');
?>
</title>
    <script type="text/javascript" src="<?php 
echo config('greenroom_path')->url;
?>
/vendor/jquery-1.4.2.min.js"></script>
    
    <link rel="stylesheet" href="<?php 
echo config('greenroom_path')->url;
Пример #5
0
foreach (array_keys($cfg['sql']['create']) as $table) {
    if (!in_array($table, $tables)) {
        $res = $db->query($cfg['sql']['create'][$table]);
        if (PEAR::isError($res)) {
            error($res->toString());
        }
    }
}
# Start session handling, check for cookie-support
session_start();
cookie_check();
# Setup user perspective
auth_check();
# Set the selected view for displaying (if any)
if (isset($_GET['view'])) {
    view_set($_GET['view']);
}
# Force the default theme, if no theme selected by user
if (!isset($_SESSION['theme'])) {
    $_SESSION['theme'] = $cfg["site"]["theme"];
}
#-------------------------------------------------------------------------------
# Start HTML
html_header($cfg['site']['name'], $cfg["dir"]["themes"] . '/' . $_SESSION["theme"] . '.css', $cfg["dir"]["themes"] . '/' . $_SESSION["theme"] . '-ie.css', $cfg['dir']['scripts'] . '/global.js', 'index');
# Display welcome message if user is logged in
if (auth_logged_in()) {
    echo "<div id=\"welcome\">\n";
    echo "Welcome, <a href=\"index.php?view=login&amp;task=profile\">{$_SESSION['handle']}</a>";
    if ($cfg['score']['show_rating']) {
        echo " ({$_SESSION['rating']})";
    }