Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialMediaSearch.php |
— | — | @@ -23,20 +23,22 @@ |
24 | 24 | // @@todo add link to "media search" |
25 | 25 | class MV_SpecialSearch extends SpecialPage { |
26 | 26 | 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 | + ) |
37 | 39 | ) |
38 | | - ) |
39 | | - ); |
40 | | - SpecialPage :: SpecialPage( 'Search' ); |
| 40 | + ); |
| 41 | + SpecialPage :: SpecialPage( 'Search' ); |
| 42 | + } |
41 | 43 | } |
42 | 44 | } |
43 | 45 | /* |
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialCRUDStream.php |
— | — | @@ -12,36 +12,23 @@ |
13 | 13 | */ |
14 | 14 | |
15 | 15 | if ( !defined( 'MEDIAWIKI' ) ) die(); |
16 | | - |
17 | | -// not need should autoload |
18 | | -// global $IP; |
19 | | -// require_once( "$IP/includes/SpecialPage.php" ); |
20 | 16 | |
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 */ |
35 | 18 | class MV_SpecialCRUDStream extends SpecialPage { |
36 | 19 | function __construct( $mode = 'add' ) { |
37 | 20 | parent::__construct( 'Mv_Add_Stream' ); |
38 | 21 | $this->mode = 'add'; |
39 | 22 | // print_r(debug_backtrace()); |
| 23 | + if ( method_exists( 'SpecialPage', 'setGroup' ) ) { |
| 24 | + parent::setGroup( 'Mv_Add_Stream', 'mv_group' ); |
| 25 | + } |
40 | 26 | |
41 | 27 | } |
42 | 28 | function execute() { |
43 | | - global $wgRequest, $wgOut, $wgUser, $mvStream_name, $mvgIP; |
| 29 | + global $wgRequest, $wgOut, $wgUser, $mvStream_name, $mvgIP, $wgTitle; |
44 | 30 | # init html output var: |
45 | | - $html = ''; |
| 31 | + $html = ''; |
| 32 | + |
46 | 33 | |
47 | 34 | # Get request data from, e.g. |
48 | 35 | $title_str = $wgRequest->getVal( 'title' ); |
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php |
— | — | @@ -23,19 +23,19 @@ |
24 | 24 | class MvVideoFeed extends SpecialPage { |
25 | 25 | function __construct() { |
26 | 26 | parent::__construct( 'MvVideoFeed' ); |
27 | | - $MvSpecialExport = new MV_SpecialExport( 'category' ); |
28 | | - |
29 | 27 | if ( method_exists( 'SpecialPage', 'setGroup' ) ) { |
30 | 28 | parent::setGroup( 'MvVideoFeed', 'mv_group' ); |
31 | | - } |
32 | | - |
33 | | - |
| 29 | + } |
34 | 30 | } |
| 31 | + function execute(){ |
| 32 | + $MvSpecialExport = new MV_SpecialExport( 'category' ); |
| 33 | + } |
35 | 34 | } |
36 | 35 | class MvExportStream extends SpecialPage { |
37 | 36 | function __construct() { |
38 | | - parent::__construct( 'MvExportStream' ); |
39 | | - |
| 37 | + parent::__construct( 'MvExportStream' ); |
| 38 | + } |
| 39 | + function execute(){ |
40 | 40 | $MvSpecialExport = new MV_SpecialExport( 'stream' ); |
41 | 41 | } |
42 | 42 | } |
— | — | @@ -76,6 +76,7 @@ |
77 | 77 | parent::__construct( 'MvExportAsk' ); |
78 | 78 | } |
79 | 79 | function execute() { |
| 80 | + global $wgTitle; |
80 | 81 | $MvSpecialExport = new MV_SpecialExport( 'ask' ); |
81 | 82 | } |
82 | 83 | } |
— | — | @@ -104,7 +105,7 @@ |
105 | 106 | $error_page = ''; |
106 | 107 | // print "RAN execute with export type: " .$this->export_type; |
107 | 108 | switch( $this->export_type ) { |
108 | | - case 'stream': |
| 109 | + case 'stream': |
109 | 110 | $this->stream_name = $wgRequest->getVal( 'stream_name' ); |
110 | 111 | |
111 | 112 | if ( $this->stream_name == '' ) |
Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | * for more info visit http:/metavid.ucsc.edu/code |
8 | 8 | * |
9 | 9 | */ |
10 | | -define( 'MV_VERSION', '1.0' ); |
| 10 | +define( 'MV_VERSION', '1.0rc2' ); |
11 | 11 | |
12 | 12 | |
13 | 13 | if ( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | |
32 | 32 | $markerList = array(); |
33 | 33 | |
34 | | -// don't override special search page: (requires ExtensionFunctions.php) |
| 34 | +// override special search page: (requires ExtensionFunctions.php) |
35 | 35 | extAddSpecialPage( dirname( __FILE__ ) . '/specials/MV_SpecialMediaSearch.php', 'Search', 'MV_SpecialSearch' ); |
36 | 36 | |
37 | 37 | |
— | — | @@ -183,7 +183,8 @@ |
184 | 184 | |
185 | 185 | |
186 | 186 | // @@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: |
188 | 189 | /* |
189 | 190 | $err = wfRunHooks('TitleisValidMove', array( &$this, &$nt, &$wgUser, $auth)); |
190 | 191 | if( is_string( $err ) ) { |
— | — | @@ -228,12 +229,12 @@ |
229 | 230 | /***** credits (see "Special:Version") *****/ |
230 | 231 | /**********************************************/ |
231 | 232 | $wgExtensionCredits['other'][] = array( |
232 | | - 'name' => 'Metavid Wiki Extension', |
| 233 | + 'name' => 'MetaVidWiki', |
233 | 234 | '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', |
236 | 237 | '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]' |
238 | 239 | ); |
239 | 240 | } |
240 | 241 | |