'WaramuSearch', 'mode' => 'results');
}
/**
* @Secured('roles' = {'authenticated'}, 'valid' = {})
* */
public function actionMetaDataSearch() {
global $kdb;
$mds = array();
foreach (array('targetgroup','language','resourcetype','lre','difficulty') as $md) {
if (isset($_POST[$md]) && is_array($_POST[$md])) {
$mds [$md] = $_POST[$md];
}
}
if (count($mds)>0) {
$_SESSION['search_results'] = $mds;
return array('pid' => 'WaramuSearch', 'mode' => 'metadata', 'searchAction' => 'multisearch');
}
return array('pid' => 'WaramuSearch', 'mode' => 'metadata');
}
function getSearchWord() {
if ( !isset($_SESSION['waramusearchword']) ) {
return "";
}
return $_SESSION['waramusearchword'];
}
function getResults() {
global $user;
$au = ''.$user->getUsername().'';
$sword = $this->getSearchWord();
$ids = array();
if ( strlen($sword) > 0 ) {
$query = '';
$query .= '';
$query .= '<_fulltext '.WARAMU_XMLNS.'>'.$sword.'';
$query .= '';
require_once("includes/Waramu.php");
$ws = new Waramu();
$ws->connect();
$idents = $ws->listIdentifiers($au, $query);
if (is_array($idents) && array_key_exists("id", $idents['identifiers'][0])) {
$ids1 = $idents['identifiers'][0]['id'];
foreach ($ids1 as $wid) {
//$wob = $ws->getResource($au, $wid[0]);
$ids []= $wid[0];
}
}
$ws->disconnect();
}
return $ids;
}
public function getDifMD($mdk) {
$tgs = array();
// tags from waramu
return $tgs;
}
public function getByMetadata(){
// ?!
return false;
}
}
?>