@@ -14,22 +14,22 @@ discard block |
||
| 14 | 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 | 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 16 | 16 | */ |
| 17 | -if (! defined ( 'DOKU_INC' )) |
|
| 17 | +if (!defined('DOKU_INC')) |
|
| 18 | 18 | die (); |
| 19 | 19 | |
| 20 | -if (! defined ( 'DOKU_LF' )) |
|
| 21 | - define ( 'DOKU_LF', "\n" ); |
|
| 22 | -if (! defined ( 'DOKU_TAB' )) |
|
| 23 | - define ( 'DOKU_TAB', "\t" ); |
|
| 24 | -if (! defined ( 'DOKU_PLUGIN' )) |
|
| 25 | - define ( 'DOKU_PLUGIN', DOKU_INC . 'lib/plugins/' ); |
|
| 20 | +if (!defined('DOKU_LF')) |
|
| 21 | + define('DOKU_LF', "\n"); |
|
| 22 | +if (!defined('DOKU_TAB')) |
|
| 23 | + define('DOKU_TAB', "\t"); |
|
| 24 | +if (!defined('DOKU_PLUGIN')) |
|
| 25 | + define('DOKU_PLUGIN', DOKU_INC.'lib/plugins/'); |
|
| 26 | 26 | |
| 27 | -require_once DOKU_PLUGIN . 'syntax.php'; |
|
| 27 | +require_once DOKU_PLUGIN.'syntax.php'; |
|
| 28 | 28 | /** |
| 29 | 29 | * adds a WMS 1.1.1 layer to your map. |
| 30 | 30 | */ |
| 31 | 31 | class syntax_plugin_openlayersmapoverlays_searchlayer extends DokuWiki_Syntax_Plugin { |
| 32 | - private $dflt = array ( |
|
| 32 | + private $dflt = array( |
|
| 33 | 33 | 'id' => 'olmap', |
| 34 | 34 | 'name' => '', |
| 35 | 35 | 'search' => '', |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | * @see Doku_Parser_Mode::connectTo() |
| 77 | 77 | */ |
| 78 | 78 | public function connectTo($mode) { |
| 79 | - $this->Lexer->addSpecialPattern ( '<olmap_searchlayer ?[^>\n]*>.*?</olmap_searchlayer>', |
|
| 80 | - $mode, 'plugin_openlayersmapoverlays_searchlayer' ); |
|
| 79 | + $this->Lexer->addSpecialPattern('<olmap_searchlayer ?[^>\n]*>.*?</olmap_searchlayer>', |
|
| 80 | + $mode, 'plugin_openlayersmapoverlays_searchlayer'); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -86,19 +86,19 @@ discard block |
||
| 86 | 86 | * @see DokuWiki_Syntax_Plugin::handle() |
| 87 | 87 | */ |
| 88 | 88 | public function handle($match, $state, $pos, Doku_Handler $handler) { |
| 89 | - $param = array (); |
|
| 89 | + $param = array(); |
|
| 90 | 90 | $data = $this->dflt; |
| 91 | 91 | |
| 92 | - preg_match_all ( '/(\w*)="(.*?)"/us', $match, $param, PREG_SET_ORDER ); |
|
| 92 | + preg_match_all('/(\w*)="(.*?)"/us', $match, $param, PREG_SET_ORDER); |
|
| 93 | 93 | |
| 94 | - foreach ( $param as $kvpair ) { |
|
| 95 | - list ( $matched, $key, $val ) = $kvpair; |
|
| 96 | - if (isset ( $data [$key] )) { |
|
| 97 | - $key = strtolower ( $key ); |
|
| 94 | + foreach ($param as $kvpair) { |
|
| 95 | + list ($matched, $key, $val) = $kvpair; |
|
| 96 | + if (isset ($data [$key])) { |
|
| 97 | + $key = strtolower($key); |
|
| 98 | 98 | $data [$key] = $val; |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | - dbglog($data,'syntax_plugin_overlayer::handle: parsed data is:'); |
|
| 101 | + dbglog($data, 'syntax_plugin_overlayer::handle: parsed data is:'); |
|
| 102 | 102 | return $data; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -112,22 +112,22 @@ discard block |
||
| 112 | 112 | return false; |
| 113 | 113 | |
| 114 | 114 | static $loadedOLlib = false; |
| 115 | - if (! $loadedOLlib) { |
|
| 116 | - $renderer->doc .= DOKU_LF . '<script type="text/javascript" src="' . DOKU_BASE . 'lib/plugins/openlayersmapoverlays/lib/layers.js' . '"></script>'; |
|
| 115 | + if (!$loadedOLlib) { |
|
| 116 | + $renderer->doc .= DOKU_LF.'<script type="text/javascript" src="'.DOKU_BASE.'lib/plugins/openlayersmapoverlays/lib/layers.js'.'"></script>'; |
|
| 117 | 117 | $loadedOLlib = true; |
| 118 | 118 | } |
| 119 | 119 | // incremented for each olmap_wmslayer tag in the page source |
| 120 | 120 | static $overlaynumber = 0; |
| 121 | 121 | |
| 122 | - list ( $id, $url, $name, $visible ) = $data; |
|
| 123 | - $renderer->doc .= DOKU_LF . "<script type='text/javascript'><!--//--><![CDATA[//><!--" . DOKU_LF; |
|
| 122 | + list ($id, $url, $name, $visible) = $data; |
|
| 123 | + $renderer->doc .= DOKU_LF."<script type='text/javascript'><!--//--><![CDATA[//><!--".DOKU_LF; |
|
| 124 | 124 | $str = '{'; |
| 125 | - foreach ( $data as $key => $val ) { |
|
| 126 | - $str .= "'" . $key . "' : '" . $val . "',"; |
|
| 125 | + foreach ($data as $key => $val) { |
|
| 126 | + $str .= "'".$key."' : '".$val."',"; |
|
| 127 | 127 | } |
| 128 | 128 | $str .= "'type':'wms'}"; |
| 129 | - $renderer->doc .= "olMapOverlays['wms" . $overlaynumber . "'] = " . $str . ";" . DOKU_LF . "//--><!]]></script>"; |
|
| 130 | - $overlaynumber ++; |
|
| 129 | + $renderer->doc .= "olMapOverlays['wms".$overlaynumber."'] = ".$str.";".DOKU_LF."//--><!]]></script>"; |
|
| 130 | + $overlaynumber++; |
|
| 131 | 131 | return true; |
| 132 | 132 | } |
| 133 | 133 | } |