r90288 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90287‎ | r90288 | r90289 >
Date:16:27, 17 June 2011
Author:reedy
Status:ok
Tags:
Comment:
Swap else if for elseif

Trimming trailing whitespace also
Modified paths:
  • /trunk/extensions/OpenStackManager/OpenStackNovaDomain.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNova.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaAddress.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaDomain.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaKey.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaProject.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaRole.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaSudoer.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaVolume.php (modified) (history)
  • /trunk/extensions/Oversight/HideRevision_body.php (modified) (history)
  • /trunk/extensions/PageObjectModel/POM/Template.php (modified) (history)
  • /trunk/extensions/PagedTiffHandler/PagedTiffHandler.image.php (modified) (history)
  • /trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php (modified) (history)
  • /trunk/extensions/Player/Player.php (modified) (history)
  • /trunk/extensions/Player/PlayerClass.php (modified) (history)
  • /trunk/extensions/PlayerStatsGrabber/PlayerStatsGrabber_body.php (modified) (history)
  • /trunk/extensions/Plotters/Plotters.php (modified) (history)
  • /trunk/extensions/Plotters/PlottersClass.php (modified) (history)
  • /trunk/extensions/PrefSwitch/SpecialPrefSwitch.php (modified) (history)
  • /trunk/extensions/Push/api/ApiPush.php (modified) (history)
  • /trunk/extensions/Push/api/ApiPushImages.php (modified) (history)
  • /trunk/extensions/Push/specials/Push_Body.php (modified) (history)
  • /trunk/extensions/QPoll/Excel/Console_Getopt.php (modified) (history)
  • /trunk/extensions/QPoll/Excel/Excel_Workbook.php (modified) (history)
  • /trunk/extensions/RDFIO/bundle/ARC2_SPARQLSerializerPlugin.php (modified) (history)
  • /trunk/extensions/RDFIO/classes/SMWBatchWriter.php (modified) (history)
  • /trunk/extensions/RDFIO/specials/SpecialRDFImport_body.php (modified) (history)
  • /trunk/extensions/RDFIO/specials/SpecialSPARQLEndpoint_body.php (modified) (history)
  • /trunk/extensions/RDFIO/stores/SMW_ARC2Store.php (modified) (history)
  • /trunk/extensions/RT/RT_body.php (modified) (history)
  • /trunk/extensions/ReaderFeedback/phplot-5.0.5/phplot.php (modified) (history)
  • /trunk/extensions/Reflect/server/api/ApiReflectAction.php (modified) (history)
  • /trunk/extensions/RefreshSpecial/RefreshSpecial.body.php (modified) (history)
  • /trunk/extensions/Renameuser/RenameUserJob.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_FormUtils.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_UploadWindow.php (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/SFI_Inputs.php (modified) (history)
  • /trunk/extensions/SemanticGraph/includes/SemanticGraphBuilders.php (modified) (history)
  • /trunk/extensions/SemanticGraph/includes/SemanticGraphHelperFunctions.php (modified) (history)
  • /trunk/extensions/SemanticGraph/includes/SemanticGraphSettings.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/queryprinters/SM_QueryHandler.php (modified) (history)
  • /trunk/extensions/SemanticNotifyMe/includes/SMW_NotifyProcessor.php (modified) (history)
  • /trunk/extensions/SemanticNotifyMe/includes/SMW_NotifyProcessor.smw15.php (modified) (history)
  • /trunk/extensions/SemanticNotifyMe/specials/SMWNotifyMe/SMW_NotAjaxAccess.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Exhibit/SRF_Exhibit.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/GraphViz/SRF_Process.php (modified) (history)
  • /trunk/extensions/regexBlock/regexBlockCore.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php
@@ -42,25 +42,25 @@
4343 return true;
4444 }
4545 $this->createInstance();
46 - } else if ( $action == "delete" ) {
 46+ } elseif ( $action == "delete" ) {
4747 if ( ! $this->userLDAP->inProject( $project ) ) {
4848 $this->notInProject();
4949 return true;
5050 }
5151 $this->deleteInstance();
52 - } else if ( $action == "configure" ) {
 52+ } elseif ( $action == "configure" ) {
5353 if ( ! $this->userLDAP->inProject( $project ) ) {
5454 $this->notInProject();
5555 return true;
5656 }
5757 $this->configureInstance();
58 - } else if ( $action == "reboot" ) {
 58+ } elseif ( $action == "reboot" ) {
5959 if ( ! $this->userLDAP->inProject( $project ) ) {
6060 $this->notInProject();
6161 return true;
6262 }
6363 $this->rebootInstance();
64 - } else if ( $action == "consoleoutput" ) {
 64+ } elseif ( $action == "consoleoutput" ) {
6565 if ( ! $this->userLDAP->inProject( $project ) ) {
6666 $this->notInProject();
6767 return true;
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php
@@ -35,15 +35,15 @@
3636
3737 if ( $action == "create" ) {
3838 $this->createSecurityGroup();
39 - } else if ( $action == "delete" ) {
 39+ } elseif ( $action == "delete" ) {
4040 $this->deleteSecurityGroup();
41 - } else if ( $action == "configure" ) {
 41+ } elseif ( $action == "configure" ) {
4242 // Currently unsupported
4343 #$this->configureSecurityGroup();
4444 $this->listSecurityGroups();
45 - } else if ( $action == "addrule" ) {
 45+ } elseif ( $action == "addrule" ) {
4646 $this->addRule();
47 - } else if ( $action == "removerule" ) {
 47+ } elseif ( $action == "removerule" ) {
4848 $this->removeRule();
4949 } else {
5050 $this->listSecurityGroups();
Index: trunk/extensions/OpenStackManager/special/SpecialNovaAddress.php
@@ -32,15 +32,15 @@
3333 $action = $wgRequest->getVal( 'action' );
3434 if ( $action == "allocate" ) {
3535 $this->allocateAddress();
36 - } else if ( $action == "release" ) {
 36+ } elseif ( $action == "release" ) {
3737 $this->releaseAddress();
38 - } else if ( $action == "associate" ) {
 38+ } elseif ( $action == "associate" ) {
3939 $this->associateAddress();
40 - } else if ( $action == "disassociate" ) {
 40+ } elseif ( $action == "disassociate" ) {
4141 $this->disassociateAddress();
42 - } else if ( $action == "addhost" ) {
 42+ } elseif ( $action == "addhost" ) {
4343 $this->addHost();
44 - } else if ( $action == "removehost" ) {
 44+ } elseif ( $action == "removehost" ) {
4545 $this->removehost();
4646 } else {
4747 $this->listAddresses();
@@ -588,7 +588,7 @@
589589 } else {
590590 $wgOut->addWikiMsg( 'openstackmanager-addhostfailed', $ip, $hostname );
591591 }
592 - } else if ( $hostbyip ) {
 592+ } elseif ( $hostbyip ) {
593593 # We need to add an associateddomain, if the associateddomain doesn't already exist
594594 $success = $hostbyip->addAssociatedDomain( $hostname . '.' . $domain->getFullyQualifiedDomainName() );
595595 if ( $success ) {
Index: trunk/extensions/OpenStackManager/special/SpecialNovaProject.php
@@ -25,11 +25,11 @@
2626 $action = $wgRequest->getVal( 'action' );
2727 if ( $action == "create" ) {
2828 $this->createProject();
29 - } else if ( $action == "delete" ) {
 29+ } elseif ( $action == "delete" ) {
3030 $this->deleteProject();
31 - } else if ( $action == "addmember" ) {
 31+ } elseif ( $action == "addmember" ) {
3232 $this->addMember();
33 - } else if ( $action == "deletemember" ) {
 33+ } elseif ( $action == "deletemember" ) {
3434 $this->deleteMember();
3535 } else {
3636 $this->listProjects();
Index: trunk/extensions/OpenStackManager/special/SpecialNovaDomain.php
@@ -44,7 +44,7 @@
4545 $action = $wgRequest->getVal( 'action' );
4646 if ( $action == "create" ) {
4747 $this->createDomain();
48 - } else if ( $action == "delete" ) {
 48+ } elseif ( $action == "delete" ) {
4949 $this->deleteDomain();
5050 } else {
5151 $this->listDomains();
Index: trunk/extensions/OpenStackManager/special/SpecialNovaVolume.php
@@ -42,19 +42,19 @@
4343 return true;
4444 }
4545 $this->createVolume();
46 - } else if ( $action == "delete" ) {
 46+ } elseif ( $action == "delete" ) {
4747 if ( ! $this->userLDAP->inProject( $project ) ) {
4848 $this->notInProject();
4949 return true;
5050 }
5151 $this->deleteVolume();
52 - } else if ( $action == "attach" ) {
 52+ } elseif ( $action == "attach" ) {
5353 if ( ! $this->userLDAP->inProject( $project ) ) {
5454 $this->notInProject();
5555 return true;
5656 }
5757 $this->attachVolume();
58 - } else if ( $action == "detach" ) {
 58+ } elseif ( $action == "detach" ) {
5959 if ( ! $this->userLDAP->inProject( $project ) ) {
6060 $this->notInProject();
6161 return true;
Index: trunk/extensions/OpenStackManager/special/SpecialNovaKey.php
@@ -28,7 +28,7 @@
2929 $action = $wgRequest->getVal( 'action' );
3030 if ( $action == "import" ) {
3131 $this->importKey();
32 - } else if ( $action == "delete" ) {
 32+ } elseif ( $action == "delete" ) {
3333 $this->deleteKey();
3434 } else {
3535 $this->listKeys();
@@ -127,7 +127,7 @@
128128 'default' => $keyname,
129129 'name' => 'project',
130130 );
131 - } else if ( $wgOpenStackManagerNovaKeypairStorage == 'ldap' ) {
 131+ } elseif ( $wgOpenStackManagerNovaKeypairStorage == 'ldap' ) {
132132 $hash = $wgRequest->getVal( 'hash' );
133133 $keypairs = $this->userLDAP->getKeypairs();
134134 if ( ! $wgRequest->wasPosted() ) {
@@ -190,7 +190,7 @@
191191 }
192192 $out .= Html::rawElement( 'table', array( 'id' => 'novakeylist', 'class' => 'wikitable sortable collapsible' ), $projectOut );
193193 }
194 - } else if ( $wgOpenStackManagerNovaKeypairStorage == 'ldap' ) {
 194+ } elseif ( $wgOpenStackManagerNovaKeypairStorage == 'ldap' ) {
195195 $out .= $sk->link( $this->getTitle(), wfMsgHtml( 'openstackmanager-importkey' ), array(), array( 'action' => 'import' ) );
196196 $keypairs = $this->userLDAP->getKeypairs();
197197 $keysOut = '';
@@ -229,7 +229,7 @@
230230 return true;
231231 }
232232 $wgOut->addWikiMsg( 'openstackmanager-keypairimported' );
233 - } else if ( $wgOpenStackManagerNovaKeypairStorage == 'nova' ) {
 233+ } elseif ( $wgOpenStackManagerNovaKeypairStorage == 'nova' ) {
234234 # wgOpenStackManagerNovaKeypairStorage == 'nova'
235235 # OpenStack's EC2 API doesn't yet support importing keys, use
236236 # of this option isn't currently recommended
Index: trunk/extensions/OpenStackManager/special/SpecialNova.php
@@ -46,10 +46,10 @@
4747 if ( $role == 'sysadmin' ) {
4848 $wgOut->setPagetitle( wfMsg( 'openstackmanager-needsysadminrole' ) );
4949 $wgOut->addWikiMsg( 'openstackmanager-needsysadminrole2' );
50 - } else if ( $role == 'netadmin' ) {
 50+ } elseif ( $role == 'netadmin' ) {
5151 $wgOut->setPagetitle( wfMsg( 'openstackmanager-neednetadminrole' ) );
5252 $wgOut->addWikiMsg( 'openstackmanager-neednetadminrole2' );
53 - } else if ( $role == 'cloudadmin' ) {
 53+ } elseif ( $role == 'cloudadmin' ) {
5454 $wgOut->setPagetitle( wfMsg( 'openstackmanager-needcloudadminrole' ) );
5555 $wgOut->addWikiMsg( 'openstackmanager-needcloudadminrole2' );
5656 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaRole.php
@@ -25,7 +25,7 @@
2626 $action = $wgRequest->getVal( 'action' );
2727 if ( $action == "addmember" ) {
2828 $this->addMember();
29 - } else if ( $action == "deletemember" ) {
 29+ } elseif ( $action == "deletemember" ) {
3030 $this->deleteMember();
3131 } else {
3232 $this->listGlobalRoles();
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSudoer.php
@@ -24,9 +24,9 @@
2525 $action = $wgRequest->getVal( 'action' );
2626 if ( $action == "create" ) {
2727 $this->createSudoer();
28 - } else if ( $action == "delete" ) {
 28+ } elseif ( $action == "delete" ) {
2929 $this->deleteSudoer();
30 - } else if ( $action == "modify" ) {
 30+ } elseif ( $action == "modify" ) {
3131 $this->modifySudoer();
3232 } else {
3333 $this->listSudoers();
Index: trunk/extensions/OpenStackManager/OpenStackNovaDomain.php
@@ -134,7 +134,7 @@
135135 $domains = array();
136136 if ( $type == 'local' ) {
137137 $query = '(&(soarecord=*)(l=*))';
138 - } else if ( $type == 'public' ) {
 138+ } elseif ( $type == 'public' ) {
139139 $query = '(&(soarecord=*)(!(l=*)))';
140140 } else {
141141 $query = '(soarecord=*)';
Index: trunk/extensions/Reflect/server/api/ApiReflectAction.php
@@ -1,9 +1,9 @@
22 <?php
33
44 /**
5 - * Reflect API for getting and posting summary bullets and responses.
6 - *
7 - * Note, many of the methods for handling Responses are almost near
 5+ * Reflect API for getting and posting summary bullets and responses.
 6+ *
 7+ * Note, many of the methods for handling Responses are almost near
88 * duplicates of those handling Bullets.
99 */
1010 class ApiReflectAction extends ApiBase {
@@ -27,9 +27,9 @@
2828
2929 /**
3030 * Gets all the bullets and responses relevant for the given LQT threads.
31 - *
 31+ *
3232 * The params listed below are the items posted in $params.
33 - * @param $comments JSON encoded list of comment ids.
 33+ * @param $comments JSON encoded list of comment ids.
3434 * @return assoc array of commentIDs=>array(bullets = {bullet attributes, responses})
3535 */
3636 public function actionGetData( $params ) {
@@ -51,7 +51,7 @@
5252
5353 foreach ( $curBullets as $curBullet ) {
5454 // TODO: is it possible to make fewer DB calls?
55 - $sel = array( 'bl_id as id', 'bl_timestamp as ts',
 55+ $sel = array( 'bl_id as id', 'bl_timestamp as ts',
5656 'bl_user as u', 'bl_text as txt' );
5757
5858 // TODO: create a Bullet model class for abstracting this away
@@ -71,7 +71,7 @@
7272 foreach ( $highlights as $highlight ) {
7373 $bullet->highlights[] = $highlight;
7474 }
75 -
 75+
7676 $curResponses = $dbr->select(
7777 $table = 'reflect_response_current',
7878 $vars = array( 'rsp_id', 'rsp_rev_id' ),
@@ -81,7 +81,7 @@
8282 foreach ( $curResponses as $curResponse ) {
8383 $response = $dbr->selectRow(
8484 $table = 'reflect_response_revision',
85 - $vars = array( 'rsp_id as id', 'rsp_timestamp as ts',
 85+ $vars = array( 'rsp_id as id', 'rsp_timestamp as ts',
8686 'rsp_user as u', 'rsp_text as txt', 'rsp_signal as sig' ),
8787 $conds = 'rsp_rev_id = ' . $curResponse->rsp_rev_id );
8888 $response->rev = $curResponse->rsp_rev_id;
@@ -99,9 +99,9 @@
100100 /**
101101 * Deletes a response by removing it from the current responses table.
102102 * A record of the response is still kept in the response revisions table.
103 - *
 103+ *
104104 * The params listed below are the items posted in $params.
105 - * @param $response_id
 105+ * @param $response_id
106106 * @return db's return from delete
107107 */
108108 private function deleteResponse( $params ) {
@@ -118,11 +118,11 @@
119119 /**
120120 * Deletes a bullet by removing it from the current bullets table.
121121 * A record of the bullet is still kept in the bullet revisions table.
122 - *
 122+ *
123123 * The params listed below are the items posted in $params.
124 - * @param $bullet_id
 124+ * @param $bullet_id
125125 * @return db's return from delete
126 - */
 126+ */
127127 private function deleteBullet( $params ) {
128128 $dbw = wfGetDB( DB_MASTER );
129129
@@ -134,16 +134,16 @@
135135 }
136136
137137 /**
138 - * Adds a new bullet or modifies an existing bullet.
139 - *
 138+ * Adds a new bullet or modifies an existing bullet.
 139+ *
140140 * The params listed below are the items posted in $params.
141141 * @param $comment_id
142142 * @param $bullet_id If set to valid bullet_id, signals a modification
143143 * @param $text The bullet text
144144 * @param $highlights Array of sentence ids that the bullet refers to
145 - *
 145+ *
146146 * @return assoc array with $insert_id as the bullet id and $rev_id as the new rev id
147 - */
 147+ */
148148 private function addBullet( $params ) {
149149 $dbw = wfGetDB( DB_MASTER );
150150 $dbr = wfGetDB( DB_SLAVE );
@@ -155,9 +155,9 @@
156156
157157 $bulletText = $params['text'];
158158 if ( $bulletText == '' ) {
159 - return '';
 159+ return '';
160160 }
161 -
 161+
162162 $modify = isset( $params['bullet_id'] );
163163
164164 if ( $modify ) {
@@ -166,10 +166,10 @@
167167 /*
168168 * w/o lock, the following could lead to a race condition
169169 * TODO: should $wgAntiLockFlags be used here?
170 - */
 170+ */
171171 $dbw->begin(); // start transaction
172172 $res = $dbr->query(
173 - 'SELECT MAX(bl_id)+1 AS next_bullet_id FROM ' .
 173+ 'SELECT MAX(bl_id)+1 AS next_bullet_id FROM ' .
174174 $dbr->tableName( 'reflect_bullet_revision' )
175175 );
176176 $bulletID = $res->fetchRow();
@@ -193,7 +193,7 @@
194194 }
195195
196196 if ( isset( $params['highlights'] ) ) {
197 - $highlights = json_decode( str_replace( '\\', '',
 197+ $highlights = json_decode( str_replace( '\\', '',
198198 $params['highlights'] ) );
199199 $highlightsToInsert = array();
200200
@@ -204,7 +204,7 @@
205205 'hl_element' => $value->eid,
206206 );
207207 }
208 -
 208+
209209 $dbw->insert( "reflect_highlight", $highlightsToInsert );
210210 }
211211
@@ -223,9 +223,9 @@
224224 }
225225
226226 /* send email notification to commenter that someone bulleted their point
227 - *
228 - * TODO: consider possibility of someone submitting harmless bullet,
229 - * getting it approved, then modifying it maliciously. By not sending
 227+ *
 228+ * TODO: consider possibility of someone submitting harmless bullet,
 229+ * getting it approved, then modifying it maliciously. By not sending
230230 * notification on modification (as below), the commenter is opened to risk.
231231 */
232232 global $wgReflectEnotif;
@@ -233,7 +233,7 @@
234234 $threadObj = Threads::withId( $commentID );
235235 $to = $threadObj->author();
236236 $catalystUser = $wgUser;
237 - $this->sendMail( $threadObj, $to, $catalystUser,
 237+ $this->sendMail( $threadObj, $to, $catalystUser,
238238 'reflect-bulleted', array( $params['text'] ), array() );
239239 }
240240 return array( "insert_id" => $bulletID, "rev_id" => $bulletRev, "u" => $user );
@@ -241,8 +241,8 @@
242242
243243
244244 /**
245 - * Adds a new response or modifies an existing response.
246 - *
 245+ * Adds a new response or modifies an existing response.
 246+ *
247247 * The params listed below are the items posted in $params.
248248 * @param $comment_id
249249 * @param $bullet_id The bullet to which this response addresses
@@ -250,9 +250,9 @@
251251 * @param $response_id If set to valid bullet_id, signals a modification
252252 * @param $text The bullet text
253253 * @param $signal The accuracy rating for the respective bullet
254 - *
 254+ *
255255 * @return assoc array with $insert_id as the bullet id and $rev_id as the new rev id
256 - */
 256+ */
257257 function addResponse( $params ) {
258258 $dbw = wfGetDB( DB_MASTER );
259259 $dbr = wfGetDB( DB_SLAVE );
@@ -264,7 +264,7 @@
265265 $commentID = $params['comment_id'];
266266
267267 $responseText = $params['text'];
268 - if ( $responseText == '' ){
 268+ if ( $responseText == '' ){
269269 return '';
270270 }
271271
@@ -277,11 +277,11 @@
278278 /*
279279 * w/o lock, the following could lead to a race condition
280280 * TODO: should $wgAntiLockFlags be used here?
281 - */
 281+ */
282282 $dbw->begin(); // start transaction
283 -
 283+
284284 $res = $dbr->query(
285 - 'select MAX(rsp_id)+1 as next_rsp_id from ' .
 285+ 'select MAX(rsp_id)+1 as next_rsp_id from ' .
286286 $dbr->tableName( 'reflect_response_revision' )
287287 );
288288 $responseID = $res->fetchRow();
@@ -299,14 +299,14 @@
300300 'rsp_signal' => $signal
301301 ));
302302 $responseRev = $dbw->insertId();
303 -
 303+
304304 if (!$modify){
305305 $dbw->commit(); // end transaction
306306 }
307307
308308 if ( $modify ) {
309309 /* shouldn't lead to race condition as long as
310 - * only commenters can update their responses (DEFAULT) */
 310+ * only commenters can update their responses (DEFAULT) */
311311 $dbw->update( $table = 'reflect_response_current',
312312 $values = array( 'rsp_rev_id' => $responseRev ),
313313 $conds = array( 'rsp_id =' . $responseID ) );
@@ -323,39 +323,39 @@
324324 $vars = array( 'bl_user as user', 'bl_text as text' ),
325325 $conds = 'bl_rev_id = ' . $params['bullet_rev'] );
326326
327 - /* send email notification to bullet author that someone
 327+ /* send email notification to bullet author that someone
328328 * rated the accuracy of their bullet */
329329 global $wgReflectEnotif;
330330 if ($wgReflectEnotif && !$modify) {
331331 $threadObj = Threads::withId( $commentID );
332332 $to = User::newFromName( $bullet->user );
333333 $catalystUser = $threadObj->author();
334 - $this->sendMail( $threadObj, $to, $catalystUser, 'reflect-responded',
 334+ $this->sendMail( $threadObj, $to, $catalystUser, 'reflect-responded',
335335 array( $responseText, $bullet->text ), array() );
336336 }
337 - return array( "insert_id" => $responseID, "rev_id" => $responseRev,
 337+ return array( "insert_id" => $responseID, "rev_id" => $responseRev,
338338 "u" => $user, "sig" => $signal );
339339 }
340340
341341 /**
342342 * Sends a Reflect email in response to a new bullet or response.
343 - *
 343+ *
344344 * @param $threadObj A reference to the relevant LQT Thread
345345 * @param $to A User object to whom the email will be sent
346346 * @param $catalystUser A User object who triggered this series of events
347347 * @param $msgType The name of the message type to be used in accessing localized msg
348348 * @param $bodyParams Additional parameters to be used in the sprintf of the body text
349349 * @param $subjectParams Additional parameters to be used in the sprintf of the subject text
350 - *
351 - */
352 - private function sendMail( $threadObj, $to, $catalystUser,
353 - $msgType, $bodyParams, $subjectParams )
 350+ *
 351+ */
 352+ private function sendMail( $threadObj, $to, $catalystUser,
 353+ $msgType, $bodyParams, $subjectParams )
354354 {
355355 global $wgPasswordSender, $wgLanguageCode;
356356
357357 // TODO: create Reflect mailing preferences for individuals & respect them
358358 if ( !$to ) {
359 - return;
 359+ return;
360360 }
361361
362362 $from = new MailAddress( $wgPasswordSender, 'WikiAdmin' );
@@ -365,7 +365,7 @@
366366 $bodyParams = array_merge( $params, $bodyParams );
367367 $subjectParams = array_merge( $params, $subjectParams );
368368 $msg = wfMsgReal( $msgType, $bodyParams, true, $wgLanguageCode, true );
369 - $subject = wfMsgReal( $msgType . '-subject', $subjectParams,
 369+ $subject = wfMsgReal( $msgType . '-subject', $subjectParams,
370370 true, $wgLanguageCode, true );
371371
372372 UserMailer::send( new MailAddress( $to ), $from, $subject, $msg );
@@ -374,74 +374,74 @@
375375 /**
376376 * Handles the bullet posts. Calls appropriate private helper functions
377377 * for deletes and adds. Makes sure user has permission to perform requested
378 - * actions.
379 - *
 378+ * actions.
 379+ *
380380 * The params listed below are the items posted in $params.
381 - * @param $delete True if post is delete. Default is add.
382 - *
 381+ * @param $delete True if post is delete. Default is add.
 382+ *
383383 * @return The response from the respective helper function
384 - */
 384+ */
385385 public function actionPostBullet( $params ) {
386386 if ( isset( $params['delete'] ) && $params['delete'] == 'true' ) {
387387 $verb = 'delete';
388388 } else {
389389 $verb = 'add';
390390 }
391 -
 391+
392392 if ( !$this->hasPermission( $verb, 'bullet', $params ) ) {
393393 return;
394394 }
395 -
 395+
396396 if ( $verb == 'delete' ) {
397397 $resp = $this->deleteBullet( $params );
398398 } else {
399399 $resp = $this->addBullet( $params );
400400 }
401 -
 401+
402402 $this->getResult()->addValue( null, $this->getModuleName(), $resp );
403403 }
404404
405405 /**
406406 * Handles the response posts. Calls appropriate private helper functions
407407 * for deletes and adds. Makes sure user has permission to perform requested
408 - * actions.
409 - *
 408+ * actions.
 409+ *
410410 * The params listed below are the items posted in $params.
411 - * @param $delete True if post is delete. Default is add.
412 - *
 411+ * @param $delete True if post is delete. Default is add.
 412+ *
413413 * @return The response from the respective helper function
414 - */
 414+ */
415415 public function actionPostResponse( $params ) {
416416 if ( isset( $params['delete'] ) && $params['delete'] == 'true' ) {
417417 $verb = 'delete';
418418 } else {
419419 $verb = 'add';
420420 }
421 -
 421+
422422 if ( !$this->hasPermission( $verb, 'response', $params ) ) {
423423 return;
424424 }
425 -
 425+
426426 if ( $verb == 'delete' ) {
427427 $resp = $this->deleteResponse( $params );
428428 } else {
429429 $resp = $this->addResponse( $params );
430430 }
431 -
 431+
432432 $this->getResult()->addValue( null, $this->getModuleName(), $resp );
433433 }
434434
435435 /**
436 - * Checks whether the current user has permission to execute a given action.
437 - * Some of the characteristics examined include the users' level (admin,
 436+ * Checks whether the current user has permission to execute a given action.
 437+ * Some of the characteristics examined include the users' level (admin,
438438 * registered, anon) and their ownership of the object being acted on.
439 - *
 439+ *
440440 * @param $verb The action.
441 - * @param $noun The object to be acted upon.
442 - * @param $params The params posted by the requester.
443 - *
 441+ * @param $noun The object to be acted upon.
 442+ * @param $params The params posted by the requester.
 443+ *
444444 * @return Returns true if the user has permission, false otherwise.
445 - */
 445+ */
446446 private function hasPermission( $verb, $noun, $params ) {
447447
448448 $dbr = wfGetDB( DB_SLAVE );
@@ -464,42 +464,42 @@
465465 } else {
466466 $bulletAuthor = $wgUser->getName();
467467 }
468 -
 468+
469469 if ( $wgUser->isAnon() ) {
470470 $userLevel = -1;
471 - } else if ( in_array( 'sysop', $wgUser->getGroups() ) ) {
 471+ } elseif ( in_array( 'sysop', $wgUser->getGroups() ) ) {
472472 $userLevel = 2;
473473 } else {
474474 $userLevel = 1;
475475 }
476 -
 476+
477477 $userName = $wgUser->getName();
478478 if ( $noun == 'bullet' ) {
479479 $denied = ( // only admins and bullet authors can delete bullets
480 - $verb == 'delete'
481 - && $bulletAuthor != $userName
482 - && $userLevel < 2
 480+ $verb == 'delete'
 481+ && $bulletAuthor != $userName
 482+ && $userLevel < 2
483483 )
484484 || ( // commenters can't add bullets to their comment
485 - $verb == 'add'
486 - && $commentAuthor == $userName
 485+ $verb == 'add'
 486+ && $commentAuthor == $userName
487487 ) ;
488488 } elseif ( $noun == 'response' ) {
489489 $denied = ( // only admins and response authors can delete responses
490 - $verb == 'delete'
491 - && $commentAuthor != $userName
492 - && $userLevel < 2
493 - )
 490+ $verb == 'delete'
 491+ && $commentAuthor != $userName
 492+ && $userLevel < 2
 493+ )
494494 || ( // only comment authors can add responses
495 - $verb == 'add'
496 - && $commentAuthor != $userName
 495+ $verb == 'add'
 496+ && $commentAuthor != $userName
497497 ) ;
498498 }
499499 return !$denied;
500500 }
501501
502502 /**** ApiBase functions *****/
503 -
 503+
504504 public function getDescription() {
505505 return 'Enables Reflect on posts in Liquid-Threaded discussions.';
506506 }
Index: trunk/extensions/Oversight/HideRevision_body.php
@@ -43,7 +43,7 @@
4444 $submitted = $wgRequest->wasPosted() &&
4545 $wgRequest->getVal( 'action' ) == 'submit' &&
4646 $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) );
47 -
 47+
4848 if( $this->mPopulated && $submitted ) {
4949 $this->submit();
5050 } elseif( $this->mPopulated ) {
@@ -371,7 +371,7 @@
372372 $revision = $wgRequest->getIntOrNull( 'revision' );
373373 if( $wgRequest->getCheck( 'diff' ) && !is_null( $revision )) {
374374 $this->showDiff( $revision);
375 - } else if( is_null( $revision ) ) {
 375+ } elseif( is_null( $revision ) ) {
376376 $this->showList( $page, $user, $offender );
377377 } else {
378378 $this->showRevision( $revision );
@@ -380,7 +380,7 @@
381381
382382 function showList( $page, $user, $offender ) {
383383 global $wgOut, $wgScript;
384 -
 384+
385385 $title = Title::newFromURL( $page );
386386 $u = User::newFromName( $user );
387387 $page = $title ? $page : ''; // blank invalid titles
@@ -419,7 +419,7 @@
420420 array(
421421 'ORDER BY' => 'hidden_on_timestamp DESC' ) );
422422 }
423 -
 423+
424424 public function getSelectFields() {
425425 return array( 'hidden_page as page_id',
426426 'hidden_namespace as page_namespace',
@@ -586,7 +586,7 @@
587587 $dbr->freeResult( $result );
588588 }
589589 }
590 -
 590+
591591 /**
592592 * Query to list out stable versions for a page
593593 */
@@ -638,7 +638,7 @@
639639 function getIndexField() {
640640 return 'hidden_on_timestamp';
641641 }
642 -
 642+
643643 function getStartBody() {
644644 wfProfileIn( __METHOD__ );
645645 # Do a link batch query
@@ -650,7 +650,7 @@
651651 wfProfileOut( __METHOD__ );
652652 return '<ul>';
653653 }
654 -
 654+
655655 function getEndBody() {
656656 return '</ul>';
657657 }
Index: trunk/extensions/PageObjectModel/POM/Template.php
@@ -20,7 +20,7 @@
2121
2222 # Split by pipe
2323 $parts = explode( '|', $text );
24 -
 24+
2525 # Check if this is a function call in the form #name:
2626 $first_part = array_shift( $parts );
2727 if ( strpos( trim( $first_part ), "#" ) == 0 )
@@ -30,11 +30,11 @@
3131 $first_part = $splitted[0];
3232 array_unshift( $parts, $splitted[1] );
3333 }
34 -
 34+
3535 }
3636
3737 $this->title_triple = new POMUtilTrimTriple( $first_part );
38 -
 38+
3939 foreach ( $parts as $part )
4040 {
4141 $this->parameters[] = POMTemplateParameter::parse( $part );
@@ -45,11 +45,11 @@
4646 {
4747 return $this->title_triple->trimmed;
4848 }
49 -
 49+
5050 public function getParametersCount() {
5151 return count( $this->parameters );
5252 }
53 -
 53+
5454 public function getParameterName( $number ) {
5555 if ( $number < 0 ) return "";
5656 if ( $number > count( $this->parameters ) - 1 ) return "";
@@ -59,25 +59,25 @@
6060 else
6161 return "";
6262 }
63 -
 63+
6464 public function removeParameterByNumber( $number ) {
6565 if ( $number < 0 ) return;
6666 if ( $number > count( $this->parameters ) - 1 ) return;
6767 unset( $this->parameters[$number] );
6868 $this->parameters = array_values( $this->parameters );
6969 }
70 -
 70+
7171 public function getNumberByName( $name ) {
7272 $trimmed_name = trim( $name );
7373 if ( strlen( $trimmed_name ) == 0 )
7474 throw new WrongParameterNameException( 'Can\'t get parameter with no name' );
75 -
 75+
7676 for ( $i = 0; $i < count( $this->parameters ); $i++ ) {
7777 $parameter = $this->parameters[$i];
7878 if ( $parameter->getName() == $trimmed_name ) return $i;
7979 }
8080 }
81 -
 81+
8282 public function getParameterByNumber( $number ) {
8383 if ( $number < 0 ) return "";
8484 if ( $number > count( $this->parameters ) - 1 ) return "";
@@ -106,7 +106,7 @@
107107 return $parameter->getValue();
108108 }
109109 }
110 - else if ( is_a( $parameter, 'POMTemplateNumberedParameter' ) )
 110+ elseif ( is_a( $parameter, 'POMTemplateNumberedParameter' ) )
111111 {
112112 if ( $number == $trimmed_name )
113113 {
@@ -115,18 +115,18 @@
116116 $number++;
117117 }
118118 }
119 -
 119+
120120 return null; # none matched
121121 }
122 -
 122+
123123 public function addParameter( $name, $value ) {
124124 if ( strlen( trim( $name ) ) == 0 )
125125 throw new WrongParameterNameException( "Can't set parameter with no name" );
126 -
 126+
127127 # add parameter to parameters array
128128 $this->parameters[] = new POMTemplateNamedParameter( $name, $value );
129129 }
130 -
 130+
131131 public function setParameter( $name, $value,
132132 $ignore_name_spacing = true,
133133 $ignore_value_spacing = true,
@@ -191,7 +191,7 @@
192192 public function asString()
193193 {
194194 if ( $this->hidden() ) return "";
195 -
 195+
196196 $text = '{{' . $this->title_triple->toString();
197197
198198 for ( $i = 0; $i < count( $this->parameters ); $i++ )
Index: trunk/extensions/Plotters/Plotters.php
@@ -118,7 +118,7 @@
119119 if ( preg_match( '/^==+ *([^*:\s|]+?)\s*==+\s*$/', $line, $m ) ) {
120120 $section = $m[1];
121121 }
122 - else if ( preg_match( '/^\*+ *([a-zA-Z](?:[-_:.\w\d ]*[a-zA-Z0-9])?)\s*((\|[^|]*)+)\s*$/', $line, $m ) ) {
 122+ elseif ( preg_match( '/^\*+ *([a-zA-Z](?:[-_:.\w\d ]*[a-zA-Z0-9])?)\s*((\|[^|]*)+)\s*$/', $line, $m ) ) {
123123 // NOTE: the plotter name is used as part of the name of a form field,
124124 // and must follow the rules defined in http://www.w3.org/TR/html4/types.html#type-cdata
125125 // Also, title-normalization applies.
@@ -157,7 +157,7 @@
158158 $u = $t->getLocalURL( 'action=raw&ctype=' . $wgJsMimeType );
159159 $out->addScript( '<script type="' . $wgJsMimeType . '" src="' . htmlspecialchars( $u ) . '"></script>' . "\n" );
160160 }
161 - else if ( preg_match( '/\.css/', $codePage ) ) {
 161+ elseif ( preg_match( '/\.css/', $codePage ) ) {
162162 $u = $t->getLocalURL( 'action=raw&ctype=text/css' );
163163 $out->addScript( '<style type="text/css">/*<![CDATA[*/ @import "' . $u . '"; /*]]>*/</style>' . "\n" );
164164 }
@@ -228,7 +228,7 @@
229229 $plotkitname = "plotkit";
230230 if ( $parserOutput->mplotter["$genericname"] ) {
231231 Plotters::setPlottersHeaders( $outputPage, 'generic' );
232 - } else if ( $parserOutput->mplotter["$plotkitname"] ) {
 232+ } elseif ( $parserOutput->mplotter["$plotkitname"] ) {
233233 Plotters::setPlottersHeaders( $outputPage, 'plotkit' );
234234 }
235235
Index: trunk/extensions/Plotters/PlottersClass.php
@@ -49,7 +49,7 @@
5050 if ( $this->argumentArray["script"] == "" ) {
5151 $errors .= wfMsg( "plotters-missing-script" ) . "<br />";
5252 $errcnt++;
53 - } else if ( strlen( $this->argumentArray["script"] ) > 255 ) {
 53+ } elseif ( strlen( $this->argumentArray["script"] ) > 255 ) {
5454 // Check to ensure scriptname is < 255 characters
5555 $errors .= wfMsg( "plotters-excessively-long-scriptname" ) . "<br />";
5656 $errcnt++;
Index: trunk/extensions/SemanticForms/specials/SF_UploadWindow.php
@@ -347,7 +347,7 @@
348348 return;
349349 }
350350 $this->mainUploadWindowForm();
351 - } else if ( 'submit' == $this->mAction || $this->mUploadClicked ) {
 351+ } elseif ( 'submit' == $this->mAction || $this->mUploadClicked ) {
352352 $this->processUpload();
353353 } else {
354354 $this->mainUploadWindowForm();
@@ -542,7 +542,7 @@
543543 if ( $this->mWatchthis ) {
544544 global $wgUser;
545545 $wgUser->addWatch( $this->mLocalFile->getTitle() );
546 -
 546+
547547 }
548548 // Success, redirect to description page
549549 // $wgOut->redirect( $this->mLocalFile->getTitle()->getFullURL() );
@@ -600,7 +600,7 @@
601601 // Check for uppercase extension. We allow these filenames but check if an image
602602 // with lowercase extension exists already
603603 $warning = '';
604 -
 604+
605605 if ( strpos( $file->getName(), '.' ) == false ) {
606606 $partname = $file->getName();
607607 $rawExtension = '';
@@ -710,7 +710,7 @@
711711 }
712712 return $s;
713713 }
714 -
 714+
715715 /**
716716 * Render a preview of a given license for the AJAX preview on upload
717717 *
@@ -722,11 +722,11 @@
723723 $text = '{{' . $license . '}}';
724724 $title = Title::makeTitle( NS_IMAGE, 'Sample.jpg' );
725725 $options = ParserOptions::newFromUser( $wgUser );
726 -
 726+
727727 // Expand subst: first, then live templates...
728728 $text = $wgParser->preSaveTransform( $text, $title, $wgUser, $options );
729729 $output = $wgParser->parse( $text, $title, $options );
730 -
 730+
731731 return $output->getText();
732732 }
733733
@@ -894,10 +894,10 @@
895895
896896 $useAjaxDestCheck = $wgUseAjax && $wgAjaxUploadDestCheck;
897897 $useAjaxLicensePreview = $wgUseAjax && $wgAjaxLicensePreview;
898 -
 898+
899899 $adc = wfBoolToStr( $useAjaxDestCheck );
900900 $alp = wfBoolToStr( $useAjaxLicensePreview );
901 -
 901+
902902 $wgOut->addScript( "<script type=\"text/javascript\">
903903 wgAjaxUploadDestCheck = {$adc};
904904 wgAjaxLicensePreview = {$alp};
@@ -910,7 +910,7 @@
911911 wfDebug( "Hook 'UploadForm:initial' broke output of the upload form" );
912912 return false;
913913 }
914 -
 914+
915915 if ( $this->mDesiredDestName && $wgUser->isAllowed( 'deletedhistory' ) ) {
916916 $title = Title::makeTitleSafe( NS_IMAGE, $this->mDesiredDestName );
917917 if ( $title instanceof Title && ( $count = $title->isDeleted() ) > 0 ) {
@@ -1028,14 +1028,14 @@
10291029 <tr>
10301030 <td align='$align1'><label for='wpDestFile'>{$destfilename}</label></td>
10311031 <td align='$align2'>
1032 - <input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='40'
 1032+ <input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='40'
10331033 value="$encDestName" $destOnkeyup />
10341034 </td>
10351035 </tr>
10361036 <tr>
10371037 <td align='$align1'><label for='wpUploadDescription'>{$summary}</label></td>
10381038 <td align='$align2'>
1039 - <textarea tabindex='3' name='wpUploadDescription' id='wpUploadDescription' rows='4'
 1039+ <textarea tabindex='3' name='wpUploadDescription' id='wpUploadDescription' rows='4'
10401040 cols='{$cols}'{$ew}>$encComment</textarea>
10411041 {$this->uploadFormTextAfterSummary}
10421042 </td>
@@ -1073,12 +1073,12 @@
10741074
10751075 $wgOut->addHTML( "
10761076 <td align='$align1' nowrap='nowrap'><label for='wpUploadCopyStatus'>$filestatus:</label></td>
1077 - <td><input tabindex='5' type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus'
 1077+ <td><input tabindex='5' type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus'
10781078 value=\"$copystatus\" size='40' /></td>
10791079 </tr>
10801080 <tr>
10811081 <td align='$align1'><label for='wpUploadCopyStatus'>$filesource:</label></td>
1082 - <td><input tabindex='6' type='text' name='wpUploadSource' id='wpUploadCopyStatus'
 1082+ <td><input tabindex='6' type='text' name='wpUploadSource' id='wpUploadCopyStatus'
10831083 value=\"$uploadsource\" size='40' /></td>
10841084 </tr>
10851085 <tr>
@@ -1245,7 +1245,7 @@
12461246 }
12471247 }
12481248
1249 - /**
 1249+ /**
12501250 * Heuristic for detecting files that *could* contain JavaScript instructions or
12511251 * things that may look like HTML to a browser and are thus
12521252 * potentially harmful. The present implementation will produce false positives in some situations.
@@ -1343,7 +1343,7 @@
13441344 return false;
13451345 }
13461346
1347 - /**
 1347+ /**
13481348 * Generic wrapper function for a virus scanner program.
13491349 * This relies on the $wgAntivirus and $wgAntivirusSetup variables.
13501350 * $wgAntivirusRequired may be used to deny upload if the scan fails.
@@ -1416,11 +1416,11 @@
14171417 } else {
14181418 return null;
14191419 }
1420 - } else if ( $mappedCode === AV_SCAN_ABORTED ) {
 1420+ } elseif ( $mappedCode === AV_SCAN_ABORTED ) {
14211421 # scan failed because filetype is unknown (probably imune)
14221422 wfDebug( __METHOD__ . ": unsupported file type $file (code $exitCode).\n" );
14231423 return null;
1424 - } else if ( $mappedCode === AV_NO_VIRUS ) {
 1424+ } elseif ( $mappedCode === AV_NO_VIRUS ) {
14251425 # no virus found
14261426 wfDebug( __METHOD__ . ": file passed virus scan.\n" );
14271427 return false;
@@ -1502,7 +1502,7 @@
15031503 return true; // non-conditional
15041504 if ( !$user->isAllowed( 'reupload-own' ) )
15051505 return false;
1506 -
 1506+
15071507 $dbr = wfGetDB( DB_SLAVE );
15081508 $row = $dbr->selectRow( 'image',
15091509 /* SELECT */ 'img_user',
Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.php
@@ -122,7 +122,7 @@
123123
124124 $sfgTabIndex++;
125125 $checked = "";
126 - // figure out if the checkbox should be checked -
 126+ // figure out if the checkbox should be checked -
127127 // this code borrowed from /includes/EditPage.php
128128 if ( $wgUser->getOption( 'watchdefault' ) ) {
129129 # Watch all edits
@@ -272,7 +272,7 @@
273273 $text = " <span class='editHelp'>$cancel</span>\n";
274274 return $text;
275275 }
276 -
 276+
277277 static function runQueryButtonHTML( $is_disabled = false, $label = null, $attr = array() ) {
278278 // is_disabled is currently ignored
279279 global $sfgTabIndex;
@@ -427,7 +427,7 @@
428428 var firstLoad = true;
429429 var editorMsgOn = "' . wfMsg( 'textrichditor' ) . '";
430430 var editorMsgOff = "' . wfMsg( 'tog-riched_disable' ) . '";
431 -var editorLink = "' . ( ( $showFCKEditor & RTE_VISIBLE ) ? wfMsg( 'tog-riched_disable' ): wfMsg( 'textrichditor' ) ) . '";
 431+var editorLink = "' . ( ( $showFCKEditor & RTE_VISIBLE ) ? wfMsg( 'tog-riched_disable' ): wfMsg( 'textrichditor' ) ) . '";
432432 var saveSetting = ' . ( $wgUser->getOption( 'riched_toggle_remember_state' ) ? 1 : 0 ) . ';
433433 var RTE_VISIBLE = ' . RTE_VISIBLE . ';
434434 var RTE_TOGGLE_LINK = ' . RTE_TOGGLE_LINK . ';
@@ -451,7 +451,7 @@
452452 if ( substr( $wgFCKEditorDir, -1 ) != '/' ) {
453453 $wgFCKEditorDir .= '/';
454454 }
455 -
 455+
456456 $javascript_text .= <<<END
457457 var oFCKeditor = new FCKeditor( "free_text" );
458458
@@ -461,7 +461,7 @@
462462 oFCKeditor.Config["EditorAreaCSS"] = "$wgScriptPath/$wgFCKEditorExtDir/css/fckeditor.css" ;
463463 oFCKeditor.Config["showreferences"] = '$showRef';
464464 oFCKeditor.Config["showsource"] = '$showSource';
465 -oFCKeditor.ToolbarSet = "$wgFCKEditorToolbarSet";
 465+oFCKeditor.ToolbarSet = "$wgFCKEditorToolbarSet";
466466 oFCKeditor.ready = true;
467467
468468 //IE hack to call func from popup
@@ -481,7 +481,7 @@
482482 if (x.currentStyle) {
483483 // IE
484484 var y = x.currentStyle['lineheight'];
485 - } else if (window.getComputedStyle) {
 485+ } elseif (window.getComputedStyle) {
486486 // FF, Opera
487487 var y = document.defaultView.getComputedStyle(x,null).getPropertyValue('line-height');
488488 }
@@ -502,7 +502,7 @@
503503
504504 function onLoadFCKeditor()
505505 {
506 - if (!(showFCKEditor & RTE_VISIBLE))
 506+ if (!(showFCKEditor & RTE_VISIBLE))
507507 showFCKEditor += RTE_VISIBLE;
508508 firstLoad = false;
509509 realTextarea = document.getElementById('free_text');
@@ -518,7 +518,7 @@
519519 }
520520 oFCKeditor.Height = height;
521521 oFCKeditor.ReplaceTextarea() ;
522 -
 522+
523523 FCKeditorInsertTags = function (tagOpen, tagClose, sampleText, oDoc)
524524 {
525525 var txtarea;
@@ -527,7 +527,7 @@
528528 {
529529 txtarea = oDoc.FCK.EditingArea.Textarea ;
530530 }
531 - else if (oDoc.editform)
 531+ elseif (oDoc.editform)
532532 {
533533 // if we have FCK enabled, behave differently...
534534 if ( showFCKEditor & RTE_VISIBLE )
@@ -539,16 +539,16 @@
540540 SRCdoc = window.frames[SRCiframe].oDoc ;
541541 else
542542 SRCdoc = SRCiframe.contentDocument ;
543 -
 543+
544544 var SRCarea = SRCdoc.getElementById ('xEditingArea').firstChild ;
545 -
 545+
546546 if (SRCarea)
547547 txtarea = SRCarea ;
548548 else
549549 return false ;
550 -
551 - }
552 - else
 550+
 551+ }
 552+ else
553553 {
554554 return false ;
555555 }
@@ -567,13 +567,13 @@
568568
569569 var selText, isSample = false ;
570570
571 - if ( oDoc.selection && oDoc.selection.createRange )
 571+ if ( oDoc.selection && oDoc.selection.createRange )
572572 { // IE/Opera
573573
574574 //save window scroll position
575575 if ( oDoc.documentElement && oDoc.documentElement.scrollTop )
576576 var winScroll = oDoc.documentElement.scrollTop ;
577 - else if ( oDoc.body )
 577+ elseif ( oDoc.body )
578578 var winScroll = oDoc.body.scrollTop ;
579579
580580 //get current selection
@@ -595,11 +595,11 @@
596596 //restore window scroll position
597597 if ( oDoc.documentElement && oDoc.documentElement.scrollTop )
598598 oDoc.documentElement.scrollTop = winScroll ;
599 - else if ( oDoc.body )
 599+ elseif ( oDoc.body )
600600 oDoc.body.scrollTop = winScroll ;
601601
602 - }
603 - else if ( txtarea.selectionStart || txtarea.selectionStart == '0' )
 602+ }
 603+ elseif ( txtarea.selectionStart || txtarea.selectionStart == '0' )
604604 { // Mozilla
605605
606606 //save textarea scroll position
@@ -609,27 +609,27 @@
610610 var startPos = txtarea.selectionStart ;
611611 var endPos = txtarea.selectionEnd ;
612612 selText = txtarea.value.substring( startPos, endPos ) ;
613 -
 613+
614614 //insert tags
615 - if (!selText)
 615+ if (!selText)
616616 {
617617 selText = sampleText ;
618618 isSample = true ;
619 - }
620 - else if (selText.charAt(selText.length - 1) == ' ')
 619+ }
 620+ elseif (selText.charAt(selText.length - 1) == ' ')
621621 { //exclude ending space char
622622 selText = selText.substring(0, selText.length - 1) ;
623623 tagClose += ' ' ;
624624 }
625 - txtarea.value = txtarea.value.substring(0, startPos) + tagOpen + selText + tagClose +
 625+ txtarea.value = txtarea.value.substring(0, startPos) + tagOpen + selText + tagClose +
626626 txtarea.value.substring(endPos, txtarea.value.length) ;
627627 //set new selection
628 - if (isSample)
 628+ if (isSample)
629629 {
630630 txtarea.selectionStart = startPos + tagOpen.length ;
631631 txtarea.selectionEnd = startPos + tagOpen.length + selText.length ;
632 - }
633 - else
 632+ }
 633+ else
634634 {
635635 txtarea.selectionStart = startPos + tagOpen.length + selText.length + tagClose.length ;
636636 txtarea.selectionEnd = txtarea.selectionStart;
@@ -645,19 +645,19 @@
646646 if (!selText) {
647647 selText = sampleText;
648648 isSample = true;
649 - } else if (selText.charAt(selText.length - 1) == ' ') { //exclude ending space char
 649+ } elseif (selText.charAt(selText.length - 1) == ' ') { //exclude ending space char
650650 selText = selText.substring(0, selText.length - 1);
651651 tagClose += ' '
652 - }
 652+ }
653653 }
654654 function initEditor()
655 -{
 655+{
656656 var toolbar = document.getElementById('free_text');
657657 //show popup or toogle link
658658 if (showFCKEditor & (RTE_POPUP|RTE_TOGGLE_LINK)){
659659 var fckTools = document.createElement('div');
660660 fckTools.setAttribute('id', 'fckTools');
661 -
 661+
662662 var SRCtextarea = document.getElementById( "free_text" ) ;
663663 if (showFCKEditor & RTE_VISIBLE) SRCtextarea.style.display = "none";
664664 }
@@ -717,7 +717,7 @@
718718 FCKeditor_OpenPopup('oFCKeditor',objId);
719719 return true;
720720 }
721 -
 721+
722722 var oToggleLink = document.getElementById('toggle_'+ objId );
723723 var oPopupLink = document.getElementById('popup_'+ objId );
724724
@@ -750,7 +750,7 @@
751751 });
752752 return true;
753753 }
754 -
 754+
755755 if (!oFCKeditor.ready) return false; //sajax_do_call in action
756756 if (!FCKeditorAPI) return false; //not loaded yet
757757 var oEditorIns = FCKeditorAPI.GetInstance( objId );
Index: trunk/extensions/PrefSwitch/SpecialPrefSwitch.php
@@ -9,7 +9,7 @@
1010 class SpecialPrefSwitch extends SpecialPage {
1111
1212 /* Private Members */
13 -
 13+
1414 private $origin = '';
1515 private $originTitle = null;
1616 private $originQuery = '';
@@ -28,7 +28,7 @@
2929 }
3030 /**
3131 * Checks if a user's preferences are switched on
32 - *
 32+ *
3333 * @param $user User object to check switched state for
3434 * @return switched state
3535 */
@@ -60,7 +60,7 @@
6161 * @param $user User object to set preferences for
6262 */
6363 public static function switchOn( $user ) {
64 - global $wgPrefSwitchPrefs;
 64+ global $wgPrefSwitchPrefs;
6565 foreach ( $wgPrefSwitchPrefs['on'] as $pref => $value ) {
6666 $user->setOption( $pref, $value );
6767 }
@@ -91,7 +91,7 @@
9292 }
9393 }
9494 }
95 -
 95+
9696 private static function switchOffUser( $user ) {
9797 global $wgPrefSwitchPrefs;
9898 foreach ( $wgPrefSwitchPrefs['off'] as $pref => $value ) {
@@ -101,7 +101,7 @@
102102 }
103103
104104 /* Methods */
105 -
 105+
106106 public function __construct() {
107107 parent::__construct( 'PrefSwitch' );
108108 }
@@ -148,7 +148,7 @@
149149 self::switchOff( $wgUser, $wgPrefSwitchGlobalOptOut && in_array( 'yes', $wgRequest->getArray( 'prefswitch-survey-global', array() ) ) );
150150 PrefSwitchSurvey::save( 'off', $wgPrefSwitchSurveys['feedback'] );
151151 $wgOut->addWikiMsg( 'prefswitch-success-off' );
152 - } else if ( !self::isSwitchedOn( $wgUser ) ) {
 152+ } elseif ( !self::isSwitchedOn( $wgUser ) ) {
153153 // User is already switched off then reloaded the page or tried to switch off again
154154 $wgOut->addWikiMsg( 'prefswitch-success-off' );
155155 } else {
@@ -214,9 +214,9 @@
215215 }
216216 $wgOut->addHtml( '</div>' );
217217 }
218 -
 218+
219219 /* Private Methods */
220 -
 220+
221221 private function render( $mode = null ) {
222222 global $wgUser, $wgOut, $wgPrefSwitchSurveys, $wgPrefSwitchGlobalOptOut, $wgAllowUserCss, $wgAllowUserJs;
223223 // Make sure links will retain the origin
@@ -259,7 +259,7 @@
260260 $wgOut->addWikiMsgArray(
261261 'prefswitch-main-logged-changes', array( 'parse' )
262262 );
263 -
 263+
264264 $oldSkin = 'monobook'; // The skin we are migrating from
265265
266266 if ( $wgAllowUserJs ) {
@@ -274,7 +274,7 @@
275275 if ( $cssPage->exists() ) {
276276 $wgOut->addWikiMsg( 'prefswitch-csswarning', $wgUser->getName(), $oldSkin, array( 'parse' ) );
277277 }
278 - }
 278+ }
279279 }
280280 $wgOut->addWikiMsgArray(
281281 'prefswitch-main-feedback', wfMsgForContent( 'prefswitch-feedbackpage' ), array( 'parse' )
Index: trunk/extensions/SemanticNotifyMe/specials/SMWNotifyMe/SMW_NotAjaxAccess.php
@@ -20,7 +20,7 @@
2121 $wgUser->saveSettings();
2222 return wfMsg( 'smw_nm_ajax_mailupdate' );
2323 }
24 - else if ( $method == "addNotify" ) {
 24+ elseif ( $method == "addNotify" ) {
2525 if ( $smwgQEnabled ) {
2626 $result = SMWNotifyProcessor::addNotify( str_replace( '&amp;', '&', str_replace( '&comma;', ',', $p_array[0] ) ),
2727 str_replace( '&amp;', '&', str_replace( '&comma;', ',', $p_array[3] ) ),
@@ -28,7 +28,7 @@
2929 }
3030 return $result;
3131 }
32 - else if ( $method == "getQueryResult" ) {
 32+ elseif ( $method == "getQueryResult" ) {
3333 if ( $smwgQEnabled ) {
3434 $params .= '
3535 | format=table
@@ -76,31 +76,31 @@
7777 }
7878 return $result;
7979 }
80 - else if ( $method == "updateStates" ) {
 80+ elseif ( $method == "updateStates" ) {
8181 if ( $smwgQEnabled ) {
8282 $result = SMWNotifyProcessor::updateStates( $p_array );
8383 }
8484 return $result;
8585 }
86 - else if ( $method == "updateReportAll" ) {
 86+ elseif ( $method == "updateReportAll" ) {
8787 if ( $smwgQEnabled ) {
8888 $result = SMWNotifyProcessor::updateReportAll( $p_array );
8989 }
9090 return $result;
9191 }
92 - else if ( $method == "updateShowAll" ) {
 92+ elseif ( $method == "updateShowAll" ) {
9393 if ( $smwgQEnabled ) {
9494 $result = SMWNotifyProcessor::updateShowAll( $p_array );
9595 }
9696 return $result;
9797 }
98 - else if ( $method == "updateDelegates" ) {
 98+ elseif ( $method == "updateDelegates" ) {
9999 if ( $smwgQEnabled ) {
100100 $result = SMWNotifyProcessor::updateDelegates( explode( "|", $params ) );
101101 }
102102 return $result;
103103 }
104 - else if ( $method == "delNotify" ) {
 104+ elseif ( $method == "delNotify" ) {
105105 if ( $smwgQEnabled ) {
106106 $result = SMWNotifyProcessor::delNotify( $p_array );
107107 }
Index: trunk/extensions/SemanticNotifyMe/includes/SMW_NotifyProcessor.smw15.php
@@ -1313,7 +1313,7 @@
13141314 $tmp_info[$key][del_vals][] = array( 'plain' => $v[value]->getWikiValue(), 'html' => $this->getFullLink( $v[value] ) );
13151315 }
13161316 }
1317 - } else if ( $i[type] == 2 ) {
 1317+ } elseif ( $i[type] == 2 ) {
13181318 $mvalue = $info[$key];
13191319 foreach ( $value as $v1 ) {
13201320 $found = false;
@@ -1458,7 +1458,7 @@
14591459 }
14601460 $this->m_notifyHtmlMsgs[$notify_id] .= $hint;
14611461 $this->m_newMonitor[] = array( 'notify_id' => $notify_id, 'page_id' => $page_id );
1462 - } else if ( ( !$match ) && $monitoring ) {
 1462+ } elseif ( ( !$match ) && $monitoring ) {
14631463 $hint = wfMsg( 'smw_nm_hint_nomatch_html', $page_html_name, htmlspecialchars( $notify[name] ) );
14641464 foreach ( $notify['user_ids'] as $uid ) {
14651465 $this->m_userMsgs[$uid] .= wfMsg( 'smw_nm_hint_nomatch', $page_name, $notify[name] );
@@ -1530,7 +1530,7 @@
15311531 private function getFullLink( $val ) {
15321532 if ( $val instanceof SMWWikiPageValue ) {
15331533 return '<a href="' . $val->getTitle()->getFullUrl() . '">' . htmlspecialchars( $val->getTitle()->getText() ) . '</a>';
1534 - } else if ( $val instanceof SMWPropertyValue ) {
 1534+ } elseif ( $val instanceof SMWPropertyValue ) {
15351535 $val = $val->getWikiPageValue();
15361536 return '<a href="' . $val->getTitle()->getFullUrl() . '">' . htmlspecialchars( $val->getTitle()->getText() ) . '</a>';
15371537 } else {
@@ -1611,7 +1611,7 @@
16121612 if ( isset( $this->m_userHtmlPropMsgs[$user_id] ) ) {
16131613 $html_msg .= wfMsg( 'smw_nm_hint_nmtable_html', $this->m_userHtmlPropMsgs[$user_id] );
16141614 }
1615 -
 1615+
16161616 global $wgNMReportModifier, $wgUser;
16171617 if ( $wgNMReportModifier ) {
16181618 $userText = $wgUser->getName();
Index: trunk/extensions/SemanticNotifyMe/includes/SMW_NotifyProcessor.php
@@ -1313,7 +1313,7 @@
13141314 $tmp_info[$key][del_vals][] = array( 'plain' => $v[value]->getWikiValue(), 'html' => $this->getFullLink( $v[value] ) );
13151315 }
13161316 }
1317 - } else if ( $i[type] == 2 ) {
 1317+ } elseif ( $i[type] == 2 ) {
13181318 $mvalue = $info[$key];
13191319 foreach ( $value as $v1 ) {
13201320 $found = false;
@@ -1458,7 +1458,7 @@
14591459 }
14601460 $this->m_notifyHtmlMsgs[$notify_id] .= $hint;
14611461 $this->m_newMonitor[] = array( 'notify_id' => $notify_id, 'page_id' => $page_id );
1462 - } else if ( ( !$match ) && $monitoring ) {
 1462+ } elseif ( ( !$match ) && $monitoring ) {
14631463 $hint = wfMsg( 'smw_nm_hint_nomatch_html', $page_html_name, htmlspecialchars( $notify[name] ) );
14641464 foreach ( $notify['user_ids'] as $uid ) {
14651465 $this->m_userMsgs[$uid] .= wfMsg( 'smw_nm_hint_nomatch', $page_name, $notify[name] );
@@ -1530,7 +1530,7 @@
15311531 private function getFullLink( $val ) {
15321532 if ( $val instanceof SMWWikiPageValue ) {
15331533 return '<a href="' . $val->getTitle()->getFullUrl() . '">' . htmlspecialchars( $val->getTitle()->getText() ) . '</a>';
1534 - } else if ( $val instanceof SMWPropertyValue ) {
 1534+ } elseif ( $val instanceof SMWPropertyValue ) {
15351535 $val = $val->getWikiPageValue();
15361536 return '<a href="' . $val->getTitle()->getFullUrl() . '">' . htmlspecialchars( $val->getTitle()->getText() ) . '</a>';
15371537 } else {
@@ -1611,7 +1611,7 @@
16121612 if ( isset( $this->m_userHtmlPropMsgs[$user_id] ) ) {
16131613 $html_msg .= wfMsg( 'smw_nm_hint_nmtable_html', $this->m_userHtmlPropMsgs[$user_id] );
16141614 }
1615 -
 1615+
16161616 global $wgNMReportModifier, $wgUser;
16171617 if ( $wgNMReportModifier ) {
16181618 $userText = $wgUser->getName();
Index: trunk/extensions/QPoll/Excel/Excel_Workbook.php
@@ -1350,7 +1350,7 @@
13511351 $align = 1;
13521352 }
13531353 # Split section without header => split on even boundary
1354 - else if ($split_string && $space_remaining % 2 == 1) {
 1354+ elseif ($split_string && $space_remaining % 2 == 1) {
13551355 $space_remaining--;
13561356 $align = 1;
13571357 }
@@ -1524,7 +1524,7 @@
15251525 $align = 1;
15261526 }
15271527 // Split section without header => split on even boundary
1528 - else if ($split_string && $space_remaining % 2 == 1) {
 1528+ elseif ($split_string && $space_remaining % 2 == 1) {
15291529 $space_remaining--;
15301530 $align = 1;
15311531 }
Index: trunk/extensions/QPoll/Excel/Console_Getopt.php
@@ -215,7 +215,7 @@
216216 if ($i + 1 < strlen($arg)) {
217217 $opts[] = array($opt, substr($arg, $i + 1));
218218 break;
219 - } else if (list(, $opt_arg) = each($args)) {
 219+ } elseif (list(, $opt_arg) = each($args)) {
220220 /* Else use the next argument. */;
221221 if (Console_Getopt::_isShortOpt($opt_arg)
222222 || Console_Getopt::_isLongOpt($opt_arg)) {
@@ -324,7 +324,7 @@
325325 return PEAR::raiseError($msg);
326326 }
327327 }
328 - } else if ($opt_arg) {
 328+ } elseif ($opt_arg) {
329329 $msg = "Console_Getopt: option --$opt doesn't allow an argument";
330330 return PEAR::raiseError($msg);
331331 }
Index: trunk/extensions/Player/Player.php
@@ -89,7 +89,7 @@
9090 if ($ex->getCode() == '404') {
9191 return $skin->makeBrokenLinkObj( Title::makeTitleSafe(NS_IMAGE, $name) );
9292 }
93 - else if (@$player && $ex->getCode() == '403') {
 93+ elseif (@$player && $ex->getCode() == '403') {
9494 //TODO: show "normal" image thumbnail. requires parameter mangeling, though...
9595 return $skin->makeKnownLinkObj( $player->title );
9696 }
@@ -156,7 +156,7 @@
157157 $s.= urlencode($k);
158158
159159 if ($v === false || $v === null) continue;
160 - else if ($v !== true) $s.= '=' . urlencode($v);
 160+ elseif ($v !== true) $s.= '=' . urlencode($v);
161161 }
162162
163163 return $s;
Index: trunk/extensions/Player/PlayerClass.php
@@ -30,8 +30,8 @@
3131 var $playerTitle;
3232
3333 function __construct( $image, $options, $sizeDefault = 'imagesize' ) {
34 -
3534
 35+
3636 if ( is_null( $options ) ) $options = array();
3737 if ( is_string( $options ) ) $options = urldecodeMap( $options );
3838
@@ -48,8 +48,8 @@
4949 }
5050
5151 static function newFromTitle( $title, $options, $sizeDefault = 'imagesize' ) {
52 -
5352
 53+
5454 $image = wfFindFile( $title );
5555 if ( !$image->exists() ) {
5656 throw new PlayerException(wfMsg("player-not-found"), 404);
@@ -59,8 +59,8 @@
6060 }
6161
6262 static function newFromName( $name, $options, $sizeDefault = 'imagesize' ) {
63 -
6463
 64+
6565 $title = Title::makeTitleSafe(NS_IMAGE, $name);
6666 if (!$title) throw new PlayerException(wfMsg("player-invalid-title"), 400);
6767
@@ -88,7 +88,7 @@
8989 if ( preg_match('!/(x-)?ogg$!', $this->mimetype) ) {
9090
9191 if ( $this->mediatype == MEDIATYPE_AUDIO ) $this->mimetype = 'audio/ogg';
92 - else if ( $this->mediatype == MEDIATYPE_VIDEO ) $this->mimetype = 'video/ogg';
 92+ elseif ( $this->mediatype == MEDIATYPE_VIDEO ) $this->mimetype = 'video/ogg';
9393 else $this->mimetype = 'application/ogg';
9494 }
9595 }
@@ -169,7 +169,7 @@
170170 #print "[WH2: $width, $height]";
171171
172172 if (!$width) $width = ceil($height * $imgratio);
173 - else if (!$height) $height = ceil($width / $imgratio);
 173+ elseif (!$height) $height = ceil($width / $imgratio);
174174
175175 #print "[WH3: $width, $height]";
176176
@@ -187,7 +187,7 @@
188188 if (!$mimetype) $mimetype = $image->getMimeType();
189189
190190 if (!is_array($wgPlayerVideoResolutionDetector)) $detector = $wgPlayerVideoResolutionDetector;
191 - else if (isset($wgPlayerVideoResolutionDetector[$mimetype])) $detector = $wgPlayerVideoResolutionDetector[$mimetype];
 191+ elseif (isset($wgPlayerVideoResolutionDetector[$mimetype])) $detector = $wgPlayerVideoResolutionDetector[$mimetype];
192192 else $detector = $wgPlayerVideoResolutionDetector['*'];
193193
194194 if (!$detector) return false;
@@ -224,8 +224,8 @@
225225 */
226226 static function setHeaders( &$outputPage ) {
227227 global $wgJsMimeType, $wgPlayerExtensionPath, $wgContLang;
228 -
229228
 229+
230230 # Register css file for Player
231231 /*$outputPage->addLink(
232232 array(
@@ -446,9 +446,9 @@
447447 if (!$align) $align = 'none';
448448
449449 if ($align == 'left') $aligncls = 'tleft';
450 - else if ($align == 'right') $aligncls = 'tright';
451 - else if ($align == 'center') $aligncls = 'tnone';
452 - else if ($align == 'none') $aligncls = 'tnone';
 450+ elseif ($align == 'right') $aligncls = 'tright';
 451+ elseif ($align == 'center') $aligncls = 'tnone';
 452+ elseif ($align == 'none') $aligncls = 'tnone';
453453 else $aligncls = 'tnone'; //inlining complex boxes doesn't really work...
454454
455455 $cls = 'playerbox thumb ' . $aligncls;
Index: trunk/extensions/PlayerStatsGrabber/PlayerStatsGrabber_body.php
@@ -7,7 +7,7 @@
88
99 function __construct() {
1010 parent::__construct( "PlayerStatsGrabber" );
11 -
 11+
1212 }
1313
1414 // used for page title
@@ -40,7 +40,7 @@
4141 default:
4242 if ( $wgRequest->getVal( 'action' ) == 'submit' ) {
4343 $this->do_submit_survey();
44 - } else if ( $wgRequest->getVal( 'action' ) == 'survey' ) {
 44+ } elseif ( $wgRequest->getVal( 'action' ) == 'survey' ) {
4545 $this->do_survey_forum();
4646 } else {
4747 $this->do_stats_page();
@@ -77,7 +77,7 @@
7878 // run the stats (if not internal oggPlay)
7979 $this->runJS_Stats( $embed['url'] );
8080 $embed_code = $embed['html_code'];
81 - } else if ( isset( $embed['wiki_code'] ) ) {
 81+ } elseif ( isset( $embed['wiki_code'] ) ) {
8282 $popts = new ParserOptions;
8383 $parserOutput = $wgParser->parse( $embed['wiki_code'], $wgTitle, $popts );
8484 $embed_code = $parserOutput->getText();
Index: trunk/extensions/SemanticFormsInputs/SFI_Inputs.php
@@ -667,7 +667,7 @@
668668 // find highlighted dates
669669 if ( array_key_exists( "highlight dates", $other_args ) ) {
670670 $highlightedDates = self::sortAndMergeRanges ( self::createRangesArray( explode( ',' , $other_args["highlight dates"] ) ) ) ;
671 - } else if ( $sfigSettings->datePickerHighlightedDates ) {
 671+ } elseif ( $sfigSettings->datePickerHighlightedDates ) {
672672 $highlightedDates = self::sortAndMergeRanges ( self::createRangesArray( explode( ',' , $sfigSettings->datePickerHighlightedDates ) ) ) ;
673673 } else {
674674 $highlightedDates = null;
Index: trunk/extensions/Renameuser/RenameUserJob.php
@@ -46,7 +46,7 @@
4747 $conds[] = "$timestampColumn >= '$minTimestamp'";
4848 $conds[] = "$timestampColumn <= '$maxTimestamp'";
4949 # Otherwise, bound by key (B/C)
50 - } else if ( isset( $uniqueKey ) ) {
 50+ } elseif ( isset( $uniqueKey ) ) {
5151 $conds[$uniqueKey] = $keyId;
5252 } else {
5353 wfDebug( 'RenameUserJob::run - invalid job row given' ); // this shouldn't happen
Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_QueryHandler.php
@@ -2,166 +2,166 @@
33
44 /**
55 * Class for handling geographical SMW queries.
6 - *
 6+ *
77 * @since 0.7.3
8 - *
 8+ *
99 * @ingroup SemanticMaps
1010 * @file SM_QueryHandler.php
11 - *
 11+ *
1212 * @author Jeroen De Dauw
1313 */
1414 class SMQueryHandler {
15 -
 15+
1616 protected $queryResult;
1717 protected $outputmode;
18 -
 18+
1919 protected $locations = false;
20 -
 20+
2121 /**
2222 * The template to use for the text, or false if there is none.
23 - *
 23+ *
2424 * @since 0.7.3
25 - *
 25+ *
2626 * @var false or string
2727 */
2828 protected $template = false;
29 -
 29+
3030 /**
3131 * The global icon.
32 - *
 32+ *
3333 * @since 0.7.3
34 - *
 34+ *
3535 * @var string
36 - */
 36+ */
3737 public $icon = '';
38 -
 38+
3939 /**
4040 * The global text.
41 - *
 41+ *
4242 * @since 1.0
43 - *
 43+ *
4444 * @var string
45 - */
 45+ */
4646 public $text = '';
47 -
 47+
4848 /**
4949 * The global title.
50 - *
 50+ *
5151 * @since 1.0
52 - *
 52+ *
5353 * @var string
54 - */
55 - public $title = '';
56 -
 54+ */
 55+ public $title = '';
 56+
5757 /**
5858 * Make a separate link to the title or not?
59 - *
 59+ *
6060 * @since 0.7.3
61 - *
 61+ *
6262 * @var boolean
6363 */
6464 public $titleLinkSeperate;
65 -
 65+
6666 /**
6767 * Should link targets be made absolute (instead of relative)?
68 - *
 68+ *
6969 * @since 1.0
70 - *
 70+ *
7171 * @var boolean
7272 */
7373 protected $linkAbsolute;
74 -
 74+
7575 /**
76 - * The text used for the link to the page (if it's created). $1 will be replaced by the page name.
77 - *
 76+ * The text used for the link to the page (if it's created). $1 will be replaced by the page name.
 77+ *
7878 * @since 1.0
79 - *
 79+ *
8080 * @var string
8181 */
82 - protected $pageLinkText;
83 -
 82+ protected $pageLinkText;
 83+
8484 /**
85 - * A separator to use beteen the subject and properties in the text field.
86 - *
 85+ * A separator to use beteen the subject and properties in the text field.
 86+ *
8787 * @since 1.0
88 - *
 88+ *
8989 * @var string
9090 */
9191 protected $subjectSeparator = '<hr />';
92 -
 92+
9393 /**
9494 * Make the subject in the text bold or not?
95 - *
 95+ *
9696 * @since 1.0
97 - *
 97+ *
9898 * @var boolean
9999 */
100100 protected $boldSubject = true;
101 -
 101+
102102 /**
103103 * Show the subject in the text or not?
104 - *
 104+ *
105105 * @since 1.0
106 - *
 106+ *
107107 * @var boolean
108 - */
 108+ */
109109 protected $showSubject = true;
110110
111111 /**
112112 * Constructor.
113 - *
 113+ *
114114 * @since 0.7.3
115 - *
 115+ *
116116 * @param SMWQueryResult $queryResult
117117 * @param integer $outputmode
118118 */
119119 public function __construct( SMWQueryResult $queryResult, $outputmode, $linkAbsolute = false, $pageLinkText = '$1', $titleLinkSeperate = false ) {
120120 $this->queryResult = $queryResult;
121121 $this->outputmode = $outputmode;
122 -
 122+
123123 $this->linkAbsolute = $linkAbsolute;
124124 $this->pageLinkText = $pageLinkText;
125125 $this->titleLinkSeperate = $titleLinkSeperate;
126126 }
127 -
 127+
128128 /**
129129 * Sets the template.
130 - *
 130+ *
131131 * @since 1.0
132 - *
 132+ *
133133 * @param string $template
134134 */
135135 public function setTemplate( $template ) {
136136 $this->template = $template == '' ? false : $template;
137137 }
138 -
 138+
139139 /**
140140 * Sets the global icon.
141 - *
 141+ *
142142 * @since 1.0
143 - *
 143+ *
144144 * @param string $icon
145145 */
146146 public function setIcon( $icon ) {
147147 $this->icon = $icon;
148148 }
149 -
 149+
150150 /**
151151 * Sets the global title.
152 - *
 152+ *
153153 * @since 1.0
154 - *
 154+ *
155155 * @param string $title
156156 */
157157 public function setTitle( $title ) {
158158 $this->title = $title;
159159 }
160 -
 160+
161161 /**
162162 * Sets the global text.
163 - *
 163+ *
164164 * @since 1.0
165 - *
 165+ *
166166 * @param string $text
167167 */
168168 public function setText( $text ) {
@@ -170,31 +170,31 @@
171171
172172 /**
173173 * Sets the subject separator.
174 - *
 174+ *
175175 * @since 1.0
176 - *
 176+ *
177177 * @param string $subjectSeparator
178178 */
179179 public function setSubjectSeparator( $subjectSeparator ) {
180180 $this->subjectSeparator = $subjectSeparator;
181 - }
182 -
 181+ }
 182+
183183 /**
184184 * Sets if the subject should be made bold in the text.
185 - *
 185+ *
186186 * @since 1.0
187 - *
 187+ *
188188 * @param string $boldSubject
189189 */
190190 public function setBoldSubject( $boldSubject ) {
191191 $this->boldSubject = $boldSubject;
192192 }
193 -
 193+
194194 /**
195195 * Sets if the subject should shown in the text.
196 - *
 196+ *
197197 * @since 1.0
198 - *
 198+ *
199199 * @param string $showSubject
200200 */
201201 public function setShowSubject( $showSubject ) {
@@ -211,105 +211,105 @@
212212 public function setPageLinkText( $text ) {
213213 $this->pageLinkText = $text;
214214 }
215 -
 215+
216216 /**
217217 * Gets the query result as a list of locations.
218 - *
 218+ *
219219 * @since 0.7.3
220 - *
 220+ *
221221 * @return array of MapsLocation
222 - */
 222+ */
223223 public function getLocations() {
224224 if ( $this->locations === false ) {
225225 $this->locations = $this->findLocations();
226226 }
227 -
 227+
228228 return $this->locations;
229229 }
230 -
 230+
231231 /**
232232 * Gets the query result as a list of locations.
233 - *
 233+ *
234234 * @since 0.7.3
235 - *
 235+ *
236236 * @return array of MapsLocation
237 - */
 237+ */
238238 protected function findLocations() {
239239 $locations = array();
240 -
 240+
241241 while ( ( $row = $this->queryResult->getNext() ) !== false ) {
242242 $locations = array_merge( $locations, $this->handleResultRow( $row ) );
243243 }
244244
245245 return $locations;
246246 }
247 -
 247+
248248 /**
249249 * Returns the locations found in the provided result row.
250 - *
 250+ *
251251 * @since 0.7.3
252 - *
 252+ *
253253 * @param array $row Array of SMWResultArray
254 - *
 254+ *
255255 * @return array of MapsLocation
256256 */
257257 protected function handleResultRow( array /* of SMWResultArray */ $row ) {
258258 $locations = array();
259259 $properties = array();
260 -
 260+
261261 $title = '';
262262 $text = '';
263 -
 263+
264264 // Loop throught all fields of the record.
265265 foreach ( $row as $i => $resultArray ) {
266266 /* SMWPrintRequest */ $printRequest = $resultArray->getPrintRequest();
267 -
 267+
268268 // Loop throught all the parts of the field value.
269 - while ( ( /* SMWDataValue */ $dataValue = $resultArray->getNextDataValue() ) !== false ) {
 269+ while ( ( /* SMWDataValue */ $dataValue = $resultArray->getNextDataValue() ) !== false ) {
270270 if ( $dataValue->getTypeID() == '_wpg' && $i == 0 ) {
271271 list( $title, $text ) = $this->handleResultSubject( $dataValue );
272272 }
273 - else if ( $dataValue->getTypeID() != '_geo' && $i != 0 ) {
 273+ elseif ( $dataValue->getTypeID() != '_geo' && $i != 0 ) {
274274 $properties[] = $this->handleResultProperty( $dataValue, $printRequest );
275275 }
276 - else if ( $printRequest->getMode() == SMWPrintRequest::PRINT_PROP && $printRequest->getTypeID() == '_geo' ) {
 276+ elseif ( $printRequest->getMode() == SMWPrintRequest::PRINT_PROP && $printRequest->getTypeID() == '_geo' ) {
277277 $dataItem = $dataValue->getDataItem();
278 -
 278+
279279 $location = MapsLocation::newFromLatLon( $dataItem->getLatitude(), $dataItem->getLongitude() );
280 -
 280+
281281 if ( $location->isValid() ) {
282282 $locations[] = $location;
283283 }
284 -
 284+
285285 }
286286 }
287287 }
288 -
 288+
289289 if ( count( $properties ) > 0 && $text != '' ) {
290290 $text .= $this->subjectSeparator;
291291 }
292 -
 292+
293293 $icon = $this->getLocationIcon( $row );
294 -
 294+
295295 return $this->buildLocationsList( $locations, $title, $text, $icon, $properties );
296296 }
297 -
 297+
298298 /**
299299 * Handles a SMWDataValue subject value.
300300 * Gets the plain text title and creates the HTML text with headers and the like.
301 - *
 301+ *
302302 * @since 1.0
303 - *
 303+ *
304304 * @param SMWDataValue $object
305 - *
 305+ *
306306 * @return array with title and text
307307 */
308308 protected function handleResultSubject( SMWDataValue $object ) {
309309 global $wgUser;
310 -
 310+
311311 $title = $object->getLongText( $this->outputmode, null );
312312 $text = '';
313 -
 313+
314314 if ( $this->showSubject ) {
315315 if ( !$this->titleLinkSeperate && $this->linkAbsolute ) {
316316 $text = Html::element(
@@ -321,14 +321,14 @@
322322 else {
323323 $text = $object->getLongText( $this->outputmode, $wgUser->getSkin() );
324324 }
325 -
 325+
326326 if ( $this->boldSubject ) {
327327 $text = '<b>' . $text . '</b>';
328328 }
329 -
 329+
330330 if ( $this->titleLinkSeperate ) {
331331 $txt = $object->getTitle()->getText();
332 -
 332+
333333 if ( $this->pageLinkText != '' ) {
334334 $txt = str_replace( '$1', $txt, $this->pageLinkText );
335335 }
@@ -337,36 +337,36 @@
338338 array( 'href' => $object->getTitle()->getFullUrl() ),
339339 $txt
340340 );
341 - }
 341+ }
342342 }
343343
344344 return array( $title, $text );
345345 }
346 -
 346+
347347 /**
348348 * Handles a single property (SMWPrintRequest) to be displayed for a record (SMWDataValue).
349 - *
 349+ *
350350 * @since 1.0
351 - *
 351+ *
352352 * @param SMWDataValue $object
353353 * @param SMWPrintRequest $printRequest
354 - *
 354+ *
355355 * @return string
356356 */
357357 protected function handleResultProperty( SMWDataValue $object, SMWPrintRequest $printRequest ) {
358358 global $wgUser;
359 -
 359+
360360 if ( $this->template ) {
361361 if ( $object instanceof SMWWikiPageValue ) {
362362 return $object->getTitle()->getPrefixedText();
363363 } else {
364364 return $object->getLongText( SMW_OUTPUT_WIKI, NULL );
365365 }
366 - }
367 -
 366+ }
 367+
368368 if ( $this->linkAbsolute ) {
369369 $t = Title::newFromText( $printRequest->getHTMLText( NULL ), SMW_NS_PROPERTY );
370 -
 370+
371371 if ( $t->exists() ) {
372372 $propertyName = $propertyName = Html::element(
373373 'a',
@@ -376,20 +376,20 @@
377377 }
378378 else {
379379 $propertyName = $printRequest->getHTMLText( NULL );
380 - }
 380+ }
381381 }
382382 else {
383383 $propertyName = $printRequest->getHTMLText( $wgUser->getSkin() );
384384 }
385 -
 385+
386386 if ( $this->linkAbsolute ) {
387387 $hasPage = $object->getTypeID() == '_wpg';
388 -
 388+
389389 if ( $hasPage ) {
390390 $t = Title::newFromText( $object->getLongText( $this->outputmode, NULL ), NS_MAIN );
391391 $hasPage = $t->exists();
392392 }
393 -
 393+
394394 if ( $hasPage ) {
395395 $propertyValue = Html::element(
396396 'a',
@@ -399,26 +399,26 @@
400400 }
401401 else {
402402 $propertyValue = $object->getLongText( $this->outputmode, NULL );
403 - }
 403+ }
404404 }
405405 else {
406406 $propertyValue = $object->getLongText( $this->outputmode, $wgUser->getSkin() );
407407 }
408 -
409 - return $propertyName . ( $propertyName == '' ? '' : ': ' ) . $propertyValue;
 408+
 409+ return $propertyName . ( $propertyName == '' ? '' : ': ' ) . $propertyValue;
410410 }
411 -
 411+
412412 /**
413413 * Builds a set of locations with the provided title, text and icon.
414 - *
 414+ *
415415 * @since 1.0
416 - *
 416+ *
417417 * @param array of MapsLocation $locations
418418 * @param string $title
419419 * @param string $text
420420 * @param string $icon
421421 * @param array $properties
422 - *
 422+ *
423423 * @return array of MapsLocation
424424 */
425425 protected function buildLocationsList( array $locations, $title, $text, $icon, array $properties ) {
@@ -429,54 +429,54 @@
430430 else {
431431 $text .= implode( '<br />', $properties );
432432 }
433 -
 433+
434434 foreach ( $locations as $location ) {
435435 if ( $this->template ) {
436436 $segments = array_merge(
437437 array( $this->template, 'title=' . $title, 'latitude=' . $location->getLatitude(), 'longitude=' . $location->getLongitude() ),
438438 $properties
439439 );
440 -
 440+
441441 $text .= $parser->parse( '{{' . implode( '|', $segments ) . '}}', $parser->getTitle(), new ParserOptions() )->getText();
442 - }
443 -
 442+ }
 443+
444444 $location->setTitle( $title );
445445 $location->setText( $text );
446446 $location->setIcon( $icon );
447447
448 - $locations[] = $location;
 448+ $locations[] = $location;
449449 }
450 -
 450+
451451 return $locations;
452452 }
453 -
 453+
454454 /**
455455 * Get the icon for a row.
456456 *
457457 * @since 0.7.3
458458 *
459459 * @param array $row
460 - *
 460+ *
461461 * @return string
462462 */
463463 protected function getLocationIcon( array $row ) {
464464 $icon = '';
465465 $legend_labels = array();
466 -
 466+
467467 // Look for display_options field, which can be set by Semantic Compound Queries
468468 // the location of this field changed in SMW 1.5
469469 $display_location = method_exists( $row[0], 'getResultSubject' ) ? $row[0]->getResultSubject() : $row[0];
470 -
 470+
471471 if ( property_exists( $display_location, 'display_options' ) && is_array( $display_location->display_options ) ) {
472472 $display_options = $display_location->display_options;
473473 if ( array_key_exists( 'icon', $display_options ) ) {
474474 $icon = $display_options['icon'];
475475
476 - // This is somewhat of a hack - if a legend label has been set, we're getting it for every point, instead of just once per icon
 476+ // This is somewhat of a hack - if a legend label has been set, we're getting it for every point, instead of just once per icon
477477 if ( array_key_exists( 'legend label', $display_options ) ) {
478 -
 478+
479479 $legend_label = $display_options['legend label'];
480 -
 480+
481481 if ( ! array_key_exists( $icon, $legend_labels ) ) {
482482 $legend_labels[$icon] = $legend_label;
483483 }
@@ -488,6 +488,6 @@
489489 }
490490
491491 return $icon;
492 - }
493 -
 492+ }
 493+
494494 }
Index: trunk/extensions/SemanticGraph/includes/SemanticGraphHelperFunctions.php
@@ -1,29 +1,29 @@
22 <?php
33 function efBigPic($fileurl, $imgwidth, $imgheight, $boxwidth = null, $boxheight = null, $boxresize = 'none', $zoom = 'tofit') {
4 -
 4+
55 global $wgBigPicCounter;
66 @$wgBigPicCounter += 1;
77 /*
88 $fileurl, the URL to the image
9 - $imgwidth,
10 - $imgheight,
 9+ $imgwidth,
 10+ $imgheight,
1111 $boxwidth = null, if null the value is calculated to maintain aspect ratio of image using boxheight.
12 - $boxheight = null, if null the value is calculated to maintain aspect ratio of image using boxwidth.
13 - If both boxwidth and boxheight null will default to size of image
 12+ $boxheight = null, if null the value is calculated to maintain aspect ratio of image using boxwidth.
 13+ If both boxwidth and boxheight null will default to size of image
1414 $boxresize = 'none'|'toimage', only does anything if both boxwidth and boxheight are specified
1515 $zoom = 'tofit'|'topage'|numeric value>0, will fit image into box either to fit all (topage) or by width (tofit) or any zoom value
16 -
 16+
1717 more than one of these functions in a page generates cross talk between script functions and unpredictable effects.
1818 */
19 -
 19+
2020 $x=$imgwidth;
2121 $y=$imgheight;
22 -
 22+
2323 list($imgwidth, $imgheight, $boxwidth, $boxheight, $offsetx, $offsety) = boxsizing($imgwidth, $imgheight, $boxwidth, $boxheight, $boxresize, $zoom);
24 -
 24+
2525 $c = $wgBigPicCounter;
2626 //clip:rect(0px '.$boxheight.'px '.$boxwidth.'px 0px);
27 -
 27+
2828 $html = '<div id=maptable style="position:relative;overflow:hidden;height:'.$boxheight.'px;'
2929 .'width:'.$boxwidth.'px;border:2px inset #aeaeae;">'
3030 .'<div id=zoom style="position:absolute;top:10px;left:10px;color:yellow;background-color:transparent; z-index:10;">'
@@ -31,7 +31,7 @@
3232 .'<a style="border:1px solid black;background-color:white; text-decoration:none; padding:2px;line-height:1.8em;color:black;" onclick="zoomOut()">Zoom out</a></div>'
3333 .'<div id=mover style="position:relative;height:'.$imgheight.'px;width:'.$imgwidth.'px;top:'.$offsety.'px;left:'.$offsetx.'px;" onmousedown="startDrag(event)">'
3434 .'<img style="height:100%;width:100%" ondragstart="return false" onmousedown="return false" src="'.$fileurl.'" id=earthMap title="" /></div></div>';
35 -
 35+
3636 $js = "<script type=\"text/javascript\">/*@cc_on @*/
3737 mapWidth=$imgwidth;
3838 mapHeight=$imgheight;
@@ -66,7 +66,7 @@
6767 }
6868 var offsetX,offsetY,draggingThing;
6969 function startDrag(e) {
70 - draggingThing=document.getElementById('mover');
 70+ draggingThing=document.getElementById('mover');
7171 offsetX=e.clientX-draggingThing.offsetLeft;
7272 offsetY=e.clientY-draggingThing.offsetTop;
7373 document.body.onmousemove=moveDrag;
@@ -91,7 +91,7 @@
9292 document.onselectstart=null;
9393 }
9494 </script>";
95 -
 95+
9696 return $js."\n".$html;
9797 }
9898
@@ -99,15 +99,15 @@
100100 if ($boxwidth == null && $boxheight == null) {
101101 $boxwidth = $imgwidth;
102102 $boxheight = $imgheight;
103 - } else if ($boxwidth == null && $boxheight != null) {
 103+ } elseif ($boxwidth == null && $boxheight != null) {
104104 $boxwidth = $imgwidth * $boxheight/$imgheight;
105105 $imgwidth = $boxwidth;
106106 $imgheight = $boxheight;
107 - } else if ($boxwidth != null && $boxheight == null) {
 107+ } elseif ($boxwidth != null && $boxheight == null) {
108108 $boxheight = $imgheight * $boxwidth/$imgwidth;
109109 $imgwidth = $boxwidth;
110110 $imgheight = $boxheight;
111 - } else if ($boxresize == "toimage") {
 111+ } elseif ($boxresize == "toimage") {
112112 if (($imgwidth/$imgheight) < ($boxwidth/$boxheight)) {
113113 // img is more portrait oriented than box
114114 // shrink box width to correct aspect ratio
@@ -125,13 +125,13 @@
126126 //shrink image to fit smallest dimension
127127 $imgwidth = min($scale) * $imgwidth;
128128 $imgheight = min($scale) * $imgheight;
129 - } else if ($zoom == 'tofit') {
 129+ } elseif ($zoom == 'tofit') {
130130 //shrink image to both dimensions
131131 $imgwidth = max($scale) * $imgwidth;
132132 $imgheight = max($scale) * $imgheight;
133133 }
134134 }
135 -
 135+
136136 /*
137137 if ((int) $zoom > 0) {
138138 //override calculated values if a percentage zoom has been specified
@@ -142,39 +142,39 @@
143143 //centre image in box
144144 $offsetx = ($boxwidth - $imgwidth)/2;
145145 $offsety = ($boxheight - $imgheight)/2;
146 -
 146+
147147 $offsetx = floor($offsetx);
148148 $offsety = floor($offsety);
149149 $boxwidth = floor($boxwidth);
150150 $imgwidth = floor($imgwidth);
151151 $boxheight = floor($boxheight);
152152 $imgheight = floor($imgheight);
153 -
 153+
154154 return array($imgwidth, $imgheight, $boxwidth, $boxheight, $offsetx, $offsety);
155155 }
156156
157157 function efBigSvg($svgurl, $boxwidth = null, $boxheight = null, $boxresize = 'none', $zoom = 'tofit') {
158 -
 158+
159159 /*
160160 $fileurl, the URL to the image
161 - $imgwidth,
162 - $imgheight,
 161+ $imgwidth,
 162+ $imgheight,
163163 $boxwidth = null, if null the value is calculated to maintain aspect ratio of image using boxheight.
164 - $boxheight = null, if null the value is calculated to maintain aspect ratio of image using boxwidth.
165 - If both boxwidth and boxheight both null will default to size of image.
 164+ $boxheight = null, if null the value is calculated to maintain aspect ratio of image using boxwidth.
 165+ If both boxwidth and boxheight both null will default to size of image.
166166 $boxresize = 'none'|'toimage', only does anything if both boxwidth and boxheight are specified when it will resize one dimension
167167 to maintain the image aspect ratio.
168168 $zoom = 'tofit'|'topage'|numeric value>0, will fit image into box either to fit all (topage) or by width (tofit) or any zoom value
169 -
 169+
170170 more than one of these functions in a page generates cross talk between script functions and unpredictable effects.
171171 */
172 -
 172+
173173 //echo $svgurl; exit(0);
174 -
 174+
175175 $svg = new DOMDocument();
176176 @$str = file_get_contents($svgurl);
177177 $svg->loadXML($str);
178 -
 178+
179179 $svgnode = $svg->getElementsByTagName('svg')->item(0);
180180 //get width and height from svg document - this is expressed in pt and needs to be changed to user units to align to browsers view of scale.
181181 $imgwidth = (int) $svgnode->getAttribute('width');
@@ -186,7 +186,7 @@
187187 $svgnode->setAttribute('width',$boxwidth);
188188 $svgnode->setAttribute('height',$boxheight);
189189 $scale = $imgwidth/$x;
190 -
 190+
191191 $js = ' var fx='.(-$x/2).';
192192 var fy='.(-$y/2).';
193193 var scale='.$scale.';
@@ -248,15 +248,15 @@
249249 function translation(x, y, s) {
250250 return \'translate('.($boxwidth/2).','.($boxheight/2).') scale(\'+s+\') translate(\'+x+\',\'+y+\')\';
251251 }';
252 -
 252+
253253 $js=preg_replace('|^\s*\r?\n|m','',$js); //strip whitespace to prevent some spurious wiki parsing
254254 $js=preg_replace('|^\s*|m','',$js);
255 - $js=preg_replace('|\s*\r?\n|m','',$js);
256 -
 255+ $js=preg_replace('|\s*\r?\n|m','',$js);
 256+
257257 $scriptnode = $svg->createElement('script', $js);
258258 $scriptnode->setAttribute('type','text/ecmascript');
259 -
260259
 260+
261261 //clear initial transforms applied by graphviz we will have to reimplement. should probably check here that current assumptions around way graphviz behaves are true.
262262 $svgnode->removeAttribute('viewBox');
263263 $svgnode->setAttribute('overflow','hidden'); // this has effect of removing scroll bars in viewing window which is good because we need to be incontrol of position
@@ -267,30 +267,30 @@
268268 $tnode->setAttribute('style',$pt);
269269 }
270270 //export as svgtxt
271 -
 271+
272272 //fix javascript to interact with svg DOM mover element.
273 -
274 -
275 -
 273+
 274+
 275+
276276 $transform = 'translate('.($boxwidth/2).','.($boxheight/2).') ';
277277 //the original scale factor. This is what will be changed with zooming
278278 $transform .= 'scale('.$scale.') ';
279279 //initial focus point is centre of original image. This is what is going to be changed with panning
280280 $transform .= 'translate('.(-$x/2).','.(-$y/2).') ';
281281 // the processing order of these feels wrong to me - i wonder if this is a bug in firefox.
282 -
 282+
283283 $graph0 = $svg->getElementsByTagName('g')->item(0);
284284 $graph0->setAttribute('transform',$transform);
285285 $graph0->setAttribute('id','mover');
286286 $graph0->parentNode->insertBefore($scriptnode, $graph0);
287 -
 287+
288288 foreach($svg->getElementsByTagName('a') as $link) {
289289 $link->setAttributeNS('http://www.w3.org/1999/xlink','xlink:show','new');
290290 } // this needs to be done to get round usability iframe behaviour.
291 -
 291+
292292 $background = $svg->getElementsByTagName('polygon')->item(0);
293293 $background->setAttribute('onmousedown','startDrag(evt)');
294 -
 294+
295295 $zoomcontrols = '<g id="zoomcontrols" class="graph">'
296296 .'<rect id="background" style="fill:none;stroke:black;" x="0" y="0" width="'.$boxwidth.'" height="'.$boxheight.'"/>'
297297 .'<g id="zoomin" class="node" onclick="zoomIn()"><rect style="fill:#f0f0f0;stroke:black;" x="10" y="10" width="20" height="15"/><text text-anchor="middle" x="20" y="20" style="font-family:Arial;font-size:7pt;fill:black;">in</text></g>'
@@ -301,13 +301,13 @@
302302 .'<g id="down" class="node" onclick="panDown()"><polygon style="fill:#f0f0f0;stroke:black;" points="25,70 45,70 35,80"/></g>'
303303 .'<g id="centre" class="node" onclick="centre()"><ellipse style="fill:#f0f0f0;stroke:black;" cx="35" cy="55" rx="10" ry="10"/></g>'
304304 .'</g>';
305 -
 305+
306306 $svgtxt = $svg->saveXML($svg->documentElement);
307307 $svgtxt = str_replace("</svg>", $zoomcontrols."</svg>", $svgtxt); //apologies to DOM purists out there.
308308
309309
310310
311 -
 311+
312312 //return $js;
313313 return $svgtxt;
314314 }
Index: trunk/extensions/SemanticGraph/includes/SemanticGraphBuilders.php
@@ -4,7 +4,7 @@
55 var $gq;
66 var $nodes;
77 var $links;
8 -
 8+
99 //make a temp table
1010
1111 function __construct($args) {
@@ -12,10 +12,10 @@
1313 $this->gq = new GraphQuery($args);
1414 $this->args = $args;
1515 $SMWengine = new SMWSQLStore2;
16 - $this->dbr = wfGetDB( DB_SLAVE );
 16+ $this->dbr = wfGetDB( DB_SLAVE );
1717 //need to hold onto this until all queries done as it controls the existance
1818 //of the temporary tables
19 -
 19+
2020 $resources=array(); //can be subjects and / or objects
2121 foreach ((array) $this->args['resource'] as $t) {
2222 $x = Title::newFromDBkey($t);
@@ -25,7 +25,7 @@
2626 $temptable["page_title"] = $t;
2727 $temptable["smw_id"] = $SMWengine->getSMWPageID($x->getDBkey(),$x->getNamespace(),$x->getInterwiki());
2828 }
29 -
 29+
3030 $p = $this->args['property'];
3131 if (!is_array($p)) $p = array($p);
3232 if (!is_array($titlearr)) $titlearr = array($titlearr);
@@ -33,15 +33,15 @@
3434 foreach ($p as $prop) {
3535 if ($prop == Title::makeTitle(SMW_NS_PROPERTY,$wgSemanticGraphSettings->dummyCategoryLinkProperty)->getPrefixedDBkey()) {
3636 $this->getPagesFromCategory($titlearr);
37 - } else if ($prop == Title::makeTitle(SMW_NS_PROPERTY,$wgSemanticGraphSettings->dummyWikiLinkProperty)->getPrefixedDBkey()) {
 37+ } elseif ($prop == Title::makeTitle(SMW_NS_PROPERTY,$wgSemanticGraphSettings->dummyWikiLinkProperty)->getPrefixedDBkey()) {
3838 $this->getPagesFromWikilinks($titlearr);
3939 } else {
4040 $this->getPagesFromSemantics( $titlearr , $prop);
4141 }
4242 }
43 -
 43+
4444 //FIXME FIXME
45 -
 45+
4646 $properties=array();
4747 foreach ((array) $this->args['property'] as $t) {
4848 $x = Title::newFromDBkey($t); // these must exist
@@ -54,22 +54,22 @@
5555 $temptable["subj2obj"] = true;
5656 $temptable["obj2subj"] = false;
5757 }
58 -
59 - //build temp tables based on this and a rdf triple store for the result based on first pass query of
 58+
 59+ //build temp tables based on this and a rdf triple store for the result based on first pass query of
6060 //smw_rels2 for semantic queries
6161 //what about normal wiki and category queries?
62 -
 62+
6363 }
6464
6565 /*function buildFromWiki() {
6666 //deprecate this in preference of constructor
67 -
 67+
6868 $this->nodes = $this->args['resource']; // this can be singelton or array
6969 if (!is_array($this->nodes)) $this->nodes = array($this->nodes);
7070 $n = $this->nodes;
7171 //identify smw_ids from page titles.
7272 //identify normal page_ids from page titles.
73 -
 73+
7474 $this->links = array();
7575 for ($i=0; $i < $this->args['depth']; $i++) {
7676 $this->gq->doQuery($n);
@@ -131,7 +131,7 @@
132132 }
133133
134134 //private functions
135 -
 135+
136136 /*DO ME IN SQL
137137 function arrayUnique($myArray) {
138138 if(!is_array($myArray))
@@ -250,7 +250,7 @@
251251 }
252252 }
253253 }
254 -
 254+
255255 function foldtype($level,$count) {
256256 global $wgSemanticGraphSettings;
257257 switch ($this->args['fold']) {
@@ -272,7 +272,7 @@
273273 }
274274 return "false";
275275 }
276 -
 276+
277277 function backlink($newnode, $t) {
278278 $element = $this->map->createElement('arrowlink');
279279 $element->setAttribute('DESTINATION',$t); //this is potentially not unique behaviour may be unpredictable
@@ -293,7 +293,7 @@
294294 var $ng;
295295 var $map;
296296 var $output;
297 -
 297+
298298 function __construct($args) {
299299 global $wgSemanticGraphSettings;
300300 $this->args = $args;
@@ -308,7 +308,7 @@
309309 $title = $this->args['resource']; // this should already be validated to be a singleton
310310 $this->output=$this->recursiveBuildTable($title, $level);
311311 }
312 -
 312+
313313 function recursiveBuildTable($title, $level, $ancestry = array()) {
314314 $this->call += 1;
315315 $ancestry[] = $title;
@@ -326,7 +326,7 @@
327327 }
328328 $html = "<table $defaultstyle id=\"$summary\" style=\"$initsummarystyle\"><tr><th onclick=\"$jscollapse\">(+)</th><th>$title</th><th></th></tr></table>";
329329 $html .= "<table $defaultstyle id=\"$detail\" style=\"$initdetailstyle\">";
330 -
 330+
331331 //upstream properties
332332 $upstream = $this->ng->getSubjectTriples($title);
333333 foreach ($upstream as $property) {
@@ -337,16 +337,16 @@
338338 //} else {
339339 //recurse here
340340 //html .= recursiveBuildTable($source,$level+1,$family);
341 - //}
 341+ //}
342342 }
343343 $html .= "</td>";
344344 $html .= "<td><i>$property</i></td><td></td>";
345345 $html .= "</tr>";
346346 }
347 -
 347+
348348 //
349349 $html .= "<tr><td onclick=\"$jsexpand\">(-)</td><td>$title</td><td></td></tr>";
350 -
 350+
351351 //downstream properties
352352 $downstream = $this->ng->getObjectTriples($title);
353353 foreach ($downstream as $property) {
@@ -358,12 +358,12 @@
359359 //} else {
360360 //recurse here
361361 //html .= recursiveBuildTable($dest,$level+1,$family);
362 - //}
 362+ //}
363363 }
364364 $html .= "</td>";
365365 $html .= "</tr>";
366366 }
367 -
 367+
368368 $html .= "</table>";
369369 return $html;
370370 }
Index: trunk/extensions/SemanticGraph/includes/SemanticGraphSettings.php
@@ -42,17 +42,17 @@
4343 );
4444 $this->options = array (
4545 'smm' => array (
46 - 'resource' => array ('type' => 'page', 'check' => array('mand','someexist'),
 46+ 'resource' => array ('type' => 'page', 'check' => array('mand','someexist'),
4747 'help' => 'the root node of the mind map'),
4848 'property' => array ('type' => 'page', 'list' => true, 'action' => array('toarray','nsproperty'), 'check' => 'someexist', 'default' => $this->dummyCategoryLinkProperty.",".$this->dummyWikiLinkProperty,
4949 'help' => $commonhelp['property']),
5050 'depth' => array ('type' => 'num', 'default' => 5),
5151 'height' => array ('type' => 'string', 'default' => 450),
52 - 'editform' => array ('type' => 'string', 'default' => false,
 52+ 'editform' => array ('type' => 'string', 'default' => false,
5353 'help' => $commonhelp['editform']),
54 - 'editquery' => array ('type' => 'string', 'default' => false,
 54+ 'editquery' => array ('type' => 'string', 'default' => false,
5555 'help' => $commonhelp['editquery']),
56 - 'fold' => array ('type' => 'string', 'default' => 'large', 'values' => array('level1', 'level2', 'level3', 'none', 'large'),
 56+ 'fold' => array ('type' => 'string', 'default' => 'large', 'values' => array('level1', 'level2', 'level3', 'none', 'large'),
5757 'help' => 'folding of generated map: by default branches with more than 10 items are folded')
5858 ),
5959 'sgraph' => array (
@@ -63,16 +63,16 @@
6464 'depth' => array ('type' => 'num', 'default' => 3,
6565 'help' => 'deep graphs can be expensive'),
6666 'engine' => array ('type' => 'string', 'default' => 'dot', 'values' => array('dot','neato','circo','twopi','fdp')),
67 - 'editform' => array ('type' => 'string', 'default' => false,
 67+ 'editform' => array ('type' => 'string', 'default' => false,
6868 'help' => $commonhelp['editform']),
69 - 'editquery' => array ('type' => 'string', 'default' => false,
 69+ 'editquery' => array ('type' => 'string', 'default' => false,
7070 'help' => $commonhelp['editquery']),
7171 'dotoptions' => array ('type' => 'string', 'default' => "rankdir=LR, ranksep=1;\nnode [fontsize=10, fontname=Helvetica];\n",
7272 'help' => 'a dot string which is inserted at the top of the graph'),
7373 'width' => array ('type' => 'string', 'default' => '800'),
7474 'height' => array ('type' => 'string', 'default' => '600'),
7575 'svg' => array ('type' => 'string', 'default' => 'false'),
76 - 'boxresize' => array ('type' => 'string' , 'default' => 'none', 'values' => array('none','toimage'),
 76+ 'boxresize' => array ('type' => 'string' , 'default' => 'none', 'values' => array('none','toimage'),
7777 'help' => "This option is for svg mode only. ".$commonhelp['boxresize']),
7878 'zoom' => array ('type' => 'string', 'default' => 'tofit' ,
7979 'help' => "This option is for svg mode only. ".$commonhelp['zoom']),
@@ -81,25 +81,25 @@
8282 'image' => array ('type' => 'page', 'action' => 'nsimage', 'check' => array('mand','someexist'),
8383 'help' => 'a page name in the image namespace that refers to an uploaded freemind map e.g. Image:map.mm, also map.mm should work'),
8484 'height' => array ('type' => 'string', 'default' => 450),
85 - 'editform' => array ('type' => 'string', 'default' => false,
 85+ 'editform' => array ('type' => 'string', 'default' => false,
8686 'help' => $commonhelp['editform']),
87 - 'editquery' => array ('type' => 'string', 'default' => false,
 87+ 'editquery' => array ('type' => 'string', 'default' => false,
8888 'help' => $commonhelp['editquery']),
8989 'fold' => array ('type' => 'string', 'values' => array('level1', 'level2', 'level3', 'none', 'large'))
9090 ),
9191 'shypergraph' => array (
9292 'resource' => array ('type' => 'page','list' => true, 'action' => 'toarray', 'check' => array('mand','someexist'),
9393 'help' => 'a set of pages that define the initial nodes of the hypergraph. This appears to behave best if it is single'),
94 - 'property' => array ('type' => 'page','list' => true, 'action' => array('toarray','nsproperty'), 'check' => 'someexist', 'default' => $this->dummyCategoryLinkProperty.",".$this->dummyWikiLinkProperty,
 94+ 'property' => array ('type' => 'page','list' => true, 'action' => array('toarray','nsproperty'), 'check' => 'someexist', 'default' => $this->dummyCategoryLinkProperty.",".$this->dummyWikiLinkProperty,
9595 'help' => $commonhelp['property']),
9696 'colours' => array ('type' => 'string', 'list' => true, 'default' => 'black', 'action' => 'toarray', 'values' => $this->colourlist,
9797 'help' => 'a list of colours for the property links - not yet implemented'),
9898 'depth' => array ('type' => 'num', 'default' => 5),
9999 'width' => array ('type' => 'string', 'default' => 800),
100100 'height' => array ('type' => 'string', 'default' => 600),
101 - 'editform' => array ('type' => 'string', 'default' => false,
 101+ 'editform' => array ('type' => 'string', 'default' => false,
102102 'help' => $commonhelp['editform']),
103 - 'editquery' => array ('type' => 'string', 'default' => false,
 103+ 'editquery' => array ('type' => 'string', 'default' => false,
104104 'help' => $commonhelp['editquery']),
105105 ),
106106 'bigpic' => array (
@@ -107,7 +107,7 @@
108108 'help' => 'a reference to an image page (that contains an image file!)'),
109109 'width' => array ('type' => 'num', 'default' => null),
110110 'height' => array ('type' => 'num', 'default' => null),
111 - 'boxresize' => array ('type' => 'string' , 'default' => 'none', 'values' => array('none','toimage'),
 111+ 'boxresize' => array ('type' => 'string' , 'default' => 'none', 'values' => array('none','toimage'),
112112 'help' => $commonhelp['boxresize']),
113113 'zoom' => array ('type' => 'string', 'default' => 'tofit' ,
114114 'help' => $commonhelp['zoom']),
@@ -123,7 +123,7 @@
124124 'dot' => array(
125125 'preamble' => 'digraph "@NAME@" {'."\n",
126126 'nodeExist' => "@CHILD_ID@ [label=\"@CHILD_LABEL@\" URL=\"$wgServer@CHILD_LNK@\", fontcolor=\"blue\"];"."\n",
127 - 'nodeNotExist'=> "@CHILD_ID@ [label=\"@CHILD_LABEL@\" URL=\"$wgServer@FORM_LNK@\", fontcolor=\"red\"];"."\n",
 127+ 'nodeNotExist'=> "@CHILD_ID@ [label=\"@CHILD_LABEL@\" URL=\"$wgServer@FORM_LNK@\", fontcolor=\"red\"];"."\n",
128128 'link' => "@PAR_ID@ -> @CHILD_ID@;"."\n",
129129 'conclusion' => "}"."\n"
130130 ),
@@ -149,9 +149,9 @@
150150 'notExistColour' => '#ff0000',
151151 )
152152 );
153 -
 153+
154154 }
155 -
 155+
156156 function usage($functn) {
157157 $t = "<p><b>USAGE: {{#$functn:property=value|property=value1,value2,value3|...}}</b></p><table border='1'><tr><th>property</th><th>type</th><th>list</th><th>values</th><th>checks</th><th>help</th></tr>";
158158 foreach ($this->options[$functn] as $rowk => $rowv) {
@@ -179,18 +179,18 @@
180180 $t .= '</ul></td>';
181181 } else {
182182 $t .= '<td></td>';
183 - }
 183+ }
184184 if (isset($rowv['help'])) {
185185 $t .= '<td>'.$rowv['help'].'</td>';
186186 } else {
187187 $t .= '<td></td>';
188 - }
 188+ }
189189 $t .= '</tr>';
190190 }
191191 $t .= '</table>';
192192 return $t;
193193 }
194 -
 194+
195195 function parseOptions( $optarray, $type = 'ERROR' ) {
196196 global $wgContLang, $wgScriptPath;
197197 array_shift( $optarray ); //first is &$parser, strip it
@@ -200,9 +200,9 @@
201201 }
202202 if ( !array_key_exists($type, $this->options) ) {
203203 $this->lastError = 'unsupported function call '.$type;
204 - return false;
205 - }
206 -
 204+ return false;
 205+ }
 206+
207207 $argv = array();
208208 //populate defaults in output array
209209 foreach ((array) $this->options[$type] as $optionk => $optionv) {
@@ -227,7 +227,7 @@
228228 foreach ((array) $this->options[$type] as $optionk => $optionv) {
229229 if (isset($argv[$optionk])) {
230230 //options are now as strings, maybe comma seperated to represent arrays
231 - //sometimes these will be converted to arrays
 231+ //sometimes these will be converted to arrays
232232 if (!is_array($argv[$optionk])) {
233233 $argv[$optionk] = array($argv[$optionk]);
234234 }
@@ -235,7 +235,7 @@
236236 if (!isset($optionv['check'])) $optionv['check']=array();
237237 if (!isset($optionv['list'])) $optionv['list']=false;
238238 //do actions on output array values
239 - foreach ((array) $optionv['action'] as $action) {
 239+ foreach ((array) $optionv['action'] as $action) {
240240 switch ($action) {
241241 case 'toarray':
242242
@@ -250,17 +250,17 @@
251251 break; // split on whitespace and comma combinations - converts flat csv into an array
252252 case 'infermode':
253253 //HELLO
254 - //here we do some advanced parsing looking for some assumptions about
 254+ //here we do some advanced parsing looking for some assumptions about
255255 //usually property relationships
256256 //this assumes that the properties are now an array
257257 //?property or property implies focus->property->object
258258 //property? implies object->property->focus
259259 //?propery? implies either (useful for transitivity)
260 -
 260+
261261 //=as assiging a label? do this first if so.
262262 //*as defining transitivity?
263263 //?property.?property as defining subrelationships?
264 -
 264+
265265 foreach ($argv[$optionk] as &$prop) {
266266 if (strpos($prop,"?")===false) {
267267 //this is the default unspecified condition equivalent to a non transitive
@@ -272,7 +272,7 @@
273273 case 'nscategory':
274274 case 'nsform':
275275 case 'nsimage':
276 - if ($action == 'nsproperty') $y= SMW_NS_PROPERTY;
 276+ if ($action == 'nsproperty') $y= SMW_NS_PROPERTY;
277277 if ($action == 'nscategory') $y= NS_CATEGORY;
278278 if ($action == 'nsform') $y= SF_NS_FORM;
279279 if ($action == 'nsimage') $y= NS_IMAGE;
@@ -281,7 +281,7 @@
282282 foreach ($argv[$optionk] as $orig) {
283283 $x = explode(":", $orig);
284284 if (count($x) == 1) {
285 - $t[] = $y.":".$x[0];
 285+ $t[] = $y.":".$x[0];
286286 } else {
287287 if ($x[0] == $y) {
288288 $t[] = $orig;
@@ -294,12 +294,12 @@
295295 }
296296 $argv[$optionk] = $t;
297297 break;
298 -
 298+
299299 }
300300 }
301301 }
302302
303 -
 303+
304304 //do specific checks
305305 foreach ((array) $optionv['check'] as $check) {
306306 switch ($check) {
@@ -314,7 +314,7 @@
315315 // this can be null if it is not mandatory and not set
316316 // but if it is not null and no valid page is found then there is an error.
317317 // twisted logic.
318 -
 318+
319319 $valid = array();
320320 foreach((array) $argv[$optionk] as $contender) {
321321 $temp = Title::newFromText($contender);
@@ -343,7 +343,7 @@
344344 }
345345 }
346346
347 -
 347+
348348 // chack types and reconvert single elements to variables from arrays
349349 if (isset($argv[$optionk])) {
350350 $output = null;
@@ -378,13 +378,13 @@
379379 }
380380 //ok variable initialised and checked for validity
381381 //page type variables are held as array of PrefixedDBkeys or a single PrefixedDBkey.
382 -
 382+
383383 $name = '';
384384 if (is_array($argv['resource'])) {
385385 foreach ((array) $argv['resource'] as $r) {
386386 $name .= $r;
387387 }
388 - } else if(isset($argv['resource'])) {
 388+ } elseif(isset($argv['resource'])) {
389389 $name .= $argv['resource'];
390390 } else {
391391 $name .= "noresource";
@@ -401,7 +401,7 @@
402402 $argv['name'] = md5($name);
403403
404404
405 -
 405+
406406 //specific form edit link setup
407407 if ($argv['editform'] != false) {
408408 $argv['editform'] = $wgScriptPath."/index.php/Special:AddData?form=".$argv['editform']."&target=@CHILD_PAGE@";
@@ -428,7 +428,7 @@
429429 if ($type == 'mm2') {
430430 $argv['renderer']='mm';
431431 }
432 -
 432+
433433 return $argv;
434434 }
435435 }
Index: trunk/extensions/RDFIO/stores/SMW_ARC2Store.php
@@ -74,7 +74,7 @@
7575
7676 if ( $object instanceof SMWExpLiteral ) {
7777 $obj_str = "\"" . $object->getName() . "\"" . ( ( $object->getDatatype() == "" ) ? "" : "^^<" . $object->getDatatype() . ">" );
78 - } else if ( $object instanceof SMWExpResource ) {
 78+ } elseif ( $object instanceof SMWExpResource ) {
7979 $obj_str = "<" . SMWExporter::expandURI( $object->getName() ) . ">";
8080 } else {
8181 $obj_str = "\"\"";
Index: trunk/extensions/RDFIO/specials/SpecialSPARQLEndpoint_body.php
@@ -60,7 +60,7 @@
6161 $this->importTriplesInQuery();
6262 }
6363 $this->printHTMLForm();
64 - } else if ( $this->m_querytype == 'delete' ) {
 64+ } elseif ( $this->m_querytype == 'delete' ) {
6565 if ( $this->checkAllowDelete() ) {
6666 $this->deleteTriplesInQuery();
6767 }
@@ -74,7 +74,7 @@
7575 $this->printQueryStructure();
7676 $executesparql = false;
7777 }
78 - } else if ( $this->m_outputtype == 'rdfxml' && $this->m_querytype != 'construct' ) {
 78+ } elseif ( $this->m_outputtype == 'rdfxml' && $this->m_querytype != 'construct' ) {
7979 $errormessage = "RDF/XML can only be used with CONSTRUCT, if constructing triples";
8080 $wgOut->addHTML( RDFIOUtils::formatErrorHTML( "Invalid choice", $errormessage ) );
8181 $this->printHTMLForm();
@@ -105,7 +105,7 @@
106106 }
107107 $output = $this->extractPrepareARCHTMLOutput( $output );
108108 $wgOut->addHTML( $output );
109 - } else if ( $outputtype == 'rdfxml' ) {
 109+ } elseif ( $outputtype == 'rdfxml' ) {
110110 $output_structure = unserialize( $output );
111111 $tripleindex = $output_structure['result'];
112112 $triples = ARC2::getTriplesFromIndex( $tripleindex );
@@ -202,7 +202,7 @@
203203 function convertURIsInQuery() {
204204 if ( $this->m_querybyoriguri ) {
205205 $this->convertOrigURIsToInternalURIsInQuery();
206 - } else if ( $this->m_querybyequivuri ) {
 206+ } elseif ( $this->m_querybyequivuri ) {
207207 $query_structure = $this->m_query_parsed;
208208 $triple = $query_structure['query']['pattern']['patterns'][0]['patterns'][0];
209209 $s = $triple['s'];
Index: trunk/extensions/RDFIO/specials/SpecialRDFImport_body.php
@@ -33,7 +33,7 @@
3434 if ( $this->m_action == 'Import' ) {
3535 if ( !$wgUser->matchEditToken( $this->m_edittoken ) ) {
3636 die( 'Cross-site request forgery detected!' );
37 - } else if ( !$this->m_haswriteaccess ) {
 37+ } elseif ( !$this->m_haswriteaccess ) {
3838 $errortitle = "Permission error";
3939 $errormessage = "The current user lacks access either to edit or create pages (or both) in this wiki.";
4040 $wgOut->addHTML( RDFIOUtils::formatErrorHTML( $errortitle, $errormessage ) );
@@ -60,7 +60,7 @@
6161 $this->executeSMWBatchWriter();
6262 }
6363 }
64 - } else if ( $this->m_action == 'AddNsPrefixes' ) {
 64+ } elseif ( $this->m_action == 'AddNsPrefixes' ) {
6565 $this->addNewNsPrefixes();
6666 $this->executeSMWBatchWriter();
6767 } else {
Index: trunk/extensions/RDFIO/bundle/ARC2_SPARQLSerializerPlugin.php
@@ -107,7 +107,7 @@
108108 case 'literal2':
109109 $string .= $this->term_to_string( $t['type'], $t['value'] );
110110 if ( isset( $t['datatype'] ) ) $string .= '^^' . $t['datatype'];
111 - else if ( isset( $t['lang'] ) ) $string .= '@' . $t['lang'];
 111+ elseif ( isset( $t['lang'] ) ) $string .= '@' . $t['lang'];
112112 break;
113113 case 'expression':
114114 $expressions = array();
@@ -132,7 +132,7 @@
133133 }
134134
135135 }
136 - else if ( is_array( $t ) ) {
 136+ elseif ( is_array( $t ) ) {
137137 foreach ( $t as $item ) {
138138 $string .= $this->sparql_info_to_string( $item );
139139 }
Index: trunk/extensions/RDFIO/classes/SMWBatchWriter.php
@@ -44,7 +44,7 @@
4545 $this->m_unparseddata = $this->cleanupXML( $this->m_unparseddata );
4646 $this->m_parser = ARC2::getRDFXMLParser();
4747 $this->parse();
48 - } else if ( $this->m_dataformat == 'turtle' ) {
 48+ } elseif ( $this->m_dataformat == 'turtle' ) {
4949 $this->m_unparseddata = $wgRequest->getText( 'importdata' );
5050 $this->m_parser = ARC2::getTurtleParser();
5151 $this->parse();
@@ -427,7 +427,7 @@
428428 function convertARCTypeToSMWType( $arctype, $arcdatatype ) {
429429 if ( $arctype == 'uri' ) {
430430 return 'Page';
431 - } else if ( $arctype == 'literal' ) {
 431+ } elseif ( $arctype == 'literal' ) {
432432 if ( $arcdatatype == 'http://www.w3.org/2001/XMLSchema#decimal' ) {
433433 return 'Number';
434434 } else {
@@ -547,7 +547,7 @@
548548 $titlebypropertyuriindex = $this->getWikiTitleByPropertyURIIndex( $uri );
549549 if ( $titlebypropertyuriindex != '' ) {
550550 $wikititle = $titlebypropertyuriindex;
551 - } else if ( ( $this->m_usenspintitles_entities && !$isproperty ) ||
 551+ } elseif ( ( $this->m_usenspintitles_entities && !$isproperty ) ||
552552 ( $this->m_usenspintitles_properties && $isproperty ) ) {
553553 $wikititle = $this->abbreviateNSFromURI( $uri );
554554 } else {
@@ -632,18 +632,18 @@
633633
634634 if ( $localpart == '' ) {
635635 $uri = $basepart;
636 - } else if ( substr( $basepart, 0, 1 ) == '_' ) {
 636+ } elseif ( substr( $basepart, 0, 1 ) == '_' ) {
637637 // Change ARC:s default "random string", to indicate more clearly that
638638 // it lacks title
639639 $uri = str_replace( 'arc', 'untitled', $localpart );
640 - } else if ( substr( $basepart, 0, 7 ) == 'http://' ) {
 640+ } elseif ( substr( $basepart, 0, 7 ) == 'http://' ) {
641641 // If the abbreviation does not seem to have succeeded,
642642 // fall back to use only the local part
643643 $uri = $localpart;
644 - } else if ( substr( $basepart, -1 ) == ':' ) {
 644+ } elseif ( substr( $basepart, -1 ) == ':' ) {
645645 // Don't add another colon
646646 $uri = $basepart . $localpart;
647 - } else if ( $basepart == false || $basepart == '' ) {
 647+ } elseif ( $basepart == false || $basepart == '' ) {
648648 $uri = $localpart;
649649 } else {
650650 $uri = $basepart . ':' . $localpart;
@@ -664,7 +664,7 @@
665665
666666 if ( $localpart == '' ) {
667667 $uri = $basepart;
668 - } else if ( substr( $basepart, 0, 1 ) == '_' ) {
 668+ } elseif ( substr( $basepart, 0, 1 ) == '_' ) {
669669 // Change ARC:s default "random string", to indicate more clearly that
670670 // it lacks title
671671 $uri = str_replace( 'arc', 'untitled', $localpart );
@@ -674,7 +674,7 @@
675675 // If the abbreviation does not seem to have succeeded,
676676 // fall back to use only the local part
677677 $uri = $localpart;
678 - } else if ( substr( $basepart, -1 ) == ':' ) {
 678+ } elseif ( substr( $basepart, -1 ) == ':' ) {
679679 // Don't add another colon
680680 $uri = $basepart . $localpart;
681681 } else {
Index: trunk/extensions/SemanticResultFormats/GraphViz/SRF_Process.php
@@ -113,7 +113,7 @@
114114 if ( array_key_exists( 'highlightcolor', $params ) ) {
115115 $this->m_process->setHighlightColor( trim( $params['highlightcolor'] ) );
116116 }
117 -
 117+
118118 if (array_key_exists('showdiscussion', $params)) {
119119 if (self::isTrue($params['showdiscussion'])) $this->m_process->setShowDiscussion(true);
120120 }
@@ -165,8 +165,8 @@
166166 if ( !is_callable( 'renderGraphviz' ) ) {
167167 wfWarn( 'The SRF Graph printer needs the GraphViz extension to be installed.' );
168168 return '';
169 - }
170 -
 169+ }
 170+
171171 global $wgContLang; // content language object
172172
173173 //
@@ -210,13 +210,13 @@
211211 }
212212
213213 break;
214 -
 214+
215215 case "haslabel":
216216 $value = current($field->getContent()); // save only the first
217217 if (($value !== false)) {
218218 $val = $value->getLongWikiText();
219219 if ($this->m_process->getUseOtherLabels()) {
220 - $val = str_replace("&","and",$val);
 220+ $val = str_replace("&","and",$val);
221221 $node->setLabel($val);
222222 }
223223 }
@@ -405,7 +405,7 @@
406406 protected $m_showRedLinks = false; // check and highlight red links?
407407 protected $m_redLinkColor = 'red'; // red link font color
408408 protected $m_showCompound = true; // highlight compound nodes (=subprocesses)
409 -
 409+
410410 public $m_useHtmlNodes = true; // Set to false if you do not want to use HTML table nodes
411411
412412 // instance variables
@@ -543,7 +543,7 @@
544544 public function getShowCompound() {
545545 return $this->m_showCompound;
546546 }
547 -
 547+
548548 public function setShowDiscussion($show){
549549 $this->m_showDiscussion = $show;
550550 }
@@ -677,7 +677,7 @@
678678 private $m_id = 'no_id';
679679 private $m_label = 'unlabeled';
680680 private $m_uid;
681 -
 681+
682682 public function getUUID(){
683683 if (!isset($this->m_uid)){
684684 $this->m_uid = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
@@ -686,7 +686,7 @@
687687 mt_rand(0, 0x3fff) | 0x8000,
688688 mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));
689689 }
690 -
 690+
691691 return $this->m_uid;
692692 }
693693 public function getId() {
@@ -877,13 +877,13 @@
878878 if ( $this->getStatus() != '' ) {
879879 if ( $this->getStatus() < 25 ) {
880880 $status = ' HREF="[[' . $this->getId() . ']]" TOOLTIP="status '.$this->getStatus().'%"><IMG SRC="' . $PicturePath .'p000.png" /';
881 - } else if ( $this->getStatus() < 50 ) {
 881+ } elseif ( $this->getStatus() < 50 ) {
882882 $status = ' HREF="[[' . $this->getId() . ']]" TOOLTIP="status '.$this->getStatus().'%"><IMG SRC="' . $PicturePath .'p025.png" /';
883 - } else if ( $this->getStatus() < 75 ) {
 883+ } elseif ( $this->getStatus() < 75 ) {
884884 $status = ' HREF="[[' . $this->getId() . ']]" TOOLTIP="status '.$this->getStatus().'%"><IMG SRC="' . $PicturePath .'p050.png" /';
885 - } else if ( $this->getStatus() < 100 ) {
 885+ } elseif ( $this->getStatus() < 100 ) {
886886 $status = ' HREF="[[' . $this->getId() . ']]" TOOLTIP="status '.$this->getStatus().'%"><IMG SRC="' . $PicturePath .'p075.png" /';
887 - } else if ( $this->getStatus() == 100 ) {
 887+ } elseif ( $this->getStatus() == 100 ) {
888888 $status = ' HREF="[[' . $this->getId() . ']]" TOOLTIP="status '.$this->getStatus().'%"><IMG SRC="' . $PicturePath .'p100.png" /';
889889 }
890890 }
@@ -909,10 +909,10 @@
910910 } else {
911911 $discussion = ' HREF="[[Talk:' . $this->getId() . ']]" TOOLTIP="Talk:' . $this->getId() . '"><IMG SRC="' . $PicturePath .'discuss_icon_grey.png" /';
912912 }
913 -
914913
 914+
915915 }
916 -
 916+
917917 // use highlight color if set (either CURRENTPAGE or REDLINK highlighting - see ProcessGraph::makeNode()
918918 $high = '';
919919 if ( $this->m_fontColor != '' ) {
@@ -931,18 +931,18 @@
932932 }
933933 if (!$this->isAtomic()) $compound = '<TR><TD ALIGN="LEFT" BORDER="0" WIDTH="20px" HREF="[['. $this->getId() . ']]" TOOLTIP="sub process"><IMG SRC="' . $PicturePath .'subprocess.png"/>';
934934 }
935 -
936 -
937935
 936+
 937+
938938 //
939939 // render node itself
940940 //
941941 if ($this->m_process->m_useHtmlNodes){
942 - $res =
 942+ $res =
943943 '"' . $this->getId() . '" [shape=plaintext,label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">' . $compound . '</TD><TD BORDER="0" WIDTH="80%"></TD><TD ALIGN="RIGHT" BORDER="0" WIDTH="20px"' . $status . '></TD><TD ALIGN="RIGHT" BORDER="0" WIDTH="20px"' . $discussion . '></TD></TR><TR><TD COLSPAN="4" PORT="port1" HREF="[[' . $this->getId() . ']]" TOOLTIP="' . $this->getLabel() .'"><FONT' . $high .'>' . $this->getLabel() . '</FONT></TD> </TR></TABLE>>];
944944 ';
945945 } else {
946 - $res =
 946+ $res =
947947 '"' . $this->getId() . '"[label="' . $this->getLabel() . '",shape=rect, height=1.5, URL="[[' . $this->getId() . ']]"];
948948 ';
949949 }
@@ -1007,18 +1007,18 @@
10081008 * Abstract base class for edges in a process graph
10091009 */
10101010 abstract class ProcessEdge{
1011 -
 1011+
10121012 private $m_id;
10131013 private $m_uid;
1014 -
 1014+
10151015 public function getId(){
10161016 if (!isset($this->m_id)){
10171017 $this->m_id = 'edge' . rand(1, 99999);
10181018 }
1019 -
 1019+
10201020 return $this->m_id;
10211021 }
1022 -
 1022+
10231023 public function getUUID(){
10241024 if (!isset($this->m_uid)){
10251025 $this->m_uid = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
@@ -1027,21 +1027,21 @@
10281028 mt_rand(0, 0x3fff) | 0x8000,
10291029 mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));
10301030 }
1031 -
 1031+
10321032 return $this->m_uid;
10331033 }
1034 -
 1034+
10351035 abstract public function getSucc();
10361036 abstract public function getPred();
1037 -
 1037+
10381038 abstract public function getGraphVizCode();
10391039 }
10401040
10411041 abstract class SplitEdge extends ProcessEdge{
1042 -
 1042+
10431043 protected $m_from;
10441044 protected $m_to = array();
1045 -
 1045+
10461046 public function setFrom($node){
10471047 $this->m_from = $node;
10481048 $node->setEdgeOut($this);
@@ -1051,32 +1051,32 @@
10521052 $this->m_to[] = $node;
10531053 $node->addEdgeIn($this);
10541054 }
1055 -
 1055+
10561056 public function getPred(){
10571057 return array($this->m_from);
10581058 }
1059 -
 1059+
10601060 public function getSucc(){
10611061 return $this->m_to;
10621062 }
1063 -
 1063+
10641064 }
10651065
10661066 class SplitConditionalOrEdge extends ProcessEdge{
1067 -
 1067+
10681068 protected $m_from;
10691069 protected $m_to_true;
10701070 protected $m_to_false;
10711071 protected $m_con_text = 'empty_condition';
1072 -
 1072+
10731073 public function getSucc(){
10741074 return array($this->m_to_false, $this->m_to_true);
10751075 }
1076 -
 1076+
10771077 public function getPred(){
1078 - return array($this->m_from);
 1078+ return array($this->m_from);
10791079 }
1080 -
 1080+
10811081 public function setFrom($node){
10821082 $this->m_from = $node;
10831083 $node->setEdgeOut($this);
@@ -1097,77 +1097,77 @@
10981098 }
10991099
11001100 public function getGraphVizCode(){
1101 -
 1101+
11021102 $p = $this->m_from;
11031103
11041104 if ((!isset($this->m_from)) || (!isset($this->m_to_false)) || (!isset($this->m_to_true))){
1105 -
 1105+
11061106 echo "error with SplitConditionalOrEdge"; // TODO
1107 - exit;
 1107+ exit;
11081108 }
1109 -
1110 -
1111 - $res =
1112 - 'subgraph "clus_' . $this->getId() . '" {
 1109+
 1110+
 1111+ $res =
 1112+ 'subgraph "clus_' . $this->getId() . '" {
11131113 ';
1114 -
 1114+
11151115 // cond-Shape
11161116 $con = 'con' . rand(1, 99999);
1117 - $res .=
1118 - '"'. $con . '"[shape=diamond,label="' . $this->m_con_text . '",style=filled,color=skyblue];
1119 - "' . $p->getId() . '":port1:s -> "'. $con . '";
 1117+ $res .=
 1118+ '"'. $con . '"[shape=diamond,label="' . $this->m_con_text . '",style=filled,color=skyblue];
 1119+ "' . $p->getId() . '":port1:s -> "'. $con . '";
11201120 ';
11211121
1122 - // True Succ
 1122+ // True Succ
11231123 $res .=
11241124 '"' . $this->m_to_true->getId() . '" [URL = "[['. $this->m_to_true->getId() . ']]"];
11251125 ';
1126 -
 1126+
11271127 $res .=
11281128 '"'. $con .'" -> "' . $this->m_to_true->getId() .'":port1:n [label="true"];
11291129 ';
11301130
1131 - // False Succ
 1131+ // False Succ
11321132 $res .=
11331133 '"' . $this->m_to_false->getId() . '" [URL = "[['. $this->m_to_false->getId() . ']]"];
11341134 ';
1135 -
 1135+
11361136 $res .=
11371137 '"'. $con .'" -> "' . $this->m_to_false->getId() .'":port1:n [label="false"];';
11381138
1139 -
 1139+
11401140 $res .= '
11411141 }
11421142 ';
1143 -
 1143+
11441144 return $res;
11451145 }
1146 -
 1146+
11471147 }
11481148
11491149 class SplitExclusiveOrEdge extends SplitEdge{
1150 -
 1150+
11511151 public function getGraphVizCode(){
11521152 global $srfgShapeStyle;
11531153 $p = $this->getPred();
11541154 $p = $p[0];
11551155 if ($srfgShapeStyle=='') $srfgShapeStyle="box";
1156 - $res =
1157 - 'subgraph "clus_' . $this->getId() . '" {
 1156+ $res =
 1157+ 'subgraph "clus_' . $this->getId() . '" {
11581158 ';
1159 -
 1159+
11601160 // add OR-Shape
11611161 $orx = 'or' . rand(1, 99999);
1162 - $res .=
1163 - '"'. $orx . '"[shape=' . $srfgShapeStyle . ',label="+",style=filled,color=gold];
1164 - "' . $p->getId() . '":port1:s -> "'. $orx . '";
 1162+ $res .=
 1163+ '"'. $orx . '"[shape=' . $srfgShapeStyle . ',label="+",style=filled,color=gold];
 1164+ "' . $p->getId() . '":port1:s -> "'. $orx . '";
11651165 ';
1166 -
 1166+
11671167 foreach ($this->getSucc() as $s){
11681168 $res .=
11691169 '"' . $s->getId() . '" [URL="[['. $s->getId() . ']]"];
11701170 ';
1171 -
 1171+
11721172 $res .=
11731173 '"'. $orx .'" -> "' . $s->getId() .'":port1:n;
11741174 ';
@@ -1179,43 +1179,43 @@
11801180
11811181 return $res;
11821182 }
1183 -
 1183+
11841184 }
11851185
11861186 class SplitParallelEdge extends SplitEdge{
1187 -
11881187
 1188+
11891189 public function getGraphVizCode(){
11901190 global $srfgShapeStyle;
11911191 if ($srfgShapeStyle=='') $srfgShapeStyle="box";
11921192 $p = $this->getPred();
11931193 $p = $p[0];
11941194
1195 - $res =
1196 - 'subgraph "clus_' . $this->getId() . '" {
 1195+ $res =
 1196+ 'subgraph "clus_' . $this->getId() . '" {
11971197 ';
1198 -
 1198+
11991199 // add AND-Shape
12001200 $and = 'and' . rand(1, 99999);
1201 - $res .=
1202 - '"'. $and . '"[shape=' . $srfgShapeStyle . ',label="||",style=filled,color=palegreen];
1203 - "' . $p->getId() . '":port1:s -> "'. $and . '";
 1201+ $res .=
 1202+ '"'. $and . '"[shape=' . $srfgShapeStyle . ',label="||",style=filled,color=palegreen];
 1203+ "' . $p->getId() . '":port1:s -> "'. $and . '";
12041204 ';
1205 -
 1205+
12061206 foreach ($this->getSucc() as $s){
12071207 $res .=
12081208 '"' . $s->getId() . '" [URL = "[['. $s->getId() . ']]"];
12091209 ';
1210 -
 1210+
12111211 $res .=
12121212 '"'. $and .'" -> "' . $s->getId() .'":port1:n;
12131213 ';
12141214 }
1215 -
 1215+
12161216 $res .= '
12171217 }
12181218 ';
1219 -
 1219+
12201220 return $res;
12211221 }
12221222
@@ -1225,45 +1225,45 @@
12261226
12271227 private $m_from;
12281228 private $m_to;
1229 -
 1229+
12301230 public function setFrom($node){
12311231 $this->m_from = $node;
12321232 $node->setEdgeOut($this);
12331233 }
1234 -
 1234+
12351235 public function setTo($node){
12361236 $this->m_to = $node;
12371237 $node->addEdgeIn($this);
12381238 }
1239 -
 1239+
12401240 public function getPred(){
12411241 return array($this->m_from);
12421242 }
1243 -
 1243+
12441244 public function getSucc(){
12451245 return array($this->m_to);
12461246 }
1247 -
 1247+
12481248 public function getGraphVizCode(){
1249 -
 1249+
12501250 $p = $this->m_from;
12511251 $s = $this->m_to;
1252 -
1253 - $res =
1254 - 'subgraph "clus_' . $this->getId() . '" {
 1252+
 1253+ $res =
 1254+ 'subgraph "clus_' . $this->getId() . '" {
12551255 ';
1256 -
 1256+
12571257 $res .=
12581258 '"' . $s->getId() . '" [URL = "[['. $s->getId() . ']]"];
12591259 ';
1260 -
 1260+
12611261 $res .=
12621262 '"'. $p->getId() .'":port1:s -> "' . $s->getId() .'":port1:n;';
1263 -
 1263+
12641264 $res .= '
12651265 }
12661266 ';
1267 -
 1267+
12681268 return $res;
12691269 }
12701270
Index: trunk/extensions/SemanticResultFormats/Exhibit/SRF_Exhibit.php
@@ -35,7 +35,7 @@
3636 if ( $row != null ) {
3737 $tmp = clone $row[0];
3838 $object = efSRFGetNextDV( $tmp );
39 -
 39+
4040 if ( $object instanceof SMWWikiPageValue ) {
4141 $value = $object->getPrefixedText();
4242 if ( strpos( $value, ':' ) ) {
@@ -202,7 +202,7 @@
203203 if ( sizeof( $dates ) == 1 ) {
204204 $tlparams[] = 'ex:start=\'.' . $this->encodePropertyName( $dates[0]->getLabel() ) . '\' ';
205205 }
206 - else if ( sizeof( $dates ) == 2 ) {
 206+ elseif ( sizeof( $dates ) == 2 ) {
207207 $tlparams[] = 'ex:start=\'.' . $this->encodePropertyName( $dates[0]->getLabel() ) . '\' ';
208208 $tlparams[] = 'ex:end=\'.' . $this->encodePropertyName( $dates[1]->getLabel() ) . '\' ';
209209 }
Index: trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php
@@ -2,10 +2,10 @@
33
44 /**
55 * Result printer that prints query results as a gallery.
6 - *
 6+ *
77 * @file SRF_Gallery.php
88 * @ingroup SemanticResultFormats
9 - *
 9+ *
1010 * @author Rowan Rodrik van der Molen
1111 * @author Jeroen De Dauw
1212 */
@@ -34,25 +34,25 @@
3535 if ( isset( $this->m_params['perrow'] ) ) {
3636 $ig->setPerRow( $this->m_params['perrow'] );
3737 }
38 -
 38+
3939 if ( isset( $this->m_params['widths'] ) ) {
4040 $ig->setWidths( $this->m_params['widths'] );
4141 }
42 -
 42+
4343 if ( isset( $this->m_params['heights'] ) ) {
4444 $ig->setHeights( $this->m_params['heights'] );
4545 }
46 -
47 - $this->m_params['autocaptions'] = isset( $this->m_params['autocaptions'] ) ? $this->m_params['autocaptions'] != 'off' : true;
4846
 47+ $this->m_params['autocaptions'] = isset( $this->m_params['autocaptions'] ) ? $this->m_params['autocaptions'] != 'off' : true;
 48+
4949 $printReqLabels = array();
50 -
 50+
5151 foreach ( $results->getPrintRequests() as $printReq ) {
5252 $printReqLabels[] = $printReq->getLabel();
53 - }
 53+ }
5454
5555 if ( isset( $this->m_params['imageproperty'] ) && in_array( $this->m_params['imageproperty'], $printReqLabels ) ) {
56 - $captionProperty = isset( $this->m_params['captionproperty'] ) ? $this->m_params['captionproperty'] : '';
 56+ $captionProperty = isset( $this->m_params['captionproperty'] ) ? $this->m_params['captionproperty'] : '';
5757 $this->addImageProperties( $results, $ig, $this->m_params['imageproperty'], $captionProperty );
5858 }
5959 else {
@@ -61,12 +61,12 @@
6262
6363 return array( $ig->toHTML(), 'nowiki' => true, 'isHTML' => true );
6464 }
65 -
 65+
6666 /**
67 - * Handles queries where the images (and optionally their captions) are specified as properties.
68 - *
 67+ * Handles queries where the images (and optionally their captions) are specified as properties.
 68+ *
6969 * @since 1.5.3
70 - *
 70+ *
7171 * @param SMWQueryResult $results
7272 * @param ImageGallery $ig
7373 * @param string $imageProperty
@@ -76,39 +76,39 @@
7777 while ( /* array of SMWResultArray */ $row = $results->getNext() ) { // Objects (pages)
7878 $images = array();
7979 $captions = array();
80 -
 80+
8181 for ( $i = 0, $n = count( $row ); $i < $n; $i++ ) { // Properties
8282 if ( $row[$i]->getPrintRequest()->getLabel() == $imageProperty ) {
8383 while ( ( $obj = efSRFGetNextDV( $row[$i] ) ) !== false ) { // Property values
8484 if ( $obj->getTypeID() == '_wpg' ) {
85 - $images[] = $obj->getTitle();
86 - }
87 - }
 85+ $images[] = $obj->getTitle();
 86+ }
 87+ }
8888 }
89 - else if ( $row[$i]->getPrintRequest()->getLabel() == $captionProperty ) {
 89+ elseif ( $row[$i]->getPrintRequest()->getLabel() == $captionProperty ) {
9090 while ( ( $obj = efSRFGetNextDV( $row[$i] ) ) !== false ) { // Property values
9191 $captions[] = $obj->getShortText( SMW_OUTPUT_HTML, $this->getLinker( true ) );
92 - }
 92+ }
9393 }
9494 }
95 -
 95+
9696 $amountMatches = count( $captions ) == count( $images );
9797 $hasCaption = $amountMatches || count( $captions ) > 0;
98 -
 98+
9999 foreach ( $images as $imgTitle ) {
100100 if ( $imgTitle->exists() ) {
101101 $imgCaption= $hasCaption ? ( $amountMatches ? array_shift( $captions ) : $captions[0] ) : '';
102 - $this->addImageToGallery( $ig, $imgTitle, $imgCaption );
 102+ $this->addImageToGallery( $ig, $imgTitle, $imgCaption );
103103 }
104 - }
 104+ }
105105 }
106106 }
107 -
 107+
108108 /**
109109 * Handles queries where the result objects are image pages.
110 - *
 110+ *
111111 * @since 1.5.3
112 - *
 112+ *
113113 * @param SMWQueryResult $results
114114 * @param ImageGallery $ig
115115 */
@@ -116,11 +116,11 @@
117117 while ( $row = $results->getNext() ) {
118118 $firstField = $row[0];
119119 $nextObject = efSRFGetNextDV( $firstField );
120 -
 120+
121121 if ( $nextObject !== false ) {
122122 $imgTitle = $nextObject->getTitle();
123123 $imgCaption = '';
124 -
 124+
125125 // Is there a property queried for display with ?property
126126 if ( isset( $row[1] ) ) {
127127 $imgCaption = efSRFGetNextDV( $row[1] );
@@ -128,25 +128,25 @@
129129 $imgCaption = $imgCaption->getShortText( SMW_OUTPUT_HTML, $this->getLinker( true ) );
130130 }
131131 }
132 -
133 - $this->addImageToGallery( $ig, $imgTitle, $imgCaption );
 132+
 133+ $this->addImageToGallery( $ig, $imgTitle, $imgCaption );
134134 }
135 - }
 135+ }
136136 }
137 -
 137+
138138 /**
139139 * Adds a single image to the gallery.
140140 * Takes care of automatically adding a caption when none is provided and parsing it's wikitext.
141 - *
 141+ *
142142 * @since 1.5.3
143 - *
 143+ *
144144 * @param ImageGallery $ig The gallery to add the image to
145145 * @param Title $imgTitle The title object of the page of the image
146146 * @param string $imgCaption An optional caption for the image
147147 */
148148 protected function addImageToGallery( ImageGallery &$ig, Title $imgTitle, $imgCaption ) {
149149 global $wgParser;
150 -
 150+
151151 if ( empty( $imgCaption ) ) {
152152 $imgCaption = $this->m_params['autocaptions'] ? preg_replace( '#\.[^.]+$#', '', $imgTitle->getBaseText() ) : '';
153153 }
@@ -161,30 +161,30 @@
162162 $wgParser->mOutput->addImage( $imgTitle->getDBkey() );
163163 }
164164 }
165 -
 165+
166166 /**
167167 * @see SMWResultPrinter::getParameters
168 - *
 168+ *
169169 * @since 1.5.3
170 - *
 170+ *
171171 * @return array
172 - */
 172+ */
173173 public function getParameters() {
174174 $params = parent::getParameters();
175 -
 175+
176176 if ( defined( 'SMW_SUPPORTS_VALIDATOR' ) ) {
177177 $params['perrow'] = new Parameter( 'perrow', Parameter::TYPE_INTEGER );
178178 $params['perrow']->setDescription( wfMsg( 'srf_paramdesc_perrow' ) );
179179 $params['perrow']->setDefault( '', false );
180 -
 180+
181181 $params['widths'] = new Parameter( 'widths', Parameter::TYPE_INTEGER );
182182 $params['widths']->setDescription( wfMsg( 'srf_paramdesc_widths' ) );
183183 $params['widths']->setDefault( '', false );
184 -
 184+
185185 $params['heights'] = new Parameter( 'heights', Parameter::TYPE_INTEGER );
186186 $params['heights']->setDescription( wfMsg( 'srf_paramdesc_heights' ) );
187187 $params['heights']->setDefault( '', false );
188 -
 188+
189189 $params['autocaptions'] = new Parameter( 'autocaptions', Parameter::TYPE_BOOLEAN );
190190 $params['autocaptions']->setDescription( wfMsg( 'srf_paramdesc_autocaptions' ) );
191191 $params['autocaptions']->setDefault( true );
@@ -194,11 +194,11 @@
195195 $params[] = array( 'name' => 'perrow', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_perrow' ) );
196196 $params[] = array( 'name' => 'widths', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_widths' ) );
197197 $params[] = array( 'name' => 'heights', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_heights' ) );
198 -
199 - $params[] = array( 'name' => 'autocaptions', 'type' => 'enumeration', 'description' => wfMsg( 'srf_paramdesc_autocaptions' ), 'values' => array( 'on', 'off' ) );
 198+
 199+ $params[] = array( 'name' => 'autocaptions', 'type' => 'enumeration', 'description' => wfMsg( 'srf_paramdesc_autocaptions' ), 'values' => array( 'on', 'off' ) );
200200 }
201 -
 201+
202202 return $params;
203 - }
204 -
 203+ }
 204+
205205 }
Index: trunk/extensions/RT/RT_body.php
@@ -9,10 +9,10 @@
1010 $parser->setHook( 'rt', array( 'RT::render' ) );
1111 return true;
1212 }
13 -
 13+
1414 // This is called to process <rt>...</rt> within a page
1515 public static function render( $input, $args = array(), $parser = null ) {
16 -
 16+
1717 global $wgRequestTracker_Cachepage,
1818 $wgRequestTracker_Active,
1919 $wgRequestTracker_DBconn,
@@ -24,21 +24,21 @@
2525 $wgRequestTracker_TIMEFORMAT_RESOLVED,
2626 $wgRequestTracker_TIMEFORMAT_RESOLVED2,
2727 $wgRequestTracker_TIMEFORMAT_NOW;
28 -
29 -
30 -
 28+
 29+
 30+
3131 // Grab the number if one was given between the <tr> tags
3232 $ticketnum = 0;
3333 $matches = array();
3434 if ( preg_match( '/^\s*(\d+)\s*$/', $input, $matches ) ) {
3535 $ticketnum = $matches[0];
3636 }
37 -
 37+
3838 // Disable all caching unless told not to
3939 if ( !$wgRequestTracker_Cachepage ) {
4040 $parser->disableCache();
4141 }
42 -
 42+
4343 // Try and connect to the database if we are active
4444 if ( $wgRequestTracker_Active ) {
4545 global $wgUser;
@@ -61,7 +61,7 @@
6262 }
6363 }
6464 }
65 -
 65+
6666 // If we are not 'active', we leave right away, with minimal output
6767 if ( !$wgRequestTracker_Active ) {
6868 if ( $ticketnum ) {
@@ -70,7 +70,7 @@
7171 $msg = wfMsg( 'rt-inactive' );
7272 return "<table class='rt-table-inactive' border='1'><tr><td>$msg</td></tr></table>";
7373 }
74 -
 74+
7575 // Standard info we gather
7676 $TZ = "AT TIME ZONE 'GMT'";
7777 $ticketinfo = 't.id, t.subject, t.priority, INITCAP(t.status) AS status, q.name AS queue,'
@@ -92,17 +92,17 @@
9393 . " CASE WHEN (now() $TZ - t.created) <= '2 hour'::interval THEN EXTRACT(minutes FROM now() $TZ - t.created) || ' minutes' ELSE"
9494 . " CASE WHEN (now() $TZ - t.created) <= '2 day'::interval THEN EXTRACT(hours FROM now() $TZ - t.created) || ' hours' ELSE"
9595 . " EXTRACT(days FROM now() $TZ - t.created) || ' days' END END END END AS age";
96 -
 96+
9797 $ticketquery = "SELECT $ticketinfo\nFROM tickets t, queues q, users u, users u2";
9898 $whereclause = "WHERE t.queue = q.id\nAND t.owner = u.id\nAND t.creator = u2.id";
99 -
 99+
100100 // If just a single number, treat it as <rt>#</rt>
101101 if ( 1 === count( $args ) ) {
102102 if ( preg_match( '/^\d+$/', key( $args ) ) ) {
103103 $ticketnum = key( $args );
104104 }
105105 }
106 -
 106+
107107 // Look up a single ticket number
108108 if ( $ticketnum ) {
109109 $SQL = "$ticketquery $whereclause\nAND t.id = $ticketnum";
@@ -116,7 +116,7 @@
117117 }
118118 return self::fancyLink( $info, $args, $parser, 0 );
119119 }
120 -
 120+
121121 // Add in a LIMIT clause if l=xx or limit=xx was used
122122 $limit = '';
123123 if ( array_key_exists( 'limit', $args ) ) {
@@ -129,7 +129,7 @@
130130 }
131131 $limit = " LIMIT $limit";
132132 }
133 -
 133+
134134 // Change the default ORDER BY clause if ob=xx was used
135135 $orderby = 'ORDER BY t.lastupdated DESC, t.id';
136136 $valid_orderby = array
@@ -158,14 +158,14 @@
159159 if ( array_key_exists( $word, $valid_orderby ) ) {
160160 $word = $valid_orderby[$word];
161161 }
162 - else if ( !preg_match ( '/^\d+$/', $word ) ) {
 162+ elseif ( !preg_match ( '/^\d+$/', $word ) ) {
163163 die ( wfMsg ( 'rt-badorderby', $word ) );
164164 }
165165 $orderby .= " $word$mod,";
166166 }
167167 $orderby = rtrim( $orderby, ',' );
168168 }
169 -
 169+
170170 // Determine what status to use. Default is new and open:
171171 $searchstatus = "t.status IN ('new','open')";
172172 $valid_status = array( 'new', 'open', 'resolved', 'deleted', 'stalled', 'rejected' );
@@ -204,7 +204,7 @@
205205 $searchq = preg_replace( '/.$/', ')', $searchq );
206206 $whereclause .= "\nAND $searchq";
207207 }
208 -
 208+
209209 // See if we are limiting to one or more owners
210210 $searchowner = '';
211211 if ( array_key_exists( 'o', $args ) ) {
@@ -220,7 +220,7 @@
221221 $searchowner = preg_replace( '/.$/', ')', $searchowner );
222222 $whereclause .= "\nAND $searchowner";
223223 }
224 -
 224+
225225 // Allow use of custom fields
226226 $searchcustom = '';
227227 if ( array_key_exists('custom', $args ) ) {
@@ -265,7 +265,7 @@
266266 && !array_key_exists( 'queue', $args ) ) ) {
267267 $showqueue = 0;
268268 }
269 -
 269+
270270 // The owner: show by default unless searching a single owner
271271 $showowner = 1;
272272 if ( array_key_exists( 'noowner', $args )
@@ -274,7 +274,7 @@
275275 && !array_key_exists( 'owner', $args ) ) ) {
276276 $showowner = 0;
277277 }
278 -
 278+
279279 // The status: show by default unless searching a single status
280280 $showstatus = 1;
281281 if ( array_key_exists( 'nostatus', $args )
@@ -282,12 +282,12 @@
283283 && !array_key_exists( 'status', $args ) ) ) {
284284 $showstatus = 0;
285285 }
286 -
 286+
287287 // Things we always show unless told not to:
288288 $showsubject = ! array_key_exists( 'nosubject', $args );
289289 $showupdated = ! array_key_exists( 'noupdated', $args );
290290 $showticket = ! array_key_exists( 'noticket', $args );
291 -
 291+
292292 // Things we don't show unless asked to:
293293 $showpriority = array_key_exists( 'priority', $args );
294294 $showupdated2 = array_key_exists( 'updated2', $args );
@@ -297,10 +297,10 @@
298298 $showresolved2 = array_key_exists( 'resolved2', $args );
299299 $showage = array_key_exists( 'age', $args );
300300 $showcustom = array_key_exists( 'custom', $args );
301 -
 301+
302302 // Unless 'tablerows' has been set, output the table and header tags
303303 if ( !array_key_exists( 'tablerows', $args ) ) {
304 -
 304+
305305 $class = $wgRequestTracker_Sortable ? 'wikitable sortable' : 'rt-table';
306306
307307 // Allow override of the default sortable table option
@@ -333,12 +333,12 @@
334334 if ( $showresolved ) { $output .= "<th style='white-space: nowrap'>Resolved</th>\n"; }
335335 if ( $showresolved2 ) { $output .= "<th style='white-space: nowrap'>Resolved</th>\n"; }
336336 if ( $showage ) { $output .= "<th style='white-space: nowrap'>Age</th>\n"; }
337 -
 337+
338338 $output .= "</tr>\n";
339339 }
340 -
 340+
341341 foreach ( $info as $row ) {
342 -
 342+
343343 if ( $showticket ) {
344344 $id = self::fancyLink( $row, $args, $parser, 1 );
345345 $output .= "<td style='white-space: nowrap'>$id</td>";
@@ -367,21 +367,21 @@
368368 if ( $showage ) { $output .= '<td>' . $row['age'] . "</td>\n"; }
369369 $output .= "\n</tr>\n";
370370 }
371 -
 371+
372372 if ( !array_key_exists( 'tablerows', $args ) ) {
373373 $output .= "\n</table>\n";
374374 }
375 -
 375+
376376 return $output;
377377 }
378378
379379 private static function fancyLink( $row, $args, $parser, $istable ) {
380 -
 380+
381381 global $wgRequestTracker_URL, $wgRequestTracker_Formats, $wgRequestTracker_Useballoons;
382 -
 382+
383383 $ticketnum = $row['id'];
384384 $ret = "[$wgRequestTracker_URL=$ticketnum RT #$ticketnum]";
385 -
 385+
386386 # Check for any custom format args in the rt tag.
387387 # If any are found, use that and ignore any other args
388388 $foundformat = 0;
@@ -396,7 +396,7 @@
397397 break;
398398 }
399399 }
400 -
 400+
401401 # Process any column-based args to the rt tag
402402 if ( !$foundformat and !$istable ) {
403403 foreach ( array_keys( $args ) as $val ) {
@@ -412,18 +412,18 @@
413413 }
414414 }
415415 }
416 -
 416+
417417 $ret = $parser->recursiveTagParse( $ret );
418 -
 418+
419419 // Not using balloons? Just return the current text
420420 if ( !$wgRequestTracker_Useballoons || array_key_exists( 'noballoon', $args ) ) {
421421 return "<span class='rt-ticket-noballoon'>$ret</span>";
422422 }
423 -
 423+
424424 $safesub = preg_replace( '/\"/', '\"', $row['subject'] );
425425 $safesub = preg_replace( '/\'/', "\'", $safesub );
426426 $safesub = htmlspecialchars( $safesub );
427 -
 427+
428428 $safeowner = $row['owner'];
429429 if ( $row['owner'] !== $row['username'] ) {
430430 $safeowner .= " ($row[username])";
@@ -431,11 +431,11 @@
432432 $safeowner = preg_replace( '/\"/', '\"', $safeowner );
433433 $safeowner = preg_replace( '/\'/', "\'", $safeowner );
434434 $safeowner = htmlspecialchars( $safeowner );
435 -
 435+
436436 $safeq = preg_replace( '/\"/', '\"', $row['queue'] );
437437 $safeq = preg_replace( '/\'/', "\'", $safeq );
438438 $safeq = htmlspecialchars( $safeq );
439 -
 439+
440440 $text = "RT #<b>$ticketnum</b>";
441441 $text .= "<br />Status: <b>$row[status]</b>";
442442 $text .= "<br />Subject: <b>$safesub</b>";
@@ -448,26 +448,26 @@
449449 else {
450450 $text .= "<br />Last updated: <b>$row[lastupdated]</b>";
451451 }
452 -
 452+
453453 # Prepare some balloon-tek
454454 $link = isset( $args['link'] ) ? $args['link'] : '';
455455 $target = isset( $args['target'] ) ? $args['target'] : '';
456456 $sticky = isset( $args['sticky'] ) ? $args['sticky'] : '0';
457457 $width = isset( $args['width'] ) ? $args['width'] : '0';
458 -
 458+
459459 $event = isset( $args['click'] ) && $args['click'] && !$link ? 'onclick' : 'onmouseover';
460460 $event2 = '';
461461 $event = "$event=\"balloon.showTooltip(event,'${text}',${sticky},${width})\"";
462 -
 462+
463463 if ( preg_match( '/onclick/', $event ) && $args['hover'] ) {
464464 $event2 = " onmouseover=\"balloon.showTooltip(event,'" . $args['hover'] . "',0,${width})\"";
465465 }
466 -
 466+
467467 $has_style = isset( $args['style'] ) && $args['style'];
468468 $style = "style=\"" . ( $has_style ? $args['style'] . ";cursor:pointer\"" : "cursor:pointer\"" );
469469 $target = $target ? "target=${target}" : '';
470470 $output = "<span class='rt-ticket' ${event} ${event2} ${style}>$ret</span>";
471 -
 471+
472472 return $output;
473473 }
474474 }
\ No newline at end of file
Index: trunk/extensions/RefreshSpecial/RefreshSpecial.body.php
@@ -25,8 +25,8 @@
2626 public function execute( $par ) {
2727 global $wgOut, $wgUser, $wgRequest;
2828
29 -
3029
 30+
3131 $wgOut->setPageTitle( wfMsg( 'refreshspecial-title' ) );
3232
3333 # If the user doesn't have the required permission, display an error
@@ -52,9 +52,9 @@
5353 $action = $wgRequest->getVal( 'action' );
5454 if( 'success' == $action ) {
5555 /* do something */
56 - } else if( 'failure' == $action ) {
 56+ } elseif( 'failure' == $action ) {
5757 $cSF->showForm( wfMsg('refreshspecial-fail') );
58 - } else if( $wgRequest->wasPosted() && 'submit' == $action &&
 58+ } elseif( $wgRequest->wasPosted() && 'submit' == $action &&
5959 $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
6060 $cSF->doSubmit();
6161 } else {
Index: trunk/extensions/Push/specials/Push_Body.php
@@ -3,32 +3,32 @@
44 /**
55 * A special page that allows pushing one or more pages to one or more targets.
66 * Partly based on MediaWiki's Special:Export.
7 - *
 7+ *
88 * @since 0.1
9 - *
 9+ *
1010 * @file Push_Body.php
1111 * @ingroup Push
12 - *
 12+ *
1313 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1414 */
1515 class SpecialPush extends SpecialPage {
16 -
 16+
1717 /**
1818 * Constructor.
19 - *
 19+ *
2020 * @since 0.1
2121 */
2222 public function __construct() {
2323 parent::__construct( 'Push', 'bulkpush' );
2424 }
25 -
 25+
2626 /**
2727 * @see SpecialPage::getDescription
2828 */
2929 public function getDescription() {
3030 return wfMsg( 'special-' . strtolower( $this->mName ) );
3131 }
32 -
 32+
3333 /**
3434 * Sets headers - this should be called from the execute() method of all derived classes!
3535 */
@@ -37,34 +37,34 @@
3838 $wgOut->setArticleRelated( false );
3939 $wgOut->setRobotPolicy( "noindex,nofollow" );
4040 $wgOut->setPageTitle( $this->getDescription() );
41 - }
42 -
 41+ }
 42+
4343 /**
4444 * Main method.
45 - *
46 - * @since 0.1
47 - *
 45+ *
 46+ * @since 0.1
 47+ *
4848 * @param string $arg
4949 */
5050 public function execute( $arg ) {
5151 global $wgOut, $wgUser, $wgRequest, $egPushTargets;
52 -
 52+
5353 $this->setHeaders();
5454 $this->outputHeader();
55 -
 55+
5656 // If the user is authorized, display the page, if not, show an error.
5757 if ( !$this->userCanExecute( $wgUser ) ) {
5858 $this->displayRestrictionError();
5959 return;
60 - }
61 -
 60+ }
 61+
6262 if ( count( $egPushTargets ) == 0 ) {
6363 $wgOut->addHTML( '<p>' . htmlspecialchars( wfMsg( 'push-tab-no-targets' ) ) . '</p>' );
6464 return;
65 - }
 65+ }
6666
6767 $doPush = false;
68 -
 68+
6969 if ( $wgRequest->getCheck( 'addcat' ) ) {
7070 $pages = $wgRequest->getText( 'pages' );
7171 $catname = $wgRequest->getText( 'catname' );
@@ -82,7 +82,7 @@
8383 }
8484 }
8585 }
86 - else if( $wgRequest->getCheck( 'addns' ) ) {
 86+ elseif( $wgRequest->getCheck( 'addns' ) ) {
8787 $pages = $wgRequest->getText( 'pages' );
8888 $nsindex = $wgRequest->getText( 'nsindex', '' );
8989
@@ -94,14 +94,14 @@
9595 if ( $nspages ) $pages .= "\n" . implode( "\n", $nspages );
9696 }
9797 }
98 - else if( $wgRequest->wasPosted() ) {
 98+ elseif( $wgRequest->wasPosted() ) {
9999 $pages = $wgRequest->getText( 'pages' );
100100 if( $pages != '' ) $doPush= true;
101 - }
 101+ }
102102 else {
103103 $pages = '';
104 - }
105 -
 104+ }
 105+
