r77851 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77850‎ | r77851 | r77852 >
Date:01:49, 6 December 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Some cleanup
Modified paths:
  • /trunk/extensions/DSMW/DSMW.hooks.php (modified) (history)
  • /trunk/extensions/DSMW/DSMW.php (modified) (history)
  • /trunk/extensions/DSMW/INSTALL (modified) (history)
  • /trunk/extensions/DSMW/files/utils.php (modified) (history)
  • /trunk/extensions/DSMW/includes/DSMW_Patch.php (added) (history)
  • /trunk/extensions/DSMW/includes/IntegrationFunctions.php (modified) (history)
  • /trunk/extensions/DSMW/jobs/DSMWUpdateJob.php (modified) (history)
  • /trunk/extensions/DSMW/patch/Patch.php (deleted) (history)
  • /trunk/extensions/DSMW/specialPage/ArticleAdminPage.php (modified) (history)
  • /trunk/extensions/DSMW/specialPage/DSMWGeneralExhibits.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DSMW/DSMW.hooks.php
@@ -655,7 +655,7 @@
656656 $listOp1 = $logoot1->generate( $text, $actualtext );
657657 // creation Patch P2
658658 $tmp = serialize( $listOp1 );
659 - $patch = new Patch( false, false, $listOp1, $urlServer, $rev_id1 );
 659+ $patch = new DSMWPatch( false, false, $listOp1, $urlServer, $rev_id1 );
660660
661661 if ( $editpage->mTitle->getNamespace() == 0 ) {
662662 $title = $editpage->mTitle->getText();
@@ -671,7 +671,7 @@
672672 $listOp = $logoot->generate( $conctext, $actualtext );
673673 $modelAfterIntegrate = $logoot->getModel();
674674 $tmp = serialize( $listOp );
675 - $patch = new Patch( false, false, $listOp, $urlServer, $rev_id1 );
 675+ $patch = new DSMWPatch( false, false, $listOp, $urlServer, $rev_id1 );
676676
677677 if ( $editpage->mTitle->getNamespace() == 0 )
678678 $title = $editpage->mTitle->getText();
@@ -720,7 +720,7 @@
721721
722722 $revID = $lastRevision->getId();
723723 $model = DSMWRevisionManager::loadModel( $rev_id );
724 - $patch = new Patch( false, true, null, $urlServer, $rev_id, null, null, null, $localfile->mime, $localfile->size, urldecode( $localfile->url ), null );
 724+ $patch = new DSMWPatch( false, true, null, $urlServer, $rev_id, null, null, null, $localfile->mime, $localfile->size, urldecode( $localfile->url ), null );
725725 $patch->storePage( $localfile->getTitle(), $revID ); // stores the patch in a wikipage
726726 DSMWRevisionManager::storeModel( $revID, $sessionId = session_id(), $model, $blobCB = 0 );
727727 }
Index: trunk/extensions/DSMW/jobs/DSMWUpdateJob.php
@@ -104,10 +104,10 @@
105105 $mime = $a['mime'];
106106 $size = $a['size'];
107107 $url = $a['url'];
108 - $patch = new Patch( false, true, null, $urlServer . $wgScriptPath, 0, null, null, null, $mime, $size, $url, null );
 108+ $patch = new DSMWPatch( false, true, null, $urlServer . $wgScriptPath, 0, null, null, null, $mime, $size, $url, null );
