@@ -19,12 +19,12 @@ |
||
19 | 19 | } |
20 | 20 | |
21 | 21 | public function setDraggable($draggable = true) { |
22 | - $this->setParam('draggable',(bool) $draggable); |
|
22 | + $this->setParam('draggable', (bool) $draggable); |
|
23 | 23 | return $this; |
24 | 24 | } |
25 | 25 | |
26 | 26 | public function moveOnClick($move = true) { |
27 | - $this->setParam('moveOnClick',(bool) $move); |
|
27 | + $this->setParam('moveOnClick', (bool) $move); |
|
28 | 28 | return $this; |
29 | 29 | } |
30 | 30 |
@@ -54,7 +54,7 @@ |
||
54 | 54 | 'height' => $service->getParam('container_height') ? $service->getParam('container_height') : '500', |
55 | 55 | ); |
56 | 56 | |
57 | - $html = '<div id="'.$this->_container['id'].'" style="width: '.$this->_container['width'].'px; height: '.$this->_container['height'].'px;"> </div> '; |
|
57 | + $html = '<div id="' . $this->_container['id'] . '" style="width: ' . $this->_container['width'] . 'px; height: ' . $this->_container['height'] . 'px;"> </div> '; |
|
58 | 58 | return $html; |
59 | 59 | } |
60 | 60 |
@@ -80,7 +80,7 @@ |
||
80 | 80 | ); |
81 | 81 | }); |
82 | 82 | '; |
83 | - $this->_scripts[] = $script; |
|
83 | + $this->_scripts[] = $script; |
|
84 | 84 | |
85 | 85 | return $return; |
86 | 86 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | var script = document.createElement("script"); |
19 | 19 | script.type = "text/javascript"; |
20 | 20 | script.async = false; |
21 | - script.src = "'.$this->getScriptURL().'"; |
|
21 | + script.src = "'.$this->getScriptURL() . '"; |
|
22 | 22 | document.documentElement.firstChild.appendChild(script); |
23 | 23 | </script> |
24 | 24 | '; |
@@ -40,16 +40,16 @@ discard block |
||
40 | 40 | $html = ' |
41 | 41 | function loadMap() { |
42 | 42 | if (GBrowserIsCompatible()) { |
43 | - var map = new GMap2(document.getElementById("'.$this->_container['id'].'"));'; |
|
43 | + var map = new GMap2(document.getElementById("'.$this->_container['id'] . '"));'; |
|
44 | 44 | $center = $this->getService()->getParam('center'); |
45 | 45 | if (is_array($center) && count($center) == 3) { |
46 | - list($cLat,$cLng, $cZoom) = $center; |
|
46 | + list($cLat, $cLng, $cZoom) = $center; |
|
47 | 47 | } else { |
48 | 48 | $cLat = '37.4419'; |
49 | 49 | $cLng = '-122.1419'; |
50 | 50 | $cZoom = '1'; |
51 | 51 | } |
52 | - $html .= 'map.setCenter(new GLatLng('.$cLat.','.$cLng.' ), '.$cZoom.');'; |
|
52 | + $html .= 'map.setCenter(new GLatLng(' . $cLat . ',' . $cLng . ' ), ' . $cZoom . ');'; |
|
53 | 53 | $html .= 'map.setUIToDefault();'; |
54 | 54 | return $html; |
55 | 55 | } |
@@ -88,17 +88,17 @@ discard block |
||
88 | 88 | public function renderMarker($marker) { |
89 | 89 | $html = ''; |
90 | 90 | if ($marker->latitude && $marker->longitude) { |
91 | - $html .= 'var latlng = new GLatLng('.$marker->latitude.', '.$marker->longitude.');'; |
|
91 | + $html .= 'var latlng = new GLatLng(' . $marker->latitude . ', ' . $marker->longitude . ');'; |
|
92 | 92 | } else { |
93 | 93 | $html .= 'var latlng = map.getCenter();'; |
94 | 94 | } |
95 | 95 | $options = array( |
96 | 96 | 'draggable' => $marker->getParam('draggable'), |
97 | 97 | ); |
98 | - $html .= 'var marker = new GMarker(latlng, ' . json_encode($options) . ');'; |
|
98 | + $html .= 'var marker = new GMarker(latlng, ' . json_encode($options) . ');'; |
|
99 | 99 | if ($marker->getParam('info')) { |
100 | - $html .= 'GEvent.addListener(marker, "click", function() { |
|
101 | - marker.openInfoWindowHtml("'.$marker->getParam('info').'"); |
|
100 | + $html .= 'GEvent.addListener(marker, "click", function() { |
|
101 | + marker.openInfoWindowHtml("'.$marker->getParam('info') . '"); |
|
102 | 102 | }); |
103 | 103 | GEvent.addListener(marker, "dragstart", function() { |
104 | 104 | map.closeInfoWindow(); |
@@ -118,13 +118,13 @@ discard block |
||
118 | 118 | $listeners = $marker->getListeners(); |
119 | 119 | foreach ($listeners as $type=>$functions) { |
120 | 120 | foreach ($functions as $function) { |
121 | - $html .= 'GEvent.addListener(marker, "'.$type.'", function() { |
|
122 | - '.$function.' |
|
121 | + $html .= 'GEvent.addListener(marker, "' . $type . '", function() { |
|
122 | + '.$function . ' |
|
123 | 123 | }); |
124 | 124 | '; |
125 | 125 | } |
126 | 126 | } |
127 | - $html .= 'map.addOverlay(marker);'; |
|
127 | + $html .= 'map.addOverlay(marker);'; |
|
128 | 128 | return $html; |
129 | 129 | } |
130 | 130 | } |
@@ -3,40 +3,40 @@ |
||
3 | 3 | class Nip_Service_Google_Charts |
4 | 4 | { |
5 | 5 | |
6 | - protected $_url = "http://chart.apis.google.com/chart"; |
|
6 | + protected $_url = "http://chart.apis.google.com/chart"; |
|
7 | 7 | |
8 | - /** |
|
9 | - * Chart factory |
|
10 | - * |
|
11 | - * @param string $type |
|
12 | - * @return Nip_Service_Google_Charts_Chart |
|
13 | - */ |
|
14 | - public function getChart($type = "Line") |
|
15 | - { |
|
16 | - $class = "Nip_Service_Google_Charts_Chart_" . $type; |
|
8 | + /** |
|
9 | + * Chart factory |
|
10 | + * |
|
11 | + * @param string $type |
|
12 | + * @return Nip_Service_Google_Charts_Chart |
|
13 | + */ |
|
14 | + public function getChart($type = "Line") |
|
15 | + { |
|
16 | + $class = "Nip_Service_Google_Charts_Chart_" . $type; |
|
17 | 17 | |
18 | - $chart = new $class(); |
|
19 | - $chart->setService($this); |
|
18 | + $chart = new $class(); |
|
19 | + $chart->setService($this); |
|
20 | 20 | |
21 | - return $chart; |
|
22 | - } |
|
21 | + return $chart; |
|
22 | + } |
|
23 | 23 | |
24 | - public function getURL() |
|
25 | - { |
|
26 | - return $this->_url; |
|
27 | - } |
|
24 | + public function getURL() |
|
25 | + { |
|
26 | + return $this->_url; |
|
27 | + } |
|
28 | 28 | |
29 | - /** |
|
30 | - * Singleton |
|
31 | - * |
|
32 | - * @return Nip_Service_Google_Charts |
|
33 | - */ |
|
34 | - static public function instance() |
|
35 | - { |
|
36 | - static $instance; |
|
37 | - if (!($instance instanceof self)) { |
|
38 | - $instance = new self(); |
|
39 | - } |
|
40 | - return $instance; |
|
41 | - } |
|
29 | + /** |
|
30 | + * Singleton |
|
31 | + * |
|
32 | + * @return Nip_Service_Google_Charts |
|
33 | + */ |
|
34 | + static public function instance() |
|
35 | + { |
|
36 | + static $instance; |
|
37 | + if (!($instance instanceof self)) { |
|
38 | + $instance = new self(); |
|
39 | + } |
|
40 | + return $instance; |
|
41 | + } |
|
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -3,29 +3,29 @@ |
||
3 | 3 | class Nip_Object |
4 | 4 | { |
5 | 5 | |
6 | - protected $_data; |
|
6 | + protected $_data; |
|
7 | 7 | |
8 | - public function &__get($name) |
|
9 | - { |
|
10 | - if (!$this->__isset($name)) { |
|
11 | - $this->_data[$name] = null; |
|
12 | - } |
|
13 | - return $this->_data[$name]; |
|
14 | - } |
|
8 | + public function &__get($name) |
|
9 | + { |
|
10 | + if (!$this->__isset($name)) { |
|
11 | + $this->_data[$name] = null; |
|
12 | + } |
|
13 | + return $this->_data[$name]; |
|
14 | + } |
|
15 | 15 | |
16 | - public function __set($name, $value) |
|
17 | - { |
|
18 | - $this->_data[$name] = $value; |
|
19 | - } |
|
16 | + public function __set($name, $value) |
|
17 | + { |
|
18 | + $this->_data[$name] = $value; |
|
19 | + } |
|
20 | 20 | |
21 | - public function __isset($name) |
|
22 | - { |
|
23 | - return isset($this->_data[$name]); |
|
24 | - } |
|
21 | + public function __isset($name) |
|
22 | + { |
|
23 | + return isset($this->_data[$name]); |
|
24 | + } |
|
25 | 25 | |
26 | - public function __unset($name) |
|
27 | - { |
|
28 | - unset($this->_data[$name]); |
|
29 | - } |
|
26 | + public function __unset($name) |
|
27 | + { |
|
28 | + unset($this->_data[$name]); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | } |
32 | 32 | \ No newline at end of file |
@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | public function render() |
31 | 31 | { |
32 | - $return = '<fieldset'.$this->renderAttributes().'>'; |
|
32 | + $return = '<fieldset' . $this->renderAttributes() . '>'; |
|
33 | 33 | $return .= '<legend>' . $this->getGroup()->getLegend() . '</legend>'; |
34 | 34 | |
35 | 35 | $renderer = clone $this->getGroup()->getForm()->getRenderer(); |
@@ -10,7 +10,6 @@ |
||
10 | 10 | |
11 | 11 | |
12 | 12 | /** |
13 | - * @param Nip_Form_DisplayGroup $form |
|
14 | 13 | * @return Nip_Form_Renderer_DisplayGroup |
15 | 14 | */ |
16 | 15 | public function setGroup(Nip_Form_DisplayGroup $group) |
@@ -2,7 +2,7 @@ |
||
2 | 2 | class Nip_Form_Renderer_Button_Button extends Nip_Form_Renderer_Button_Abstract { |
3 | 3 | |
4 | 4 | public function generateItem() { |
5 | - $return = '<button '.$this->renderAttributes().'> |
|
5 | + $return = '<button ' . $this->renderAttributes() . '> |
|
6 | 6 | ' . $this->getItem()->getLabel() . ' |
7 | 7 | </button>'; |
8 | 8 | return $return; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | /** |
13 | 13 | * @return Nip_Form_Renderer_Abstract |
14 | - */ |
|
14 | + */ |
|
15 | 15 | public function getRenderer() { |
16 | 16 | return $this->_renderer; |
17 | 17 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | /** |
25 | 25 | * @return Nip_Form_Button_Abstract |
26 | - */ |
|
26 | + */ |
|
27 | 27 | public function getItem() { |
28 | 28 | return $this->_item; |
29 | 29 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | public function renderItem() { |
40 | - $return = $this->generateItem(); |
|
40 | + $return = $this->generateItem(); |
|
41 | 41 | return $return; |
42 | 42 | } |
43 | 43 |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | public function generateItem() { |
5 | 5 | $this->getItem()->setValue($this->getItem()->getLabel()); |
6 | - $return = '<input '.$this->renderAttributes().' />'; |
|
6 | + $return = '<input ' . $this->renderAttributes() . ' />'; |
|
7 | 7 | return $return; |
8 | 8 | } |
9 | 9 |