106106 if ( $doPush ) {
107107 $this->doPush( $pages );
108108 }
@@ -109,18 +109,18 @@
110110 $this->displayPushInterface( $arg, $pages );
111111 }
112112 }
113 -
 113+
114114 /**
115115 * Outputs the HTML to indicate a push is occurring and
116116 * the JavaScript to needed by the push.
117 - *
 117+ *
118118 * @since 0.2
119 - *
 119+ *
120120 * @param string $pages
121121 */
122122 protected function doPush( $pages ) {
123123 global $wgOut, $wgLang, $wgRequest, $wgSitename, $wgTitle, $egPushTargets, $egPushBulkWorkers, $egPushBatchSize;
124 -
 124+
125125 $pageSet = array(); // Inverted index of all pages to look up
126126
127127 // Split up and normalize input
@@ -138,11 +138,11 @@
139139 $pageSet = PushFunctions::getTemplates( array_keys( $pageSet ), $pageSet );
140140 }
141141
142 - $pages = array_keys( $pageSet );
143 -
 142+ $pages = array_keys( $pageSet );
 143+
144144 $targets = array();
145145 $links = array();
146 -
 146+
147147 if ( count( $egPushTargets ) > 1 ) {
148148 foreach ( $egPushTargets as $targetName => $targetUrl ) {
149149 if ( $wgRequest->getCheck( str_replace( ' ', '_', $targetName ) ) ) {
@@ -154,9 +154,9 @@
155155 else {
156156 $targets = $egPushTargets;
157157 }
158 -
 158+
159159 $wgOut->addWikiMsg( 'push-special-pushing-desc', $wgLang->listToText( $links ), $wgLang->formatNum( count( $pages ) ) );
160 -
 160+
161161 $wgOut->addHTML(
162162 Html::hidden( 'siteName', $wgSitename, array( 'id' => 'siteName' ) ) .
163163 Html::rawElement(
@@ -173,7 +173,7 @@
174174 ) . '<br />' .
175175 Html::element( 'a', array( 'href' => $wgTitle->getInternalURL() ), wfMsg( 'push-special-return' ) )
176176 );
177 -
 177+
178178 $wgOut->addInlineScript(
179179 'var wgPushPages = ' . FormatJson::encode( $pages ) . ';' .
180180 'var wgPushTargets = ' . FormatJson::encode( $targets ) . ';' .
@@ -181,16 +181,16 @@
182182 'var wgPushBatchSize = ' . $egPushBatchSize . ';' .
183183 'var wgPushIncFiles = ' . ( $wgRequest->getCheck( 'files' ) ? 'true' : 'false' ) . ';'
184184 );
185 -
 185+
186186 $this->loadJs();
187187 }
188 -
 188+
189189 /**
190190 * @since 0.2
191191 */
192192 protected function displayPushInterface( $arg, $pages ) {
193193 global $wgOut, $wgUser, $wgRequest, $egPushTargets, $egPushIncTemplates, $egPushIncFiles;
194 -
 194+
195195 $wgOut->addWikiMsg( 'push-special-description' );
196196
197197 $form = Xml::openElement( 'form', array( 'method' => 'post',
@@ -210,43 +210,43 @@
211211 'wpPushTemplates',
212212 $wgRequest->wasPosted() ? $wgRequest->getCheck( 'templates' ) : $egPushIncTemplates
213213 ) . '<br />';
214 -
 214+
215215 if ( $wgUser->isAllowed( 'filepush' ) ) {
216216 $form .= Xml::checkLabel(
217217 wfMsg( 'push-special-inc-files' ),
218218 'files',
219219 'wpPushFiles',
220220 $wgRequest->wasPosted() ? $wgRequest->getCheck( 'files' ) : $egPushIncFiles
221 - ) . '<br />';
 221+ ) . '<br />';
222222 }
223 -
 223+
224224 if ( count( $egPushTargets ) == 1 ) {
225225 $names = array_keys( $egPushTargets );
226226 $form .= '<b>' . htmlspecialchars( wfMsgExt( 'push-special-target-is', 'parsemag', $names[0] ) ) . '</b><br />';
227227 }
228228 else {
229229 $form .= '<b>' . htmlspecialchars( wfMsg( 'push-special-select-targets' ) ) . '</b><br />';
230 -
 230+
231231 foreach ( $egPushTargets as $targetName => $targetUrl ) {
232232 $checkName = str_replace( ' ', '_', $targetName );
233233 $checked = $wgRequest->wasPosted() ? $wgRequest->getCheck( $checkName ) : true;
234234 $form .= Xml::checkLabel( $targetName, $checkName, $targetName, $checked ) . '<br />';
235235 }
236236 }
237 -
 237+
238238 $form .= Xml::submitButton( wfMsg( 'push-special-button-text' ), array( 'style' => 'width: 125px; height: 30px' ) );
239239 $form .= Xml::closeElement( 'form' );
240 -
241 - $wgOut->addHTML( $form );
 240+
 241+ $wgOut->addHTML( $form );
242242 }
243 -
 243+
244244 /**
245 - * Returns all pages for a category (up to 5000).
246 - *
 245+ * Returns all pages for a category (up to 5000).
 246+ *
247247 * @since 0.2
248 - *
 248+ *
249249 * @param Title $title
250 - *
 250+ *
251251 * @return array
252252 */
253253 protected function getPagesFromCategory( Title $title ) {
@@ -264,7 +264,7 @@
265265 );
266266
267267 $pages = array();
268 -
 268+
269269 foreach ( $res as $row ) {
270270 $n = $row->page_title;
271271 if ($row->page_namespace) {
@@ -278,12 +278,12 @@
279279 }
280280
281281 /**
282 - * Returns all pages for a namespace (up to 5000).
283 - *
 282+ * Returns all pages for a namespace (up to 5000).
 283+ *
284284 * @since 0.2
285 - *
 285+ *
286286 * @param integer $nsindex
287 - *
 287+ *
288288 * @return array
289289 */
290290 protected function getPagesFromNamespace( $nsindex ) {
@@ -299,10 +299,10 @@
300300 );
301301
302302 $pages = array();
303 -
 303+
304304 foreach ( $res as $row ) {
305305 $n = $row->page_title;
306 -
 306+
307307 if ( $row->page_namespace ) {
308308 $ns = $wgContLang->getNsText( $row->page_namespace );
309309 $n = $ns . ':' . $n;
@@ -311,33 +311,33 @@
312312 $pages[] = $n;
313313 }
314314 return $pages;
315 - }
316 -
 315+ }
 316+
317317 /**
318318 * Loads the needed JavaScript.
319319 * Takes care of non-RL compatibility.
320 - *
 320+ *
321321 * @since 0.2
322322 */
323323 protected static function loadJs() {
324324 global $wgOut;
325 -
 325+
326326 // For backward compatibility with MW < 1.17.
327327 if ( is_callable( array( $wgOut, 'addModules' ) ) ) {
328328 $wgOut->addModules( 'ext.push.special' );
329329 }
330330 else {
331331 global $egPushScriptPath;
332 -
 332+
333333 PushFunctions::addJSLocalisation();
334 -
 334+
335335 $wgOut->includeJQuery();
336 -
 336+
337337 $wgOut->addHeadItem(
338338 'ext.push.special',
339339 Html::linkedScript( $egPushScriptPath . '/specials/ext.push.special.js' )
340340 );
341 - }
342 - }
343 -
 341+ }
 342+ }
 343+
