Example #1
0
	$dia->setParam('qt',$qt);
	$dia->setParam('sort',$sort);

	$diaResponse = $dia->search($q, $index, $filterSearch, $from);
	$result = json_decode($diaResponse);

	if ($output == "xml" || $output == "sol"){
		header("Content-type: text/xml; charset=UTF-8");
		print $diaResponse;
	}else if($output == "rss"){
		header("Content-type: text/xml; charset=UTF-8");
		$page->RSS();
	}else if($output == "ris"){
		header("Content-type: application/x-Research-Info-Systems; charset=UTF-8");
        header('Content-Disposition: attachment; filename="citation.ris"');
		$page->RIS();
	}else if($output == "metasearch"){
		header("Content-type: text/xml; charset=UTF-8");
		$page->MetaSearch();
    }else if($output == "js"){
        header("Content-type: text/plain; charset=UTF-8");
        if (isset($callback) && ereg("^[a-z_]{1,25}$", $callback)){
            echo $callback . "(" . $diaResponse . ");";
        }else{
            echo $diaResponse;
        }
	}else{		
		// html output
		$page->show();
	}