Ejemplo n.º 1
0
} elseif ($save and $SQLquery != NULL) {
    $serial = $advsearch->Serialize();
    if ($saveas != "" and $serial != "") {
        $prefs = $user->getPreferences();
        //$prefs->savedQueries =  array();
        $prefs->savedQueries[] = array("name" => $saveas, "query" => $serial, "default" => 0);
        $prefs->save();
        //print($saveas." = ".$serial);
    }
} else {
    $max = count($SQLquery);
    $i = 0;
    for (; $i < $max; $i++) {
        //go through - buttons
        if ($paramcache->getRegistered("DEL" . $i . "_x") != NULL) {
            $SQLquery = $advsearch->DelRow($i);
        }
        //go through + buttons
        if ($paramcache->getRegistered("ADD" . $i . "_x") != NULL) {
            $SQLquery = $advsearch->AddRow($SQLlink, $SQLfield, $i);
        }
    }
}
$_SESSION["SQLquerySerial"] = $advsearch->Serialize();
//save the new query to the session
////SMARTY
//terms
$smarty->assign("SQLquery", $SQLquery);
//the query
$smarty->assign("SQLquerySerial", $advsearch->Serialize());
//the serialized query