@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | if (false) parent::__construct(); |
36 | 36 | |
37 | 37 | // Title not set for new widgets created via context menu |
38 | - if(!$context['title']) |
|
38 | + if (!$context['title']) |
|
39 | 39 | { |
40 | 40 | // Set initial size to 3x2, default is too small |
41 | 41 | $context['width'] = 3; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $id = $_GET['id'] ? $_GET['id'] : $content['id']; |
57 | 57 | $height = $_GET['height'] ? $_GET['height'] : $content['height']; |
58 | 58 | |
59 | - if($content['group'] && $GLOBALS['egw_info']['apps']['admin']) |
|
59 | + if ($content['group'] && $GLOBALS['egw_info']['apps']['admin']) |
|
60 | 60 | { |
61 | 61 | $prefs = new Api\Preferences(is_numeric($content['group']) ? $content['group'] : $GLOBALS['egw_info']['user']['account_id']); |
62 | 62 | } |
@@ -67,18 +67,18 @@ discard block |
||
67 | 67 | $type = is_numeric($content['group']) ? "user" : $content['group']; |
68 | 68 | $arr = $prefs->read_repository(); |
69 | 69 | $portlets = $arr['home']; |
70 | - if($content['button']) |
|
70 | + if ($content['button']) |
|
71 | 71 | { |
72 | 72 | // Save updated Api\Preferences |
73 | 73 | $portlets[$id]['note'] = $content['note']; |
74 | - $prefs->add('home', $id, $portlets[$id],$type); |
|
75 | - $prefs->save_repository(True,$type); |
|
74 | + $prefs->add('home', $id, $portlets[$id], $type); |
|
75 | + $prefs->save_repository(True, $type); |
|
76 | 76 | // Yay for AJAX submit |
77 | - Api\Json\Response::get()->apply('window.opener.app.home.refresh',array($id)); |
|
77 | + Api\Json\Response::get()->apply('window.opener.app.home.refresh', array($id)); |
|
78 | 78 | |
79 | - if(key($content['button'])=='save') |
|
79 | + if (key($content['button']) == 'save') |
|
80 | 80 | { |
81 | - Api\Json\Response::get()->apply('window.close',array()); |
|
81 | + Api\Json\Response::get()->apply('window.close', array()); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | $etemplate = new Etemplate('home.note'); |
@@ -90,15 +90,15 @@ discard block |
||
90 | 90 | 'height' => $height, |
91 | 91 | 'group' => $portlets[$id]['group'] |
92 | 92 | ); |
93 | - $etemplate->exec('home.home_note_portlet.edit',array( |
|
93 | + $etemplate->exec('home.home_note_portlet.edit', array( |
|
94 | 94 | 'note' => $portlets[$id]['note'] |
95 | - ), array(),array('note'=>false,'save'=>false), $preserve); |
|
95 | + ), array(), array('note'=>false, 'save'=>false), $preserve); |
|
96 | 96 | } |
97 | 97 | |
98 | - public function exec($id = null, Etemplate &$etemplate = null) |
|
98 | + public function exec($id = null, Etemplate&$etemplate = null) |
|
99 | 99 | { |
100 | 100 | // Allow to submit directly back here |
101 | - if(is_array($id) && $id['id']) |
|
101 | + if (is_array($id) && $id['id']) |
|
102 | 102 | { |
103 | 103 | $id = $id['id']; |
104 | 104 | } |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | $etemplate->set_dom_id($id); |
108 | 108 | $content = $this->context; |
109 | 109 | |
110 | - if(!$content['note']) |
|
110 | + if (!$content['note']) |
|
111 | 111 | { |
112 | 112 | $content['note'] = ''; |
113 | - Api\Json\Response::get()->apply('app.home.note_edit',array($id)); |
|
113 | + Api\Json\Response::get()->apply('app.home.note_edit', array($id)); |
|
114 | 114 | } |
115 | 115 | |
116 | - $etemplate->exec('home.home_note_portlet.exec',$content,array(),array('__ALL__'=>true),array('id' =>$id)); |
|
116 | + $etemplate->exec('home.home_note_portlet.exec', $content, array(), array('__ALL__'=>true), array('id' =>$id)); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | public function get_actions() |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * |
50 | 50 | * @param boolean $need_reload Flag to indicate that the portlet needs to be reloaded (exec will be called) |
51 | 51 | */ |
52 | - public function __construct(Array &$context = array(), &$need_reload = false) |
|
52 | + public function __construct(array &$context = array(), &$need_reload = false) |
|
53 | 53 | { |
54 | 54 | if (false) parent::__construct(); |
55 | 55 |
@@ -51,7 +51,10 @@ |
||
51 | 51 | */ |
52 | 52 | public function __construct(Array &$context = array(), &$need_reload = false) |
53 | 53 | { |
54 | - if (false) parent::__construct(); |
|
54 | + if (false) |
|
55 | + { |
|
56 | + parent::__construct(); |
|
57 | + } |
|
55 | 58 | |
56 | 59 | // Process dropped data into something useable |
57 | 60 | if($context['dropped_data']) |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | if (false) parent::__construct(); |
40 | 40 | |
41 | 41 | // City not set for new widgets created via context menu |
42 | - if(!$context['city'] || $context['height'] < 2) |
|
42 | + if (!$context['city'] || $context['height'] < 2) |
|
43 | 43 | { |
44 | 44 | // Set initial size to 3x2, default is too small |
45 | 45 | $context['width'] = 3; |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | $this->context = $context; |
52 | 52 | } |
53 | 53 | |
54 | - public function exec($id = null, Etemplate &$etemplate = null) |
|
54 | + public function exec($id = null, Etemplate&$etemplate = null) |
|
55 | 55 | { |
56 | 56 | // Allow to submit directly back here |
57 | - if(is_array($id) && $id['id']) |
|
57 | + if (is_array($id) && $id['id']) |
|
58 | 58 | { |
59 | 59 | $id = $id['id']; |
60 | 60 | } |
@@ -68,24 +68,24 @@ discard block |
||
68 | 68 | // Always get (& cache) 10 days, we'll cut down later |
69 | 69 | 'cnt' => 10 |
70 | 70 | ); |
71 | - if($this->context['city_id']) |
|
71 | + if ($this->context['city_id']) |
|
72 | 72 | { |
73 | 73 | $request['id'] = $this->context['city_id']; |
74 | 74 | $content += $this->get_weather($request); |
75 | 75 | } |
76 | - elseif($this->context['city']) |
|
76 | + elseif ($this->context['city']) |
|
77 | 77 | { |
78 | 78 | $request['q'] = $this->context['city']; |
79 | 79 | $content += $this->get_weather($request); |
80 | 80 | } |
81 | 81 | elseif ($this->context['position']) |
82 | 82 | { |
83 | - list($request['lat'],$request['lon']) = explode(',',$this->context['position']); |
|
83 | + list($request['lat'], $request['lon']) = explode(',', $this->context['position']); |
|
84 | 84 | $content += $this->get_weather($request); |
85 | 85 | } |
86 | 86 | |
87 | 87 | // Caching is best done by city ID, so store that |
88 | - if($content['city_id'] && (!$this->context['city_id'] || $content['city_id'] != $this->context['city_id'])) |
|
88 | + if ($content['city_id'] && (!$this->context['city_id'] || $content['city_id'] != $this->context['city_id'])) |
|
89 | 89 | { |
90 | 90 | |
91 | 91 | $arr = $GLOBALS['egw']->preferences->read_repository(); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | // Adjust data to match portlet size |
104 | - if($this->context['height'] <= 2 && $this->context['width'] <= 3) |
|
104 | + if ($this->context['height'] <= 2 && $this->context['width'] <= 3) |
|
105 | 105 | { |
106 | 106 | // Too small for the other days |
107 | 107 | unset($content['list']); |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | unset($content['current']); |
113 | 113 | } |
114 | 114 | // Even too small for current high/low |
115 | - if($this->context['width'] < 3) |
|
115 | + if ($this->context['width'] < 3) |
|
116 | 116 | { |
117 | 117 | $content['current']['no_current_temp'] = true; |
118 | 118 | } |
119 | 119 | |
120 | 120 | |
121 | 121 | // Direct to full forecast page |
122 | - $content['attribution'] ='http://openweathermap.org/city/'.$content['city_id']; |
|
122 | + $content['attribution'] = 'http://openweathermap.org/city/'.$content['city_id']; |
|
123 | 123 | |
124 | - $etemplate->exec('home.home_weather_portlet.exec',$content,array(),array('__ALL__'=>true),array('id' =>$id)); |
|
124 | + $etemplate->exec('home.home_weather_portlet.exec', $content, array(), array('__ALL__'=>true), array('id' =>$id)); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -133,27 +133,27 @@ discard block |
||
133 | 133 | public function get_weather(Array $query, $api_url = '') |
134 | 134 | { |
135 | 135 | static $debug = false; |
136 | - if(!$api_url) |
|
136 | + if (!$api_url) |
|
137 | 137 | { |
138 | - $api_url = self::API_URL . '/weather?'; |
|
138 | + $api_url = self::API_URL.'/weather?'; |
|
139 | 139 | } |
140 | - if(self::API_KEY) |
|
140 | + if (self::API_KEY) |
|
141 | 141 | { |
142 | 142 | $query['APPID'] = self::API_KEY; |
143 | 143 | } |
144 | 144 | $data = Api\Cache::getTree('home', json_encode($query), function($query) |
145 | 145 | { |
146 | 146 | $debug = false; |
147 | - if($debug) error_log('Fetching fresh data from ' . static::API_URL); |
|
147 | + if ($debug) error_log('Fetching fresh data from '.static::API_URL); |
|
148 | 148 | |
149 | - $url = static::API_URL.'forecast/daily?'. http_build_query($query); |
|
149 | + $url = static::API_URL.'forecast/daily?'.http_build_query($query); |
|
150 | 150 | $forecast = file_get_contents($url); |
151 | 151 | |
152 | - $url = static::API_URL.'weather?'. http_build_query($query); |
|
152 | + $url = static::API_URL.'weather?'.http_build_query($query); |
|
153 | 153 | $current = file_get_contents($url); |
154 | - if($debug) error_log(__METHOD__ . ' current: ' . $current); |
|
154 | + if ($debug) error_log(__METHOD__.' current: '.$current); |
|
155 | 155 | |
156 | - return array_merge(array('current' => json_decode($current,true)), json_decode($forecast,true)); |
|
156 | + return array_merge(array('current' => json_decode($current, true)), json_decode($forecast, true)); |
|
157 | 157 | }, array($query), self::CACHE_TIME); |
158 | 158 | |
159 | 159 | // Some sample data, if you need to test |
@@ -161,22 +161,22 @@ discard block |
||
161 | 161 | //$weather = '{"coord":{"lon":-114.05,"lat":53.23},"sys":{"message":0.3098,"country":"Canada","sunrise":1420559329,"sunset":1420587344},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"base":"cmc stations","main":{"temp":-21.414,"temp_min":-21.414,"temp_max":-21.414,"pressure":947.79,"sea_level":1050.73,"grnd_level":947.79,"humidity":69},"wind":{"speed":3,"deg":273.5},"clouds":{"all":32},"dt":1420502430,"id":0,"name":"Thorsby","cod":200}'; |
162 | 162 | //$weather = '{"cod":"200","message":0.1743,"city":{"id":"5978233","name":"Thorsby","coord":{"lon":-114.051,"lat":53.2285},"country":"Canada","population":0},"cnt":6,"list":[{"dt":1420743600,"temp":{"day":-17.49,"min":-27.86,"max":-16.38,"night":-27.86,"eve":-19.91,"morn":-16.77},"pressure":966.21,"humidity":66,"weather":[{"id":800,"main":"Clear","description":"sky is clear","icon":"01d"}],"speed":6.91,"deg":312,"clouds":0,"snow":0.02},{"dt":1420830000,"temp":{"day":-24.86,"min":-29.71,"max":-17.98,"night":-18.31,"eve":-18.32,"morn":-29.51},"pressure":948.46,"humidity":54,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"speed":3.21,"deg":166,"clouds":20},{"dt":1420916400,"temp":{"day":-18.51,"min":-25.57,"max":-17.86,"night":-23.83,"eve":-23.91,"morn":-19.28},"pressure":947.22,"humidity":74,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"speed":1.97,"deg":314,"clouds":48},{"dt":1421002800,"temp":{"day":-26.69,"min":-29.86,"max":-20.19,"night":-21.82,"eve":-24.66,"morn":-28.85},"pressure":951.93,"humidity":22,"weather":[{"id":800,"main":"Clear","description":"sky is clear","icon":"02d"}],"speed":1.36,"deg":196,"clouds":8},{"dt":1421089200,"temp":{"day":0.9,"min":-8.24,"max":0.9,"night":-4.99,"eve":-0.21,"morn":-8.24},"pressure":929.31,"humidity":0,"weather":[{"id":800,"main":"Clear","description":"sky is clear","icon":"01d"}],"speed":6.01,"deg":302,"clouds":5,"snow":0},{"dt":1421175600,"temp":{"day":-1.53,"min":-6.7,"max":2.23,"night":-3.65,"eve":2.23,"morn":-6.7},"pressure":934.51,"humidity":0,"weather":[{"id":800,"main":"Clear","description":"sky is clear","icon":"01d"}],"speed":3.9,"deg":201,"clouds":78}]}'; |
163 | 163 | |
164 | - if($debug) |
|
164 | + if ($debug) |
|
165 | 165 | { |
166 | - error_log(__METHOD__ .' weather info:'); |
|
167 | - foreach(array_keys($data) as $key) |
|
166 | + error_log(__METHOD__.' weather info:'); |
|
167 | + foreach (array_keys($data) as $key) |
|
168 | 168 | { |
169 | - error_log($key . ': ' .array2string($data[$key])); |
|
169 | + error_log($key.': '.array2string($data[$key])); |
|
170 | 170 | } |
171 | 171 | } |
172 | - if(is_string($data['message'])) |
|
172 | + if (is_string($data['message'])) |
|
173 | 173 | { |
174 | 174 | $desc = $this->get_description(); |
175 | - Framework::message($desc['displayName'] . ': ' . $desc['title'] . "\n".$data['message'], 'warning'); |
|
175 | + Framework::message($desc['displayName'].': '.$desc['title']."\n".$data['message'], 'warning'); |
|
176 | 176 | return array(); |
177 | 177 | } |
178 | 178 | |
179 | - if(array_key_exists('city', $data)) |
|
179 | + if (array_key_exists('city', $data)) |
|
180 | 180 | { |
181 | 181 | $data['city_id'] = $data['city']['id']; |
182 | 182 | } |
@@ -184,23 +184,23 @@ discard block |
||
184 | 184 | { |
185 | 185 | $data['city_id'] = $data['id']; |
186 | 186 | } |
187 | - if($data['list']) |
|
187 | + if ($data['list']) |
|
188 | 188 | { |
189 | - $massage =& $data['list']; |
|
189 | + $massage = & $data['list']; |
|
190 | 190 | |
191 | - for($i = 0; $i < min(count($massage), $this->context['width']); $i++) |
|
191 | + for ($i = 0; $i < min(count($massage), $this->context['width']); $i++) |
|
192 | 192 | { |
193 | - $forecast =& $massage[$i]; |
|
194 | - $forecast['day'] = Api\DateTime::to($forecast['dt'],'l'); |
|
193 | + $forecast = & $massage[$i]; |
|
194 | + $forecast['day'] = Api\DateTime::to($forecast['dt'], 'l'); |
|
195 | 195 | self::format_forecast($forecast); |
196 | 196 | } |
197 | 197 | // Chop data to fit into portlet |
198 | - for($i; $i < count($massage); $i++) |
|
198 | + for ($i; $i < count($massage); $i++) |
|
199 | 199 | { |
200 | 200 | unset($massage[$i]); |
201 | 201 | } |
202 | 202 | } |
203 | - if($data['current'] && is_array($data['current'])) |
|
203 | + if ($data['current'] && is_array($data['current'])) |
|
204 | 204 | { |
205 | 205 | // Current weather |
206 | 206 | $data['current']['temp'] = $data['current']['main']; |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | if ($data['list']) |
212 | 212 | { |
213 | - $data['current']['temp'] = array_merge($data['current']['temp'],$data['list'][0]['temp']); |
|
213 | + $data['current']['temp'] = array_merge($data['current']['temp'], $data['list'][0]['temp']); |
|
214 | 214 | } |
215 | 215 | return $data; |
216 | 216 | } |
@@ -220,22 +220,22 @@ discard block |
||
220 | 220 | */ |
221 | 221 | protected static function format_forecast(&$data) |
222 | 222 | { |
223 | - $weather =& $data['weather'] ? $data['weather'] : $data; |
|
224 | - $temp =& $data['temp'] ? $data['temp'] : $data; |
|
223 | + $weather = & $data['weather'] ? $data['weather'] : $data; |
|
224 | + $temp = & $data['temp'] ? $data['temp'] : $data; |
|
225 | 225 | |
226 | 226 | // Full URL for icon |
227 | - if(is_array($weather)) |
|
227 | + if (is_array($weather)) |
|
228 | 228 | { |
229 | - foreach($weather as &$w) |
|
229 | + foreach ($weather as &$w) |
|
230 | 230 | { |
231 | - $w['icon'] = static::ICON_URL . $w['icon'].'.png'; |
|
231 | + $w['icon'] = static::ICON_URL.$w['icon'].'.png'; |
|
232 | 232 | } |
233 | 233 | } |
234 | 234 | |
235 | 235 | // Round |
236 | - foreach(array('temp','temp_min','temp_max','min','max') as $temp_name) |
|
236 | + foreach (array('temp', 'temp_min', 'temp_max', 'min', 'max') as $temp_name) |
|
237 | 237 | { |
238 | - if(array_key_exists($temp_name, $temp)) |
|
238 | + if (array_key_exists($temp_name, $temp)) |
|
239 | 239 | { |
240 | 240 | $temp[$temp_name] = ''.round($temp[$temp_name]); |
241 | 241 | } |
@@ -36,7 +36,10 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function __construct(Array &$context = array(), &$need_reload = false) |
38 | 38 | { |
39 | - if (false) parent::__construct(); |
|
39 | + if (false) |
|
40 | + { |
|
41 | + parent::__construct(); |
|
42 | + } |
|
40 | 43 | |
41 | 44 | // City not set for new widgets created via context menu |
42 | 45 | if(!$context['city'] || $context['height'] < 2) |
@@ -144,14 +147,20 @@ discard block |
||
144 | 147 | $data = Api\Cache::getTree('home', json_encode($query), function($query) |
145 | 148 | { |
146 | 149 | $debug = false; |
147 | - if($debug) error_log('Fetching fresh data from ' . static::API_URL); |
|
150 | + if($debug) |
|
151 | + { |
|
152 | + error_log('Fetching fresh data from ' . static::API_URL); |
|
153 | + } |
|
148 | 154 | |
149 | 155 | $url = static::API_URL.'forecast/daily?'. http_build_query($query); |
150 | 156 | $forecast = file_get_contents($url); |
151 | 157 | |
152 | 158 | $url = static::API_URL.'weather?'. http_build_query($query); |
153 | 159 | $current = file_get_contents($url); |
154 | - if($debug) error_log(__METHOD__ . ' current: ' . $current); |
|
160 | + if($debug) |
|
161 | + { |
|
162 | + error_log(__METHOD__ . ' current: ' . $current); |
|
163 | + } |
|
155 | 164 | |
156 | 165 | return array_merge(array('current' => json_decode($current,true)), json_decode($forecast,true)); |
157 | 166 | }, array($query), self::CACHE_TIME); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | /** |
35 | 35 | * Context for this portlet |
36 | 36 | */ |
37 | - public function __construct(Array &$context = array(), &$need_reload = false) |
|
37 | + public function __construct(array &$context = array(), &$need_reload = false) |
|
38 | 38 | { |
39 | 39 | if (false) parent::__construct(); |
40 | 40 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @see http://openweathermap.org/api |
131 | 131 | * @param array $query |
132 | 132 | */ |
133 | - public function get_weather(Array $query, $api_url = '') |
|
133 | + public function get_weather(array $query, $api_url = '') |
|
134 | 134 | { |
135 | 135 | static $debug = false; |
136 | 136 | if(!$api_url) |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Egroupware |
|
4 | - * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License |
|
5 | - * @package home |
|
6 | - * @subpackage portlet |
|
7 | - * @link http://www.egroupware.org |
|
8 | - * @author Nathan Gray |
|
9 | - * @version $Id$ |
|
10 | - */ |
|
3 | + * Egroupware |
|
4 | + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License |
|
5 | + * @package home |
|
6 | + * @subpackage portlet |
|
7 | + * @link http://www.egroupware.org |
|
8 | + * @author Nathan Gray |
|
9 | + * @version $Id$ |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | use EGroupware\Api; |
13 | 13 | use EGroupware\Api\Etemplate; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function __construct(Array &$context = array(), &$need_reload = false) |
33 | 33 | { |
34 | - unset($need_reload); // not used, but required by function signature |
|
34 | + unset($need_reload); // not used, but required by function signature |
|
35 | 35 | if (false) parent::__construct(); |
36 | 36 | |
37 | 37 | $this->context = $context; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * unique, if needed. |
65 | 65 | * @param etemplate Etemplate Etemplate to generate content |
66 | 66 | */ |
67 | - public function exec($id = null, Etemplate &$etemplate = null) |
|
67 | + public function exec($id = null, Etemplate&$etemplate = null) |
|
68 | 68 | { |
69 | 69 | $content = array(); |
70 | 70 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | $etemplate->set_dom_id($id); |
78 | 78 | |
79 | - $etemplate->exec('home.home_list_portlet.exec',$content); |
|
79 | + $etemplate->exec('home.home_list_portlet.exec', $content); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -85,30 +85,30 @@ discard block |
||
85 | 85 | protected function get_birthdays() |
86 | 86 | { |
87 | 87 | $contacts = new Api\Contacts(); |
88 | - $month_start = date('-m-',$contacts->now_su); |
|
88 | + $month_start = date('-m-', $contacts->now_su); |
|
89 | 89 | $days = $this->context['days']; |
90 | 90 | $birthdays = array(); |
91 | 91 | |
92 | - $bdays =& $contacts->search(array('bday' => $month_start),array('id','n_family','n_given','bday'),'n_given,n_family','','%'); |
|
92 | + $bdays = & $contacts->search(array('bday' => $month_start), array('id', 'n_family', 'n_given', 'bday'), 'n_given,n_family', '', '%'); |
|
93 | 93 | // search accounts too, if not stored in accounts repository |
94 | 94 | $extra_accounts_search = $contacts->account_repository == 'ldap' && !is_null($contacts->so_accounts) && |
95 | 95 | !$GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']; |
96 | - if ($extra_accounts_search && ($bdays2 = $contacts->search(array('bday' => $month_start),array('id','n_family','n_given','bday'), |
|
97 | - 'n_given,n_family','','%',false,'AND',false,array('owner' => 0)))) |
|
96 | + if ($extra_accounts_search && ($bdays2 = $contacts->search(array('bday' => $month_start), array('id', 'n_family', 'n_given', 'bday'), |
|
97 | + 'n_given,n_family', '', '%', false, 'AND', false, array('owner' => 0)))) |
|
98 | 98 | { |
99 | - $bdays = !$bdays ? $bdays2 : array_merge($bdays,$bdays2); |
|
99 | + $bdays = !$bdays ? $bdays2 : array_merge($bdays, $bdays2); |
|
100 | 100 | } |
101 | - if (($month_end = date('-m-',$contacts->now_su+$days*24*3600)) != $month_start) |
|
101 | + if (($month_end = date('-m-', $contacts->now_su + $days * 24 * 3600)) != $month_start) |
|
102 | 102 | { |
103 | - if (($bdays2 =& $contacts->search(array('bday' => $month_end),array('id','n_family','n_given','bday'),'n_given,n_family','','%'))) |
|
103 | + if (($bdays2 = & $contacts->search(array('bday' => $month_end), array('id', 'n_family', 'n_given', 'bday'), 'n_given,n_family', '', '%'))) |
|
104 | 104 | { |
105 | - $bdays = !$bdays ? $bdays2 : array_merge($bdays,$bdays2); |
|
105 | + $bdays = !$bdays ? $bdays2 : array_merge($bdays, $bdays2); |
|
106 | 106 | } |
107 | 107 | // search accounts too, if not stored in accounts repository |
108 | - if ($extra_accounts_search && ($bdays2 = $contacts->search(array('bday' => $month_end),array('id','n_family','n_given','bday'), |
|
109 | - 'n_given,n_family','','%',false,'AND',false,array('owner' => 0)))) |
|
108 | + if ($extra_accounts_search && ($bdays2 = $contacts->search(array('bday' => $month_end), array('id', 'n_family', 'n_given', 'bday'), |
|
109 | + 'n_given,n_family', '', '%', false, 'AND', false, array('owner' => 0)))) |
|
110 | 110 | { |
111 | - $bdays = !$bdays ? $bdays2 : array_merge($bdays,$bdays2); |
|
111 | + $bdays = !$bdays ? $bdays2 : array_merge($bdays, $bdays2); |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | unset($bdays2); unset($extra_accounts_search); |
@@ -116,15 +116,15 @@ discard block |
||
116 | 116 | if ($bdays) |
117 | 117 | { |
118 | 118 | $ab_lang_loaded = 0; |
119 | - for($n = 0; $n <= $days; ++$n) |
|
119 | + for ($n = 0; $n <= $days; ++$n) |
|
120 | 120 | { |
121 | - $day = date('-m-d',$contacts->now_su+$n*24*3600); |
|
122 | - foreach($bdays as $contact) |
|
121 | + $day = date('-m-d', $contacts->now_su + $n * 24 * 3600); |
|
122 | + foreach ($bdays as $contact) |
|
123 | 123 | { |
124 | - if(substr($contact['bday'],-6) == $day) |
|
124 | + if (substr($contact['bday'], -6) == $day) |
|
125 | 125 | { |
126 | 126 | if (!$ab_lang_loaded++) Api\Translation::add_app('addressbook'); |
127 | - switch($n) |
|
127 | + switch ($n) |
|
128 | 128 | { |
129 | 129 | case 0: |
130 | 130 | $text = lang("Today is %1's birthday!", $contact['n_given'].' '.$contact['n_family']); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * |
18 | 18 | */ |
19 | 19 | class home_birthday_portlet extends home_portlet |
20 | -{ |
|
20 | + { |
|
21 | 21 | /** |
22 | 22 | * Constructor sets up the portlet according to the user's saved property values |
23 | 23 | * for this particular portlet. It is possible to have multiple instances of the |
@@ -32,7 +32,10 @@ discard block |
||
32 | 32 | public function __construct(Array &$context = array(), &$need_reload = false) |
33 | 33 | { |
34 | 34 | unset($need_reload); // not used, but required by function signature |
35 | - if (false) parent::__construct(); |
|
35 | + if (false) |
|
36 | + { |
|
37 | + parent::__construct(); |
|
38 | + } |
|
36 | 39 | |
37 | 40 | $this->context = $context; |
38 | 41 | } |
@@ -70,10 +73,13 @@ discard block |
||
70 | 73 | |
71 | 74 | $etemplate->read('home.birthdays'); |
72 | 75 | |
73 | - if ($GLOBALS['egw_info']['server']['hide_birthdays'] != 'yes') // calendar Api\Config |
|
76 | + if ($GLOBALS['egw_info']['server']['hide_birthdays'] != 'yes') |
|
77 | + { |
|
78 | + // calendar Api\Config |
|
74 | 79 | { |
75 | 80 | $content = $this->get_birthdays(); |
76 | 81 | } |
82 | + } |
|
77 | 83 | $etemplate->set_dom_id($id); |
78 | 84 | |
79 | 85 | $etemplate->exec('home.home_list_portlet.exec',$content); |
@@ -123,7 +129,10 @@ discard block |
||
123 | 129 | { |
124 | 130 | if(substr($contact['bday'],-6) == $day) |
125 | 131 | { |
126 | - if (!$ab_lang_loaded++) Api\Translation::add_app('addressbook'); |
|
132 | + if (!$ab_lang_loaded++) |
|
133 | + { |
|
134 | + Api\Translation::add_app('addressbook'); |
|
135 | + } |
|
127 | 136 | switch($n) |
128 | 137 | { |
129 | 138 | case 0: |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * |
50 | 50 | * @param boolean $need_reload Flag to indicate that the portlet needs to be reloaded (exec will be called) |
51 | 51 | */ |
52 | - public function __construct(Array &$context = array(), &$need_reload = false) |
|
52 | + public function __construct(array &$context = array(), &$need_reload = false) |
|
53 | 53 | { |
54 | 54 | if (false) parent::__construct(); |
55 | 55 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | protected $nm_settings = array( |
40 | 40 | 'lettersearch' => false, |
41 | - 'favorites' => false, // Hide favorite control |
|
41 | + 'favorites' => false, // Hide favorite control |
|
42 | 42 | 'actions' => array(), |
43 | 43 | 'placeholder_actions' => array() |
44 | 44 | ); |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | if (false) parent::__construct(); |
63 | 63 | |
64 | 64 | // Process dropped data (Should be [appname => <appname>, id => <favorite ID>]) into something useable |
65 | - if($context['dropped_data']) |
|
65 | + if ($context['dropped_data']) |
|
66 | 66 | { |
67 | - foreach((Array)$context['dropped_data'] as $dropped) |
|
67 | + foreach ((Array)$context['dropped_data'] as $dropped) |
|
68 | 68 | { |
69 | 69 | // Only handle one, but dropped is an array |
70 | 70 | $context['appname'] = $dropped['appname']; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $need_reload = true; |
78 | 78 | } |
79 | 79 | // Favorite not set for new widgets created via context menu |
80 | - if(!$context['favorite']) |
|
80 | + if (!$context['favorite']) |
|
81 | 81 | { |
82 | 82 | // Set initial size to 6x3, default is way too small |
83 | 83 | $context['width'] = max($context['width'], 6); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | // Load and copy favorite |
90 | - if($context['favorite'] && !is_array($context['favorite'])) |
|
90 | + if ($context['favorite'] && !is_array($context['favorite'])) |
|
91 | 91 | { |
92 | 92 | $favorites = Framework\Favorites::get_favorites($context['appname']); |
93 | 93 | $context['favorite'] = $favorites[$context['favorite']]; |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | $this->favorite = $context['favorite']; |
98 | - $this->title = lang($context['appname']) . ': ' . $this->favorite['name']; |
|
98 | + $this->title = lang($context['appname']).': '.$this->favorite['name']; |
|
99 | 99 | $this->context = $context; |
100 | - if($this->favorite) |
|
100 | + if ($this->favorite) |
|
101 | 101 | { |
102 | 102 | $this->nm_settings['favorite'] = $this->context['favorite']; |
103 | - if(is_array($this->favorite['state'])) |
|
103 | + if (is_array($this->favorite['state'])) |
|
104 | 104 | { |
105 | 105 | $this->nm_settings += $this->favorite['state']; |
106 | 106 | } |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | Api\Translation::add_app($context['appname']); |
111 | 111 | } |
112 | 112 | |
113 | - public function exec($id = null, Etemplate &$etemplate = null) |
|
113 | + public function exec($id = null, Etemplate&$etemplate = null) |
|
114 | 114 | { |
115 | - if($etemplate == null) |
|
115 | + if ($etemplate == null) |
|
116 | 116 | { |
117 | 117 | $etemplate = new Etemplate(); |
118 | 118 | } |
@@ -124,34 +124,34 @@ discard block |
||
124 | 124 | $content['header_node'] = "home-index_{$id}_header"; |
125 | 125 | $sel_options = $content['sel_options'] ? $content['sel_options'] : array(); |
126 | 126 | unset($content['sel_options']); |
127 | - $etemplate->setElementAttribute('nm', 'template',$this->nm_settings['template']); |
|
127 | + $etemplate->setElementAttribute('nm', 'template', $this->nm_settings['template']); |
|
128 | 128 | |
129 | 129 | |
130 | 130 | // Always load app's css |
131 | 131 | Framework::includeCSS($this->context['appname'], 'app-'.$GLOBALS['egw_info']['user']['preferences']['common']['theme']) || |
132 | - Framework::includeCSS($this->context['appname'],'app'); |
|
132 | + Framework::includeCSS($this->context['appname'], 'app'); |
|
133 | 133 | |
134 | 134 | // Always load app's javascript, so most actions have a chance of working |
135 | - Framework::includeJS('.','app',$this->context['appname']); |
|
135 | + Framework::includeJS('.', 'app', $this->context['appname']); |
|
136 | 136 | |
137 | 137 | // Set this so app's JS gets initialized |
138 | 138 | $old_app = $GLOBALS['egw_info']['flags']['currentapp']; |
139 | 139 | $GLOBALS['egw_info']['flags']['currentapp'] = $this->context['appname']; |
140 | 140 | |
141 | - $etemplate->exec(get_called_class() .'::process',$content,$sel_options); |
|
141 | + $etemplate->exec(get_called_class().'::process', $content, $sel_options); |
|
142 | 142 | |
143 | 143 | $GLOBALS['egw_info']['flags']['currentapp'] = $old_app; |
144 | 144 | } |
145 | 145 | |
146 | 146 | public static function process($content = array()) |
147 | 147 | { |
148 | - unset($content); // not used, but required by function signature |
|
148 | + unset($content); // not used, but required by function signature |
|
149 | 149 | |
150 | 150 | // We need to keep the template going, thanks. |
151 | - Etemplate\Widget::setElementAttribute('','',''); |
|
151 | + Etemplate\Widget::setElementAttribute('', '', ''); |
|
152 | 152 | } |
153 | 153 | |
154 | - public function get_actions(){ |
|
154 | + public function get_actions() { |
|
155 | 155 | return array(); |
156 | 156 | } |
157 | 157 | |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | $properties = parent::get_properties(); |
196 | 196 | $favorites = Framework\Favorites::get_favorites($this->context['appname']); |
197 | 197 | $favorite_list = array(); |
198 | - foreach($favorites as $id => $favorite) |
|
198 | + foreach ($favorites as $id => $favorite) |
|
199 | 199 | { |
200 | - if($favorite) |
|
200 | + if ($favorite) |
|
201 | 201 | { |
202 | 202 | $favorite_list[$id] = $favorite['name']; |
203 | 203 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | 'type' => 'select', |
209 | 209 | 'select_options' => $favorite_list |
210 | 210 | ); |
211 | - if($this->context['favorite']) |
|
211 | + if ($this->context['favorite']) |
|
212 | 212 | { |
213 | 213 | $favorite['type'] = 'select_ro'; |
214 | 214 | } |
@@ -59,7 +59,10 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function __construct(Array &$context = array(), &$need_reload = false) |
61 | 61 | { |
62 | - if (false) parent::__construct(); |
|
62 | + if (false) |
|
63 | + { |
|
64 | + parent::__construct(); |
|
65 | + } |
|
63 | 66 | |
64 | 67 | // Process dropped data (Should be [appname => <appname>, id => <favorite ID>]) into something useable |
65 | 68 | if($context['dropped_data']) |
@@ -151,7 +154,8 @@ discard block |
||
151 | 154 | Etemplate\Widget::setElementAttribute('','',''); |
152 | 155 | } |
153 | 156 | |
154 | - public function get_actions(){ |
|
157 | + public function get_actions() |
|
158 | + { |
|
155 | 159 | return array(); |
156 | 160 | } |
157 | 161 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * |
50 | 50 | * @param boolean $need_reload Flag to indicate that the portlet needs to be reloaded (exec will be called) |
51 | 51 | */ |
52 | - public function __construct(Array &$context = array(), &$need_reload = false) |
|
52 | + public function __construct(array &$context = array(), &$need_reload = false) |
|
53 | 53 | { |
54 | 54 | if (false) parent::__construct(); |
55 | 55 |
@@ -34,14 +34,14 @@ discard block |
||
34 | 34 | |
35 | 35 | public function __construct(array &$context = array(), &$need_reload = false) |
36 | 36 | { |
37 | - unset($need_reload); // not used, but required by function signature |
|
37 | + unset($need_reload); // not used, but required by function signature |
|
38 | 38 | if (false) parent::__construct(); |
39 | 39 | |
40 | 40 | $this->context = $context; |
41 | 41 | |
42 | 42 | // Try to load content here, so all needed info is available |
43 | 43 | $appname = $this->context['app']; |
44 | - if(!$appname || !Api\Hooks::exists('home', $appname)) |
|
44 | + if (!$appname || !Api\Hooks::exists('home', $appname)) |
|
45 | 45 | { |
46 | 46 | return; |
47 | 47 | } |
@@ -50,30 +50,30 @@ discard block |
||
50 | 50 | |
51 | 51 | // Execute hook to get content |
52 | 52 | ob_start(); |
53 | - $_content = Api\Hooks::single('home',$appname); |
|
53 | + $_content = Api\Hooks::single('home', $appname); |
|
54 | 54 | if (!$_content || $_content == 1) // content has been echoed and not returned |
55 | 55 | { |
56 | 56 | $_content = ob_get_contents(); |
57 | 57 | ob_end_clean(); |
58 | 58 | } |
59 | - if($_content) |
|
59 | + if ($_content) |
|
60 | 60 | { |
61 | 61 | // Now we have to extract the actual content |
62 | 62 | $dom = new DOMDocument(); |
63 | 63 | libxml_use_internal_errors(true); |
64 | - $dom->loadHTML($_content,LIBXML_NOWARNING + LIBXML_NOERROR); |
|
64 | + $dom->loadHTML($_content, LIBXML_NOWARNING + LIBXML_NOERROR); |
|
65 | 65 | $finder = new DOMXPath($dom); |
66 | 66 | |
67 | 67 | // Find header for title |
68 | 68 | $title = $finder->query("//div[contains(@class,'divSideboxHeader')]/descendant::strong"); |
69 | - if($title->length) |
|
69 | + if ($title->length) |
|
70 | 70 | { |
71 | 71 | $this->title = $title->item(0)->textContent; |
72 | 72 | } |
73 | 73 | |
74 | 74 | // Remove header |
75 | 75 | $content = $finder->query("//div[contains(@class,'divSideboxHeader')]/descendant::strong/ancestor::tr"); |
76 | - for($i = 0; $i < $content->length; $i++) |
|
76 | + for ($i = 0; $i < $content->length; $i++) |
|
77 | 77 | { |
78 | 78 | $content->item($i)->parentNode->removeChild($content->item($i)); |
79 | 79 | } |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | * unique, if needed. |
96 | 96 | * @return string HTML fragment for display |
97 | 97 | */ |
98 | - public function exec($id = null, Etemplate &$etemplate = null) |
|
98 | + public function exec($id = null, Etemplate&$etemplate = null) |
|
99 | 99 | { |
100 | 100 | $etemplate->read('home.legacy'); |
101 | 101 | |
102 | 102 | $etemplate->set_dom_id($id); |
103 | 103 | |
104 | - $etemplate->exec('home.home_link_portlet.exec',array('legacy' => $this->content), array(),array(),array(),2); |
|
104 | + $etemplate->exec('home.home_link_portlet.exec', array('legacy' => $this->content), array(), array(), array(), 2); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -35,7 +35,10 @@ discard block |
||
35 | 35 | public function __construct(array &$context = array(), &$need_reload = false) |
36 | 36 | { |
37 | 37 | unset($need_reload); // not used, but required by function signature |
38 | - if (false) parent::__construct(); |
|
38 | + if (false) |
|
39 | + { |
|
40 | + parent::__construct(); |
|
41 | + } |
|
39 | 42 | |
40 | 43 | $this->context = $context; |
41 | 44 | |
@@ -51,9 +54,12 @@ discard block |
||
51 | 54 | // Execute hook to get content |
52 | 55 | ob_start(); |
53 | 56 | $_content = Api\Hooks::single('home',$appname); |
54 | - if (!$_content || $_content == 1) // content has been echoed and not returned |
|
57 | + if (!$_content || $_content == 1) |
|
58 | + { |
|
59 | + // content has been echoed and not returned |
|
55 | 60 | { |
56 | 61 | $_content = ob_get_contents(); |
62 | + } |
|
57 | 63 | ob_end_clean(); |
58 | 64 | } |
59 | 65 | if($_content) |
@@ -54,13 +54,13 @@ discard block |
||
54 | 54 | if (false) parent::__construct(); |
55 | 55 | |
56 | 56 | // Process dropped data into something useable |
57 | - if($context['dropped_data']) |
|
57 | + if ($context['dropped_data']) |
|
58 | 58 | { |
59 | 59 | list($context['entry']['app'], $context['entry']['id']) = explode('::', $context['dropped_data'][0], 2); |
60 | 60 | unset($context['dropped_data']); |
61 | 61 | $need_reload = true; |
62 | 62 | } |
63 | - if($context['entry'] && is_array($context['entry'])) |
|
63 | + if ($context['entry'] && is_array($context['entry'])) |
|
64 | 64 | { |
65 | 65 | $this->title = $context['entry']['title'] = Link::title($context['entry']['app'], $context['entry']['id']); |
66 | 66 | |
@@ -97,12 +97,12 @@ discard block |
||
97 | 97 | * @param id String unique ID, provided to the portlet so it can make sure content is |
98 | 98 | * unique, if needed. |
99 | 99 | */ |
100 | - public function exec($id = null, Etemplate &$etemplate = null) |
|
100 | + public function exec($id = null, Etemplate&$etemplate = null) |
|
101 | 101 | { |
102 | 102 | // Check for custom template for app |
103 | 103 | $custom_template = false; |
104 | - if($this->context && $this->context['entry'] && $this->context['entry']['app'] && |
|
105 | - $etemplate->read($this->context['entry']['app'] . '.' . $this->template_name)) |
|
104 | + if ($this->context && $this->context['entry'] && $this->context['entry']['app'] && |
|
105 | + $etemplate->read($this->context['entry']['app'].'.'.$this->template_name)) |
|
106 | 106 | { |
107 | 107 | // No action needed, custom template loaded as side-effect |
108 | 108 | $custom_template = true; |
@@ -120,50 +120,50 @@ discard block |
||
120 | 120 | ); |
121 | 121 | |
122 | 122 | // Try to load entry |
123 | - if($this->context['entry'] && $this->context['entry']['app']) |
|
123 | + if ($this->context['entry'] && $this->context['entry']['app']) |
|
124 | 124 | { |
125 | 125 | |
126 | 126 | // Always load app's css |
127 | 127 | Framework::includeCSS($this->context['entry']['app'], 'app-'.$GLOBALS['egw_info']['user']['preferences']['common']['theme']) || |
128 | - Framework::includeCSS($this->context['entry']['app'],'app'); |
|
128 | + Framework::includeCSS($this->context['entry']['app'], 'app'); |
|
129 | 129 | |
130 | 130 | try |
131 | 131 | { |
132 | - $classname = $this->context['entry']['app'] . '_egw_record'; |
|
133 | - if(class_exists($classname)) |
|
132 | + $classname = $this->context['entry']['app'].'_egw_record'; |
|
133 | + if (class_exists($classname)) |
|
134 | 134 | { |
135 | 135 | $record = new $classname($this->context['entry']['id']); |
136 | - if($record && $record->get_record_array()) |
|
136 | + if ($record && $record->get_record_array()) |
|
137 | 137 | { |
138 | 138 | // If there's a custom template, send the full record |
139 | - if($custom_template) |
|
139 | + if ($custom_template) |
|
140 | 140 | { |
141 | 141 | $content += $record->get_record_array(); |
142 | 142 | } |
143 | 143 | // Use calendar hover for calendar |
144 | - if($this->context['entry']['app'] == 'calendar') |
|
144 | + if ($this->context['entry']['app'] == 'calendar') |
|
145 | 145 | { |
146 | - $etemplate->setElementAttribute('tooltip','class', 'tooltip calendar_uitooltip'); |
|
146 | + $etemplate->setElementAttribute('tooltip', 'class', 'tooltip calendar_uitooltip'); |
|
147 | 147 | } |
148 | - if($content['image'] == false) |
|
148 | + if ($content['image'] == false) |
|
149 | 149 | { |
150 | 150 | $content['image'] = $record->get_icon(); |
151 | 151 | } |
152 | 152 | } |
153 | 153 | } |
154 | 154 | } |
155 | - catch(Exception $e) |
|
155 | + catch (Exception $e) |
|
156 | 156 | { |
157 | - error_log("Problem loading record " . array2string($this->context['entry'])); |
|
157 | + error_log("Problem loading record ".array2string($this->context['entry'])); |
|
158 | 158 | throw $e; |
159 | 159 | } |
160 | 160 | |
161 | 161 | // Set a fallback image |
162 | - if($content['image'] == false) |
|
162 | + if ($content['image'] == false) |
|
163 | 163 | { |
164 | - if($this->context['entry'] && $this->context['entry']['app']) |
|
164 | + if ($this->context['entry'] && $this->context['entry']['app']) |
|
165 | 165 | { |
166 | - $content['image'] = $this->context['entry']['app'] . '/navbar'; |
|
166 | + $content['image'] = $this->context['entry']['app'].'/navbar'; |
|
167 | 167 | } |
168 | 168 | else |
169 | 169 | { |
@@ -173,22 +173,22 @@ discard block |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | // Filemanager support - links need app = 'file' and type set |
176 | - if($this->context && $this->context['entry'] && $this->context['entry']['app'] == 'filemanager') |
|
176 | + if ($this->context && $this->context['entry'] && $this->context['entry']['app'] == 'filemanager') |
|
177 | 177 | { |
178 | 178 | $this->context['entry']['app'] = 'file'; |
179 | 179 | $this->context['entry']['path'] = $this->context['entry']['title'] = $this->context['entry']['id']; |
180 | 180 | $this->context['entry']['type'] = Vfs::mime_content_type($this->context['entry']['id']); |
181 | - $content['image'] = Framework::link('/api/thumbnail.php',array('path' => $this->context['entry']['id'])); |
|
181 | + $content['image'] = Framework::link('/api/thumbnail.php', array('path' => $this->context['entry']['id'])); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | $content += $this->context; |
185 | 185 | |
186 | - if(!is_array($content['entry'])) |
|
186 | + if (!is_array($content['entry'])) |
|
187 | 187 | { |
188 | 188 | $content['entry'] = null; |
189 | 189 | } |
190 | 190 | |
191 | - $etemplate->exec('home.home_link_portlet.exec',$content); |
|
191 | + $etemplate->exec('home.home_link_portlet.exec', $content); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | /** |
@@ -252,6 +252,6 @@ discard block |
||
252 | 252 | */ |
253 | 253 | public function accept_drop() |
254 | 254 | { |
255 | - return array('file','link'); |
|
255 | + return array('file', 'link'); |
|
256 | 256 | } |
257 | 257 | } |
@@ -198,7 +198,7 @@ |
||
198 | 198 | /** |
199 | 199 | * This portlet accepts files and links |
200 | 200 | * |
201 | - * @return boolean|String[] |
|
201 | + * @return string[] |
|
202 | 202 | */ |
203 | 203 | public function accept_drop() |
204 | 204 | { |
@@ -51,7 +51,10 @@ |
||
51 | 51 | */ |
52 | 52 | public function __construct(Array &$context = array(), &$need_reload = false) |
53 | 53 | { |
54 | - if (false) parent::__construct(); |
|
54 | + if (false) |
|
55 | + { |
|
56 | + parent::__construct(); |
|
57 | + } |
|
55 | 58 | |
56 | 59 | // Process dropped data into something useable |
57 | 60 | if($context['dropped_data']) |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * |
50 | 50 | * @param boolean $need_reload Flag to indicate that the portlet needs to be reloaded (exec will be called) |
51 | 51 | */ |
52 | - public function __construct(Array &$context = array(), &$need_reload = false) |
|
52 | + public function __construct(array &$context = array(), &$need_reload = false) |
|
53 | 53 | { |
54 | 54 | if (false) parent::__construct(); |
55 | 55 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | ); |
20 | 20 | |
21 | 21 | include('../header.inc.php'); |
22 | -$GLOBALS['egw_info']['flags']['nonavbar']=false; |
|
22 | +$GLOBALS['egw_info']['flags']['nonavbar'] = false; |
|
23 | 23 | |
24 | 24 | // Home is treated specially, so a redirect won't work. |
25 | 25 | $home = new home_ui(); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | ); |
48 | 48 | |
49 | 49 | $custom = Api\Storage\Customfields::get('resources', true); |
50 | - foreach($custom as $name => $data) { |
|
50 | + foreach ($custom as $name => $data) { |
|
51 | 51 | $this->mapping_fields['#'.$name] = $data['label']; |
52 | 52 | } |
53 | 53 |
@@ -14,7 +14,8 @@ discard block |
||
14 | 14 | |
15 | 15 | class infolog_wizard_export_csv extends importexport_wizard_basic_export_csv |
16 | 16 | { |
17 | - public function __construct() { |
|
17 | + public function __construct() |
|
18 | + { |
|
18 | 19 | parent::__construct(); |
19 | 20 | |
20 | 21 | // Field mapping |
@@ -27,7 +28,8 @@ discard block |
||
27 | 28 | // Custom fields |
28 | 29 | unset($this->export_fields['custom']); // Heading, not a real field |
29 | 30 | $custom = Api\Storage\Customfields::get('infolog', true); |
30 | - foreach($custom as $name => $data) { |
|
31 | + foreach($custom as $name => $data) |
|
32 | + { |
|
31 | 33 | $this->export_fields['#'.$name] = $data['label']; |
32 | 34 | } |
33 | 35 | } |
@@ -20,4 +20,6 @@ |
||
20 | 20 | * |
21 | 21 | * As you get this only by an error in the code or during development, the message does not need to be translated |
22 | 22 | */ |
23 | -class InvalidName extends Exception\NoPermission { } |
|
23 | +class InvalidName extends Exception\NoPermission |
|
24 | +{ |
|
25 | +} |