344344 }
\ No newline at end of file
Index: trunk/extensions/Push/api/ApiPush.php
@@ -11,93 +11,93 @@
1212 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1313 */
1414 class ApiPush extends ApiBase {
15 -
 15+
1616 protected $editResponses = array();
17 -
 17+
1818 /**
1919 * Associative array containing CookieJar objects (values) to be passed in
2020 * order to authenticate to the targets (keys).
21 - *
 21+ *
2222 * @since 0.4
23 - *
 23+ *
2424 * @var array
2525 */
2626 protected $cookieJars = array();
27 -
 27+
2828 public function __construct( $main, $action ) {
2929 parent::__construct( $main, $action );
3030 }
31 -
 31+
3232 public function execute() {
3333 global $wgUser;
34 -
 34+
3535 if ( !$wgUser->isAllowed( 'push' ) || $wgUser->isBlocked() ) {
3636 $this->dieUsageMsg( array( 'badaccess-groups' ) );
3737 }
38 -
 38+
3939 global $egPushLoginUser, $egPushLoginPass, $egPushLoginUsers, $egPushLoginPasswords;
40 -
 40+
4141 $params = $this->extractRequestParams();
42 -
 42+
4343 if ( !isset( $params['page'] ) ) {
4444 $this->dieUsageMsg( array( 'missingparam', 'page' ) );
4545 }
46 -
 46+
4747 if ( !isset( $params['targets'] ) ) {
4848 $this->dieUsageMsg( array( 'missingparam', 'targets' ) );
49 - }
 49+ }
5050
5151 PushFunctions::flipKeys( $egPushLoginUsers, 'users' );
5252 PushFunctions::flipKeys( $egPushLoginPasswords, 'passwds' );
53 -
 53+
5454 foreach ( $params['targets'] as &$target ) {
5555 $user = false;
5656 $pass = false;
57 -
 57+
5858 if ( array_key_exists( $target, $egPushLoginUsers ) && array_key_exists( $target, $egPushLoginPasswords ) ) {
5959 $user = $egPushLoginUsers[$target];
6060 $pass = $egPushLoginPasswords[$target];
6161 }
62 - else if ( $egPushLoginUser != '' && $egPushLoginPass != '' ) {
 62+ elseif ( $egPushLoginUser != '' && $egPushLoginPass != '' ) {
6363 $user = $egPushLoginUser;
64 - $pass = $egPushLoginPass;
65 - }
66 -
 64+ $pass = $egPushLoginPass;
 65+ }
 66+
6767 if ( substr( $target, -1 ) !== '/' ) {
6868 $target .= '/';
6969 }
70 -
 70+
7171 $target .= 'api.php';
72 -
 72+
7373 if ( $user !== false ) {
7474 $this->doLogin( $user, $pass, $target );
7575 }
7676 }
77 -
 77+
7878 foreach ( $params['page'] as $page ) {
7979 $title = Title::newFromText( $page );
80 -
 80+
8181 $revision = $this->getPageRevision( $title );
82 -
 82+
8383 if ( $revision !== false ) {
8484 $this->doPush( $title, $revision, $params['targets'] );
85 - }
 85+ }
8686 }
87 -
 87+
