Skip to content
Permalink
Browse files

Merge branch 'master' of https://github.com/uprel/gisapp

  • Loading branch information...
uprel committed Jun 11, 2019
2 parents d06d9a3 + 96fa859 commit 209f88c8ee540b6b3b30f5c5237aadcc107d5265
@@ -523,18 +523,16 @@ public static function loadGoogle() {
public static function getEqwcVersion() {
$version = '0';
if (file_exists('../version.txt')) {
$version = trim(file_get_contents('../version.txt',null,null,null,7));
$version = trim(file_get_contents('../version.txt',null,null,null,9));
}
return $version;
}
public static function getPluginVersion($name) {
$version = '0';
$dir = dirname(dirname(__FILE__)) . "/plugins/";
if (self::checkModulexist($name)) {
if (file_exists($dir . $name . '/changelog.txt')) {
if (file_exists($dir . $name . '/changelog.txt')) {
$version = trim(file_get_contents($dir . $name . '/changelog.txt',null,null,null,5));
}
}
return $version;
}
@@ -577,4 +575,37 @@ public function checkReferer($project) {
return TRUE;
}
public static function hasPluginAccess($plugin) {
//check only for editing plugin
if($plugin !== 'editing') {
return TRUE;
}
$role = null;
if (isset($_SESSION['role'])) {
$role = $_SESSION['role'];
}
switch($role) {
case null :
return TRUE;
case 'admin' :
return TRUE;
case 'editor' :
return TRUE;
case 'user' :
return FALSE;
case 'public' :
return FALSE;
default :
return FALSE;
}
}
}
@@ -75,6 +75,7 @@ I18n.properties = {
header: "Karteneinstellungen",
mapFollowing: "Verfolgung",
mapRotation: "Kartenausrichtung",
mapLoading: "Karte wird geladen...",
scaleBar: "Massstab",
about: "Impressum",
share: "Share",
@@ -78,6 +78,7 @@ I18n.properties = {
header: "Map Settings",
mapFollowing: "Tracking",
mapRotation: "Auto Rotation",
mapLoading: "Loading Map...",
scaleBar: "Scale",
about: "Imprint",
share: "Share",
@@ -78,6 +78,7 @@ I18n.properties = {
header: "Map Settings",
mapFollowing: "Tracking",
mapRotation: "Auto Rotation",
mapLoading: "Cargando mapa...",
scaleBar: "Scale",
about: "Imprint",
share: "Share",
@@ -78,6 +78,7 @@ I18n.properties = {
header: "Impostazioni Mappa",
mapFollowing: "Tracking",
mapRotation: "Auto Rotation",
mapLoading: "Caricamento della mappa...",
scaleBar: "Scala",
about: "Imprint",
share: "Condividi",
@@ -76,6 +76,7 @@ I18n.properties = {
header: "Oppsett",
mapFollowing: "Følg i kartet",
mapRotation: "Auto-rotasjon",
mapLoading: "Laster kart ...",
scaleBar: "Skala",
about: "Avtrykk",
share: "Del",
@@ -78,6 +78,7 @@ I18n.properties = {
header: "Ustawienia mapy",
mapFollowing: "Śledzenie",
mapRotation: "Auto-obracanie",
mapLoading: "Ładowanie mapy...",
scaleBar: "Skala",
about: "Informacje",
share: "Udostępnij",
@@ -77,6 +77,7 @@ I18n.properties = {
header: "Map Settings",
mapFollowing: "Tracking",
mapRotation: "Auto Rotation",
mapLoading: "Загрузка карты...",
scaleBar: "Scale",
about: "Imprint",
share: "Share",
@@ -78,6 +78,7 @@ I18n.properties = {
header: "Map Settings",
mapFollowing: "Tracking",
mapRotation: "Auto Rotation",
mapLoading: "Načítavam mapu...",
scaleBar: "Scale",
about: "Imprint",
share: "Share",
@@ -78,6 +78,7 @@ I18n.properties = {
header: "Map Settings",
mapFollowing: "Tracking",
mapRotation: "Auto Rotation",
mapLoading: "Nalaganje karte...",
scaleBar: "Scale",
about: "Imprint",
share: "Share",
@@ -78,6 +78,7 @@ I18n.properties = {
header: "Inställning karta",
mapFollowing: "Spårning",
mapRotation: "Automatisk rotation",
mapLoading: "Laddar karta...",
scaleBar: "Skala",
about: "Om",
share: "Dela",
@@ -49,7 +49,7 @@
//add into array all js files in plugins/xxx/js subfolder
if (!(empty($plugin_list))) {
foreach ($plugin_list as $item) {
if (is_dir($dir . $item)) {
if (is_dir($dir . $item) && \GisApp\Helpers::hasPluginAccess($item)) {
$plugin_path = $dir . $item;
//plugin language file
@@ -51,12 +51,12 @@
$debug = defined('DEBUG') ? DEBUG : false;
//eqwc language files
array_push($lang, "admin/languages/". $def_lang .".js");
array_push($lang, "admin/languages/". $def_lang .".js?v=".rand());
//add into array all js files in plugins/xxx/src_mobile subfolder
if (!(empty($plugin_list))) {
foreach ($plugin_list as $item) {
if (is_dir($dir . $item)) {
if (is_dir($dir . $item) && \GisApp\Helpers::hasPluginAccess($item)) {
$plugin_path = $dir . $item;
//plugin language file
@@ -118,6 +118,7 @@ FeatureInfo.prototype.handleEvent = function (e) {
$.ajax({
url: url,
dataType: 'text',
timeout: 3000,
context: this
}).done(function (data, status) {
var results = null;
@@ -131,7 +132,11 @@ FeatureInfo.prototype.handleEvent = function (e) {
this.resultsCallback(status,results);
//allow clicking again
Map.toggleClickHandling(true);
});
})
.fail(function (xhr, status, error) {
//todo what with error here
Map.toggleClickHandling(true);
});
};

/**
@@ -265,18 +265,18 @@ Gui.loadLayers = function (data) {
}

// add layer
html += '<label>';
html += '<input type="' + type + '" ';
//html += '<label>';
//html += '<input type="' + type + '" ';

//group layer + legend
//html += '<div data-role="collapsible" data-theme="c"';
//html += ' data-iconpos="right" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d" data-groupcheckbox="true"';
//html += '>';
//html += '<h3>' + node.name + '</h3>';
//
//// add layer, but hidden, checkbox in group above will control layer on/off
//html += '<label style="display:none">';
//html += '<input style="display:none" type="' + type + '" ';
html += '<div data-role="collapsible" data-theme="c" id="'+layer.id+'"';
html += ' data-iconpos="right" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d" data-groupcheckbox="true"';
html += '>';
html += '<h3>' + node.name + '</h3>';

// add layer, but hidden, checkbox in group above will control layer on/off
html += '<label style="display:none">';
html += '<input style="display:none" type="' + type + '" ';
if (parent != null) {
// prevent auto-enhancement by jQuery Mobile if layer belongs to a group
html += 'data-role="none" ';
@@ -289,32 +289,8 @@ Gui.loadLayers = function (data) {
html += '>' + layer.toclayertitle;
html += '</input>';
html += '</label>';
html += '</div>';

//var legendUrl = Map.topics[Map.topic].wms_url +
// "?SERVICE=WMS"+
// "&VERSION=1.3.0"+
// "&REQUEST=GetLegendGraphics"+
// "&FORMAT=image/png"+
// "&EXCEPTIONS=application/vnd.ogc.se_inimage"+
// "&BOXSPACE=1"+
// "&LAYERSPACE=2"+
// "&SYMBOLSPACE=1"+
// "&SYMBOLHEIGHT=2"+
// "&LAYERFONTSIZE=8"+
// "&ITEMFONTSIZE=8"+
// "&LAYERTITLE=FALSE"+
// "&LAYERTITLESPACE=0"+
// "&TRANSPARENT=TRUE"+
// "&LAYERS="+encodeURIComponent(layer.id)+
// "&DPI="+encodeURIComponent(Config.map.dpi);
//html+='<img data-layer="'+layer.id+'" src="' + legendUrl + '"';
//html += '</img>';
//
//html += '</div>';
//if (!layer.visini) {
// html += '" style="display:none;" ';
//}
//html+=' />';
layers.push({
id: layer.id,
layername: layer.layername,
@@ -349,9 +325,44 @@ Gui.loadLayers = function (data) {

// enhance checkboxes of group children when expanding for the first time
function enhanceCheckbox() {
var labels = $(this).children('.ui-collapsible-content').children('label');
labels.find(':checkbox[data-role="none"]').attr('data-role', null);
labels.trigger('create');
if(this.id == '') {
var labels = $(this).children('.ui-collapsible-content').children('label');
labels.find(':checkbox[data-role="none"]').attr('data-role', null);
labels.trigger('create');
} else {
//legend
var lay = this.id;
var layer = projectData.layers[lay];

if(layer) {
if(layer.provider !== 'gdal' && layer.provider !== 'wms') {

var legendUrl = Map.topics[Map.topic].wms_url +
"?SERVICE=WMS" +
"&VERSION=1.3.0" +
"&REQUEST=GetLegendGraphics" +
"&FORMAT=image/png" +
"&EXCEPTIONS=application/vnd.ogc.se_inimage" +
"&BOXSPACE=1" +
"&LAYERSPACE=2" +
"&SYMBOLSPACE=1" +
"&SYMBOLHEIGHT=2" +
"&LAYERFONTSIZE=8" +
"&ITEMFONTSIZE=8" +
"&ICONLABELSPACE=2" +
"&LAYERTITLE=FALSE" +
"&LAYERTITLESPACE=0" +
"&TRANSPARENT=TRUE" +
"&LAYERS=" + encodeURIComponent(lay) +
"&DPI=" + encodeURIComponent(Config.map.dpi);

var leg = '<img data-layer="'+lay+'" src="' + legendUrl + '"</img>';

//var legend
$(this).children('.ui-collapsible-content').html(leg);
}
}
}
$(this).unbind('expand', enhanceCheckbox);
}
var groups = $('#panelLayerAll').find('.ui-collapsible');
@@ -727,7 +738,9 @@ Gui.onLayerOrderChanged = function(event, ui) {

// update map
Map.layers = orderedLayers;
Map.refresh();
setTimeout(function() {
Map.refresh();
}, 1000);
};

// select layer in layer order panel
@@ -1408,6 +1421,29 @@ Gui.initViewer = function() {
};

$(document).ready(function(e) {

//ajax global loading enable
$(document).on({
ajaxSend: function () { loading('show'); },
ajaxStart: function () { loading('show'); },
ajaxStop: function () { loading('hide'); },
ajaxError: function () { loading('hide'); }
});

function loading(showOrHide) {
setTimeout(function(){
$.mobile.loading(showOrHide);
}, 1);
}

//Thanks: https://github.com/jquery/jquery-mobile/issues/3414
$.mobile.loader.prototype.defaultHtml = "<div class='ui-loader'>" +
"<span class='ui-icon ui-icon-loading'></span>" +
"<h1></h1>" +
"<div class='ui-loader-curtain'></div>" +
"</div>";


UrlParams.parse();
Config.permalink.read(UrlParams.params, Gui.initViewer);
});

0 comments on commit 209f88c

Please sign in to comment.
You can’t perform that action at this time.