@@ -42,8 +42,8 @@ |
||
| 42 | 42 | </head> |
| 43 | 43 | <body> |
| 44 | 44 | <div class="box"><?php |
| 45 | - foreach(glob('*.png') as $img) { |
|
| 46 | - echo '<img src="' . $img . '" alt="' . $img . '" title="' . $img . '" /> '; |
|
| 45 | + foreach (glob('*.png') as $img) { |
|
| 46 | + echo '<img src="'.$img.'" alt="'.$img.'" title="'.$img.'" /> '; |
|
| 47 | 47 | } |
| 48 | 48 | ?></div> |
| 49 | 49 | </body> |
@@ -80,17 +80,17 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | // normalize zoom |
| 82 | 82 | $zoom = $zoom ?: 0; |
| 83 | - if($zoom > 18) { |
|
| 83 | + if ($zoom > 18) { |
|
| 84 | 84 | $zoom = 18; |
| 85 | 85 | } |
| 86 | 86 | // normalize WxH |
| 87 | 87 | list($width, $height) = explode('x', $size); |
| 88 | 88 | $width = (int) $width; |
| 89 | - if($width > $this->maxWidth) { |
|
| 89 | + if ($width > $this->maxWidth) { |
|
| 90 | 90 | $width = $this->maxWidth; |
| 91 | 91 | } |
| 92 | 92 | $height = (int) $height; |
| 93 | - if($height > $this->maxHeight) { |
|
| 93 | + if ($height > $this->maxHeight) { |
|
| 94 | 94 | $height = $this->maxHeight; |
| 95 | 95 | } |
| 96 | 96 | |
@@ -125,14 +125,14 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | private function mediaIdToPath(string $id): string { |
| 127 | 127 | global $conf; |
| 128 | - if(empty($id)) { |
|
| 128 | + if (empty($id)) { |
|
| 129 | 129 | return ""; |
| 130 | 130 | } |
| 131 | 131 | $id = str_replace(array("[[", "]]"), "", $id); |
| 132 | - if((strpos($id, ':') === 0)) { |
|
| 132 | + if ((strpos($id, ':') === 0)) { |
|
| 133 | 133 | $id = substr($id, 1); |
| 134 | 134 | } |
| 135 | 135 | $id = str_replace(":", "/", $id); |
| 136 | - return $conf['mediadir'] . '/' . $id; |
|
| 136 | + return $conf['mediadir'].'/'.$id; |
|
| 137 | 137 | } |
| 138 | 138 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | * Simple test to make sure the plugin.info.txt is in correct format. |
| 31 | 31 | */ |
| 32 | 32 | final public function test_plugininfo(): void { |
| 33 | - $file = __DIR__ . '/../plugin.info.txt'; |
|
| 33 | + $file = __DIR__.'/../plugin.info.txt'; |
|
| 34 | 34 | self::assertFileExists($file); |
| 35 | 35 | |
| 36 | 36 | $info = confToHash($file); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function getMenuIcon(): string { |
| 36 | 36 | $plugin = $this->getPluginName(); |
| 37 | - return DOKU_PLUGIN . $plugin . '/admin/purge.svg'; |
|
| 37 | + return DOKU_PLUGIN.$plugin.'/admin/purge.svg'; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -43,18 +43,18 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function handle(): void { |
| 45 | 45 | global $conf; |
| 46 | - if(!isset($_REQUEST['continue']) || !checkSecurityToken()) { |
|
| 46 | + if (!isset($_REQUEST['continue']) || !checkSecurityToken()) { |
|
| 47 | 47 | return; |
| 48 | 48 | } |
| 49 | - if(isset($_REQUEST['purgetiles'])) { |
|
| 50 | - $path = $conf['cachedir'] . '/olmaptiles'; |
|
| 51 | - if($this->rrmdir($path)) { |
|
| 49 | + if (isset($_REQUEST['purgetiles'])) { |
|
| 50 | + $path = $conf['cachedir'].'/olmaptiles'; |
|
| 51 | + if ($this->rrmdir($path)) { |
|
| 52 | 52 | msg($this->getLang('admin_purged_tiles'), 0); |
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | - if(isset($_REQUEST['purgemaps'])) { |
|
| 56 | - $path = $conf['mediadir'] . '/olmapmaps'; |
|
| 57 | - if($this->rrmdir($path)) { |
|
| 55 | + if (isset($_REQUEST['purgemaps'])) { |
|
| 56 | + $path = $conf['mediadir'].'/olmapmaps'; |
|
| 57 | + if ($this->rrmdir($path)) { |
|
| 58 | 58 | msg($this->getLang('admin_purged_maps'), 0); |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | * @return boolean true when succesful |
| 67 | 67 | */ |
| 68 | 68 | private function rrmdir(string $sDir): bool { |
| 69 | - if(is_dir($sDir)) { |
|
| 69 | + if (is_dir($sDir)) { |
|
| 70 | 70 | dbglog($sDir, 'admin_plugin_openlayersmap_purge::rrmdir: recursively removing path: '); |
| 71 | 71 | $sDir = rtrim($sDir, '/'); |
| 72 | 72 | $oDir = dir($sDir); |
| 73 | - while(($sFile = $oDir->read()) !== false) { |
|
| 74 | - if($sFile !== '.' && $sFile !== '..') { |
|
| 73 | + while (($sFile = $oDir->read()) !== false) { |
|
| 74 | + if ($sFile !== '.' && $sFile !== '..') { |
|
| 75 | 75 | (!is_link("$sDir/$sFile") && is_dir("$sDir/$sFile")) ? |
| 76 | 76 | $this->rrmdir("$sDir/$sFile") : unlink("$sDir/$sFile"); |
| 77 | 77 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | '<input id="purgetiles" name="purgetiles" type="checkbox" value="1" class="checkbox" />' |
| 99 | 99 | ); |
| 100 | 100 | $form->addElement( |
| 101 | - '<label for="purgetiles" class="label">' . $this->getLang('admin_purge_tiles') |
|
| 101 | + '<label for="purgetiles" class="label">'.$this->getLang('admin_purge_tiles') |
|
| 102 | 102 | . '</label>' |
| 103 | 103 | ); |
| 104 | 104 | $form->addElement('</p>'); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $form->addElement('<p>'); |
| 109 | 109 | $form->addElement('<input id="purgemaps" name="purgemaps" type="checkbox" value="1" class="checkbox" />'); |
| 110 | 110 | $form->addElement( |
| 111 | - '<label for="purgemaps" class="label">' . $this->getLang('admin_purge_maps') . '</label>' |
|
| 111 | + '<label for="purgemaps" class="label">'.$this->getLang('admin_purge_maps').'</label>' |
|
| 112 | 112 | ); |
| 113 | 113 | $form->addElement('</p>'); |
| 114 | 114 | $form->endFieldset(); |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | * @param Doku_Event $event the DokuWiki event |
| 40 | 40 | */ |
| 41 | 41 | public function insertButton(Doku_Event $event, $param) { |
| 42 | - $strOpen = '<olmap id="olMapOne" width="550px" height="450px" lat="50.0" '; |
|
| 42 | + $strOpen = '<olmap id="olMapOne" width="550px" height="450px" lat="50.0" '; |
|
| 43 | 43 | $strOpen .= 'lon="5.1" zoom="12" controls="1" '; |
| 44 | 44 | $strOpen .= 'baselyr="OpenStreetMap" gpxfile="" kmlfile="" geojsonfile="" summary="" >\n'; |
| 45 | 45 | $strOpen .= '~~ Plugin olmap help.\n'; |
@@ -119,13 +119,13 @@ |
||
| 119 | 119 | // incremented for each olmap_wmslayer tag in the page source |
| 120 | 120 | static $overlaynumber = 0; |
| 121 | 121 | |
| 122 | - $renderer->doc .= DOKU_LF . '<script defer="defer" src="data:text/javascript;base64,'; |
|
| 123 | - $str = '{'; |
|
| 122 | + $renderer->doc .= DOKU_LF.'<script defer="defer" src="data:text/javascript;base64,'; |
|
| 123 | + $str = '{'; |
|
| 124 | 124 | foreach ($data as $key => $val) { |
| 125 | - $str .= "'" . $key . "' : '" . $val . "',"; |
|
| 125 | + $str .= "'".$key."' : '".$val."',"; |
|
| 126 | 126 | } |
| 127 | 127 | $str .= "'type':'wms'}"; |
| 128 | - $renderer->doc .= base64_encode("olMapOverlays['wms" . $overlaynumber . "'] = " . $str . ";") |
|
| 128 | + $renderer->doc .= base64_encode("olMapOverlays['wms".$overlaynumber."'] = ".$str.";") |
|
| 129 | 129 | . '"></script>'; |
| 130 | 130 | $overlaynumber++; |
| 131 | 131 | return true; |
@@ -116,13 +116,13 @@ |
||
| 116 | 116 | // incremented for each olmap_osmlayer tag in the page source |
| 117 | 117 | static $overlaynumber = 0; |
| 118 | 118 | |
| 119 | - $renderer->doc .= DOKU_LF . '<script defer="defer" src="data:text/javascript;base64,'; |
|
| 120 | - $str = '{'; |
|
| 119 | + $renderer->doc .= DOKU_LF.'<script defer="defer" src="data:text/javascript;base64,'; |
|
| 120 | + $str = '{'; |
|
| 121 | 121 | foreach ($data as $key => $val) { |
| 122 | - $str .= "'" . $key . "' : '" . $val . "',"; |
|
| 122 | + $str .= "'".$key."' : '".$val."',"; |
|
| 123 | 123 | } |
| 124 | 124 | $str .= '"type":"osm"}'; |
| 125 | - $renderer->doc .= base64_encode("olMapOverlays['osm" . $overlaynumber . "'] = " . $str . ";") |
|
| 125 | + $renderer->doc .= base64_encode("olMapOverlays['osm".$overlaynumber."'] = ".$str.";") |
|
| 126 | 126 | . '"></script>'; |
| 127 | 127 | $overlaynumber++; |
| 128 | 128 | return true; |
@@ -120,13 +120,13 @@ |
||
| 120 | 120 | // incremented for each olmap_agslayer tag in the page source |
| 121 | 121 | static $overlaynumber = 0; |
| 122 | 122 | |
| 123 | - $renderer->doc .= DOKU_LF . '<script defer="defer" src="data:text/javascript;base64,'; |
|
| 124 | - $str = '{'; |
|
| 123 | + $renderer->doc .= DOKU_LF.'<script defer="defer" src="data:text/javascript;base64,'; |
|
| 124 | + $str = '{'; |
|
| 125 | 125 | foreach ($data as $key => $val) { |
| 126 | - $str .= "'" . $key . "' : '" . $val . "',"; |
|
| 126 | + $str .= "'".$key."' : '".$val."',"; |
|
| 127 | 127 | } |
| 128 | 128 | $str .= "'type':'ags'}"; |
| 129 | - $renderer->doc .= base64_encode("olMapOverlays['ags" . $overlaynumber . "'] = " . $str . ";") |
|
| 129 | + $renderer->doc .= base64_encode("olMapOverlays['ags".$overlaynumber."'] = ".$str.";") |
|
| 130 | 130 | . '"></script>'; |
| 131 | 131 | $overlaynumber++; |
| 132 | 132 | return true; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $conf['plugin']['openlayersmap']['optionStaticMapGenerator'] = 'local'; |
| 39 | 39 | $conf['plugin']['openlayersmap']['autoZoomMap'] = 1; |
| 40 | 40 | |
| 41 | - TestUtils::rcopy(TMP_DIR, __DIR__ . '/data/'); |
|
| 41 | + TestUtils::rcopy(TMP_DIR, __DIR__.'/data/'); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | final public function setUp(): void { |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | // foreach($data as $val) { |
| 51 | 51 | // idx_addPage($val['id']); |
| 52 | 52 | // } |
| 53 | - if($conf['allowdebug']) { |
|
| 54 | - if(mkdir(DOKU_TMP_DATA . 'data/log/debug/', 0777, true)) { |
|
| 55 | - touch(DOKU_TMP_DATA . 'data/log/debug/' . date('Y-m-d') . '.log'); |
|
| 53 | + if ($conf['allowdebug']) { |
|
| 54 | + if (mkdir(DOKU_TMP_DATA.'data/log/debug/', 0777, true)) { |
|
| 55 | + touch(DOKU_TMP_DATA.'data/log/debug/'.date('Y-m-d').'.log'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | } |
@@ -63,10 +63,10 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | global $conf; |
| 65 | 65 | // try to get the debug log after running the test, print and clear |
| 66 | - if($conf['allowdebug']) { |
|
| 66 | + if ($conf['allowdebug']) { |
|
| 67 | 67 | print "\n"; |
| 68 | - readfile(DOKU_TMP_DATA . 'data/log/debug/' . date('Y-m-d') . '.log'); |
|
| 69 | - unlink(DOKU_TMP_DATA . 'data/log/debug/' . date('Y-m-d') . '.log'); |
|
| 68 | + readfile(DOKU_TMP_DATA.'data/log/debug/'.date('Y-m-d').'.log'); |
|
| 69 | + unlink(DOKU_TMP_DATA.'data/log/debug/'.date('Y-m-d').'.log'); |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |