r41427 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41426‎ | r41427 | r41428 >
Date:16:00, 30 September 2008
Author:dale
Status:old
Tags:
Comment:
updates for compatibility with mediaWiki 1.14
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/specials/MV_SpecialCRUDStream.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/specials/MV_SpecialMediaSearch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialMediaSearch.php
@@ -23,20 +23,22 @@
2424 // @@todo add link to "media search"
2525 class MV_SpecialSearch extends SpecialPage {
2626 function MV_SpecialSearch() {
27 - global $wgOut, $wgRequest, $wgUser;
28 - mvfAddHTMLHeader( 'search' );
29 - // $MvSpecialSearch = new MV_SpecialMediaSearch();
30 - // $MvSpecialSearch->doSearchPage( $wgRequest->getVal('search') );
31 - $mediaPage = Title::newFromText( 'MediaSearch', NS_SPECIAL );
32 - $sk = $wgUser->getSkin();
33 - $wgOut->addHTML( wfMsg( 'mv_do_media_search',
34 - $sk->makeKnownLinkObj( $mediaPage,
35 - htmlspecialchars( $wgRequest->getVal( 'search' ) ),
36 - 'mv_search=' . $wgRequest->getVal( 'search' )
 27+ global $wgOut, $wgRequest, $wgUser, $wgTitle;
 28+ if($wgTitle->getText()!='SpecialPages'){
 29+ //mvfAddHTMLHeader( 'search' );
 30+ // $MvSpecialSearch = new MV_SpecialMediaSearch();
 31+ // $MvSpecialSearch->doSearchPage( $wgRequest->getVal('search') );
 32+ $mediaPage = Title::newFromText( 'MediaSearch', NS_SPECIAL );
 33+ $sk = $wgUser->getSkin();
 34+ $wgOut->addHTML( wfMsg( 'mv_do_media_search',
 35+ $sk->makeKnownLinkObj( $mediaPage,
 36+ htmlspecialchars( $wgRequest->getVal( 'search' ) ),
 37+ 'mv_search=' . $wgRequest->getVal( 'search' )
 38+ )
3739 )
38 - )
39 - );
40 - SpecialPage :: SpecialPage( 'Search' );
 40+ );
 41+ SpecialPage :: SpecialPage( 'Search' );
 42+ }
4143 }
4244 }
4345 /*
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialCRUDStream.php
@@ -12,36 +12,23 @@
1313 */
1414
1515 if ( !defined( 'MEDIAWIKI' ) ) die();
16 -
17 -// not need should autoload
18 -// global $IP;
19 -// require_once( "$IP/includes/SpecialPage.php" );
2016
21 -/*function doSpecialAddStream() {
22 - $MV_SpecialAddStream = new MV_SpecialCRUDStream('add');
23 - $MV_SpecialAddStream->execute();
24 -}
25 -function doSpecialEditStream(){
26 - $MV_SpecialAddStream = new MV_SpecialCRUDStream('edit');
27 - $MV_SpecialAddStream->execute();
28 -}
29 -
30 -SpecialPage::addPage( new SpecialPage('Mv_Add_Stream','',true,'doSpecialAddStream',false) );
31 -SpecialPage::addPage( new SpecialPage('Mv_Edit_Stream','',true,'doSpecialEditStream',false) );
32 -*/
33 -
34 -/* @@TODO depreciate in favor of oggFile -> stream setup */
 17+/* @@TODO also support oggHandler stream setup */
3518 class MV_SpecialCRUDStream extends SpecialPage {
3619 function __construct( $mode = 'add' ) {
3720 parent::__construct( 'Mv_Add_Stream' );
3821 $this->mode = 'add';
3922 // print_r(debug_backtrace());
 23+ if ( method_exists( 'SpecialPage', 'setGroup' ) ) {
 24+ parent::setGroup( 'Mv_Add_Stream', 'mv_group' );
 25+ }
4026
4127 }
4228 function execute() {
43 - global $wgRequest, $wgOut, $wgUser, $mvStream_name, $mvgIP;
 29+ global $wgRequest, $wgOut, $wgUser, $mvStream_name, $mvgIP, $wgTitle;
4430 # init html output var:
45 - $html = '';
 31+ $html = '';
 32+
4633
4734 # Get request data from, e.g.
4835 $title_str = $wgRequest->getVal( 'title' );
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php
@@ -23,19 +23,19 @@
2424 class MvVideoFeed extends SpecialPage {
2525 function __construct() {
2626 parent::__construct( 'MvVideoFeed' );
27 - $MvSpecialExport = new MV_SpecialExport( 'category' );
28 -
2927 if ( method_exists( 'SpecialPage', 'setGroup' ) ) {
3028 parent::setGroup( 'MvVideoFeed', 'mv_group' );
31 - }
32 -
33 -
 29+ }
3430 }
 31+ function execute(){
 32+ $MvSpecialExport = new MV_SpecialExport( 'category' );
 33+ }
3534 }
3635 class MvExportStream extends SpecialPage {
3736 function __construct() {
38 - parent::__construct( 'MvExportStream' );
39 -
 37+ parent::__construct( 'MvExportStream' );
 38+ }
 39+ function execute(){
4040 $MvSpecialExport = new MV_SpecialExport( 'stream' );
4141 }
4242 }
@@ -76,6 +76,7 @@
7777 parent::__construct( 'MvExportAsk' );
7878 }
7979 function execute() {
 80+ global $wgTitle;
8081 $MvSpecialExport = new MV_SpecialExport( 'ask' );
8182 }
8283 }
@@ -104,7 +105,7 @@
105106 $error_page = '';
106107 // print "RAN execute with export type: " .$this->export_type;
107108 switch( $this->export_type ) {
108 - case 'stream':
 109+ case 'stream':
109110 $this->stream_name = $wgRequest->getVal( 'stream_name' );
110111
111112 if ( $this->stream_name == '' )
Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -6,7 +6,7 @@
77 * for more info visit http:/metavid.ucsc.edu/code
88 *
99 */
10 -define( 'MV_VERSION', '1.0' );
 10+define( 'MV_VERSION', '1.0rc2' );
1111
1212
1313 if ( !defined( 'MEDIAWIKI' ) ) die( 1 );
@@ -30,7 +30,7 @@
3131
3232 $markerList = array();
3333
34 -// don't override special search page: (requires ExtensionFunctions.php)
 34+// override special search page: (requires ExtensionFunctions.php)
3535 extAddSpecialPage( dirname( __FILE__ ) . '/specials/MV_SpecialMediaSearch.php', 'Search', 'MV_SpecialSearch' );
3636
3737
@@ -183,7 +183,8 @@
184184
185185
186186 // @@NOTE this hook is not avaliable by default in medaiwiki
187 - // to use this hook you should add this function to moveTo() in Title.php:
 187+ // to use this hook you should add this function to moveTo()
 188+ // right after the local check in Title.php:
188189 /*
189190 $err = wfRunHooks('TitleisValidMove', array( &$this, &$nt, &$wgUser, $auth));
190191 if( is_string( $err ) ) {
@@ -228,12 +229,12 @@
229230 /***** credits (see "Special:Version") *****/
230231 /**********************************************/
231232 $wgExtensionCredits['other'][] = array(
232 - 'name' => 'Metavid Wiki Extension',
 233+ 'name' => 'MetaVidWiki',
233234 'author' => 'Michael Dale',
234 - 'version' => 'alpha 0.1',
235 - 'url' => 'http://metavid.org',
 235+ 'version' => MV_VERSION,
 236+ 'url' => 'http://metavid.org/wiki/MetaVidWiki_Software',
236237 'description' => 'Video Metadata Editor & Media Search<br />' .
237 - '[http://metavid.ucsc.edu/wiki/index.php/MetaVidWiki_Software More about MetaVidWiki Software]'
 238+ '[http://metavid.org/wiki/MetaVidWiki_Software More about MetaVidWiki Software]'
238239 );
239240 }
240241

Status & tagging log