svn commit: r906 - trunk/mapbender/http/php/mod_editGuiWms.php
christoph at osgeo.org
christoph at osgeo.org
Tue Nov 21 04:35:43 EST 2006
Author: christoph
Date: 2006-11-21 09:35:42+0000
New Revision: 906
Modified:
trunk/mapbender/http/php/mod_editGuiWms.php
Log:
* used function getGuisByOwner from class_Administration
* include via dirname(__FILE__)
Modified: trunk/mapbender/http/php/mod_editGuiWms.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_editGuiWms.php?view=diff&rev=906&p1=trunk/mapbender/http/php/mod_editGuiWms.php&p2=trunk/mapbender/http/php/mod_editGuiWms.php&r1=905&r2=906
==============================================================================
--- trunk/mapbender/http/php/mod_editGuiWms.php (original)
+++ trunk/mapbender/http/php/mod_editGuiWms.php 2006-11-21 09:35:42+0000
@@ -18,11 +18,11 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
session_start();
-require_once("../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
$con = db_connect(DBSERVER,OWNER,PW);
db_select_db(DB,$con);
import_request_variables("PG");
-require_once("../php/mb_validatePermission.php");
+require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
$self = $PHP_SELF . "?".SID."&guiID=".$_REQUEST["guiID"]."&elementID=".$_REQUEST["elementID"];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
@@ -138,7 +138,7 @@
<body>
<?php
-require_once("../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
$con = db_connect($DBSERVER,$OWNER,$PW);
db_select_db(DB,$con);
@@ -295,35 +295,42 @@
echo "<tr>";
echo "<td>";
-$sql = "SELECT * from gui_mb_user JOIN gui ON gui.gui_id = gui_mb_user.fkey_gui_id WHERE ";
-$sql .= "gui.gui_public = 1 AND gui_mb_user.fkey_mb_user_id = $1 AND gui_mb_user.mb_user_type = 'owner' Order BY fkey_gui_id ";
-$v = array($mb_user_id,);
-$t = array('i',);
-$res = db_prep_query($sql,$v,$t);
-$count=0;
-while($row = db_fetch_array($res)){
- $gui_id[$count]=$row["gui_id"];
- $gui_name[$count]=$row["gui_name"];
- $gui_description[$count]=$row["gui_description"];
- $count++;
+
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"],true);
+
+#$sql = "SELECT * from gui_mb_user JOIN gui ON gui.gui_id = gui_mb_user.fkey_gui_id WHERE ";
+#$sql .= "gui.gui_public = 1 AND ";
+#$sql .= "gui_mb_user.fkey_mb_user_id = $1 AND gui_mb_user.mb_user_type = 'owner' Order BY fkey_gui_id ";
+#$v = array($mb_user_id,);
+#$t = array('i',);
+#$res = db_prep_query($sql,$v,$t);
+#$count=0;
+#while($row = db_fetch_array($res)){
+$gui_id =array();
+if (count($ownguis)>0){
+ for($i=0; $i<count($ownguis); $i++){
+ $gui_id[$i]=$ownguis[$i];
+ }
}
echo"<select size='8' name='guiList' onchange='document.form1.wmsList.selectedIndex = -1;submit()'>";
$selected_gui_id="";
-for ($i=0; $i<$count;$i++){
- echo "<option value='".$gui_name[$i]."' ";
- if($guiList && $guiList == $gui_name[$i]){
+for ($i=0; $i<count($ownguis);$i++){
+ echo "<option value='".$gui_id[$i]."' ";
+ if($guiList && $guiList == $gui_id[$i]){
echo "selected";
- $selected_gui_id=$gui_name[$i];
+ $selected_gui_id=$gui_id[$i];
}
else{
if ($i==0){
echo "selected";
- $selected_gui_id=$gui_name[$i];
+ $selected_gui_id=$gui_id[$i];
}
}
- echo ">".$gui_name[$i]."</option>";
+ echo ">".$gui_id[$i]."</option>";
}
echo "</select>";
More information about the Mapbender_commits
mailing list