0){$sql_g .= ",";}
$sql_g .= "$".strval($i+1);
array_push($v,$mb_user_groups[$i]);
array_push($t,"i");
}
$sql_g .= ") GROUP BY gui.gui_id";
$res_g = db_prep_query($sql_g,$v,$t);
while($row = db_fetch_array($res_g)){
array_push($arrayGuis,$row["gui_id"]);
}
}
$sql_guis = "SELECT gui.gui_id FROM gui JOIN gui_mb_user ON gui.gui_id = gui_mb_user.fkey_gui_id";
$sql_guis .= " WHERE (gui_mb_user.fkey_mb_user_id = $1) ";
if (!isset($ignore_public) OR $ignore_public== false){
$sql_guis .= " AND gui.gui_public = 1 ";
}
$sql_guis .= " GROUP BY gui.gui_id";
$v = array($mb_user_id);
$t = array("i");
$res_guis = db_prep_query($sql_guis,$v,$t);
$guis = array();
while($row = db_fetch_array($res_guis)){
if(!in_array($row['gui_id'],$arrayGuis)){
array_push($arrayGuis,$row["gui_id"]);
}
}
return $arrayGuis;
}
//end of functions which m,ay be included from class_administration in next versions
#**************************************************************************
//Function to create an OpenLayers Javascript from a mapbender wmc document
function createOlFromWMC_id($wmc_id){
global $userId;
//Get WMC out of mb Database
$sql = "SELECT wmc FROM mb_user_wmc WHERE wmc_serial_id = $1";
$res = db_prep_query($sql, array($wmc_id), array("s"));
$wmc = db_fetch_row($res);
//Read out WMC into XML object
$xml=simplexml_load_string($wmc[0], "SimpleXMLElement", LIBXML_NOBLANKS);
//generate general html data
$html='';
$html.="\n";
$html.="\n";
//define global variables for extent out of WMC File
$windowWidth=$xml->General->Window->attributes()->width;
$windowHeight=$xml->General->Window->attributes()->height;
$htmlWidth=$windowWidth+40;
$htmlHeight=$windowHeight+70;
//define CSS
$html.="\n";
//Generate Title
$html.="".$xml->General->Title."\n";
//include OL libs from local source - must be minimized
$html.="\n";
$html.="\n";
$html.=" \n";
$html.="\n";
$html.="\n";
$html.="\n";//class dont exists
$html.="\n";
$html.="\n";
$html.="
\n";
//Show coords if wished
if($_REQUEST["mb_showCoords"]=='1'){
// $html.="\n";
$html.="Koordinaten in ".$xml->General->BoundingBox['SRS'].":
\n";
}
$html.="\n";
$html.="\n";
$html.="\n";
$html.="\n";
//Print out HTML code
echo $html;
}
//end of function createOlfromWMC_id()
createOlfromWMC_id($_GET["wmc_id"]);
?>