8888 foreach ( $this->editResponses as $response ) {
8989 $this->getResult()->addValue(
9090 null,
9191 null,
9292 FormatJson::decode( $response )
93 - );
94 - }
 93+ );
 94+ }
9595 }
96 -
 96+
9797 /**
9898 * Logs in into a target wiki using the provided username and password.
99 - *
 99+ *
100100 * @since 0.4
101 - *
 101+ *
102102 * @param string $user
103103 * @param string $password
104104 * @param string $target
@@ -112,14 +112,14 @@
113113 'lgname' => $user,
114114 'lgpassword' => $password
115115 );
116 -
 116+
117117 //static $fail = 0;$fail++;
118 -
 118+
119119 if ( !is_null( $token ) ) {
120120 $requestData['lgtoken'] = $token;
121121 }
122 -
123 - $req = PushFunctions::getHttpRequest( $target,
 122+
 123+ $req = PushFunctions::getHttpRequest( $target,
124124 array(
125125 'postData' => $requestData,
126126 'method' => 'POST',
@@ -130,21 +130,21 @@
131131 if ( !is_null( $cookieJar ) ) {
132132 $req->setCookieJar( $cookieJar );
133133 }
134 -
 134+
135135 $status = $req->execute();
136136
137137 $attemtNr++;
138 -
 138+
139139 if ( $status->isOK() ) {
140140 $response = FormatJson::decode( $req->getContent() );
141 -
 141+
142142 if ( property_exists( $response, 'login' )
143143 && property_exists( $response->login, 'result' ) ) {
144144
145145 if ( $response->login->result == 'NeedToken' && $attemtNr < 3 ) {
146146 $this->doLogin( $user, $password, $target, $response->login->token, $req->getCookieJar(), $attemtNr );
147147 }
148 - else if ( $response->login->result == 'Success' ) {
 148+ elseif ( $response->login->result == 'Success' ) {
149149 $this->cookieJars[$target] = $req->getCookieJar();
150150 }
151151 else {
@@ -153,25 +153,25 @@
154154 }
155155 else {
156156 $this->dieUsage( wfMsgExt( 'push-err-authentication', 'parsemag', $target, '' ), 'authentication-failed' );
157 - }
158 - }
 157+ }
 158+ }
159159 else {
160160 $this->dieUsage( wfMsgExt( 'push-err-authentication', 'parsemag', $target, '' ), 'authentication-failed' );
161161 }
162162 }
163 -
 163+
164164 /**
165165 * Makes an internal request to the API to get the needed revision.
166 - *
 166+ *
167167 * @since 0.3
168 - *
 168+ *
169169 * @param Title $title
170 - *
 170+ *
171171 * @return array or false
172172 */
173173 protected function getPageRevision( Title $title ) {
174174 $revId = PushFunctions::getRevisionToPush( $title );
175 -
 175+
176176 $requestData = array(
177177 'action' => 'query',
178178 'format' => 'json',
@@ -179,25 +179,25 @@
180180 'rvprop' => 'timestamp|user|comment|content',
181181 'titles' => $title->getFullText(),
182182 'rvstartid' => $revId,
183 - 'rvendid' => $revId,
 183+ 'rvendid' => $revId,
184184 );
185 -
 185+
186186 $api = new ApiMain( new FauxRequest( $requestData, true ), true );
187187 $api->execute();
188188 $response = $api->getResultData();
189 -
 189+
190190 $revision = false;
191 -
 191+
192192 if ( $response !== false
193193 && array_key_exists( 'query', $response )
194194 && array_key_exists( 'pages', $response['query'] )
195195 && count( $response['query']['pages'] ) > 0 ) {
196 -
 196+
197197 foreach ( $response['query']['pages'] as $key => $value ) {
198198 $first = $key;
199199 break;
200200 }
201 -
 201+
202202 if ( array_key_exists( 'revisions', $response['query']['pages'][$first] )
203203 && count( $response['query']['pages'][$first]['revisions'] ) > 0 ) {
204204 $revision = $response['query']['pages'][$first]['revisions'][0];
@@ -212,80 +212,80 @@
213213
214214 return $revision;
215215 }
216 -
 216+
217217 /**
218218 * Pushes the page content to the target wikis.
219 - *
 219+ *
220220 * @since 0.3
221 - *
 221+ *
222222 * @param Title $title
223223 * @param array $revision
224224 * @param array $targets
225 - */
 225+ */
226226 protected function doPush( Title $title, array $revision, array $targets ) {
227 - foreach ( $targets as $target ) {
 227+ foreach ( $targets as $target ) {
228228 $token = $this->getEditToken( $title, $target );
229 -
 229+
230230 if ( $token !== false ) {
231231 $doPush = true;
232 -
 232+
233233 wfRunHooks( 'PushAPIBeforePush', array( &$title, &$revision, &$target, &$token, &$doPush ) );
234 -
 234+
235235 if ( $doPush ) {
236236 $this->pushToTarget( $title, $revision, $target, $token );
237237 }
238238 }
239239 }
240240 }
241 -
 241+
242242 /**
243243 * Obtains the needed edit token by making an HTTP GET request
244 - * to the remote wikis API.
245 - *
 244+ * to the remote wikis API.
 245+ *
246246 * @since 0.3
247 - *
 247+ *
248248 * @param Title $title
249249 * @param string $target
250 - *
 250+ *
251251 * @return string or false
252 - */
 252+ */
253253 protected function getEditToken( Title $title, $target ) {
254254 $requestData = array(
255255 'action' => 'query',
256256 'format' => 'json',
257257 'intoken' => 'edit',
258258 'prop' => 'info',
259 - 'titles' => $title->getFullText(),
 259+ 'titles' => $title->getFullText(),
260260 );
261 -
 261+
262262 $parts = array();
263 -
 263+
264264 foreach ( $requestData as $key => $value ) {
265265 $parts[] = $key . '=' . urlencode( $value );
266266 }
267267
268 - $req = PushFunctions::getHttpRequest( $target . '?' . implode( '&', $parts ),
 268+ $req = PushFunctions::getHttpRequest( $target . '?' . implode( '&', $parts ),
269269 array(
270270 'method' => 'GET',
271271 'timeout' => 'default'
272272 )
273273 );
274 -
 274+
275275 if ( array_key_exists( $target, $this->cookieJars ) ) {
276276 $req->setCookieJar( $this->cookieJars[$target] );
277 - }
278 -
 277+ }
 278+
279279 $status = $req->execute();
280 -
 280+
281281 $response = $status->isOK() ? FormatJson::decode( $req->getContent() ) : null;
282 -
 282+
283283 $token = false;
284284
285285 if ( !is_null( $response )
286286 && property_exists( $response, 'query' )
287287 && property_exists( $response->query, 'pages' )
288288 && count( $response->query->pages ) > 0 ) {
289 -
 289+
290290 foreach ( $response->query->pages as $key => $value ) {
291291 $first = $key;
292292 break;
@@ -299,25 +299,25 @@
300300 }
301301 else {
302302 $this->dieUsage( wfMsg( 'push-special-err-token-failed' ), 'token-request-failed' );
303 - }
 303+ }
304304 }
305305 else {
306306 $this->dieUsage( wfMsg( 'push-special-err-token-failed' ), 'token-request-failed' );
307307 }
308 -
 308+
309309 return $token;
310 - }
311 -
 310+ }
 311+
312312 /**
313313 * Pushes the page content to the specified wiki.
314 - *
 314+ *
315315 * @since 0.3
316 - *
 316+ *
317317 * @param Title $title
318318 * @param array $revision
319319 * @param string $target
320320 * @param string $token
321 - */
 321+ */
322322 protected function pushToTarget( Title $title, array $revision, $target, $token ) {
323323 global $wgSitename;
324324
@@ -337,20 +337,20 @@
338338 'token' => $token,
339339 );
340340
341 - $req = PushFunctions::getHttpRequest( $target,
 341+ $req = PushFunctions::getHttpRequest( $target,
342342 array(
343343 'method' => 'POST',
344344 'timeout' => 'default',
345345 'postData' => $requestData
346346 )
347347 );
348 -
 348+
349349 if ( array_key_exists( $target, $this->cookieJars ) ) {
350350 $req->setCookieJar( $this->cookieJars[$target] );
351351 }
352 -
 352+
353353 $status = $req->execute();
354 -
 354+
355355 if ( $status->isOK() ) {
356356 $this->editResponses[] = $req->getContent();
357357 }
@@ -358,7 +358,7 @@
359359 $this->dieUsage( wfMsg( 'push-special-err-push-failed' ), 'page-push-failed' );
360360 }
361361 }
362 -
 362+
