svn commit: r59 - trunk/mapbender/http/include/dyn_css.php
uli at osgeo.org
uli at osgeo.org
Fri Apr 14 04:33:39 EDT 2006
Author: uli
Date: 2006-04-14 08:33:39+0000
New Revision: 59
Added:
trunk/mapbender/http/include/dyn_css.php
Log:
import Mapbender source without history
Added: trunk/mapbender/http/include/dyn_css.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/include/dyn_css.php?view=auto&rev=59
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/include/dyn_css.php 2006-04-14 08:33:39+0000
@@ -0,0 +1,90 @@
+<?php
+if(isset($gui_id) && $gui_id != ""){
+ #echo $gui_id. " - ".$_REQUEST["e_id_css"];
+ if (isset($_REQUEST["e_id_css"]) && $_REQUEST["e_id_css"] != '') {
+ #
+ #
+ # css file
+ #
+ #
+ $sql = "SELECT * FROM gui_element_vars WHERE fkey_e_id = '".$_REQUEST["e_id_css"]."' AND fkey_gui_id = '".$gui_id."' and var_type='file/css'";
+ $res = db_query($sql);
+ $cnt = 0;
+ while($row = db_fetch_array($res)){
+ echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"".$row["var_value"]."\" />\n";
+ }
+
+
+
+ #
+ #
+ # css text
+ #
+ #
+
+
+ $sql = "SELECT * FROM gui_element_vars WHERE fkey_e_id = '".$_REQUEST["e_id_css"]."' AND fkey_gui_id = '".$gui_id."' and var_type='text/css'";
+ $res = db_query($sql);
+ $cnt = 0;
+ $style = "";
+ while($row = db_fetch_array($res)){
+ $style .= $row["var_value"]."\n";
+ }
+ if ($style) {
+ echo "<style type=\"text/css\">\n";
+ echo "<!--\n";
+ echo $style;
+ echo "-->\n";
+ echo "</style>\n";
+ }
+ }
+
+ #
+ #
+ # php variables
+ #
+ #
+ $sql = "SELECT * FROM gui_element_vars WHERE fkey_e_id = '".$_REQUEST["e_id_css"]."' AND fkey_gui_id = '".$gui_id."' and var_type='php_var'";
+ $res = db_query($sql);
+
+ echo "\n";
+ while($row = db_fetch_array($res))
+ {
+ $$row["var_name"] = "'" . stripslashes($row["var_value"]) . "'";
+ echo "\n";
+ }
+
+
+
+ #
+ #
+ # JavaScript variables
+ #
+ #
+ $sql = "SELECT * FROM gui_element_vars WHERE fkey_e_id = '".$_REQUEST["e_id_css"]."' AND fkey_gui_id = '".$gui_id."' and var_type='var'";
+ $res = db_query($sql);
+
+ echo "\n";
+ echo "<script type=\"text/javascript\">\n";
+ echo "<!--\n";
+ $arrays = array();
+ $i=-1;
+ while($row = db_fetch_array($res))
+ {
+ if (strpos($row["var_name"], "[")) {
+ $arrayname = substr($row["var_name"], 0, strpos($row["var_name"], "["));
+ if (!in_array($arrayname, $arrays)) {
+ $i++;
+ $arrays[$i] = $arrayname;
+ echo "var " . $arrayname . " = new Array();\n";
+ }
+ }
+ else {
+ echo "var ";
+ }
+ echo $row["var_name"]." = '".stripslashes($row["var_value"])."';\n";
+ }
+ echo "// -->\n";
+ echo "</script>\n";
+}
+ ?>
\ No newline at end of file
More information about the Mapbender_commits
mailing list