]> ToastFreeware Gitweb - philipp/winterrodeln/mediawiki_extensions/wrmap.git/blobdiff - wrmap.body.php
Update extension.json to version 2 with "updateExtensionJsonSchema.php".
[philipp/winterrodeln/mediawiki_extensions/wrmap.git] / wrmap.body.php
index 79a4ee8e1245410ba7162f66ec2ffbdf94e3c4be..600821be4ea9e061bccb39c75a1da9e6c83bc7d7 100644 (file)
@@ -244,7 +244,7 @@ class WrBaseMap {
                        $key_sledrun = $wgContLang->getNSText(NS_CATEGORY) . ':Rodelbahn';
                        if (array_key_exists($key_sledrun, $categories)) {
                                // for sledrun titles use the image from the rodelbahnbox
-                               $dbr = wfGetDB(DB_SLAVE);
+                               $dbr = wfGetDB(DB_REPLICA);
                                $res = $dbr->select('wrsledruncache', 'image', array('page_id' => $title->getArticleID()), __METHOD__);
                                $image = $dbr->fetchRow($res);
                                if ($image && !is_null($image['image'])) $file = wfFindFile($image['image']);
@@ -253,7 +253,7 @@ class WrBaseMap {
                        $key_inn = $wgContLang->getNSText(NS_CATEGORY) . ':Gasthaus';
                        if (array_key_exists($key_inn, $categories)) {
                                // for inn titles use the image from the gasthausbox
-                               $dbr = wfGetDB(DB_SLAVE);
+                               $dbr = wfGetDB(DB_REPLICA);
                                $res = $dbr->select('wrinncache', 'image', array('page_id' => $title->getArticleID()), __METHOD__);
                                $image = $dbr->fetchRow($res);
                                if ($image && !is_null($image['image'])) $file = wfFindFile($image['image']);
@@ -272,7 +272,7 @@ class WrBaseMap {
        // Returns an array of features
        public static function sledruns_to_json_features() {
                $json_features = array(); // result
-               $dbr = wfGetDB(DB_SLAVE);
+               $dbr = wfGetDB(DB_REPLICA);
                $res = $dbr->select(array('wrsledruncache', 'wrreportcache'), array('wrsledruncache.page_title', 'position_latitude', 'position_longitude', 'date_report', '`condition`'), array('show_in_overview', 'not under_construction'), __METHOD__, array(), array('wrreportcache' => array('left outer join', 'wrsledruncache.page_id=wrreportcache.page_id')));
                while ($sledrun = $dbr->fetchRow($res)) {
                        $lat = $sledrun['position_latitude'];
@@ -399,8 +399,11 @@ class WrBaseMap {
                assert(in_array($tagname, array('wrmap', 'wrgmap')));
 
                $parserOutput = $parser->getOutput();
-               $parserOutput->addHeadItem('<script src="https://cdnjs.cloudflare.com/ajax/libs/openlayers/4.6.5/ol-debug.js"></script>', 'openlayers_js');
-               $parserOutput->addHeadItem('<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/openlayers/4.6.5/ol-debug.css">', 'openlayers_css');
+               // Polyfill für Internet Explorer
+               $parserOutput->addHeadItem('<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,fetch"></script>', 'polyfill_ie');
+               // OpenLayers 6.5.0 does not work with Internet Explorer, see https://github.com/openlayers/openlayers/issues/11870
+               $parserOutput->addHeadItem('<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.5.0/build/ol.js"></script>', 'openlayers_js'); // CDN link for 6.4.3 doesn't work anymore
+               $parserOutput->addHeadItem('<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.5.0/css/ol.css">', 'openlayers_css');
                $parserOutput->addModules('ext.wrmap');
 
                // append all sledruns as icon
@@ -449,12 +452,6 @@ class WrBaseMap {
                $div_popup->appendElement('div', array('id' => 'popup-content'));
                return array($doc->saveHTML($div_map) . $doc->saveHTML($div_popup), 'markerType' => 'nowiki');
        }
-
-
-       public static function onEnableMobileModules($out, $mode) {
-               $out->addModules('ext.wrmap.mobile');
-               return true;
-       }
 }