363363 public function getAllowedParams() {
364364 return array(
365365 'page' => array(
@@ -370,23 +370,23 @@
371371 ApiBase::PARAM_TYPE => 'string',
372372 ApiBase::PARAM_ISMULTI => true,
373373 //ApiBase::PARAM_REQUIRED => true,
374 - ),
 374+ ),
375375 );
376376 }
377 -
 377+
378378 public function getParamDescription() {
379379 return array(
380380 'page' => 'The names of the page to push. Delimitered by |',
381381 'targets' => 'The urls of the wikis to push to. Delimitered by |',
382382 );
383383 }
384 -
 384+
385385 public function getDescription() {
386386 return array(
387387 'Pushes the content of one ore more pages to one or more target wikis.'
388388 );
389389 }
390 -
 390+
391391 public function getPossibleErrors() {
392392 return array_merge( parent::getPossibleErrors(), array(
393393 array( 'missingparam', 'page' ),
@@ -402,6 +402,6 @@
403403
404404 public function getVersion() {
405405 return __CLASS__ . ': $Id$';
406 - }
407 -
 406+ }
 407+
408408 }
Index: trunk/extensions/Push/api/ApiPushImages.php
@@ -11,67 +11,67 @@
1212 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1313 */
1414 class ApiPushImages extends ApiBase {
15 -
 15+
1616 /**
1717 * Associative array containing CookieJar objects (values) to be passed in
1818 * order to authenticate to the targets (keys).
19 - *
 19+ *
2020 * @since 0.5
21 - *
 21+ *
2222 * @var array
2323 */
2424 protected $cookieJars = array();
25 -
 25+
2626 public function __construct( $main, $action ) {
2727 parent::__construct( $main, $action );
2828 }
29 -
 29+
3030 public function execute() {
3131 global $wgUser;
32 -
 32+
3333 if ( !$wgUser->isAllowed( 'push' ) || $wgUser->isBlocked() ) {
3434 $this->dieUsageMsg( array( 'badaccess-groups' ) );
3535 }
36 -
 36+
3737 global $egPushLoginUser, $egPushLoginPass, $egPushLoginUsers, $egPushLoginPasswords;
38 -
 38+
3939 $params = $this->extractRequestParams();
40 -
 40+
4141 if ( !isset( $params['images'] ) ) {
4242 $this->dieUsageMsg( array( 'missingparam', 'images' ) );
4343 }
44 -
 44+
4545 if ( !isset( $params['targets'] ) ) {
4646 $this->dieUsageMsg( array( 'missingparam', 'targets' ) );
47 - }
 47+ }
4848
4949 PushFunctions::flipKeys( $egPushLoginUsers, 'users' );
50 - PushFunctions::flipKeys( $egPushLoginPasswords, 'passwds' );
51 -
 50+ PushFunctions::flipKeys( $egPushLoginPasswords, 'passwds' );
 51+
5252 foreach ( $params['targets'] as &$target ) {
5353 $user = false;
5454 $pass = false;
55 -
 55+
5656 if ( array_key_exists( $target, $egPushLoginUsers ) && array_key_exists( $target, $egPushLoginPasswords ) ) {
5757 $user = $egPushLoginUsers[$target];
5858 $pass = $egPushLoginPasswords[$target];
5959 }
60 - else if ( $egPushLoginUser != '' && $egPushLoginPass != '' ) {
 60+ elseif ( $egPushLoginUser != '' && $egPushLoginPass != '' ) {
6161 $user = $egPushLoginUser;
62 - $pass = $egPushLoginPass;
63 - }
64 -
 62+ $pass = $egPushLoginPass;
 63+ }
 64+
6565 if ( substr( $target, -1 ) !== '/' ) {
6666 $target .= '/';
6767 }
68 -
 68+
6969 $target .= 'api.php';
70 -
 70+
7171 if ( $user !== false ) {
7272 $this->doLogin( $user, $pass, $target );
7373 }
7474 }
75 -
 75+
7676 foreach ( $params['images'] as $image ) {
7777 $title = Title::newFromText( $image, NS_FILE );
7878 if ( !is_null( $title ) && $title->getNamespace() == NS_FILE && $title->exists() ) {
@@ -79,12 +79,12 @@
8080 }
8181 }
8282 }
83 -
 83+
8484 /**
8585 * Logs in into a target wiki using the provided username and password.
86 - *
 86+ *
8787 * @since 0.5
88 - *
 88+ *
8989 * @param string $user
9090 * @param string $password
9191 * @param string $target
@@ -99,37 +99,37 @@
100100 'lgname' => $user,
101101 'lgpassword' => $password
102102 );
103 -
 103+
104104 if ( !is_null( $token ) ) {
105105 $requestData['lgtoken'] = $token;
106106 }
107 -
108 - $req = PushFunctions::getHttpRequest( $target,
 107+
 108+ $req = PushFunctions::getHttpRequest( $target,
109109 array(
110110 'postData' => $requestData,
111111 'method' => 'POST',
112112 'timeout' => 'default'
113113 )
114114 );
115 -
 115+
116116 if ( !is_null( $cookieJar ) ) {
117117 $req->setCookieJar( $cookieJar );
118 - }
119 -
 118+ }
 119+
120120 $status = $req->execute();
121121
122122 $attemtNr++;
123 -
 123+
124124 if ( $status->isOK() ) {
125125 $response = FormatJson::decode( $req->getContent() );
126 -
 126+
127127 if ( property_exists( $response, 'login' )
128128 && property_exists( $response->login, 'result' ) ) {
129129
130130 if ( $response->login->result == 'NeedToken' && $attemtNr < 3 ) {
131131 $this->doLogin( $user, $password, $target, $response->login->token, $req->getCookieJar(), $attemtNr );
132132 }
133 - else if ( $response->login->result == 'Success' ) {
 133+ elseif ( $response->login->result == 'Success' ) {
134134 $this->cookieJars[$target] = $req->getCookieJar();
135135 }
136136 else {
@@ -138,85 +138,85 @@
139139 }
140140 else {
141141 $this->dieUsage( wfMsgExt( 'push-err-authentication', 'parsemag', $target, '' ), 'authentication-failed' );
142 - }
143 - }
 142+ }
 143+ }
144144 else {
145145 $this->dieUsage( wfMsgExt( 'push-err-authentication', 'parsemag', $target, '' ), 'authentication-failed' );
146146 }
147147 }
148 -
 148+
149149 /**
150150 * Pushes the page content to the target wikis.
151 - *
 151+ *
152152 * @since 0.5
153 - *
 153+ *
154154 * @param Title $title
155155 * @param array $targets
156 - */
 156+ */
157157 protected function doPush( Title $title, array $targets ) {
158 - foreach ( $targets as $target ) {
 158+ foreach ( $targets as $target ) {
159159 $token = $this->getEditToken( $title, $target );
160160
161161 if ( $token !== false ) {
162162 $doPush = true;
163 -
 163+
164164 wfRunHooks( 'PushAPIBeforeImagePush', array( &$title, &$target, &$token, &$doPush ) );
165 -
 165+
166166 if ( $doPush ) {
167167 $this->pushToTarget( $title, $target, $token );
168168 }
169169 }
170170 }
171171 }
172 -
 172+
173173 /**
174174 * Obtains the needed edit token by making an HTTP GET request
175 - * to the remote wikis API.
176 - *
 175+ * to the remote wikis API.
 176+ *
177177 * @since 0.5
178 - *
 178+ *
179179 * @param Title $title
180180 * @param string $target
181 - *
 181+ *
182182 * @return string or false
183 - */
 183+ */
184184 protected function getEditToken( Title $title, $target ) {
185185 $requestData = array(
186186 'action' => 'query',
187187 'format' => 'json',
188188 'intoken' => 'edit',
189189 'prop' => 'info',
190 - 'titles' => $title->getFullText(),
 190+ 'titles' => $title->getFullText(),
191191 );
192 -
 192+
193193 $parts = array();
194 -
 194+
195195 foreach ( $requestData as $key => $value ) {
196196 $parts[] = $key . '=' . urlencode( $value );
197197 }
198198
199 - $req = PushFunctions::getHttpRequest( $target . '?' . implode( '&', $parts ),
 199+ $req = PushFunctions::getHttpRequest( $target . '?' . implode( '&', $parts ),
200200 array(
201201 'method' => 'GET',
202202 'timeout' => 'default'
203203 )
204204 );
205 -
 205+
206206 if ( array_key_exists( $target, $this->cookieJars ) ) {
207207 $req->setCookieJar( $this->cookieJars[$target] );
208 - }
209 -
 208+ }
 209+
210210 $status = $req->execute();
211 -
 211+
212212 $response = $status->isOK() ? FormatJson::decode( $req->getContent() ) : null;
213 -
 213+
214214 $token = false;
215215
216216 if ( !is_null( $response )
217217 && property_exists( $response, 'query' )
218218 && property_exists( $response->query, 'pages' )
219219 && count( $response->query->pages ) > 0 ) {
220 -
 220+
221221 foreach ( $response->query->pages as $key => $value ) {
222222 $first = $key;
223223 break;
@@ -230,27 +230,27 @@
231231 }
232232 else {
233233 $this->dieUsage( wfMsg( 'push-special-err-token-failed' ), 'token-request-failed' );
234 - }
 234+ }
235235 }
236236 else {
237237 $this->dieUsage( wfMsg( 'push-special-err-token-failed' ), 'token-request-failed' );
238238 }
239 -
 239+
240240 return $token;
241 - }
242 -
 241+ }
 242+
