r40115 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40114‎ | r40115 | r40116 >
Date:23:57, 27 August 2008
Author:dale
Status:old
Tags:
Comment:
some updates for compatibility with new special pages
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.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/skins/mv_embed/embedLibs/mv_nativeEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_page.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialCRUDStream.php
@@ -29,11 +29,14 @@
3030 SpecialPage::addPage( new SpecialPage('Mv_Add_Stream','',true,'doSpecialAddStream',false) );
3131 SpecialPage::addPage( new SpecialPage('Mv_Edit_Stream','',true,'doSpecialEditStream',false) );
3232 */
 33+
3334 /* @@TODO depreciate in favor of oggFile -> stream setup */
3435 class MV_SpecialCRUDStream extends SpecialPage{
35 - function __construct($mode='add'){
 36+ function __construct($mode='add'){
3637 parent::__construct('Mv_Add_Stream');
37 - $this->mode='add';
 38+ $this->mode='add';
 39+ //print_r(debug_backtrace());
 40+
3841 }
3942 function execute() {
4043 global $wgRequest, $wgOut, $wgUser, $mvStream_name, $mvgIP;
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php
@@ -21,9 +21,13 @@
2222 global $IP, $smwgIP;
2323 //all the special pages handled by this master Special Export (could reactor into individual classes if we want to)
2424 class MvVideoFeed extends SpecialPage{
25 - function __construct(){
 25+ function __construct(){
2626 parent::__construct('MvVideoFeed');
2727 $MvSpecialExport = new MV_SpecialExport('category');
 28+
 29+ if (method_exists('SpecialPage', 'setGroup')) {
 30+ parent::setGroup('MvVideoFeed', 'mv_group');
 31+ }
2832 }
2933 }
3034 class MvExportStream extends SpecialPage{
@@ -32,12 +36,28 @@
3337 $MvSpecialExport = new MV_SpecialExport('stream');
3438 }
3539 }
36 -class MvExportSequence extends SpecialPage{
 40+class MvExportSequence extends SpecialPage{
3741 function __construct(){
3842 parent::__construct('MvExportSequence');
39 - $MvSpecialExport = new MV_SpecialExport('sequence');
 43+ global $wgRequest;
 44+ //@@todo replace this ugly hack .. don't know how to get around the missing param atm:
 45+ $tl = $wgRequest->getVal('title');
 46+ $par='';
 47+ if(strpos($tl,'/')!==false){
 48+ $par = substr($tl, strpos($tl,'/')+1 );
 49+ }
 50+ //print "par: ". $par ;
 51+ //die;
 52+ $MvSpecialExport = new MV_SpecialExport('sequence', $par);
 53+
 54+ if (method_exists('SpecialPage', 'setGroup')) {
 55+ parent::setGroup('MvExportSequence', 'mv_group');
 56+ }
4057 }
4158 }
 59+function wfSpecialMvExportSequence(){
 60+ return true;
 61+}
4262 class MvExportSearch extends SpecialPage{
4363 function __construct(){
4464 parent::__construct('MvExportSearch');
@@ -54,6 +74,7 @@
5575 return true;
5676 }
5777
 78+
5879 //extend supported feed types:
5980 $wgFeedClasses['cmml']='CmmlFeed';
6081 $wgFeedClasses['podcast']='PodcastFeed';
@@ -63,7 +84,7 @@
6485 function __construct($export_type, $par=''){
6586 $this->export_type=$export_type;
6687 $this->par = $par;
67 - $this->execute();
 88+ $this->execute();
6889 }
6990 //@@todo think about integration into api.php
7091 function execute() {
@@ -72,6 +93,7 @@
7394 //set universal variables:
7495 $this->feed_format = $wgRequest->getVal('feed_format');
7596 $error_page = '';
 97+ //print "RAN execute with export type: " .$this->export_type;
7698 switch($this->export_type){
7799 case 'stream':
78100 $this->stream_name = $wgRequest->getVal('stream_name');
@@ -105,9 +127,11 @@
106128 case 'search':
107129 $this->get_search_feed();
108130 break;
109 - case 'sequence':
110 - $this->seq_title = $this->par;
111 - $this->get_sequence_xspf();
 131+ case 'sequence':
 132+ if($this->par!=''){
 133+ $this->seq_title = $this->par;
 134+ $this->get_sequence_xspf();
 135+ }
112136 break;
113137 case 'ask':
114138 $this->get_ask_feed();
@@ -119,7 +143,7 @@
120144 $wgOut->addHTML($error_page);
121145 }
122146 }
123 - function get_sequence_xspf(){
 147+ function get_sequence_xspf(){
124148 //get the sequence article and export in xspf format:
125149 $seqTitle = Title::newFromText($this->seq_title, MV_NS_SEQUENCE);
126150 $seqArticle = new MV_SequencePage($seqTitle);
Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php
@@ -22,7 +22,9 @@
2323 function __construct($title){
2424 global $wgRequest;
2525 mvfAddHTMLHeader('sequence');
26 - parent::__construct($title);
 26+ if($title!=null){
 27+ parent::__construct($title);
 28+ }
2729 return $this;
2830 }
2931 /*function doSeqReplace(&$input, &$argv, &$parser){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_page.php
@@ -22,10 +22,10 @@
2323 $sample_embed = array();
2424
2525 $sample_embed[0]['tag'] = '<video id="vid_4184"
26 -thumbnail="http://metavid.ucsc.edu/wiki/index.php?action=ajax&rs=mv_frame_server&stream_name=senate_proceeding_08-01-07&t=0:27:16&size=small"
 26+thumbnail="http://metavid.ucsc.edu/wiki/index.php?action=ajax&rs=mv_frame_server&stream_name=senate_proceeding_08-01-07&t=0:27:16&size=large"
2727 src="http://128.114.20.64/media/senate_proceeding_08-01-07.ogg.anx?t=0:27:16/0:27:32"
2828 roe="http://localhost/mvw-exp/index.php?title=Special:MvExportStream&feed_format=roe&stream_name=senate_proceeding_08-01-07&t=0:27:16/0:27:32"
29 -show_meta_link="false" autoplay="false" style="width:160px;height:120px" controls="true" embed_link="true" ></video>';
 29+show_meta_link="false" autoplay="false" style="width:400px;height:300px" controls="true" embed_link="true" ></video>';
3030 $sample_embed[0]['desc']=' auto play test (similar embed syntax to the metavidWiki site)';
3131
3232 /*$sample_embed[0]['tag']='<video id="v0" src="sample.ogg" thumbnail="sample.jpg"></video>';
@@ -125,7 +125,7 @@
126126 <table border="1" cellpadding="6" width="600">
127127 <? foreach($sample_embed as $key=>$aval){
128128 //$key!=8
129 - if($key!=2)continue;
 129+ if($key!=0)continue;
130130 ?>
131131 <tr>
132132 <td valign="top"><?=$aval['tag']?></td>
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_nativeEmbed.js
@@ -46,7 +46,7 @@
4747 this.currentTime = this.vid.currentTime;
4848
4949 if( this.currentTime > 0 ){
50 - if(! this.userSlide){
 50+ if(!this.userSlide){
5151 this.setSliderValue(this.currentTime/this.duration );
5252 this.setStatus( seconds2ntp(this.currentTime) + '/'+ seconds2ntp(this.duration));
5353 }else{