[Mapbender-commits] r6161 - trunk/mapbender/http/plugins
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue May 11 05:25:04 EDT 2010
Author: christoph
Date: 2010-05-11 05:25:04 -0400 (Tue, 11 May 2010)
New Revision: 6161
Modified:
trunk/mapbender/http/plugins/mb_metadata_layer.php
Log:
i18nized
Modified: trunk/mapbender/http/plugins/mb_metadata_layer.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_layer.php 2010-05-11 08:03:00 UTC (rev 6160)
+++ trunk/mapbender/http/plugins/mb_metadata_layer.php 2010-05-11 09:25:04 UTC (rev 6161)
@@ -1,5 +1,22 @@
<?php
require_once dirname(__FILE__) . "/../../core/globalSettings.php";
+
+ $firephp->log($_SESSION);
+
+ function displayCategories ($sql) {
+ if (Mapbender::session()->get("mb_lang") === "de") {
+ $sql = str_replace("category_code_en", "category_code_de", $sql);
+ }
+
+ $str = "";
+ $res = db_query($sql);
+ while ($row = db_fetch_assoc($res)) {
+ $str .= "<option value='" . $row["id"] . "'>" .
+ htmlentities($row["name"], ENT_QUOTES, CHARSET) .
+ "</option>";
+ }
+ return $str;
+ }
?>
<h1>Layer Level Metadata:</h1>
@@ -68,7 +85,6 @@
<div id="toolbar_lower"></div>
</fieldset>
</div>
-
<div id="classification">
<fieldset class="">
<legend>Classification</legend>
@@ -76,18 +92,30 @@
<label for="fkey_md_topic_category_id">ISO Topic Category:</label>
<img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
<select class="metadata_selectbox" id="fkey_md_topic_category_id" name="fkey_md_topic_category_id" size="2" multiple="multiple">
+<?php
+ $sql = "SELECT md_topic_category_id AS id, md_topic_category_code_en AS name FROM md_topic_category";
+ echo displayCategories($sql);
+?>
</select>
</p>
<p>
<label for="fkey_inspire_category_id">INSPIRE Category:</label>
<img class="metadata_img" src="../img/misc/inspire_eu_klein.png"></img>
<select class="metadata_selectbox" id="fkey_inspire_category_id" name="fkey_inspire_category_id" size="2" multiple="multiple">
+<?php
+ $sql = "SELECT inspire_category_id AS id, inspire_category_code_en AS name FROM inspire_category";
+ echo displayCategories($sql);
+?>
</select>
</p>
<p>
<label for="fkey_custom_category_id">Custom Category:</label>
<span class="metadata_span"></span>
<select class="metadata_selectbox" id="fkey_custom_category_id" name="fkey_custom_category_id" size="2" multiple="multiple">
+<?php
+ $sql = "SELECT custom_category_id AS id, custom_category_code_en AS name FROM custom_category";
+ echo displayCategories($sql);
+?>
</select>
</p>
</fieldset>
More information about the Mapbender_commits
mailing list