109109 $patch->storePage( 'File:' . $lastRev->getTitle()->getText(), $lastRev->getId() );
110110 } else {
111 - $patch = new Patch( false, false, $listOp, $urlServer, 0 );
 111+ $patch = new DSMWPatch( false, false, $listOp, $urlServer, 0 );
112112 $patch->storePage( $lastRev->getTitle()->getText(), $lastRev->getId() );
113113 }
114114
Index: trunk/extensions/DSMW/patch/Patch.php
@@ -1,194 +0,0 @@
2 -<?php
3 -
4 -/**
5 - * Object that wraps an operation list and other features concerning an article
6 - * page.
7 - *
8 - * @copyright INRIA-LORIA-ECOO project
9 - * @author muller jean-philippe & Morel Émile
10 - */
11 -class Patch {
12 -
13 - private $mPatchId;
14 - private $mOperations = array();
15 - private $mPrevPatch;
16 - private $mCausal;
17 - private $mSiteId;
18 - private $mSiteUrl;
19 - private $mRemote;
20 - private $mAttachment;
21 - private $mMime;
22 - private $mSize;
23 - private $mUrl;
24 - private $mDate;
25 - private $mID;
26 -
27 - /**
28 - *
29 - * @param <bool> $remote
30 - * @param <bool> $attachment
31 - * @param <array> $operations
32 - * @param <string> $siteUrl
33 - * @param <array> $causalLink
34 - * @param <string> $patchid
35 - * @param <string> $previousPatch
36 - * @param <string> $siteID
37 - * @param <string> $Mime
38 - * @param <string> $Size
39 - * @param <string> $Url
40 - * @param <string> $Date
41 - */
42 - public function __construct( $remote, $attachment, $operations, $siteUrl = '', $causalLink = '', $patchid = '', $previousPatch = '', $siteID = '', $Mime = '', $Size = '', $Url = '', $Date = '' ) {
43 - global $wgServer;
44 -
45 - $this->mRemote = $remote;
46 - $this->mID = utils::generateID();
47 -
48 - if ( $remote == true ) {
49 - $this->mPatchId = $patchid;
50 - $this->mSiteId = $siteID;
51 - $this->mID = $patchid;
52 - } else {
53 - $this->mPatchId = "Patch:" . $this->mID;
54 - $this->mSiteId = DSMWSiteId::getInstance()->getSiteId();
55 - }
56 -
57 - $this->mOperations = $operations;
58 - $this->mPrevPatch = $previousPatch;
59 - $this->mSiteUrl = $siteUrl;
60 - $this->mCausal = $causalLink;
61 -
62 - $this->mAttachment = $attachment;
63 - if ( $attachment == true ) {
64 - $this->mMime = $Mime;
65 - $this->mSize = $Size;
66 - if ( $remote ) {
67 - $this->mDate = $Date;
68 - $this->mUrl = $Url;
69 - }
70 - else {
71 - $this->mDate = date( DATE_RFC822 );
72 - $this->mPatchId = "Patch:ATT" . $this->mID;
73 - $this->mUrl = $wgServer . $Url;
74 - $this->mID = "Patch:ATT" . $this->mID;
75 - }
76 - }
77 - }
78 -
79 - public function storePage( $pageName, $rev ) {
80 - global $wgUser;
81 - $text = '
82 -[[Special:ArticleAdminPage|DSMW Admin functions]]
83 -
84 -==Features==
85 -[[patchID::' . $this->mPatchId . '| ]]
86 -
87 -\'\'\'SiteID:\'\'\' [[siteID::' . $this->mSiteId . ']]
88 -
89 -\'\'\'SiteUrl:\'\'\' [[siteUrl::' . $this->mSiteUrl . ']]
90 -
91 -\'\'\'Rev:\'\'\' [[Rev::' . $rev . ']]
92 -
93 -';
94 -
95 - if ( $this->mRemote ) {
96 - $text .= '\'\'\'Remote Patch\'\'\'
97 -
98 -';
99 - } else {
100 - $this->mPrevPatch = utils::getLastPatchId( $pageName );
101 - if ( $this->mPrevPatch == false ) {
102 - $this->mPrevPatch = "none";
103 - }
104 - $this->mCausal = utils::searchCausalLink( $pageName, $this->mCausal );
105 - }
106 -
107 -
108 - $text .= '\'\'\'Date:\'\'\' ' . date( DATE_RFC822 ) . '
109 -
110 -';
111 - if ( $this->mAttachment ) {
112 - $text .= '\'\'\'Date of upload of the Attachment:\'\'\' [[DateAtt::' . $this->mDate . ']]
113 -
114 -\'\'\'Mime:\'\'\' [[Mime::' . $this->mMime . ']]
115 -
116 -\'\'\'Size:\'\'\' [[Size::' . $this->mSize . ']]
117 -
118 -\'\'\'Url:\'\'\' [[Url::' . $this->mUrl . ']]
119 -
120 -';
121 - }
122 - $text .= '\'\'\'User:\'\'\' ' . $wgUser->getName() . '
123 -
124 -This is a patch of the article: [[onPage::' . $pageName . ']] <br>
125 -
126 -';
127 - if ( $this->mAttachment == false ) {
128 - $text .= '==Operations of the patch==
129 -
130 -{| class="wikitable" border="1" style="text-align:left; width:80%;"
131 -|-
132 -!bgcolor=#c0e8f0 scope=col | Type
133 -!bgcolor=#c0e8f0 scope=col | Content
134 -|-
135 -';
136 - if ( $this->mRemote == true ) {
137 - foreach ( $this->mOperations as $op ) {
138 - $opArr = explode( ";", $op );
139 - $text .= '|[[hasOperation::' . $op . '| ]]' . $opArr[1] . '
140 -|<nowiki>' . utils::contentDecoding( $opArr[3] ) . '</nowiki>
141 -|-
142 -';
143 - }
144 - } else {
145 - $i = 1; // op counter
146 - foreach ( $this->mOperations as $operation ) {
147 - $lineContent = $operation->getLineContent();
148 - $lineContent1 = utils::contentEncoding( $lineContent ); // base64 encoding
149 - $type = $operation instanceof LogootIns ? 'Insert' : 'Delete';
150 -
151 - $operationID = utils::generateID();
152 - $text .= '|[[hasOperation::' . $operationID . ';' . $type . ';'
153 - . $operation->getLogootPosition()->toString() . ';' . $lineContent1 . '| ]]' . $type;
154 -
155 - // displayed text
156 - $lineContent2 = $lineContent;
157 - $text .= '
158 -|<nowiki>' . $lineContent2 . '</nowiki>
159 -|-
160 -';
161 - }
162 - }
163 -
164 - $text .= '|}';
165 - }
166 - if ( is_array( $this->mPrevPatch ) ) {
167 - $text .= '
168 -
169 -==Previous patch(es)==
170 -[[previous::';
171 - foreach ( $this->mPrevPatch as $prev ) {
172 - $text .= $prev . ';';
173 - }
174 - $text .= ']]';
175 - } else {
176 - $text .= '
177 -
178 -==Previous patch(es)==
179 -[[previous::' . $this->mPrevPatch . ']]';
180 - }
181 - $text .= '
182 -
183 -==Causal Link==
184 -[[causal::' . $this->mCausal . ']]';
185 -
186 - $title = Title::newFromText( $this->mID, PATCH );
187 - $article = new Article( $title );
188 - $article->doEdit( $text, $summary = "" );
189 - }
190 -
191 - protected function splitLine( $line ) {
192 - return implode( '<br>', str_split( $line, 150 ) ) . '<br />';
193 - }
194 -
195 -}
Index: trunk/extensions/DSMW/DSMW.php
@@ -74,9 +74,8 @@
7575
7676 $wgAutoloadClasses['DSMWRevisionManager'] = dirname( __FILE__ ) . '/includes/DSMW_RevisionManager.php';
7777 $wgAutoloadClasses['DSMWPersistentClock'] = dirname( __FILE__ ) . '/includes/DSMW_PersistentClock.php';
 78+$wgAutoloadClasses['DSMWPatch'] = dirname( __FILE__ ) . '/includes/DSMW_Patch.php';
7879
79 -$wgAutoloadClasses['Patch'] = "$wgDSMWIP/patch/Patch.php";
80 -
8180 $wgAutoloadClasses['ApiQueryPatch'] = "$wgDSMWIP/api/ApiQueryPatch.php";
8281 $wgAutoloadClasses['ApiQueryChangeSet'] = "$wgDSMWIP/api/ApiQueryChangeSet.php";
8382 $wgAutoloadClasses['ApiUpload'] = "$wgDSMWIP/api/upload/ApiUpload.php";
Index: trunk/extensions/DSMW/files/utils.php
@@ -357,6 +357,7 @@
358358 *
359359 * @param <String> $pageName
360360 * @param <Integer> $rev
 361+ *
361362 * @return <String> the causal link
362363 */
363364 static function searchCausalLink( $pageName, $rev ) {
@@ -364,13 +365,27 @@
365366 return 'none';
366367 } else {
367368 $res = utils::getSemanticQuery( '[[Patch:+]][[onPage::' . $pageName . ']][[Rev::' . $rev . ']]', '?PatchID' );
368 - if ( $res === false ) return 'none';
 369+
 370+ if ( $res === false ) {
 371+ return 'none';
 372+ }
 373+
369374 $count1 = $res->getCount();
 375+
370376 for ( $j = 0; $j < $count1; $j++ ) {
371 -
372 - $row1 = $res->getNext();
373 - if ( $row1 === false )
374 - break;
 377+
 378+ if ( is_object($res) ) {
 379+ $row1 = $res->getNext();
 380+ }
 381+ else {
 382+ break;
 383+ }
 384+
 385+
 386+ if ( $row1 === false ) {
 387+ break;
 388+ }
 389+
375390 $row1 = $row1[0];
376391
377392 $col1 = $row1->getContent(); // SMWResultArray object
@@ -710,17 +725,17 @@
711726 }
712727
713728 /**
714 - *
715729 * @param <String> $query (e.g. [[ChangeSet:+]][[inPullFeed::Pullfeed:xxxxx]])
716730 * @param <String> $paramstring Printout parameters (e.g. ?hasPatch?changeSetID)
717 - * @return <Object> SMWQueryResult object
 731+ *
 732+ * @return SMWQueryResult or false
718733 */
719 -
720734 static public function getSemanticQuery( $query, $paramstring = '' ) {
721735 $printouts = array();
722736 $rawparams = array();
723737 $params = array( 'format' => ' ', 'sort' => ' ', 'offset' => 0 );
724738 $rawparams[] = $query;
 739+
725740 if ( $paramstring != '' ) {
726741 $ps = explode( "\n", $paramstring );
727742 foreach ( $ps as $param ) {
@@ -738,7 +753,10 @@
739754 $queryobj->setLimit( 5000 );
740755 $res = smwfGetStore()->getQueryResult( $queryobj );
741756
742 - if ( !( $res instanceof SMWQueryResult ) )return false;
 757+ if ( !( $res instanceof SMWQueryResult ) ) {
 758+ return false;
 759+ }
 760+
743761 return $res;
744762 }
745763
Index: trunk/extensions/DSMW/INSTALL
@@ -1,4 +1,4 @@
2 -[[Distributed Semantic MediaWiki 1.0]]
 2+[[Distributed Semantic MediaWiki 1.1]]
33
44 Contents:
55 * Disclaimer
@@ -15,6 +15,7 @@
1616 provided).
1717
1818 == Requirements ==
 19+
1920 DSMW has been developped on MW 1.14.0. DSMW-0.3.1 and DSMW-0.3.2 has been tested
2021 with version MW-1.13.2, MW-1.14.0, MW-1.15.0 and MW-1.15.1.
2122 The DSMW extension requires an install of Semantic MediaWiki 1.4.2 or 1.4.3
@@ -22,13 +23,11 @@
2324 For more details, see those extensions'own
2425 installation requirements.
2526
26 -
2727 Important: If you want to run the DSMW tests, you must make a dump of your
2828 database immediatly after having installed DSMW but before using DSMW.
2929 For more details, see the readme file in the tests directory
3030 [wikipath]/extensions/DSMW/tests.
3131
32 -
3332 == Installation ==
3433
3534 '''Remark:''' Follow these different points carefully for a successful
@@ -74,10 +73,7 @@
7574 include_once("$IP/extensions/SemanticMediaWiki/includes/SMW_Settings.php");
7675 enableSemantics($_SERVER['SERVER_NAME']);
7776
78 -
79 -
8077 == Contact ==
8178
8279 If you have any issues or questions, please consult:
8380 https://gforge.inria.fr/projects/m3p/
84 -
Index: trunk/extensions/DSMW/includes/DSMW_Patch.php
@@ -0,0 +1,194 @@
 2+<?php
 3+
 4+/**
 5+ * Object that wraps an operation list and other features concerning an article
 6+ * page.
 7+ *
 8+ * @copyright INRIA-LORIA-ECOO project
 9+ * @author muller jean-philippe & Morel Émile
 10+ */
 11+class DSMWPatch {
 12+
 13+ private $mPatchId;
 14+ private $mOperations = array();
 15+ private $mPrevPatch;
 16+ private $mCausal;
 17+ private $mSiteId;
 18+ private $mSiteUrl;
 19+ private $mRemote;
 20+ private $mAttachment;
 21+ private $mMime;
 22+ private $mSize;
 23+ private $mUrl;
 24+ private $mDate;
 25+ private $mID;
 26+
 27+ /**
 28+ *
 29+ * @param <bool> $remote
 30+ * @param <bool> $attachment
 31+ * @param <array> $operations
 32+ * @param <string> $siteUrl
 33+ * @param <array> $causalLink
 34+ * @param <string> $patchid
 35+ * @param <string> $previousPatch
 36+ * @param <string> $siteID
 37+ * @param <string> $Mime
 38+ * @param <string> $Size
 39+ * @param <string> $Url
 40+ * @param <string> $Date
 41+ */
 42+ public function __construct( $remote, $attachment, $operations, $siteUrl = '', $causalLink = '', $patchid = '', $previousPatch = '', $siteID = '', $Mime = '', $Size = '', $Url = '', $Date = '' ) {
 43+ global $wgServer;
 44+
 45+ $this->mRemote = $remote;
 46+ $this->mID = utils::generateID();
 47+
 48+ if ( $remote == true ) {
 49+ $this->mPatchId = $patchid;
 50+ $this->mSiteId = $siteID;
 51+ $this->mID = $patchid;
 52+ } else {
 53+ $this->mPatchId = "Patch:" . $this->mID;
 54+ $this->mSiteId = DSMWSiteId::getInstance()->getSiteId();
 55+ }
 56+
 57+ $this->mOperations = $operations;
 58+ $this->mPrevPatch = $previousPatch;
 59+ $this->mSiteUrl = $siteUrl;
 60+ $this->mCausal = $causalLink;
 61+
 62+ $this->mAttachment = $attachment;
 63+ if ( $attachment == true ) {
 64+ $this->mMime = $Mime;
 65+ $this->mSize = $Size;
 66+ if ( $remote ) {
 67+ $this->mDate = $Date;
 68+ $this->mUrl = $Url;
 69+ }
 70+ else {
 71+ $this->mDate = date( DATE_RFC822 );
 72+ $this->mPatchId = "Patch:ATT" . $this->mID;
 73+ $this->mUrl = $wgServer . $Url;
 74+ $this->mID = "Patch:ATT" . $this->mID;
 75+ }
 76+ }
 77+ }
 78+
 79+ public function storePage( $pageName, $rev ) {
 80+ global $wgUser;
 81+ $text = '
 82+[[Special:ArticleAdminPage|DSMW Admin functions]]
 83+
 84+==Features==
 85+[[patchID::' . $this->mPatchId . '| ]]
 86+
 87+\'\'\'SiteID:\'\'\' [[siteID::' . $this->mSiteId . ']]
 88+
 89+\'\'\'SiteUrl:\'\'\' [[siteUrl::' . $this->mSiteUrl . ']]
 90+
 91+\'\'\'Rev:\'\'\' [[Rev::' . $rev . ']]
 92+
 93+';
 94+
 95+ if ( $this->mRemote ) {
 96+ $text .= '\'\'\'Remote Patch\'\'\'
 97+
 98+';
 99+ } else {
 100+ $this->mPrevPatch = utils::getLastPatchId( $pageName );
 101+ if ( $this->mPrevPatch == false ) {
 102+ $this->mPrevPatch = "none";
 103+ }
 104+ $this->mCausal = utils::searchCausalLink( $pageName, $this->mCausal );
 105+ }
 106+
 107+
 108+ $text .= '\'\'\'Date:\'\'\' ' . date( DATE_RFC822 ) . '
 109+
 110+';
 111+ if ( $this->mAttachment ) {
 112+ $text .= '\'\'\'Date of upload of the Attachment:\'\'\' [[DateAtt::' . $this->mDate . ']]
 113+
 114+\'\'\'Mime:\'\'\' [[Mime::' . $this->mMime . ']]
 115+
 116+\'\'\'Size:\'\'\' [[Size::' . $this->mSize . ']]
 117+
 118+\'\'\'Url:\'\'\' [[Url::' . $this->mUrl . ']]
 119+
 120+';
 121+ }
 122+ $text .= '\'\'\'User:\'\'\' ' . $wgUser->getName() . '
 123+
 124+This is a patch of the article: [[onPage::' . $pageName . ']] <br>
 125+
 126+';
 127+ if ( $this->mAttachment == false ) {
 128+ $text .= '==Operations of the patch==
 129+
 130+{| class="wikitable" border="1" style="text-align:left; width:80%;"
 131+|-
 132+!bgcolor=#c0e8f0 scope=col | Type
 133+!bgcolor=#c0e8f0 scope=col | Content
 134+|-
 135+';
 136+ if ( $this->mRemote == true ) {
 137+ foreach ( $this->mOperations as $op ) {
 138+ $opArr = explode( ";", $op );
 139+ $text .= '|[[hasOperation::' . $op . '| ]]' . $opArr[1] . '
 140+|<nowiki>' . utils::contentDecoding( $opArr[3] ) . '</nowiki>
 141+|-
 142+';
 143+ }
 144+ } else {
 145+ $i = 1; // op counter
 146+ foreach ( $this->mOperations as $operation ) {
 147+ $lineContent = $operation->getLineContent();
 148+ $lineContent1 = utils::contentEncoding( $lineContent ); // base64 encoding
 149+ $type = $operation instanceof LogootIns ? 'Insert' : 'Delete';
 150+
 151+ $operationID = utils::generateID();
 152+ $text .= '|[[hasOperation::' . $operationID . ';' . $type . ';'
 153+ . $operation->getLogootPosition()->toString() . ';' . $lineContent1 . '| ]]' . $type;
 154+
 155+ // displayed text
 156+ $lineContent2 = $lineContent;
 157+ $text .= '
 158+|<nowiki>' . $lineContent2 . '</nowiki>
 159+|-
 160+';
 161+ }
 162+ }
 163+
 164+ $text .= '|}';
 165+ }
 166+ if ( is_array( $this->mPrevPatch ) ) {
 167+ $text .= '
 168+
 169+==Previous patch(es)==
 170+[[previous::';
 171+ foreach ( $this->mPrevPatch as $prev ) {
 172+ $text .= $prev . ';';
 173+ }
 174+ $text .= ']]';
 175+ } else {
 176+ $text .= '
 177+
 178+==Previous patch(es)==
 179+[[previous::' . $this->mPrevPatch . ']]';
 180+ }
 181+ $text .= '
 182+
 183+==Causal Link==
 184+[[causal::' . $this->mCausal . ']]';
 185+
 186+ $title = Title::newFromText( $this->mID, PATCH );
 187+ $article = new Article( $title );
 188+ $article->doEdit( $text, $summary = "" );
 189+ }
 190+
 191+ protected function splitLine( $line ) {
 192+ return implode( '<br>', str_split( $line, 150 ) ) . '<br />';
 193+ }
 194+
 195+}
Property changes on: trunk/extensions/DSMW/includes/DSMW_Patch.php
___________________________________________________________________
Added: svn:eol-style
1196 + native
Index: trunk/extensions/DSMW/includes/IntegrationFunctions.php
@@ -128,7 +128,7 @@
129129 if ( $sub === 'ATT' ) {
130130 $rev = logootIntegrateAtt( $onPage, $edit );
131131 if ( $rev > 0 ) {
132 - $patch = new Patch( true, true, $operations, $SiteUrl, $causal, $patchId, $lastPatch, $siteID, $Mime, $Size, $Url, $Date );
 132+ $patch = new DSMWPatch( true, true, $operations, $SiteUrl, $causal, $patchId, $lastPatch, $siteID, $Mime, $Size, $Url, $Date );
133133 $patch->storePage( $onPage, $rev );
134134 } else {
135135 throw new MWException( __METHOD__ . ': article not saved!' );
@@ -138,7 +138,7 @@
139139 else {
140140 $rev = logootIntegrate( $operations, $onPage, $sub );
141141 if ( $rev > 0 ) {
142 - $patch = new Patch( true, false, $operations, $SiteUrl, $causal, $patchId, $lastPatch, $siteID, null, null, null, null );
 142+ $patch = new DSMWPatch( true, false, $operations, $SiteUrl, $causal, $patchId, $lastPatch, $siteID, null, null, null, null );
143143 $patch->storePage( $onPage, $rev );
144144 }
145145 else {
Index: trunk/extensions/DSMW/specialPage/ArticleAdminPage.php
@@ -4,15 +4,13 @@
55 * DSMW Special page
66 *
77 * @copyright INRIA-LORIA-ECOO project
 8+ *
89 * @author Hantz Marlene - jean-Philippe Muller
910 */
10 -require_once "$IP/includes/SpecialPage.php";
11 -require_once "$wgDSMWIP/files/utils.php";
12 -
1311 class ArticleAdminPage extends SpecialPage {
1412
1513 public function __construct() {
16 - global $wgHooks, $wgSpecialPages, $wgWatchingMessages;
 14+ global $wgHooks;
1715
1816 # Add all our needed hooks
1917 $wgHooks["UnknownAction"][] = $this;
@@ -545,6 +543,7 @@
546544 return true;
547545 }
548546 }
 547+
549548 /**
550549 * Defines the "Article Admin tab"
551550 *
@@ -599,7 +598,7 @@
600599 return false;
601600 }
602601
603 - /**
 602+ /**
604603 * Defines the "Article Admin tab"
605604 *
606605 * @global <type> $wgRequest
Index: trunk/extensions/DSMW/specialPage/DSMWGeneralExhibits.php
@@ -6,11 +6,9 @@
77 * TODO: only load when SRF is available?
88 *
99 * @copyright INRIA-LORIA-SCORE Team
 10+ *
1011 * @author jean-Philippe Muller
1112 */
12 -
13 -require_once "$IP/includes/SpecialPage.php";
14 -
1513 class DSMWGeneralExhibits extends SpecialPage {
1614
1715 public function __construct() {
@@ -27,34 +25,10 @@
2826 * (This special page works only when the Semantic Results Format extension is installed)
2927 *
3028 * There are 3 links used to see informations about Patches, PullFeeds or PushFeeds
31 - *
32 - *
3329 */
3430 public function execute() {
35 - global $wgOut, $wgRequest, $wgServerName, $wgScriptPath, $wgDSMWIP, $wgServerName, $wgScriptPath;
 31+ global $wgOut, $wgRequest;
3632
37 - // If the Semantic Results Format isn't installed, a blank warning page appears
38 -// if (!defined('SRF_VERSION')) {
39 -// $wgOut->disable(); // raw output
40 -// ob_start();
41 -// print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\" dir=\"ltr\">\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>DSMW General Exhibits</title></head><body><p><pre>";
42 -// header( "Content-type: text/html; charset=UTF-8" );
43 -//
44 -// print '</pre></p>';
45 -// print '<p><b>In order to use this feature, you must have installed the Semantic Results Format extension.</b></p>';
46 -// $SRFUrl = 'http://www.mediawiki.org/wiki/Extension:Semantic_Result_Formats';
47 -// print '<p> <a href="' . htmlspecialchars($SRFUrl) . '">Extension:Semantic_Result_Formats</a></p>';
48 -// $returntitle = Title::makeTitle(NS_SPECIAL, 'SpecialPages');
49 -// print '<p> <a href="' . htmlspecialchars($returntitle->getFullURL()) . '"> Back to Special:SpecialPages</a></p>';
50 -// print '</body></html>';
51 -// ob_flush();
52 -// flush();
53 -// return;
54 -// }
55 -
56 -
57 - $wgOut->setPagetitle( "DSMW General Exhibits" );
58 -
5933 $output = '<p>This page displays general informations about Distributed Semantic MediaWiki.</p>';
6034
6135 $returntitle1 = Title::makeTitle( NS_SPECIAL, 'DSMWGeneralExhibits' );
@@ -146,6 +120,6 @@
147121 $wgOut->addWikiText( $wikitext );
148122
149123 return false;
150 - }// end execute fct
 124+ }
151125
152126 }

Status & tagging log