Index: trunk/extensions/DataCenter/UI/Widgets/Plan.php |
— | — | @@ -75,9 +75,7 @@ |
76 | 76 | |
77 | 77 | /* Static Functions */ |
78 | 78 | |
79 | | - public static function render( |
80 | | - array $parameters |
81 | | - ) { |
| 79 | + public static function render( array $parameters ) { |
82 | 80 | // Adds script to UI |
83 | 81 | DataCenterUI::addScript( |
84 | 82 | '/extensions/DataCenter/Resources/Widgets/Plan/Plan.js' |
— | — | @@ -125,9 +123,7 @@ |
126 | 124 | return $xmlOutput; |
127 | 125 | } |
128 | 126 | |
129 | | - private static function addPlanJsFunction( |
130 | | - array $parameters |
131 | | - ) { |
| 127 | + private static function addPlanJsFunction( array $parameters ) { |
132 | 128 | // Adds script to add plan to scene |
133 | 129 | $jsOutput = DataCenterJs::callFunction( |
134 | 130 | 'scene.setModule', |
— | — | @@ -148,9 +144,7 @@ |
149 | 145 | return DataCenterJs::buildFunction( array( 'scene' ), $jsOutput ); |
150 | 146 | } |
151 | 147 | |
152 | | - private static function buildStateJsObject( |
153 | | - $parameters |
154 | | - ) { |
| 148 | + private static function buildStateJsObject( $parameters ) { |
155 | 149 | // Builds array for state |
156 | 150 | $state = array( |
157 | 151 | 'focus' => array( |
— | — | @@ -170,11 +164,11 @@ |
171 | 165 | $state['focus']['id'] = $parameters['look-at-rack']; |
172 | 166 | $state['focus']['progress'] = 1; |
173 | 167 | $state['focus']['inc'] = true; |
174 | | - } else if ( $parameters['zoom-to-rack'] !== null ) { |
| 168 | + } elseif ( $parameters['zoom-to-rack'] !== null ) { |
175 | 169 | $state['focus']['id'] = $parameters['zoom-to-rack']; |
176 | 170 | $state['focus']['progress'] = 0; |
177 | 171 | $state['focus']['inc'] = true; |
178 | | - } else if ( $parameters['zoom-from-rack'] !== null ) { |
| 172 | + } elseif ( $parameters['zoom-from-rack'] !== null ) { |
179 | 173 | $state['focus']['id'] = $parameters['zoom-from-rack']; |
180 | 174 | $state['focus']['progress'] = 0; |
181 | 175 | $state['focus']['inc'] = false; |
— | — | @@ -183,9 +177,7 @@ |
184 | 178 | return DataCenterJs::toObject( $state ); |
185 | 179 | } |
186 | 180 | |
187 | | - private static function buildPhysicalJsObject( |
188 | | - $parameters |
189 | | - ) { |
| 181 | + private static function buildPhysicalJsObject( $parameters ) { |
190 | 182 | // Creates shortcut to plan |
191 | 183 | $plan = $parameters['plan']; |
192 | 184 | // Gets plan's space from database |
— | — | @@ -256,7 +248,7 @@ |
257 | 249 | // Creates empty array |
258 | 250 | $physical = array(); |
259 | 251 | } |
260 | | - // Returns javascript object |
| 252 | + // Returns JavaScript object |
261 | 253 | return DataCenterJs::toObject( $physical ); |
262 | 254 | } |
263 | 255 | } |
\ No newline at end of file |
Index: trunk/extensions/DataCenter/UI/Widgets/Space.php |
— | — | @@ -40,9 +40,7 @@ |
41 | 41 | |
42 | 42 | /* Static Functions */ |
43 | 43 | |
44 | | - public static function render( |
45 | | - array $parameters |
46 | | - ) { |
| 44 | + public static function render( array $parameters ) { |
47 | 45 | // Adds script to UI |
48 | 46 | DataCenterUI::addScript( |
49 | 47 | '/extensions/DataCenter/Resources/Widgets/Space/Space.js' |
— | — | @@ -92,9 +90,7 @@ |
93 | 91 | return $xmlOutput; |
94 | 92 | } |
95 | 93 | |
96 | | - private static function addSpaceJsFunction( |
97 | | - array $parameters |
98 | | - ) { |
| 94 | + private static function addSpaceJsFunction( array $parameters ) { |
99 | 95 | // Adds script to add space to scene |
100 | 96 | $jsOutput = DataCenterJs::callFunction( |
101 | 97 | 'scene.setModule', |
— | — | @@ -114,9 +110,7 @@ |
115 | 111 | return DataCenterJs::buildFunction( array( 'scene' ), $jsOutput ); |
116 | 112 | } |
117 | 113 | |
118 | | - private static function buildPhysicalJsObject( |
119 | | - $parameters |
120 | | - ) { |
| 114 | + private static function buildPhysicalJsObject( $parameters ) { |
121 | 115 | // Creates shortcut to space |
122 | 116 | $space = $parameters['space']; |
123 | 117 | // Checks if space was valid |
Index: trunk/extensions/DataCenter/UI/Widgets/Body.php |
— | — | @@ -50,9 +50,7 @@ |
51 | 51 | |
52 | 52 | /* Functions */ |
53 | 53 | |
54 | | - public static function render( |
55 | | - array $parameters |
56 | | - ) { |
| 54 | + public static function render( array $parameters ) { |
57 | 55 | // Sets defaults |
58 | 56 | $parameters = array_merge( self::$defaultParameters, $parameters ); |
59 | 57 | // Begins widget |
— | — | @@ -76,7 +74,7 @@ |
77 | 75 | 'body', $parameters['message'], $parameters['subject'] |
78 | 76 | ); |
79 | 77 | // Checks if a type was given |
80 | | - } else if ( $parameters['type'] !== null ) { |
| 78 | + } elseif ( $parameters['type'] !== null ) { |
81 | 79 | // Uses type-based message |
82 | 80 | $message = DataCenterUI::message( |
83 | 81 | 'body', |
— | — | @@ -95,7 +93,7 @@ |
96 | 94 | DataCenterXml::div( $message ) |
97 | 95 | ); |
98 | 96 | // Checks if text was given |
99 | | - } else if ( |
| 97 | + } elseif ( |
100 | 98 | // Required parameters |
101 | 99 | isset( $parameters['text'] ) && |
102 | 100 | // Required styles |
Index: trunk/extensions/DataCenter/UI/Widgets/Gallery.php |
— | — | @@ -54,9 +54,7 @@ |
55 | 55 | |
56 | 56 | /* Static Functions */ |
57 | 57 | |
58 | | - public static function render( |
59 | | - array $parameters |
60 | | - ) { |
| 58 | + public static function render( array $parameters ) { |
61 | 59 | // Sets defaults |
62 | 60 | $parameters = array_merge_recursive( |
63 | 61 | self::$defaultParameters, $parameters |
Index: trunk/extensions/DataCenter/UI/Widgets/Heading.php |
— | — | @@ -45,9 +45,7 @@ |
46 | 46 | |
47 | 47 | /* Functions */ |
48 | 48 | |
49 | | - public static function render( |
50 | | - array $parameters |
51 | | - ) { |
| 49 | + public static function render( array $parameters ) { |
52 | 50 | // Sets defaults |
53 | 51 | $parameters = array_merge( self::$defaultParameters, $parameters ); |
54 | 52 | // Begins widget |
— | — | @@ -65,9 +63,7 @@ |
66 | 64 | $message = DataCenterUI::message( |
67 | 65 | 'heading', $parameters['message'], $parameters['subject'] |
68 | 66 | ); |
69 | | - } |
70 | | - // Checks if a type was given |
71 | | - else if ( $parameters['type'] !== null ) { |
| 67 | + } elseif ( $parameters['type'] !== null ) { // Checks if a type was given |
72 | 68 | // Uses type-based message |
73 | 69 | $message = DataCenterUI::message( |
74 | 70 | 'heading', |
— | — | @@ -83,7 +79,7 @@ |
84 | 80 | // Returns heading with message |
85 | 81 | $xmlOutput .= $message; |
86 | 82 | // Checks if text was given |
87 | | - } else if ( $parameters['text'] !== null ) { |
| 83 | + } elseif ( $parameters['text'] !== null ) { |
88 | 84 | // Adds a heading with text |
89 | 85 | $xmlOutput .= $parameters['text']; |
90 | 86 | } |
Index: trunk/extensions/DataCenter/UI/Widgets/Actions.php |
— | — | @@ -40,9 +40,7 @@ |
41 | 41 | |
42 | 42 | /* Functions */ |
43 | 43 | |
44 | | - public static function render( |
45 | | - array $parameters |
46 | | - ) { |
| 44 | + public static function render( array $parameters ) { |
47 | 45 | // Sets defaults |
48 | 46 | $parameters = array_merge( self::$defaultParameters, $parameters ); |
49 | 47 | // Checks for permissions |
— | — | @@ -72,7 +70,7 @@ |
73 | 71 | } |
74 | 72 | // Builds label |
75 | 73 | $label = DataCenterUI::message( 'action', $label . '-type', |
76 | | - DataCenterUI::message('type', $subject ) |
| 74 | + DataCenterUI::message( 'type', $subject ) |
77 | 75 | ); |
78 | 76 | // Builds link |
79 | 77 | $link = DataCenterXml::link( $label, $link ); |
Index: trunk/extensions/DataCenter/UI/Widgets/Model.php |
— | — | @@ -41,9 +41,7 @@ |
42 | 42 | |
43 | 43 | /* Static Functions */ |
44 | 44 | |
45 | | - public static function render( |
46 | | - array $parameters |
47 | | - ) { |
| 45 | + public static function render( array $parameters ) { |
48 | 46 | // Sets Defaults |
49 | 47 | $parameters = array_merge( self::$defaultParameters, $parameters ); |
50 | 48 | // Begins widget |
— | — | @@ -82,17 +80,13 @@ |
83 | 81 | |
84 | 82 | /* Private Static Functions */ |
85 | 83 | |
86 | | - private static function renderModel( |
87 | | - $parameters, |
88 | | - $structure, |
89 | | - $level = 0 |
90 | | - ) { |
| 84 | + private static function renderModel( $parameters, $structure, $level = 0 ) { |
91 | 85 | $xmlOutput = ''; |
92 | 86 | foreach ( $structure as $model ) { |
93 | 87 | $modelLink = DataCenterDB::getModelLink( $model->get( 'link' ) ); |
94 | 88 | if ( !DataCenterPage::userCan( 'change' ) ) { |
95 | 89 | $rowAttributes = array(); |
96 | | - } else if ( $level == 0 && count( $parameters['link'] ) > 0 ) { |
| 90 | + } elseif ( $level == 0 && count( $parameters['link'] ) > 0 ) { |
97 | 91 | $rowAttributes = array_merge( |
98 | 92 | array( 'class' => 'link' ), |
99 | 93 | DataCenterXml::buildLink( $parameters['link'], $model ) |
Index: trunk/extensions/DataCenter/UI/Widgets/History.php |
— | — | @@ -83,9 +83,7 @@ |
84 | 84 | |
85 | 85 | /* Static Functions */ |
86 | 86 | |
87 | | - public static function render( |
88 | | - array $parameters |
89 | | - ) { |
| 87 | + public static function render( array $parameters ) { |
90 | 88 | global $wgUser; |
91 | 89 | // Gets current path |
92 | 90 | $path = DataCenterPage::getPath(); |
— | — | @@ -388,9 +386,7 @@ |
389 | 387 | return $xmlOutput; |
390 | 388 | } |
391 | 389 | |
392 | | - public static function compareChanges( |
393 | | - $data |
394 | | - ) { |
| 390 | + public static function compareChanges( $data ) { |
395 | 391 | global $wgOut; |
396 | 392 | $path = DataCenterPage::getPath(); |
397 | 393 | $path['parameter'] = array( |
Index: trunk/extensions/DataCenter/UI/Widgets/Form.php |
— | — | @@ -157,9 +157,7 @@ |
158 | 158 | |
159 | 159 | /* Functions */ |
160 | 160 | |
161 | | - public static function render( |
162 | | - array $parameters |
163 | | - ) { |
| 161 | + public static function render( array $parameters ) { |
164 | 162 | global $wgUser; |
165 | 163 | // Sets defaults |
166 | 164 | $parameters = array_merge( self::$defaultParameters, $parameters ); |
— | — | @@ -260,7 +258,7 @@ |
261 | 259 | // Sets name of input for form processing |
262 | 260 | $inputOptions['name'] = "row[{$inputOptions['field']}]"; |
263 | 261 | // Alternatively checks if a list of fields were given |
264 | | - } else if ( isset( $inputOptions['fields'] ) ) { |
| 262 | + } elseif ( isset( $inputOptions['fields'] ) ) { |
265 | 263 | // Loops over each sub-field |
266 | 264 | foreach( $inputOptions['fields'] as $key => $field ) { |
267 | 265 | // Checks if sub-field is an array |
Index: trunk/extensions/DataCenter/UI/Widgets/Search.php |
— | — | @@ -83,9 +83,7 @@ |
84 | 84 | |
85 | 85 | /* Static Functions */ |
86 | 86 | |
87 | | - public static function render( |
88 | | - array $parameters |
89 | | - ) { |
| 87 | + public static function render( array $parameters ) { |
90 | 88 | global $wgUser; |
91 | 89 | // Gets current path |
92 | 90 | $path = DataCenterPage::getPath(); |
— | — | @@ -151,9 +149,7 @@ |
152 | 150 | return $xmlOutput; |
153 | 151 | } |
154 | 152 | |
155 | | - public static function redirect( |
156 | | - $data |
157 | | - ) { |
| 153 | + public static function redirect( $data ) { |
158 | 154 | global $wgOut; |
159 | 155 | $path = DataCenterPage::getPath(); |
160 | 156 | if ( isset( $data['meta']['query'] ) ) { |
Index: trunk/extensions/DataCenter/UI/Widgets/Map.php |
— | — | @@ -46,9 +46,7 @@ |
47 | 47 | |
48 | 48 | /* Static Functions */ |
49 | 49 | |
50 | | - public static function render( |
51 | | - array $parameters |
52 | | - ) { |
| 50 | + public static function render( array $parameters ) { |
53 | 51 | global $egDataCenterGoogleMapsAPIKey; |
54 | 52 | DataCenterUI::addScript( |
55 | 53 | 'http://maps.google.com/maps?file=api&v=2&key=' . |
— | — | @@ -83,7 +81,7 @@ |
84 | 82 | self::addMarkersJsFunction( $parameters ) |
85 | 83 | ); |
86 | 84 | // Alternatively checks if a single location was given |
87 | | - } else if ( $parameters['location'] ) { |
| 85 | + } elseif ( $parameters['location'] ) { |
88 | 86 | // Builds script to add setup job to renderer |
89 | 87 | $jsOutput = sprintf( |
90 | 88 | "dataCenter.renderer.addJob( 'map', %s, %s );", |
— | — | @@ -107,10 +105,7 @@ |
108 | 106 | |
109 | 107 | /* Private Funtions */ |
110 | 108 | |
111 | | - private static function markerOptions( |
112 | | - array $parameters, |
113 | | - $location |
114 | | - ) { |
| 109 | + private static function markerOptions( array $parameters, $location ) { |
115 | 110 | // Begins window |
116 | 111 | $xmlOutput = DataCenterXml::open( 'div', array( 'class' => 'window' ) ); |
117 | 112 | // Adds heading |
— | — | @@ -150,9 +145,7 @@ |
151 | 146 | return DataCenterJs::toObject( array( 'content' => $xmlOutput ) ); |
152 | 147 | } |
153 | 148 | |
154 | | - private static function showPositionJsFunction( |
155 | | - array $parameters |
156 | | - ) { |
| 149 | + private static function showPositionJsFunction( array $parameters ) { |
157 | 150 | $location = $parameters['location']; |
158 | 151 | // Builds script to show position |
159 | 152 | return sprintf( |
— | — | @@ -163,9 +156,7 @@ |
164 | 157 | ); |
165 | 158 | } |
166 | 159 | |
167 | | - private static function addMarkersJsFunction( |
168 | | - array $parameters |
169 | | - ) { |
| 160 | + private static function addMarkersJsFunction( array $parameters ) { |
170 | 161 | // Begins building javascript for adding markers |
171 | 162 | $jsMarkers = ''; |
172 | 163 | // Loops over each location |
Index: trunk/extensions/DataCenter/UI/Widgets/Export.php |
— | — | @@ -79,9 +79,7 @@ |
80 | 80 | |
81 | 81 | /* Static Functions */ |
82 | 82 | |
83 | | - public static function render( |
84 | | - array $parameters |
85 | | - ) { |
| 83 | + public static function render( array $parameters ) { |
86 | 84 | global $wgUser; |
87 | 85 | // Gets current path |
88 | 86 | $path = DataCenterPage::getPath(); |
— | — | @@ -232,11 +230,9 @@ |
233 | 231 | return $xmlOutput; |
234 | 232 | } |
235 | 233 | |
236 | | - public static function export( |
237 | | - array $data |
238 | | - ) { |
| 234 | + public static function export( array $data ) { |
239 | 235 | global $wgOut; |
240 | | - // Disables mediawiki output |
| 236 | + // Disables MediaWiki output |
241 | 237 | $wgOut->disable(); |
242 | 238 | // Gets current path |
243 | 239 | $path = DataCenterPage::getPath(); |
— | — | @@ -253,8 +249,8 @@ |
254 | 250 | ) . |
255 | 251 | ' - ' . $date . '.' . $data['meta']['format']; |
256 | 252 | // Sets headers for downloading CSV file |
257 | | - header("Content-type: application/octet-stream"); |
258 | | - header("Content-Disposition: attachment; filename=\"{$fileName}\""); |
| 253 | + header( 'Content-type: application/octet-stream' ); |
| 254 | + header( "Content-Disposition: attachment; filename=\"{$fileName}\"" ); |
259 | 255 | $rows = DataCenterDB::getRows( |
260 | 256 | 'DataCenterDBRow', |
261 | 257 | $data['meta']['category'], |
— | — | @@ -340,9 +336,7 @@ |
341 | 337 | } |
342 | 338 | } |
343 | 339 | |
344 | | - private static function exportValue( |
345 | | - $value |
346 | | - ) { |
| 340 | + private static function exportValue( $value ) { |
347 | 341 | if ( |
348 | 342 | strpos( $value, ',' ) !== false || |
349 | 343 | strpos( $value, '"' ) !== false || |
Index: trunk/extensions/DataCenter/UI/Widgets/FieldLinks.php |
— | — | @@ -93,9 +93,7 @@ |
94 | 94 | |
95 | 95 | /* Static Functions */ |
96 | 96 | |
97 | | - public static function render( |
98 | | - array $parameters |
99 | | - ) { |
| 97 | + public static function render( array $parameters ) { |
100 | 98 | global $wgUser; |
101 | 99 | // Gets current path |
102 | 100 | $path = DataCenterPage::getPath(); |
— | — | @@ -274,9 +272,7 @@ |
275 | 273 | return $xmlOutput; |
276 | 274 | } |
277 | 275 | |
278 | | - public function saveFieldLinks( |
279 | | - array $data |
280 | | - ) { |
| 276 | + public function saveFieldLinks( array $data ) { |
281 | 277 | $metaField = DataCenterDBMetaField::newFromValues( $data['row'] ); |
282 | 278 | $metaFieldLinks = $metaField->getLinks(); |
283 | 279 | // Build table of links that do exist |
— | — | @@ -313,7 +309,7 @@ |
314 | 310 | ) |
315 | 311 | ); |
316 | 312 | $metaFieldLink->insert(); |
317 | | - } else if ( |
| 313 | + } elseif ( |
318 | 314 | !isset( $shouldExistTable[$key] ) && |
319 | 315 | isset( $doesExistTable[$key] ) && |
320 | 316 | ( $doesExistTable[$key]->numValues() == 0 ) |
Index: trunk/extensions/DataCenter/UI/Widgets/Details.php |
— | — | @@ -39,9 +39,7 @@ |
40 | 40 | |
41 | 41 | /* Functions */ |
42 | 42 | |
43 | | - public static function render( |
44 | | - array $parameters |
45 | | - ) { |
| 43 | + public static function render( array $parameters ) { |
46 | 44 | // Sets defaults |
47 | 45 | $parameters = array_merge( self::$defaultParameters, $parameters ); |
48 | 46 | // Begins widget |
Index: trunk/extensions/DataCenter/UI/Widgets/SearchResults.php |
— | — | @@ -82,9 +82,7 @@ |
83 | 83 | |
84 | 84 | /* Static Functions */ |
85 | 85 | |
86 | | - public static function render( |
87 | | - array $parameters |
88 | | - ) { |
| 86 | + public static function render( array $parameters ) { |
89 | 87 | global $wgUser; |
90 | 88 | // Gets current path |
91 | 89 | $path = DataCenterPage::getPath(); |
— | — | @@ -139,8 +137,7 @@ |
140 | 138 | 'body', |
141 | 139 | array( 'message' => 'notice-no-results', 'style' => 'notice' ) |
142 | 140 | ); |
143 | | - } |
144 | | - else { |
| 141 | + } else { |
145 | 142 | $joins = array(); |
146 | 143 | if ( $currentTarget['class'] == 'DataCenterDBAsset' ) { |
147 | 144 | $joins = array_merge_recursive( |
Index: trunk/extensions/DataCenter/UI/Widgets/Table.php |
— | — | @@ -79,9 +79,7 @@ |
80 | 80 | |
81 | 81 | /* Static Functions */ |
82 | 82 | |
83 | | - public static function render( |
84 | | - array $parameters |
85 | | - ) { |
| 83 | + public static function render( array $parameters ) { |
86 | 84 | // Sets defaults |
87 | 85 | $parameters = array_merge_recursive( |
88 | 86 | self::$defaultParameters, $parameters |
— | — | @@ -195,9 +193,7 @@ |
196 | 194 | * the widget as options for the entire column, |
197 | 195 | * merging with default options to ensure keys exist |
198 | 196 | */ |
199 | | - private static function processFields( |
200 | | - $fields |
201 | | - ) { |
| 197 | + private static function processFields( $fields ) { |
202 | 198 | // Checks that fields is an array with at least one element |
203 | 199 | if ( count( $fields ) == 0 ) { |
204 | 200 | return null; |