[Mapbender-commits] r7146 - in trunk/mapbender/http: javascripts php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Nov 24 03:34:53 EST 2010
Author: verenadiewald
Date: 2010-11-24 00:34:53 -0800 (Wed, 24 Nov 2010)
New Revision: 7146
Modified:
trunk/mapbender/http/javascripts/mod_loadwmc.js
trunk/mapbender/http/javascripts/mod_savewmc.js
trunk/mapbender/http/javascripts/mod_savewmc.php
trunk/mapbender/http/php/mod_savewmc_server.php
Log:
categories for wmc are categories from table wmc_md_topic_category, not from wmc_inspire_category, so changed that relation in all scripts
Modified: trunk/mapbender/http/javascripts/mod_loadwmc.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_loadwmc.js 2010-11-23 17:37:47 UTC (rev 7145)
+++ trunk/mapbender/http/javascripts/mod_loadwmc.js 2010-11-24 08:34:53 UTC (rev 7146)
@@ -233,10 +233,10 @@
$("#" + options.saveWmcTarget + "_wmcname").val(wmc.title);
$("#" + options.saveWmcTarget + "_wmcabstract").val(wmc.abstract);
$("#" + options.saveWmcTarget + "_wmckeywords").val(wmc.keywords.join(","));
- $("input[id^='" + options.saveWmcTarget + "_wmcinspire_']").removeAttr("checked");
+ $("input[id^='" + options.saveWmcTarget + "_wmcIsoTopicCategory_']").removeAttr("checked");
for (var j = 0; j < wmc.categories.length; j++) {
var cat = wmc.categories[j];
- $("#" + options.saveWmcTarget + "_wmcinspire_" + cat).attr("checked", "checked");
+ $("#" + options.saveWmcTarget + "_wmcIsoTopicCategory_" + cat).attr("checked", "checked");
}
}
}
Modified: trunk/mapbender/http/javascripts/mod_savewmc.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_savewmc.js 2010-11-23 17:37:47 UTC (rev 7145)
+++ trunk/mapbender/http/javascripts/mod_savewmc.js 2010-11-24 08:34:53 UTC (rev 7146)
@@ -180,9 +180,6 @@
case options.id + "_wmckeywords" :
$(this).text(translatedI18nObj.labelKeywords);
break;
- case options.id + "_wmckeywords" :
- $(this).text(translatedI18nObj.labelKeywords);
- break;
}
});
var $legend = $form.next().children("legend");
@@ -233,7 +230,7 @@
$("#" + options.id + "_wmcname").val("");
$("#" + options.id + "_wmcabstract").val("");
$("#" + options.id + "_wmckeywords").val("");
- $("input[id^='" + options.id + "_wmcinspire_']").removeAttr("checked");
+ $("input[id^='" + options.id + "_wmcIsoTopicCategory_']").removeAttr("checked");
return false;
}
//
@@ -246,10 +243,10 @@
$("#" + options.id + "_wmcname").val(wmc.title);
$("#" + options.id + "_wmcabstract").val(wmc.abstract);
$("#" + options.id + "_wmckeywords").val(wmc.keywords.join(","));
- $("input[id^='" + options.id + "_wmcinspire_']").removeAttr("checked");
+ $("input[id^='" + options.id + "_wmcIsoTopicCategory_']").removeAttr("checked");
for (var j = 0; j < wmc.categories.length; j++) {
var cat = wmc.categories[j];
- $("#" + options.id + "_wmcinspire_" + cat).attr("checked", "checked");
+ $("#" + options.id + "_wmcIsoTopicCategory_" + cat).attr("checked", "checked");
}
return false;
}
@@ -261,11 +258,11 @@
var getButtons = function () {
var buttonObj = {};
buttonObj[translatedI18nObj.labelSave] = function() {
- var inspire_cat = {};
+ var isoTopicCat = {};
var regExp = new RegExp(options.id + "_");
- $("#" + options.id + "_wmcinspire:checkbox").each(function(){
+ $(".wmcIsoTopicCategory:checkbox").each(function(){
if(!!$(this).attr('checked')) {
- inspire_cat[$(this).attr('id').replace(regExp, "")] = true;
+ isoTopicCat[$(this).attr('id').replace(regExp, "")] = true;
}
});
var attributes = {};
@@ -273,7 +270,7 @@
attributes.title = $("#" + options.id + "_wmcname").val();
attributes.abstract = $("#" + options.id + "_wmcabstract").val();
attributes.keywords = $("#" + options.id + "_wmckeywords").val();
- attributes.inspirecat = inspire_cat;
+ attributes.isoTopicCat = isoTopicCat;
if (!!attributes.title) {
sendMapDataToServer(attributes, 0, (function(result, status, message) {
alert(message);
Modified: trunk/mapbender/http/javascripts/mod_savewmc.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_savewmc.php 2010-11-23 17:37:47 UTC (rev 7145)
+++ trunk/mapbender/http/javascripts/mod_savewmc.php 2010-11-24 08:34:53 UTC (rev 7146)
@@ -18,7 +18,7 @@
/*
* @return String containing checkboxes and labels as HTML
*/
-function createInspireCategoryString($prefix) {
+function createIsoTopicCategoryString($prefix) {
$str = "";
$htmlrows = "";
$sql = "SELECT md_topic_category_id, md_topic_category_code_en FROM md_topic_category";
@@ -27,8 +27,8 @@
$i = 0;
while($row = db_fetch_array($res)) {
$i++;
- $str .= "<label for=\"{$prefix}_wmcinspire_{$row[0]}\">" .
- "<input id=\"{$prefix}_wmcinspire_{$row[0]}\" " .
+ $str .= "<label for=\"{$prefix}_wmcIsoTopicCategory_{$row[0]}\">" .
+ "<input class=\"wmcIsoTopicCategory\" id=\"{$prefix}_wmcIsoTopicCategory_{$row[0]}\" " .
"type=\"checkbox\" />{$row[1]}</label>";
}
return $str;
@@ -53,7 +53,7 @@
$json = new Mapbender_JSON();
-$saveWmcCategoryString = createInspireCategoryString($e_id);
+$saveWmcCategoryString = createIsoTopicCategoryString($e_id);
$originalI18nObjJson = $json->encode($originalI18nObj);
$translatedI18nObjJson = $json->encode($translatedI18nObj);
@@ -77,7 +77,7 @@
'<label for="{$e_id}_wmckeywords">{$labelKeywords}</label>' +
'<input id="{$e_id}_wmckeywords" type="text" class="text ui-widget-content ui-corner-all" />' +
'<input id="{$e_id}_wmc_id" type="hidden" />' +
- '</fieldset><fieldset id="{$e_id}_inspire_cat"><legend>{$labelCategories}' +
+ '</fieldset><fieldset id="{$e_id}_isoTopic_cat"><legend>{$labelCategories}' +
'</legend>' +
'{$saveWmcCategoryString}' +
'</fieldset></form>';
Modified: trunk/mapbender/http/php/mod_savewmc_server.php
===================================================================
--- trunk/mapbender/http/php/mod_savewmc_server.php 2010-11-23 17:37:47 UTC (rev 7145)
+++ trunk/mapbender/http/php/mod_savewmc_server.php 2010-11-24 08:34:53 UTC (rev 7146)
@@ -79,10 +79,10 @@
// make a keyword array here
$wmc->keyword = explode(" ",$attributes->keywords);
$wmc->wmc_abstract = $attributes->abstract;
- $inspireCat = $attributes->inspirecat;
- foreach($inspireCat as $cat => $val) {
+ $isoTopicCat = $attributes->isoTopicCat;
+ foreach($isoTopicCat as $cat => $val) {
$parts = explode("_",$cat);
- $wmc->inspireCats[] = $parts[1];
+ $wmc->isoTopicCats[] = $parts[1];
}
$result = $wmc->insert($overwrite);
More information about the Mapbender_commits
mailing list