r58726 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58725‎ | r58726 | r58727 >
Date:18:07, 7 November 2009
Author:ashley
Status:deferred
Tags:
Comment:
DataCenter: coding style cleanup for Views
Modified paths:
  • /trunk/extensions/DataCenter/Views/Assets.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Facilities.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Facilities/Location.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Facilities/Space.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Models.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Overview.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Plans.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Plans/Object.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Plans/Plan.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Plans/Rack.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Search.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Settings.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Settings/Field.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DataCenter/Views/Settings/Field.php
@@ -10,9 +10,7 @@
1111
1212 /* Functions */
1313
14 - public function main(
15 - $path
16 - ) {
 14+ public function main( $path ) {
1715 $metaFields = DataCenterDB::getMetaFields();
1816 return DataCenterUI::renderLayout(
1917 'columns',
@@ -58,9 +56,7 @@
5957 );
6058 }
6159
62 - public function view(
63 - $path
64 - ) {
 60+ public function view( $path ) {
6561 $metaField = DataCenterDB::getMetaField( $path['id'] );
6662 return DataCenterUI::renderLayout(
6763 'columns',
@@ -103,9 +99,7 @@
104100 );
105101 }
106102
107 - public function remove(
108 - $path
109 - ) {
 103+ public function remove( $path ) {
110104 $metaField = DataCenterDB::getMetaField( $path['id'] );
111105 $metaFieldLinks = $metaField->getLinks();
112106 foreach ( $metaFieldLinks as $metaFieldLink ) {
@@ -183,15 +177,11 @@
184178 );
185179 }
186180
187 - public function add(
188 - $path
189 - ) {
 181+ public function add( $path ) {
190182 return $this->configure( $path );
191183 }
192184
193 - public function configure(
194 - $path
195 - ) {
 185+ public function configure( $path ) {
196186 // Detects mode
197187 if ( !$path['id'] ) {
198188 // Creates new component
Index: trunk/extensions/DataCenter/Views/Facilities.php
@@ -10,12 +10,10 @@
1111
1212 /* Functions */
1313
14 - public function history(
15 - $path
16 - ) {
 14+ public function history( $path ) {
1715 if ( $path['type'] == 'location' ) {
1816 $facility = DataCenterDB::getLocation( $path['id'] );
19 - } else if ( $path['type'] == 'space' ) {
 17+ } elseif ( $path['type'] == 'space' ) {
2018 $facility = DataCenterDB::getSpace( $path['id'] );
2119 } else {
2220 return null;
Index: trunk/extensions/DataCenter/Views/Plans.php
@@ -10,9 +10,7 @@
1111
1212 /* Functions */
1313
14 - public function main(
15 - $path
16 - ) {
 14+ public function main( $path ) {
1715 $plans = DataCenterDB::getPlans(
1816 DataCenterDB::buildSort(
1917 'meta', 'plan', array( 'space', 'tense DESC' )
Index: trunk/extensions/DataCenter/Views/Settings.php
@@ -10,9 +10,7 @@
1111
1212 /* Functions */
1313
14 - public function main(
15 - $path
16 - ) {
 14+ public function main( $path ) {
1715 return DataCenterUI::renderLayout(
1816 'columns',
1917 array(
Index: trunk/extensions/DataCenter/Views/Assets.php
@@ -41,9 +41,7 @@
4242
4343 /* Functions */
4444
45 - public function main(
46 - $path
47 - ) {
 45+ public function main( $path ) {
4846 if ( !isset( self::$options[$path['type']] ) ) {
4947 return DataCenterUI::renderWidget(
5048 'body', array(
@@ -127,9 +125,7 @@
128126 );
129127 }
130128
131 - public function history(
132 - $path
133 - ) {
 129+ public function history( $path ) {
134130 $asset = DataCenterDB::getAsset( $path['type'], $path['id'] );
135131 return DataCenterUI::renderLayout(
136132 'columns',
@@ -156,9 +152,7 @@
157153 );
158154 }
159155
160 - public function export(
161 - $path
162 - ) {
 156+ public function export( $path ) {
163157 // Returns single columm layout with a table
164158 return DataCenterUI::renderLayout(
165159 'columns',
@@ -183,9 +177,7 @@
184178 );
185179 }
186180
187 - public function view(
188 - $path
189 - ) {
 181+ public function view( $path ) {
190182 // Checks if the user did not provide enough information
191183 if ( !$path['id'] ) {
192184 // Returns error message
@@ -257,9 +249,7 @@
258250 );
259251 }
260252
261 - public function design(
262 - $path
263 - ) {
 253+ public function design( $path ) {
264254 $options = DataCenterViewModels::$options[$path['type']];
265255 if ( isset( $options['gallery'] ) ) {
266256 // Gets all components from database
@@ -300,15 +290,11 @@
301291 }
302292 }
303293
304 - public function deploy(
305 - $path
306 - ) {
 294+ public function deploy( $path ) {
307295 return $this->manage( $path );
308296 }
309297
310 - public function manage(
311 - $path
312 - ) {
 298+ public function manage( $path ) {
313299 // Checks if...
314300 if (
315301 // No rack asset was specified
Index: trunk/extensions/DataCenter/Views/Models.php
@@ -129,9 +129,7 @@
130130
131131 /* Functions */
132132
133 - public function main(
134 - $path
135 - ) {
 133+ public function main( $path ) {
136134 if ( !isset( self::$options[$path['type']] ) ) {
137135 return 'MODELS';
138136 }
@@ -195,9 +193,7 @@
196194 );
197195 }
198196
199 - public function history(
200 - $path
201 - ) {
 197+ public function history( $path ) {
202198 $model = DataCenterDB::getModel( $path['type'], $path['id'] );
203199 return DataCenterUI::renderLayout(
204200 'columns',
@@ -224,9 +220,7 @@
225221 );
226222 }
227223
228 - public function view(
229 - $path
230 - ) {
 224+ public function view( $path ) {
231225 // Checks if the user did not provide enough information
232226 if ( !$path['id'] ) {
233227 // Returns error message
@@ -310,9 +304,7 @@
311305 );
312306 }
313307
314 - public function select(
315 - $path
316 - ) {
 308+ public function select( $path ) {
317309 // Checks if...
318310 if (
319311 // There was only one parameter
@@ -369,15 +361,11 @@
370362 }
371363 }
372364
373 - public function attach(
374 - $path
375 - ) {
 365+ public function attach( $path ) {
376366 return $this->configure( $path );
377367 }
378368
379 - public function configure(
380 - $path
381 - ) {
 369+ public function configure( $path ) {
382370 // Checks if...
383371 if (
384372 is_array( $path['parameter'] ) &&
@@ -489,15 +477,11 @@
490478 );
491479 }
492480
493 - public function create(
494 - $path
495 - ) {
 481+ public function create( $path ) {
496482 return $this->modify( $path );
497483 }
498484
499 - public function modify(
500 - $path
501 - ) {
 485+ public function modify( $path ) {
502486 // Checks if the type is supported
503487 if ( !isset( self::$options[$path['type']]['gallery'] ) ) {
504488 // Returns error message
Index: trunk/extensions/DataCenter/Views/Search.php
@@ -10,9 +10,7 @@
1111
1212 /* Functions */
1313
14 - public function main(
15 - $path
16 - ) {
 14+ public function main( $path ) {
1715 return DataCenterUI::renderLayout(
1816 'columns',
1917 array(
@@ -35,9 +33,7 @@
3634 );
3735 }
3836
39 - public function results(
40 - $path
41 - ) {
 37+ public function results( $path ) {
4238 return DataCenterUI::renderLayout(
4339 'columns',
4440 array(
Index: trunk/extensions/DataCenter/Views/Facilities/Space.php
@@ -10,9 +10,7 @@
1111
1212 /* Functions */
1313
14 - public function main(
15 - $path
16 - ) {
 14+ public function main( $path ) {
1715 // Gets all components from database
1816 $spaces = DataCenterDB::getSpaces(
1917 array_merge_recursive(
@@ -73,9 +71,7 @@
7472 );
7573 }
7674
77 - public function view(
78 - $path
79 - ) {
 75+ public function view( $path ) {
8076 // Checks if the user did not provide enough information
8177 if ( !$path['id'] ) {
8278 // Returns error message
@@ -178,15 +174,11 @@
179175 );
180176 }
181177
182 - public function add(
183 - $path
184 - ) {
 178+ public function add( $path ) {
185179 return $this->edit( $path );
186180 }
187181
188 - public function edit(
189 - $path
190 - ) {
 182+ public function edit( $path ) {
191183 // Checks if...
192184 if (
193185 // No space facility was specified
@@ -246,7 +238,7 @@
247239 'subject' => DataCenterUI::message( 'type', $path['type'] )
248240 );
249241 }
250 - // Builds javascript to access renderable facility
 242+ // Builds JavaScript to access renderable facility
251243 $jsTarget = DataCenterJs::chain(
252244 array(
253245 "dataCenter.renderer.getTarget" =>
Index: trunk/extensions/DataCenter/Views/Facilities/Location.php
@@ -10,9 +10,7 @@
1111
1212 /* Functions */
1313
14 - public function main(
15 - $path
16 - ) {
 14+ public function main( $path ) {
1715 // Gets all components from database
1816 $locations = DataCenterDB::getLocations(
1917 DataCenterDB::buildSort(
@@ -42,7 +40,7 @@
4341 $tables[$tense] = null;
4442 }
4543 }
46 - // Returns 2 columm layout with a table and a map widget
 44+ // Returns 2 column layout with a table and a map widget
4745 return DataCenterUI::renderLayout(
4846 'columns',
4947 array(
@@ -78,9 +76,7 @@
7977 );
8078 }
8179
82 - public function view(
83 - $path
84 - ) {
 80+ public function view( $path ) {
8581 // Checks if the user did not provide enough information
8682 if ( !$path['id'] ) {
8783 // Returns error message
@@ -167,15 +163,11 @@
168164 );
169165 }
170166
171 - public function add(
172 - $path
173 - ) {
 167+ public function add( $path ) {
174168 return $this->edit( $path );
175169 }
176170
177 - public function edit(
178 - $path
179 - ) {
 171+ public function edit( $path ) {
180172 // Detects mode
181173 if ( !$path['id'] ) {
182174 // Creates a new facility location
@@ -222,7 +214,7 @@
223215 'subject' => DataCenterUI::message( 'type', $path['type'] )
224216 );
225217 }
226 - // Builds javascript that hooks the button into the geocoder
 218+ // Builds JavaScript that hooks the button into the geocoder
227219 $jsForm = 'document.form_save';
228220 $jsOut = DataCenterJs::callFunction(
229221 'addHandler',
Index: trunk/extensions/DataCenter/Views/Overview.php
@@ -10,9 +10,7 @@
1111
1212 /* Functions */
1313
14 - public function main(
15 - $path
16 - ) {
 14+ public function main( $path ) {
1715 return DataCenterUI::renderLayout(
1816 'columns',
1917 array(
Index: trunk/extensions/DataCenter/Views/Plans/Plan.php
@@ -10,9 +10,7 @@
1111
1212 /* Functions */
1313
14 - public function view(
15 - $path
16 - ) {
 14+ public function view( $path ) {
1715 // Checks if the user did not provide enough information
1816 if ( !$path['id'] ) {
1917 // Returns error message
@@ -202,9 +200,7 @@
203201 );
204202 }
205203
206 - public function remove(
207 - $path
208 - ) {
 204+ public function remove( $path ) {
209205 // Gets link from database
210206 $plan = DataCenterDB::getPlan( $path['id'] );
211207 // Gets links to plan
@@ -277,15 +273,11 @@
278274 );
279275 }
280276
281 - public function add(
282 - $path
283 - ) {
 277+ public function add( $path ) {
284278 return $this->configure( $path );
285279 }
286280
287 - public function configure(
288 - $path
289 - ) {
 281+ public function configure( $path ) {
290282 // Detects mode
291283 if ( !$path['id'] ) {
292284 if (
Index: trunk/extensions/DataCenter/Views/Plans/Rack.php
@@ -10,9 +10,7 @@
1111
1212 /* Functions */
1313
14 - public function view(
15 - $path
16 - ) {
 14+ public function view( $path ) {
1715 // Checks if the user did not provide enough information
1816 if ( !$path['id'] ) {
1917 // Returns error message
@@ -179,9 +177,7 @@
180178 );
181179 }
182180
183 - public function select(
184 - $path
185 - ) {
 181+ public function select( $path ) {
186182 // Checks if...
187183 if (
188184 // No rack asset was specified
@@ -321,9 +317,7 @@
322318 }
323319 }
324320
325 - public function remove(
326 - $path
327 - ) {
 321+ public function remove( $path ) {
328322 // Gets link from database
329323 $rackLink = DataCenterDB::getAssetLink( $path['id'] );
330324 // Extracts rack from link
@@ -407,15 +401,11 @@
408402 );
409403 }
410404
411 - public function attach(
412 - $path
413 - ) {
 405+ public function attach( $path ) {
414406 return $this->configure( $path );
415407 }
416408
417 - public function configure(
418 - $path
419 - ) {
 409+ public function configure( $path ) {
420410 // Checks if...
421411 if (
422412 // No rack asset was specified
Index: trunk/extensions/DataCenter/Views/Plans/Object.php
@@ -10,9 +10,7 @@
1111
1212 /* Functions */
1313
14 - public function view(
15 - $path
16 - ) {
 14+ public function view( $path ) {
1715 // Checks if the user did not provide enough information
1816 if ( !$path['id'] ) {
1917 // Returns error message
@@ -105,9 +103,7 @@
106104 );
107105 }
108106
109 - public function select(
110 - $path
111 - ) {
 107+ public function select( $path ) {
112108 // Checks if...
113109 if (
114110 // No rack asset was specified
@@ -269,9 +265,7 @@
270266 }
271267 }
272268
273 - public function remove(
274 - $path
275 - ) {
 269+ public function remove( $path ) {
276270 // Gets link from database
277271 $objectLink = DataCenterDB::getAssetLink( $path['id'] );
278272 // Extracts object from link
@@ -364,15 +358,11 @@
365359 );
366360 }
367361
368 - public function attach(
369 - $path
370 - ) {
 362+ public function attach( $path ) {
371363 return $this->configure( $path );
372364 }
373365
374 - public function configure(
375 - $path
376 - ) {
 366+ public function configure( $path ) {
377367 // Checks if...
378368 if (
379369 // No rack asset was specified

Status & tagging log