243243 /**
244244 * Pushes the image to the specified wiki.
245 - *
 245+ *
246246 * @since 0.5
247 - *
 247+ *
248248 * @param Title $title
249249 * @param string $target
250250 * @param string $token
251 - */
 251+ */
252252 protected function pushToTarget( Title $title, $target, $token ) {
253253 global $egPushDirectFileUploads;
254 -
 254+
255255 $imagePage = new ImagePage( $title );
256256
257257 $requestData = array(
@@ -260,25 +260,25 @@
261261 'filename' => $title->getText(),
262262 'ignorewarnings' => '1'
263263 );
264 -
 264+
265265 if ( $egPushDirectFileUploads ) {
266266 $requestData['file'] = '@' . $imagePage->getFile()->getPath();
267267 }
268268 else {
269269 $requestData['url'] = $imagePage->getDisplayedFile()->getFullUrl();
270270 }
271 -
 271+
272272 $reqArgs = array(
273273 'method' => 'POST',
274274 'timeout' => 'default',
275275 'postData' => $requestData
276276 );
277 -
 277+
278278 if ( $egPushDirectFileUploads ) {
279279 if ( !function_exists( 'curl_init' ) ) {
280280 $this->dieUsage( wfMsg( 'push-api-err-nocurl' ), 'image-push-nocurl' );
281281 }
282 - else if ( !defined( 'CurlHttpRequest::SUPPORTS_FILE_POSTS' ) || !CurlHttpRequest::SUPPORTS_FILE_POSTS ) {
 282+ elseif ( !defined( 'CurlHttpRequest::SUPPORTS_FILE_POSTS' ) || !CurlHttpRequest::SUPPORTS_FILE_POSTS ) {
283283 $this->dieUsage( wfMsg( 'push-api-err-nofilesupport' ), 'image-push-nofilesupport' );
284284 }
285285 else {
@@ -288,25 +288,25 @@
289289 else {
290290 $req = PushFunctions::getHttpRequest( $target, $reqArgs );
291291 }
292 -
 292+
293293 if ( array_key_exists( $target, $this->cookieJars ) ) {
294294 $req->setCookieJar( $this->cookieJars[$target] );
295 - }
296 -
 295+ }
 296+
297297 $status = $req->execute();
298 -
 298+
299299 if ( $status->isOK() ) {
300300 $this->getResult()->addValue(
301301 null,
302302 null,
303303 FormatJson::decode( $req->getContent() )
304 - );
 304+ );
305305 }
306306 else {
307307 $this->dieUsage( wfMsg( 'push-special-err-push-failed' ), 'page-push-failed' );
308308 }
309309 }
310 -
 310+
311311 public function getAllowedParams() {
312312 return array(
313313 'images' => array(
@@ -318,23 +318,23 @@
319319 ApiBase::PARAM_TYPE => 'string',
320320 ApiBase::PARAM_ISMULTI => true,
321321 //ApiBase::PARAM_REQUIRED => true,
322 - ),
 322+ ),
323323 );
324324 }
325 -
 325+
