| Index: trunk/extensions/Collection/Collection.hooks.php |
| — | — | @@ -24,6 +24,11 @@ |
| 25 | 25 | class CollectionHooks { |
| 26 | 26 | /** |
| 27 | 27 | * Callback for hook SkinBuildSidebar |
| | 28 | + * |
| | 29 | + * @param $skin Skin |
| | 30 | + * @param $bar |
| | 31 | + * |
| | 32 | + * @return bool |
| 28 | 33 | */ |
| 29 | 34 | static function buildSidebar( $skin, &$bar ) { |
| 30 | 35 | global $wgUser; |
| — | — | @@ -38,6 +43,11 @@ |
| 39 | 44 | return true; |
| 40 | 45 | } |
| 41 | 46 | |
| | 47 | + /** |
| | 48 | + * @param $skin Skin |
| | 49 | + * @param $navUrls |
| | 50 | + * @return bool |
| | 51 | + */ |
| 42 | 52 | static function buildNavUrls( $skin, &$navUrls ) { |
| 43 | 53 | global $wgUser; |
| 44 | 54 | global $wgCollectionPortletForLoggedInUsersOnly; |
| — | — | @@ -53,6 +63,10 @@ |
| 54 | 64 | |
| 55 | 65 | /** |
| 56 | 66 | * Return HTML-code to be inserted as portlet |
| | 67 | + * |
| | 68 | + * @param $sk Skin |
| | 69 | + * |
| | 70 | + * @return string |
| 57 | 71 | */ |
| 58 | 72 | static function getPortlet( $sk ) { |
| 59 | 73 | global $wgRequest; |
| — | — | @@ -215,14 +229,18 @@ |
| 216 | 230 | return true; |
| 217 | 231 | } |
| 218 | 232 | |
| | 233 | + /** |
| | 234 | + * @param $title Title |
| | 235 | + * @param $skin Skin |
| | 236 | + * @param $mode string |
| | 237 | + * @return string |
| | 238 | + */ |
| 219 | 239 | static function renderBookCreatorBox( $title, $skin, $mode = '' ) { |
| 220 | 240 | global $wgCollectionStyleVersion; |
| 221 | | - global $wgJsMimeType; |
| 222 | 241 | global $wgOut; |
| 223 | 242 | global $wgScriptPath; |
| 224 | 243 | global $wgRequest; |
| 225 | 244 | |
| 226 | | - $jsPath = "$wgScriptPath/extensions/Collection/js"; |
| 227 | 245 | $imagePath = "$wgScriptPath/extensions/Collection/images"; |
| 228 | 246 | $ptext = $title->getPrefixedText(); |
| 229 | 247 | $oldid = $wgRequest->getVal( 'oldid', 0 ); |
| — | — | @@ -315,6 +333,14 @@ |
| 316 | 334 | . self::getBookCreatorBoxSuggestLink( $skin, $imagePath, $ajaxHint ); |
| 317 | 335 | } |
| 318 | 336 | |
| | 337 | + /** |
| | 338 | + * @param $sk Skin |
| | 339 | + * @param $imagePath |
| | 340 | + * @param $ajaxHint |
| | 341 | + * @param $title Title |
| | 342 | + * @param $oldid |
| | 343 | + * @return string |
| | 344 | + */ |
| 319 | 345 | static function getBookCreatorBoxAddRemoveLink( $sk, $imagePath, $ajaxHint, $title, $oldid ) { |
| 320 | 346 | $namespace = $title->getNamespace(); |
| 321 | 347 | $ptext = $title->getPrefixedText(); |
| Index: trunk/extensions/Collection/Collection.body.php |
| — | — | @@ -306,7 +306,6 @@ |
| 307 | 307 | |
| 308 | 308 | function renderBookCreatorPage( $referer, $par ) { |
| 309 | 309 | global $wgOut; |
| 310 | | - global $wgScriptPath; |
| 311 | 310 | global $wgUser; |
| 312 | 311 | global $wgJsMimeType; |
| 313 | 312 | |
| — | — | @@ -315,12 +314,8 @@ |
| 316 | 315 | |
| 317 | 316 | $wgOut->addWikiMsg( 'coll-book_creator_intro' ); |
| 318 | 317 | |
| 319 | | - $imagepath = "$wgScriptPath/extensions/Collection/images"; |
| 320 | | - $jspath = "$wgScriptPath/extensions/Collection/js"; |
| 321 | | - |
| 322 | 318 | $wgOut->addModules( 'ext.collection.checkLoadFromLocalStorage' ); |
| 323 | 319 | |
| 324 | | - $coll = CollectionSession::getCollection(); |
| 325 | 320 | $dialogtxt = wfMsg( 'coll-load_local_book' ); |
| 326 | 321 | |
| 327 | 322 | $wgOut->addScript( |
| — | — | @@ -464,17 +459,12 @@ |
| 465 | 460 | |
| 466 | 461 | function renderSpecialPage() { |
| 467 | 462 | global $wgCollectionFormats; |
| 468 | | - global $wgCollectionVersion; |
| 469 | | - global $wgJsMimeType; |
| 470 | | - global $wgScriptPath; |
| 471 | 463 | global $wgOut; |
| 472 | 464 | |
| 473 | 465 | if ( !CollectionSession::hasSession() ) { |
| 474 | 466 | CollectionSession::startSession(); |
| 475 | 467 | } |
| 476 | 468 | |
| 477 | | - $jspath = "$wgScriptPath/extensions/Collection/js"; |
| 478 | | - |
| 479 | 469 | $this->setHeaders(); |
| 480 | 470 | $wgOut->setPageTitle( wfMsg( 'coll-manage_your_book' ) ); |
| 481 | 471 | $wgOut->addModules( 'ext.collection' ); |
| — | — | @@ -541,10 +531,17 @@ |
| 542 | 532 | |
| 543 | 533 | static function addArticleFromName( $namespace, $name, $oldid = 0 ) { |
| 544 | 534 | $title = Title::makeTitleSafe( $namespace, $name ); |
| 545 | | - if ( !$title ) return false; |
| | 535 | + if ( !$title ) { |
| | 536 | + return false; |
| | 537 | + } |
| 546 | 538 | return self::addArticle( $title, $oldid ); |
| 547 | 539 | } |
| 548 | 540 | |
| | 541 | + /** |
| | 542 | + * @param $title Title |
| | 543 | + * @param $oldid int |
| | 544 | + * @return bool |
| | 545 | + */ |
| 549 | 546 | static function addArticle( $title, $oldid = 0 ) { |
| 550 | 547 | global $wgCollectionHierarchyDelimiter; |
| 551 | 548 | |
| — | — | @@ -598,6 +595,11 @@ |
| 599 | 596 | return self::removeArticle( $title, $oldid ); |
| 600 | 597 | } |
| 601 | 598 | |
| | 599 | + /** |
| | 600 | + * @param $title Title |
| | 601 | + * @param $oldid int |
| | 602 | + * @return bool |
| | 603 | + */ |
| 602 | 604 | static function removeArticle( $title, $oldid = 0 ) { |
| 603 | 605 | if ( !CollectionSession::hasSession() ) { |
| 604 | 606 | return false; |
| — | — | @@ -773,6 +775,11 @@ |
| 774 | 776 | return null; |
| 775 | 777 | } |
| 776 | 778 | |
| | 779 | + /** |
| | 780 | + * @param $title Title |
| | 781 | + * @param $append bool |
| | 782 | + * @return array|bool |
| | 783 | + */ |
| 777 | 784 | function loadCollection( $title, $append = false ) { |
| 778 | 785 | global $wgOut; |
| 779 | 786 | |
| — | — | @@ -1011,7 +1018,7 @@ |
| 1012 | 1019 | } |
| 1013 | 1020 | |
| 1014 | 1021 | function renderRenderingPage() { |
| 1015 | | - global $wgCollectionVersion, $wgJsMimeType, $wgLang, $wgOut, $wgRequest, $wgScriptPath; |
| | 1022 | + global $wgLang, $wgOut, $wgRequest; |
| 1016 | 1023 | |
| 1017 | 1024 | $response = self::mwServeCommand( 'render_status', array( |
| 1018 | 1025 | 'collection_id' => $wgRequest->getVal( 'collection_id' ), |
| — | — | @@ -1118,6 +1125,12 @@ |
| 1119 | 1126 | $wgOut->disable(); |
| 1120 | 1127 | } |
| 1121 | 1128 | |
| | 1129 | + /** |
| | 1130 | + * @param $title Title |
| | 1131 | + * @param $oldid |
| | 1132 | + * @param $writer |
| | 1133 | + * @return |
| | 1134 | + */ |
| 1122 | 1135 | function renderArticle( $title, $oldid, $writer ) { |
| 1123 | 1136 | global $wgOut; |
| 1124 | 1137 | |