r7164 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r7163‎ | r7164 | r7165 >
Date:14:48, 18 January 2005
Author:magnus_manske
Status:old
Tags:
Comment:
style improvements
Modified paths:
  • /trunk/extensions/geo/geo.php (modified) (history)
  • /trunk/extensions/geo/index.php (modified) (history)

Diff [purge]

Index: trunk/extensions/geo/geo.php
@@ -40,18 +40,31 @@
4141 $b = explode ( ";" , str_replace ( "," , ";" , $a[0] ) ) ;
4242 foreach ( $b AS $c )
4343 {
44 - if ( $key == "style" )
45 - $this->styles[$c][] = $a[1] ;
46 - else if ( $key == "label" )
 44+# if ( $key == "style" )
4745 {
4846 $d = explode ( ";" , str_replace ( "," , ";" , $a[1] ) ) ;
4947 foreach ( $d AS $e )
5048 {
5149 $e = explode ( ":" , $e ) ;
 50+ $va = trim ( strtolower ( $e[0] ) ) ;
 51+ if ( count ( $e ) < 2 ) $vb = "" ; #/*$this->styles*/$kv[$c][$e[0]] = "" ;
 52+ else $vb = trim ( strtolower ( $e[1] ) ) ;# /*$this->styles*/$kv[$c][$e[0]] = trim ( strtolower ( $e[1] ) ) ;
 53+ if ( $key == "style" ) $this->styles[$c][$va] = $vb ;
 54+ else $this->label_styles[$c][$va] = $vb ;
 55+# print "{$va} : " .$vb. "\n" ;
 56+ }
 57+ }
 58+# $this->styles[$c][] = $a[1] ;
 59+/* else if ( $key == "label" )
 60+ {
 61+ $d = explode ( ";" , str_replace ( "," , ";" , $a[1] ) ) ;
 62+ foreach ( $d AS $e )
 63+ {
 64+ $e = explode ( ":" , $e ) ;
5265 if ( count ( $e ) < 2 ) $this->label_styles[$c][$e[0]] = "" ;
5366 else $this->label_styles[$c][$e[0]] = $e[1] ;
5467 }
55 - }
 68+ }*/
5669 }
5770 }
5871 }
@@ -244,6 +257,7 @@
245258 $s .= "' x='{$x}' y='{$y}'>{$text}</text>" ;
246259 if ( isset ( $l['href'] ) )
247260 {
 261+ print $l['href'] . "\n" ;
248262 $href = $l['href'] ;
249263 $s = "<a xlink:href={$href}>{$s}</a>" ;
250264 }
@@ -569,7 +583,10 @@
570584 if ( $k != "" ) $ret[strtolower($k)] = strtolower($v) ;
571585 }
572586 }
573 - $ret = "style=\"" . implode ( "; " , $ret ) . "\"" ;
 587+ $s = "" ;
 588+ foreach ( $ret AS $k => $v )
 589+ $s .= "{$k}:{$v}; " ;
 590+ $ret = "style=\"{$s}\"" ;
574591 return $ret ;
575592 # $t = trim ( strtolower ( $this->get_current_type ( $params ) ) ) ;
576593 # $s = $params->get_styles ( $this->id , $t ) ;
Index: trunk/extensions/geo/index.php
@@ -17,7 +17,7 @@
1818 draw:germany.bavaria.cities#munich
1919 style:germany[state],germany[isle]=fill:#CCCCCC; stroke:black; stroke-width:10
2020 style:germany.hamburg=fill:red
21 -label:germany.bavaria.cities#munich=font-size:medium;fill-opacity:1.0;clickable
 21+label:germany.bavaria.cities#munich=font-size:medium;fill-opacity:1.0;clickable:yes
2222 label:germany[state]=font-size:medium;fill-opacity:0.7
2323 " ) ;
2424

Status & tagging log