326326 public function getParamDescription() {
327327 return array(
328328 'images' => 'The names of the images to push. Delimitered by |',
329329 'targets' => 'The urls of the wikis to push to. Delimitered by |',
330330 );
331331 }
332 -
 332+
333333 public function getDescription() {
334334 return array(
335335 'Pushes the content of one ore more pages to one or more target wikis.'
336336 );
337337 }
338 -
 338+
339339 public function getPossibleErrors() {
340340 return array_merge( parent::getPossibleErrors(), array(
341341 array( 'missingparam', 'images' ),
@@ -350,6 +350,6 @@
351351
352352 public function getVersion() {
353353 return __CLASS__ . ': $Id$';
354 - }
355 -
 354+ }
 355+
356356 }
Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php
@@ -199,7 +199,7 @@
200200 * thumb.php is to be used (e.g. $wgThumbnailScriptPath !== false). You should
201201 * pass through the same parameters as in makeParamString().
202202 */
203 - function getScriptParams( $params ) {
 203+ function getScriptParams( $params ) {
204204 return array(
205205 'width' => $params['width'],
206206 'page' => $params['page'],
@@ -234,7 +234,7 @@
235235 $params['lossy'] = 'lossless';
236236 } else {
237237 $params['lossy'] = 'lossy';
238 - }
 238+ }
239239 }
240240
241241 return true;
@@ -247,7 +247,7 @@
248248
249249 if ( !$metadata ) {
250250 return true;
251 - } else if ( isset( $metadata[ 'errors' ] ) ) {
 251+ } elseif ( isset( $metadata[ 'errors' ] ) ) {
252252 return $metadata[ 'errors' ];
253253 } else {
254254 return false;
@@ -262,12 +262,12 @@
263263
264264 $errors = array();
265265 foreach ( $errors_raw as $error ) {
266 - if ( $error === false || $error === null || $error === 0 || $error === '' )
 266+ if ( $error === false || $error === null || $error === 0 || $error === '' )
267267 continue;
268268
269269 $error = trim( $error );
270270
271 - if ( $error === '' )
 271+ if ( $error === '' )
272272 continue;
273273
274274 if ( $to_html )
@@ -292,7 +292,7 @@
293293 * Supports extra parameters for multipage files and thumbnail type (lossless vs. lossy)
294294 */
295295 function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
296 - global $wgImageMagickConvertCommand, $wgMaxImageAreaForVips,
 296+ global $wgImageMagickConvertCommand, $wgMaxImageAreaForVips,
297297 $wgTiffUseVips, $wgTiffVipsCommand, $wgMaxImageArea;
298298
299299 $meta = $this->getMetaArray( $image );
@@ -302,7 +302,7 @@
303303 $errors = PagedTiffHandler::joinMessages( $errors );
304304 if ( is_string( $errors ) ) {
305305 // TODO: original error as param // TESTME
306 - return $this->doThumbError( $params, 'tiff_bad_file' );
 306+ return $this->doThumbError( $params, 'tiff_bad_file' );
307307 } else {
308308 return $this->doThumbError( $params, 'tiff_no_metadata' );
309309 }
@@ -318,7 +318,7 @@
319319 $page = intval( $params['page'] );
320320 $page = $this->adjustPage( $image, $page );
321321
322 - if ( $flags & self::TRANSFORM_LATER ) {
 322+ if ( $flags & self::TRANSFORM_LATER ) {
323323 // pretend the thumbnail exists, let it be created by a 404-handler
324324 return new ThumbnailImage( $image, $dstUrl, $width, $height, $dstPath, $page );
325325 }
@@ -340,13 +340,13 @@
341341 if ( !$pagesize ) {
342342 return $this->doThumbError( $params, 'tiff_no_metadata' );
343343 }
344 - if ( isset( $meta['page_data'][$page]['pixels'] )
 344+ if ( isset( $meta['page_data'][$page]['pixels'] )
345345 && $meta['page_data'][$page]['pixels'] > $wgMaxImageAreaForVips )
346346 return $this->doThumbError( $params, 'tiff_sourcefile_too_large' );
347347
348348 if ( ( $width * $height ) > $wgMaxImageAreaForVips )
349 - return $this->doThumbError( $params, 'tiff_targetfile_too_large' );
350 -
 349+ return $this->doThumbError( $params, 'tiff_targetfile_too_large' );
 350+
351351 // Shrink factors must be > 1.
352352 if ( ( $pagesize['width'] > $width ) && ( $pagesize['height'] > $height ) ) {
353353 $xfac = $pagesize['width'] / $width;
@@ -366,7 +366,7 @@
367367 } else {
368368 if ( ( $width * $height ) > $wgMaxImageArea )
369369 return $this->doThumbError( $params, 'tiff_targetfile_too_large' );
370 - if ( isset( $meta['page_data'][$page]['pixels'] )
 370+ if ( isset( $meta['page_data'][$page]['pixels'] )
371371 && $meta['page_data'][$page]['pixels'] > $wgMaxImageArea )
372372 return $this->doThumbError( $params, 'tiff_sourcefile_too_large' );
373373 $cmd = wfEscapeShellArg( $wgImageMagickConvertCommand );
@@ -405,7 +405,7 @@
406406 // We have some other file pretending to be a tiff image.
407407 return $tiffImageThumbType;
408408 }
409 -
 409+
410410 if ( $params[ 'lossy' ] == 'lossy' ) {
411411 return array( 'jpg', 'image/jpeg' );
412412 } else {
@@ -447,7 +447,7 @@
448448 }
449449
450450 /**
451 - * Returns a page number within range.
 451+ * Returns a page number within range.
452452 */
453453 function adjustPage( $image, $page ) {
454454 $page = intval( $page );
@@ -473,7 +473,7 @@
474474 // no usable width/height in the parameter array
475475 // only happens if we don't have image meta-data, and no
476476 // size was specified by the user.
477 - // we need to pick *some* size, and the preferred
 477+ // we need to pick *some* size, and the preferred
478478 // thumbnail size seems sane.
479479 $sz = $wgUser->getOption( 'thumbsize' );
480480 $width = $wgThumbLimits[ $sz ];
@@ -488,7 +488,7 @@
489489 }
490490 }
491491
492 -
 492+
493493 return new MediaTransformError( 'thumbnail_error',
494494 $width, $height, wfMsg( $msg ) );
495495 }
@@ -522,7 +522,7 @@
523523
524524 $metadata = $this->getMetaArray( $image );
525525 if ( $metadata ) {
526 -
 526+
527527 return wfMsgExt(
528528 'tiff-file-info-size',
529529 'parseinline',
@@ -656,7 +656,7 @@
657657 */
658658 static function getTiffImage( $image, $path ) {
659659 // If no Image object is passed, a TiffImage is created based on $path .
660 - // If there is an Image object, we check whether there's already a TiffImage
 660+ // If there is an Image object, we check whether there's already a TiffImage
661661 // instance in there; if not, a new instance is created and stored in the Image object
662662 if ( !$image ) {
663663 $tiffimg = new PagedTiffImage( $path );
@@ -700,8 +700,8 @@
701701 * Returns false if unknown or if the document is not multi-page.
702702 */
703703 function getPageDimensions( $image, $page ) {
704 - // makeImageLink2 (Linker.php) sets $page to false if no page parameter
705 - // is set in wiki code
 704+ // makeImageLink2 (Linker.php) sets $page to false if no page parameter
 705+ // is set in wiki code
706706 $page = $this->adjustPage( $image, $page );
707707 $data = $this->getMetaArray( $image );
708708 return PagedTiffImage::getPageSize( $data, $page );
Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler.image.php
@@ -97,8 +97,8 @@
9898 //run hooks first, then optionally tiffinfo or, per default, ImageMagic's identify command
9999 if ( !wfRunHooks( 'PagedTiffHandlerTiffData', array( $this->mFilename, &$this->_meta ) ) ) {
100100 wfDebug( __METHOD__ . ": hook PagedTiffHandlerTiffData overrides TIFF data extraction\n" );
101 - } else if ( $wgTiffUseTiffinfo ) {
102 - // read TIFF directories using libtiff's tiffinfo, see
 101+ } elseif ( $wgTiffUseTiffinfo ) {
 102+ // read TIFF directories using libtiff's tiffinfo, see
103103 // http://www.libtiff.org/man/tiffinfo.1.html
104104 $cmd = wfEscapeShellArg( $wgTiffTiffinfoCommand ) .
105105 ' ' . wfEscapeShellArg( $this->mFilename ) . ' 2>&1';
@@ -134,7 +134,7 @@
135135 }
136136
137137 $this->_meta = $this->parseIdentifyOutput( $dump );
138 - }
 138+ }
139139
140140 $this->_meta['exif'] = array();
141141
@@ -142,13 +142,13 @@
143143 //run hooks first, then optionally Exiv2 or, per default, the internal EXIF class
144144 if ( !empty( $this->_meta['errors'] ) ) {
145145 wfDebug( __METHOD__ . ": found errors, skipping EXIF extraction\n" );
146 - } else if ( !wfRunHooks( 'PagedTiffHandlerExifData', array( $this->mFilename, &$this->_meta['exif'] ) ) ) {
 146+ } elseif ( !wfRunHooks( 'PagedTiffHandlerExifData', array( $this->mFilename, &$this->_meta['exif'] ) ) ) {
147147 wfDebug( __METHOD__ . ": hook PagedTiffHandlerExifData overrides EXIF extraction\n" );
148 - } else if ( $wgTiffUseExiv ) {
149 - // read EXIF, XMP, IPTC as name-tag => interpreted data
 148+ } elseif ( $wgTiffUseExiv ) {
 149+ // read EXIF, XMP, IPTC as name-tag => interpreted data
150150 // -ignore unknown fields
151151 // see exiv2-doc @link http://www.exiv2.org/sample.html
152 - // NOTE: the linux version of exiv2 has a bug: it can only
 152+ // NOTE: the linux version of exiv2 has a bug: it can only
153153 // read one type of meta-data at a time, not all at once.
154154 $cmd = wfEscapeShellArg( $wgTiffExivCommand ) .
155155 ' -u -psix -Pnt ' . wfEscapeShellArg( $this->mFilename ) . ' 2>&1';
@@ -168,14 +168,14 @@
169169 $data = $this->parseExiv2Output( $dump );
170170
171171 $this->_meta['exif'] = $data;
172 - } else if ( $wgShowEXIF ) {
 172+ } elseif ( $wgShowEXIF ) {
173173 wfDebug( __METHOD__ . ": using internal Exif( {$this->mFilename} )\n" );
174174 $exif = new Exif( $this->mFilename );
175175 $data = $exif->getFilteredData();
176176 if ( $data ) {
177177 $data['MEDIAWIKI_EXIF_VERSION'] = Exif::version();
178178 $this->_meta['exif'] = $data;
179 - }
 179+ }
180180 }
181181
182182 unset( $this->_meta['exif']['Image'] );
@@ -183,12 +183,12 @@
184184 unset( $this->_meta['exif']['Base filename'] );
185185 unset( $this->_meta['exif']['XMLPacket'] );
186186 unset( $this->_meta['exif']['ImageResources'] );
187 -
 187+
188188 $this->_meta['TIFF_METADATA_VERSION'] = TIFF_METADATA_VERSION;
189189
190190 wfProfileOut( 'PagedTiffImage::retrieveMetaData' );
191191 }
192 -
 192+
193193 return $this->_meta;
194194 }
195195
@@ -211,7 +211,7 @@
212212 $row = trim( $row );
213213
214214 # ignore XML rows
215 - if ( preg_match('/^<|^$/', $row) ) {
 215+ if ( preg_match('/^<|^$/', $row) ) {
216216 continue;
217217 }
218218
@@ -247,10 +247,10 @@
248248 # check if the next IFD is to be ignored
249249 $offset = (int)$m[1];
250250 $ignore = !empty( $ignoreIFDs[ $offset ] );
251 - } else if ( preg_match('#^(TIFF.*?Directory): (.*?/.*?): (.*)#i', $row, $m) ) {
 251+ } elseif ( preg_match('#^(TIFF.*?Directory): (.*?/.*?): (.*)#i', $row, $m) ) {
252252 # handle warnings
253253
254 - $bypass = false;
 254+ $bypass = false;
255255 $msg = $m[3];
256256
257257 foreach ( $wgTiffTiffinfoBypassMessages as $pattern ) {
@@ -263,7 +263,7 @@
264264 if ( !$bypass ) {
265265 $state->addWarning( $msg );
266266 }
267 - } else if ( preg_match('/^\s*(.*?)\s*:\s*(.*?)\s*$/', $row, $m) ) {
 267+ } elseif ( preg_match('/^\s*(.*?)\s*:\s*(.*?)\s*$/', $row, $m) ) {
268268 # handle key/value pair
269269
270270 $key = $m[1];
@@ -271,15 +271,15 @@
272272
273273 if ( $key == 'Page Number' && preg_match('/(\d+)-(\d+)/', $value, $m) ) {
274274 $state->setPageProperty('page', (int)$m[1] +1);
275 - } else if ( $key == 'Samples/Pixel' ) {
 275+ } elseif ( $key == 'Samples/Pixel' ) {
276276 if ($value == '4') $state->setPageProperty('alpha', 'true');
277 - } else if ( $key == 'Extra samples' ) {
 277+ } elseif ( $key == 'Extra samples' ) {
278278 if (preg_match('.*alpha.*', $value)) $state->setPageProperty('alpha', 'true');
279 - } else if ( $key == 'Image Width' || $key == 'PixelXDimension' ) {
 279+ } elseif ( $key == 'Image Width' || $key == 'PixelXDimension' ) {
280280 $state->setPageProperty('width', (int)$value);
281 - } else if ( $key == 'Image Length' || $key == 'PixelYDimension' ) {
 281+ } elseif ( $key == 'Image Length' || $key == 'PixelYDimension' ) {
282282 $state->setPageProperty('height', (int)$value);
283 - } else if ( preg_match('/.*IFDOffset/', $key) ) {
 283+ } elseif ( preg_match('/.*IFDOffset/', $key) ) {
284284 # ignore extra IFDs, see <http://www.awaresystems.be/imaging/tiff/tifftags/exififd.html>
285285 # Note: we assume that we will always see the reference before the actual IFD, so we know which IFDs to ignore
286286 $offset = (int)$value;
@@ -358,7 +358,7 @@
359359 $state->finishPage();
360360 }
361361
362 -
 362+
363363 $dump = preg_replace( '/\[BEGIN\](.+?)\[END\]/si', '', $dump );
364364 if ( strlen( $dump ) ) {
365365 $errors = explode( "\n", $dump );
@@ -444,7 +444,7 @@
445445 if ( $this->prevPage >= $this->page['page'] ) {
446446 $this->metadata['errors'][] = "inconsistent page numbering in TIFF directory";
447447 return false;
448 - }
 448+ }
449449 }
450450
451451 if ( isset( $this->page['width'] ) && isset( $this->page['height'] ) ) {
Index: trunk/extensions/ReaderFeedback/phplot-5.0.5/phplot.php
@@ -68,7 +68,7 @@
6969 var $y_precision = 1;
7070 var $x_precision = 1;
7171
72 - var $data_units_text = ''; // Units text for 'data' labels (i.e: '�', '$', etc.)
 72+ var $data_units_text = ''; // Units text for 'data' labels (i.e: '�', '$', etc.)
7373
7474 // Titles
7575 var $title_txt = '';
@@ -581,7 +581,7 @@
582582 {
583583 if (is_null($which_data) && is_array($this->data_colors)) {
584584 // use already set data_colors
585 - } else if (! is_array($which_data)) {
 585+ } elseif (! is_array($which_data)) {
586586 $this->data_colors = ($which_data) ? array($which_data) : array('blue', 'red', 'green', 'orange');
587587 } else {
588588 $this->data_colors = $which_data;
@@ -609,7 +609,7 @@
610610 {
611611 if (is_null($which_br) && is_array($this->data_border_colors)) {
612612 // use already set data_border_colors
613 - } else if (! is_array($which_br)) {
 613+ } elseif (! is_array($which_br)) {
614614 // Create new array with specified color
615615 $this->data_border_colors = ($which_br) ? array($which_br) : array('black');
616616 } else {
@@ -635,7 +635,7 @@
636636 {
637637 if (is_null($which_err) && is_array($this->error_bar_colors)) {
638638 // use already set error_bar_colors
639 - } else if (! is_array($which_err)) {
 639+ } elseif (! is_array($which_err)) {
640640 $this->error_bar_colors = ($which_err) ? array($which_err) : array('black');
641641 } else {
642642 $this->error_bar_colors = $which_err;
@@ -707,7 +707,7 @@
708708 {
709709 if (is_null($which_lw)) {
710710 // Do nothing, use default value.
711 - } else if (is_array($which_lw)) {
 711+ } elseif (is_array($which_lw)) {
712712 // Did we get an array with line widths?
713713 $this->line_widths = $which_lw;
714714 } else {
@@ -723,7 +723,7 @@
724724 {
725725 if (is_null($which_ls)) {
726726 // Do nothing, use default value.
727 - } else if ( is_array($which_ls)) {
 727+ } elseif ( is_array($which_ls)) {
728728 // Did we get an array with line styles?
729729 $this->line_styles = $which_ls;
730730 } else {
@@ -1493,7 +1493,7 @@
14941494 * + Trigger a user-level error containing the error message.
14951495 * If no error handler was set up, the script will log the
14961496 * error and exit with non-zero status.
1497 - *
 1497+ *
14981498 * PrintError() and DrawError() are now equivalent. Both are provided for
14991499 * compatibility. (In earlier releases, PrintError sent the message to
15001500 * stdout only, and DrawError sent it in an image only.)
@@ -1574,15 +1574,15 @@
15751575 __FUNCTION__);
15761576 if (!$which_ydlp) return FALSE;
15771577 $this->y_data_label_pos = $which_ydlp;
1578 - //This bit in SetYDataLabelPos about plotleft is for those who were
 1578+ //This bit in SetYDataLabelPos about plotleft is for those who were
15791579 //using this function to set SetYTickLabelPos.
1580 - if ( ($which_ydlp == 'plotleft') || ($which_ydlp == 'plotright') ||
1581 - ($which_ydlp == 'both') || ($which_ydlp == 'yaxis') ) {
 1580+ if ( ($which_ydlp == 'plotleft') || ($which_ydlp == 'plotright') ||
 1581+ ($which_ydlp == 'both') || ($which_ydlp == 'yaxis') ) {
15821582
15831583 //Call sety_TICK_labelpos instead of sety_DATA_labelpos
15841584 $this->SetYTickLabelPos($which_ydlp);
15851585
1586 - } elseif ($which_ydlp != 'none') {
 1586+ } elseif ($which_ydlp != 'none') {
15871587 //right now its plotin or none
15881588 $this->y_data_label_pos = 'plotin';
15891589 }
@@ -1994,7 +1994,7 @@
19951995 {
19961996 if (is_null($which_pt)) {
19971997 // Do nothing, use default value.
1998 - } else if (is_array($which_pt)) {
 1998+ } elseif (is_array($which_pt)) {
19991999 // Did we get an array with point shapes?
20002000 $this->point_shapes = $which_pt;
20012001 } else {
@@ -2016,7 +2016,7 @@
20172017
20182018 if ($ps < $pt) {
20192019 $this->pad_array($this->point_sizes, $pt);
2020 - } else if ($pt > $ps) {
 2020+ } elseif ($pt > $ps) {
20212021 $this->pad_array($this->point_shapes, $ps);
20222022 }
20232023 return TRUE;
@@ -2031,7 +2031,7 @@
20322032 {
20332033 if (is_null($which_ps)) {
20342034 // Do nothing, use default value.
2035 - } else if (is_array($which_ps)) {
 2035+ } elseif (is_array($which_ps)) {
20362036 // Did we get an array with point sizes?
20372037 $this->point_sizes = $which_ps;
20382038 } else {
@@ -2045,7 +2045,7 @@
20462046
20472047 if ($ps < $pt) {
20482048 $this->pad_array($this->point_sizes, $pt);
2049 - } else if ($pt > $ps) {
 2049+ } elseif ($pt > $ps) {
20502050 $this->pad_array($this->point_shapes, $ps);
20512051 }
20522052
@@ -2613,7 +2613,7 @@
26142614 $this->x_left_margin = max($min_margin, $left_margin);
26152615 $this->x_right_margin = max($min_margin, $right_margin);
26162616 }
2617 -
 2617+
26182618 if ($this->GetCallback('debug_scale')) {
26192619 // (Too bad compact() doesn't work on class member variables...)
26202620 $this->DoCallback('debug_scale', __FUNCTION__, array(
@@ -2807,7 +2807,7 @@
28082808 // Note that the extra space due to group_frac_width and bar_extra_space will be
28092809 // evenly divided on each side of the group: the drawn bars are centered in the group.
28102810
2811 - // Within each bar's allocated space, if bar_width_adjust=1 the bar fills the
 2811+ // Within each bar's allocated space, if bar_width_adjust=1 the bar fills the
28122812 // space, otherwise it is centered.
28132813 // This is the actual drawn bar width:
28142814 $this->actual_bar_width = $this->record_bar_width * $this->bar_width_adjust;
@@ -2846,7 +2846,7 @@
28472847 $this->x_axis_position = 1;
28482848 elseif ($this->plot_min_y <= 0 && 0 <= $this->plot_max_y)
28492849 $this->x_axis_position = 0;
2850 - else
 2850+ else
28512851 $this->x_axis_position = $this->plot_min_y;
28522852 } else
28532853 $this->x_axis_position = min(max($this->plot_min_y, $this->x_axis_position), $this->plot_max_y);
@@ -3293,10 +3293,10 @@
32943294 if ($mode == 'scale') {
32953295 imagecopyresized($this->img, $im, $xorig, $yorig, 0, 0, $width, $height, $tile_width, $tile_height);
32963296 return TRUE;
3297 - } else if ($mode == 'centeredtile') {
 3297+ } elseif ($mode == 'centeredtile') {
32983298 $x0 = - floor($tile_width/2); // Make the tile look better
32993299 $y0 = - floor($tile_height/2);
3300 - } else if ($mode == 'tile') {
 3300+ } elseif ($mode == 'tile') {
33013301 $x0 = 0;
33023302 $y0 = 0;
33033303 }
@@ -3676,17 +3676,17 @@
36773677 * This is currently only used for Y data labels for bar charts.
36783678 */
36793679 function DrawDataLabel($which_font, $which_angle, $x_world, $y_world, $which_color, $which_text,
3680 - $which_halign = 'center', $which_valign = 'bottom', $x_adjustment=0, $y_adjustment=0)
 3680+ $which_halign = 'center', $which_valign = 'bottom', $x_adjustment=0, $y_adjustment=0)
36813681 {
36823682 $data_label = $this->FormatLabel('y', $which_text);
3683 - //since DrawDataLabel is going to be called alot - perhaps for speed it is better to
 3683+ //since DrawDataLabel is going to be called alot - perhaps for speed it is better to
36843684 //not use this if statement and just always assume which_font is x_label_font (ditto for color).
3685 - if ( empty($which_font) )
 3685+ if ( empty($which_font) )
36863686 $which_font = $this->x_label_font;
36873687
36883688 $which_angle = empty($which_angle)?'0':$this->x_label_angle;
36893689
3690 - if ( empty($which_color) )
 3690+ if ( empty($which_color) )
36913691 $which_color = $this->ndx_title_color;
36923692
36933693 $x_pixels = $this->xtr($x_world) + $x_adjustment;
@@ -3755,12 +3755,12 @@
37563756 ImageLine($this->img, $xpos, $this->plot_area[3], $xpos, $this->plot_area[1], $style);
37573757 }
37583758 // Lines from the bottom of the plot up to the max Y value at this X:
3759 - else if ($this->x_data_label_pos == 'plotdown') {
 3759+ elseif ($this->x_data_label_pos == 'plotdown') {
37603760 $ypos = $this->ytr($this->data_maxy[$row]);
37613761 ImageLine($this->img, $xpos, $ypos, $xpos, $this->plot_area[3], $style);
37623762 }
37633763 // Lines from the top of the plot down to the min Y value at this X:
3764 - else if ($this->x_data_label_pos == 'plotup') {
 3764+ elseif ($this->x_data_label_pos == 'plotup') {
37653765 $ypos = $this->ytr($this->data_miny[$row]);
37663766 ImageLine($this->img, $xpos, $this->plot_area[1], $xpos, $ypos, $style);
37673767 }
@@ -3921,13 +3921,13 @@
39223922 }
39233923 }
39243924 // Or only one column per row, one pie slice per row?
3925 - else if ($this->data_type == 'text-data-single') {
 3925+ elseif ($this->data_type == 'text-data-single') {
39263926 for ($i = 0; $i < $this->num_data_rows; $i++) {
39273927 $legend[$i] = $this->data[$i][0]; // Set the legend to column labels
39283928 $sumarr[$i] = $this->data[$i][1];
39293929 }
39303930 }
3931 - else if ($this->data_type == 'data-data') {
 3931+ elseif ($this->data_type == 'data-data') {
39323932 for ($i = 0; $i < $this->num_data_rows; $i++) {
39333933 for ($j = 2; $j < $this->num_recs[$i]; $j++) {
39343934 @ $sumarr[$j] += abs($this->data[$i][$j]);
@@ -4364,7 +4364,7 @@
43654365 $start_lines[$idx] = TRUE;
43664366 }
43674367 // Y data missing... should we leave a blank or not?
4368 - else if ($this->draw_broken_lines) {
 4368+ elseif ($this->draw_broken_lines) {
43694369 $start_lines[$idx] = FALSE;
43704370 }
43714371 } // end for
@@ -4498,7 +4498,7 @@
44994499 $start_lines[$idx] = TRUE;
45004500 }
45014501 // Y data missing... should we leave a blank or not?
4502 - else if ($this->draw_broken_lines) {
 4502+ elseif ($this->draw_broken_lines) {
45034503 $start_lines[$idx] = FALSE;
45044504 }
45054505 }
Index: trunk/extensions/regexBlock/regexBlockCore.php
@@ -563,7 +563,7 @@
564564 if ( $valid['ip'] == 1 ) {
565565 /* we blocked by IP */
566566 $user->mBlockreason = wfMsg( 'regexblock-reason-ip', $wgContactLink );
567 - } else if( $valid['exact'] == 1 ) {
 567+ } elseif( $valid['exact'] == 1 ) {
568568 /* we blocked by username exact match */
569569 $user->mBlockreason = wfMsg( 'regexblock-reason-name', $wgContactLink );
570570 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r90995Revert of changes in r90288 - changes of "else if" to "elseif" are fine in PH...yaron20:31, 28 June 2011

Status & tagging log