Example #1
0
function draw_header($pageTitle, $lastmessage = '')
{
    global $pdo;
    $uid = isset($_SESSION['uid']) ? $_SESSION['uid'] : '';
    // Is the uid set?
    if ($uid != null) {
        $current_user_obj = new User($uid, $pdo);
        $GLOBALS['smarty']->assign('userName', $current_user_obj->getName());
        $GLOBALS['smarty']->assign('can_add', $current_user_obj->can_add);
        $GLOBALS['smarty']->assign('can_checkin', $current_user_obj->can_checkin);
    }
    // Are they an Admin?
    if ($uid != null && $current_user_obj->isAdmin()) {
        $GLOBALS['smarty']->assign('isadmin', 'yes');
    }
    if (!isset($_REQUEST['state'])) {
        $_REQUEST['state'] = 1;
    }
    $lastmessage = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : $lastmessage;
    // Set up the breadcrumbs
    $crumb = new crumb();
    $crumb->addCrumb(e::h($_REQUEST['state']), e::h($pageTitle), e::h($_SERVER['PHP_SELF']) . '?' . e::h($_SERVER['QUERY_STRING']));
    $breadCrumb = $crumb->printTrail(e::h($_REQUEST['state']));
    $GLOBALS['smarty']->assign('breadCrumb', $breadCrumb);
    $GLOBALS['smarty']->assign('site_title', $GLOBALS['CONFIG']['title']);
    $GLOBALS['smarty']->assign('base_url', $GLOBALS['CONFIG']['base_url']);
    $GLOBALS['smarty']->assign('page_title', $pageTitle);
    $GLOBALS['smarty']->assign('lastmessage', urldecode($lastmessage));
    display_smarty_template('header.tpl');
}
Example #2
0
function draw_header($pageTitle, $lastmessage = '')
{
    $uid = isset($_SESSION['uid']) ? $_SESSION['uid'] : '';
    // Is the uid set?
    if ($uid != NULL) {
        $current_user_obj = new User($uid, $GLOBALS['connection'], DB_NAME);
        $GLOBALS['smarty']->assign('userName', $current_user_obj->getName());
        $GLOBALS['smarty']->assign('can_add', $current_user_obj->can_add);
        $GLOBALS['smarty']->assign('can_checkin', $current_user_obj->can_checkin);
    }
    // Are they an Admin?
    if ($uid != NULL && $current_user_obj->isAdmin()) {
        $GLOBALS['smarty']->assign('isadmin', 'yes');
    }
    if (!isset($_REQUEST['state'])) {
        $_REQUEST['state'] = 1;
    }
    $lastmessage = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : $lastmessage;
    // Set up the breadcrumbs
    $crumb = new crumb();
    $crumb->addCrumb($_REQUEST['state'], $pageTitle, $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']);
    $breadCrumb = $crumb->printTrail($_REQUEST['state']);
    $GLOBALS['smarty']->assign('breadCrumb', $breadCrumb);
    $GLOBALS['smarty']->assign('site_title', $GLOBALS['CONFIG']['title']);
    $GLOBALS['smarty']->assign('base_url', $GLOBALS['CONFIG']['base_url']);
    $GLOBALS['smarty']->assign('page_title', $pageTitle);
    $GLOBALS['smarty']->assign('lastmessage', $lastmessage);
    display_smarty_template('header.tpl');
    if (is_dir('install')) {
        echo '<span style="color: red;">' . msg('install_folder') . '</span>';
    }
}