示例#1
0
function get_smarty() {
    $smarty = new Smarty();

    $p = new SiteParse();

    # Basic info we need in templatse
    $smarty->assign("baseurl", $p->base_url);
    $smarty->assign("catalogname", $p->catalog_name);
    $smarty->assign("catalogurl", $p->catalog_url);
    $smarty->assign("feedback_email", $p->feedback_email);
    $smarty->assign("scoping", $p->scoping);
    $smarty->assign("scopes", $p->scopes);
    $smarty->assign("def_scope", $p->def_scope);

    # Does the catalog use PIN numbers
    $smarty->assign("uses_pin", $p->uses_pin);

    # Last email address used to send a record
    $smarty->assign('saved_email',  ar_get('email', $_SESSION));

    # Last text message info used to send a record
    $smarty->assign('saved_text',   ar_get('text', $_SESSION));
    $smarty->assign('saved_domain', ar_get('domain', $_SESSION));
    
    # User login info
    $smarty->assign('saved_name', ar_get('name', $_SESSION));
    $smarty->assign('saved_code', ar_get('code', $_SESSION));
    $smarty->assign('saved_pin', ar_get('code', $_SESSION));
    $smarty->assign('saved_userid', ar_get('userid', $_SESSION));

    $smarty->assign('js', use_js());

    # How many records have we saved on our device list?
    if (($saved = ar_get('saved', $_SESSION))) {
        $smarty->assign('saved_count',  count($saved));
    } else {
        $smarty->assign('saved_count', 0);
    }

    $smarty->assign("mobile_domains", $p->mobile_domains);

    # for nojs return-to-search navigation
    $smarty->assign('search_arg', ar_get('searcharg', $_SESSION));
    $smarty->assign('last_results', ar_get('results_url', $_SESSION));

    return $smarty;
}
示例#2
0
<?
    require_once('util.php');

    $sm = get_smarty();
    $p = new SiteParse();

    try {
        if (!ar_get('userid', $_SESSION)) {

            $query = http_build_query(array(
                "redirect" => $_SERVER['REQUEST_URI']
            ));

            $page = use_js() ? "small_login" : "login";

            header("Location: " . $p->base_url . "$page?" . $query);

        } else {

            $bib  = ar_get('bibid', $_REQUEST);
            $rurl = ar_get('url', $_REQUEST);
       
            $loc_options = $p->get_request_form($_SESSION['name'], $_SESSION['code'], $rurl);
            $nbMonth = $p->get_needby_month($_SESSION['name'], $_SESSION['code'], $rurl);
            $nbDay = $p->get_needby_day($_SESSION['name'], $_SESSION['code'], $rurl);
            $nbYear = $p->get_needby_year($_SESSION['name'], $_SESSION['code'], $rurl);
            
            # if only one request location, skip step1?
            if(!$loc_options) $loc_options = array("Library pickup?");

            $sm->assign("jsfiles", array("static/relogin.js"));