[Mapbender-commits] r6103 - in trunk/mapbender: http/plugins lib
resources/db/pgsql/UTF-8/update
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Sun May 9 08:36:09 EDT 2010
Author: verenadiewald
Date: 2010-05-09 08:36:09 -0400 (Sun, 09 May 2010)
New Revision: 6103
Modified:
trunk/mapbender/http/plugins/mb_resultList_DetailPopup.js
trunk/mapbender/lib/resultGeometryListController.js
trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6.1_to_2.7rc1_pgsql_UTF-8.sql
Log:
http://trac.osgeo.org/mapbender/ticket/605
Modified: trunk/mapbender/http/plugins/mb_resultList_DetailPopup.js
===================================================================
--- trunk/mapbender/http/plugins/mb_resultList_DetailPopup.js 2010-05-09 11:34:29 UTC (rev 6102)
+++ trunk/mapbender/http/plugins/mb_resultList_DetailPopup.js 2010-05-09 12:36:09 UTC (rev 6103)
@@ -23,6 +23,8 @@
* > VALUES('<app_id>', 'resultList_DetailPopup', 'detailPopupWidth', '400', 'width of the result list detail popup' ,'var');
* > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
* > VALUES('<app_id>', 'resultList_DetailPopup', 'position', '[200,200]', 'position of the result list detail popup' ,'var');
+ * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
+ * > VALUES('<app_id>', 'resultList_DetailPopup', 'openLinkFromSearch', '0', 'open link directly if feature attr is defined as link' ,'var');
*
* Help:
* http://www.mapbender.org/ResultList_DetailPopup
@@ -35,6 +37,7 @@
* detailPopupHeight - *[optional]* height of the result list detail popup
* detailPopupWidth - *[optional]* width of the result list detail popup
* position - *[optional]* position of the result list detail popup
+ * openLinkFromSearch - *[optional]* open link directly if feature attr is defined as link
*
*
* License:
@@ -50,6 +53,7 @@
options.detailPopupWidth = options.detailPopupWidth || 400;
// see http://docs.jquery.com/UI/Dialog for possible values
options.position = options.position || 'center';
+options.openLinkFromSearch = options.openLinkFromSearch || '0';
Mapbender.events.init.register(function(){
Mapbender.modules[options.target[0]].rowclick.register(function(row){
@@ -65,7 +69,26 @@
for (var columnIndex in me.detailColumns) {
infoPopupHtml += "<tr>";
infoPopupHtml += "<td>" + me.detailColumns[columnIndex].label + "</td>";
- infoPopupHtml += "<td>" + me.model.getFeatureProperty(modelIndex, me.detailColumns[columnIndex].name)+ "</td>";
+ infoPopupHtml += "<td>";
+ if(me.detailColumns[columnIndex].html.indexOf("href") != -1) {
+ var featureHref = me.model.getFeatureProperty(modelIndex, me.detailColumns[columnIndex].name);
+ var setUrl = me.detailColumns[columnIndex].html.replace(/href\s*=\s*['|"]\s*['|"]/, "href='" + featureHref + "' target='_blank'");
+ if(setUrl.match(/><\/a>/)){
+ var newLink = setUrl.replace(/><\/a>/, ">" + featureHref + "</a>");
+ }
+ else{
+ var newLink = setUrl;
+ }
+ if(options.openLinkFromSearch == '1'){
+ window.open(featureHref, featureHref,"width=500, height=400,left=100,top=100,scrollbars=yes");
+ }
+ infoPopupHtml += newLink;
+ }
+ else {
+ infoPopupHtml += me.model.getFeatureProperty(modelIndex, me.detailColumns[columnIndex].name);
+ }
+ infoPopupHtml += "</td>";
+
infoPopupHtml += "</tr>";
}
infoPopupHtml += "</table>";
Modified: trunk/mapbender/lib/resultGeometryListController.js
===================================================================
--- trunk/mapbender/lib/resultGeometryListController.js 2010-05-09 11:34:29 UTC (rev 6102)
+++ trunk/mapbender/lib/resultGeometryListController.js 2010-05-09 12:36:09 UTC (rev 6103)
@@ -147,7 +147,8 @@
var labelPos = currentWfsConf.element[j].f_detailpos;
labelArray[labelPos] = {
name : currentWfsConf.element[j].element_name,
- label : currentWfsConf.element[j].f_label
+ label : currentWfsConf.element[j].f_label,
+ html : currentWfsConf.element[j].f_form_element_html
};
}
}
Modified: trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6.1_to_2.7rc1_pgsql_UTF-8.sql
===================================================================
--- trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6.1_to_2.7rc1_pgsql_UTF-8.sql 2010-05-09 11:34:29 UTC (rev 6102)
+++ trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6.1_to_2.7rc1_pgsql_UTF-8.sql 2010-05-09 12:36:09 UTC (rev 6103)
@@ -1323,6 +1323,18 @@
NOT IN (SELECT fkey_gui_id FROM gui_element_vars WHERE fkey_e_id = 'resultList_DetailPopup' AND var_name = 'position');
--
+-- add element var openLinkFromSearch to element resultList_DetailPopup
+--
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
+SELECT gui_element.fkey_gui_id,
+'resultList_DetailPopup', 'openLinkFromSearch', '0', 'open link directly if feature attr is defined as link' ,'var'
+from gui_element
+WHERE
+gui_element.e_id = 'resultList_DetailPopup' AND
+gui_element.fkey_gui_id
+NOT IN (SELECT fkey_gui_id FROM gui_element_vars WHERE fkey_e_id = 'resultList_DetailPopup' AND var_name = 'openLinkFromSearch');
+
+--
-- add resultList_Zoom to applications with element gazetteerWFS
--
INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, e_element, e_src, e_attributes,
More information about the Mapbender_commits
mailing list