r52012 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52011‎ | r52012 | r52013 >
Date:23:23, 16 June 2009
Author:dale
Status:deferred
Tags:
Comment:
some updates for the setting in-out time in transcripts
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Overlay.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Overlay.php
@@ -10,16 +10,16 @@
1111 // hide the fact box in any MV_Overlay driven view of mvd
1212 global $smwgShowFactbox;
1313 $smwgShowFactbox = SMW_FACTBOX_HIDDEN;
14 -
 14+
1515 class MV_Overlay extends MV_Component {
1616 /*init function should load the target overlay*/
17 - // set up defaults:
 17+ // set up defaults:
1818 var $req = 'stream_transcripts';
1919 var $tl_width = '16';
2020 var $parserOutput = null;
2121 var $oddEvenToggle = true;
2222 var $mvd_pages = array();
23 -
 23+
2424 /*structures the component output and call html code generation */
2525 function getHTML() {
2626 switch( $this->req ) {
@@ -31,14 +31,14 @@
3232 break;
3333 }
3434 }
35 -
36 - // renders recent changes in the MVD namespace
 35+
 36+ // renders recent changes in the MVD namespace
3737 function do_Recentchanges() {
3838 global $wgOut;
39 - // quick and easy way:
 39+ // quick and easy way:
4040 $wgOut->addWikiText( '{{Special:Recentchanges/namespace=' . MV_NS_MVD . '}}' );
4141 }
42 -
 42+
4343 function do_stream_transcripts() {
4444 global $wgOut;
4545 $this->procMVDReqSet();
@@ -46,7 +46,7 @@
4747 $out = '';
4848 // set up left hand side timeline
4949 $ttl_width = count( $this->mvd_tracks ) * ( $this->tl_width );
50 - /*$wgOut->addHTML('<div id="mv_time_line" style="width:'.$ttl_width.'px">' .
 50+ /*$wgOut->addHTML('<div id="mv_time_line" style="width:'.$ttl_width.'px">' .
5151 $this->get_video_timeline() .
5252 '</div>');
5353 */
@@ -57,33 +57,33 @@
5858 $this->get_transcript_pages();
5959 $wgOut->addHTML( "</div>" );
6060 }
61 -
 61+
6262 function render_full() {
6363 global $wgOut;
64 - // "<div >" .
 64+ // "<div >" .
6565 $wgOut->addHTML( "<div id=\"selectionsBox\">\n" );
6666 $this->getHTML();
6767 $wgOut->addHTML( "</div>\n" );
6868 // add in contorls:
6969 $wgOut->addHTML( $this->render_controls() );
70 -
 70+
7171 }
72 -
 72+
7373 function render_controls() {
7474 global $mvgShowLayerControls;
75 - $ct = '<div class="layers">
 75+ $ct = '<div class="layers">
7676 <ul>
7777 <li>
7878 <a href="javascript:mv_disp_add_mvd(\'anno_en\')">' . wfMsg( 'mv_new_anno_en' ) . '</a>
7979 </li>
8080 <li>
81 - <a title="' . htmlspecialchars( wfMsg( 'mv_new_ht_en' ) ) . '" href="javascript:mv_disp_add_mvd(\'ht_en\')">' . wfMsg( 'mv_new_ht_en' ) . '</a>
 81+ <a title="' . htmlspecialchars( wfMsg( 'mv_new_ht_en' ) ) . '" href="javascript:mv_disp_add_mvd(\'ht_en\')">' . wfMsg( 'mv_new_ht_en' ) . '</a>
8282 </li>';
8383 if($mvgShowLayerControls){
8484 $ct.= '<li>
85 - <a title="' . htmlspecialchars( wfMsg( 'mv_mang_layers' ) ) . '" href="javascript:mv_tool_disp(\'mang_layers\')">' . wfMsg( 'mv_mang_layers' ) . '</a>
 85+ <a title="' . htmlspecialchars( wfMsg( 'mv_mang_layers' ) ) . '" href="javascript:mv_tool_disp(\'mang_layers\')">' . wfMsg( 'mv_mang_layers' ) . '</a>
8686 </li>';
87 - }
 87+ }
8888 $ct.=' </ul>
8989 </div>';
9090 return $ct;
@@ -92,7 +92,7 @@
9393 global $wgLang;
9494
9595 $base_title = '';
96 - // set the base title to the stream name:
 96+ // set the base title to the stream name:
9797 if ( isset( $this->mv_interface->article->mvTitle ) ) {
9898 $base_title = $this->mv_interface->article->mvTitle->getStreamName();
9999 }
@@ -119,10 +119,10 @@
120120 foreach ( $this->mvd_pages as & $mvd_page ) {
121121 $out .= $this->get_timeline_html( $mvd_page );
122122 }
123 - // output the time stamps:
 123+ // output the time stamps:
124124 /*$out.='<div style="position:absolute;top:0%;z-index:2;background:#FFFFFF;font-size:x-small">';
125125 $out.=$start_str;
126 - $out.='</div>';
 126+ $out.='</div>';
127127 $out.='<div style="position:absolute;top:100%;z-index:2;background:#FFFFFF;font-size:x-small">';
128128 $out.=$end_str;
129129 $out.='</div>';*/
@@ -149,7 +149,7 @@
150150 function get_transcript_pages() {
151151 global $wgUser, $mvgIP, $wgOut;
152152 $sk = $wgUser->getSkin();
153 -
 153+
154154 $out = '';
155155 if ( count( $this->mvd_pages ) == 0 ) {
156156 $out = 'no mvd rows found';
@@ -164,15 +164,15 @@
165165 // print_r($mvd_page);
166166 // "<div id=\"mv_ctail_{$mvd_page->id}\" style=\"position:relative\">"
167167 if ( isset( $this->mv_interface->smwProperties['playback_resolution'] ) ) {
168 - // for now just put in a hack that forces no size adjustment
 168+ // for now just put in a hack that forces no size adjustment
169169 $img_url = MV_StreamImage::getStreamImageURL( $mvd_page->stream_id, $mvd_page->start_time, null, true );
170170 } else {
171171 $img_url = MV_StreamImage::getStreamImageURL( $mvd_page->stream_id, $mvd_page->start_time, $mvDefaultVideoPlaybackRes, true );
172172 }
173173 $oe_class = '';
174 - //color annnotative layers seperatly:
 174+ //color annnotative layers seperatly:
175175 $oe_class.=' ' . htmlspecialchars( strtolower( $mvd_page->mvd_type ) );
176 - //preset classes for rendering on page load (will repaint but whatever)
 176+ //preset classes for rendering on page load (will repaint but whatever)
177177 if ( $this->oddEvenToggle ) {
178178 $this->oddEvenToggle = false;
179179 $oe_class .= ' even';
@@ -180,14 +180,14 @@
181181 $this->oddEvenToggle = true;
182182 $oe_class .= ' odd';
183183 }
184 -
 184+
185185 // style=\"background:#".$this->getMvdBgColor($mvd_page)."\" "
186186 $wgOut->addHTML( '<fieldset class="mv_fd_mvd' . htmlspecialchars( $oe_class ) . '" id="mv_fd_mvd_' . htmlspecialchars( $mvd_page->id ) . '" ' .
187187 'name="' . htmlspecialchars( $mvd_page->wiki_title ) . '" ' .
188188 'image_url="' . htmlspecialchars( $img_url ) . '" >' );
189 -
190 - /*$wgOut->addHTML("<legend id=\"mv_ld_{$mvd_page->id}\">" .
191 - $this->get_mvd_menu($mvd_page) .
 189+
 190+ /*$wgOut->addHTML("<legend id=\"mv_ld_{$mvd_page->id}\">" .
 191+ $this->get_mvd_menu($mvd_page) .
192192 "</legend>");*/
193193 // $menu_html = $this->get_mvd_menu($mvd_page);
194194 $wgOut->addHTML( "<div id=\"mv_fcontent_{$mvd_page->id}\">" );
@@ -206,7 +206,7 @@
207207 return $this->get_timeline_html( $this->mvd_pages[$mvd_id] );
208208 }
209209 function get_fd_mvd_request( $titleKey, $mvd_id, $mode = 'inner', $content = '' ) {
210 - global $wgOut;
 210+ global $wgOut;
211211 if ( !isset( $this->mvd_pages[$mvd_id] ) )
212212 $this->mvd_pages[$mvd_id] = MV_Index::getMVDbyId( $mvd_id );
213213 if ( $mode == 'inner' ) {
@@ -223,27 +223,27 @@
224224 /*
225225 * time_line actions added by jQuery
226226 'onmouseover="mv_mvd_tlOver(\''.$mvd_page->id.'\')" '.
227 - 'onmouseout="mv_mvd_tlOut(\''.$mvd_page->id.'\')" '.
228 - 'onmouseup="mv_do_play()" ' .
 227+ 'onmouseout="mv_mvd_tlOut(\''.$mvd_page->id.'\')" '.
 228+ 'onmouseup="mv_do_play()" ' .
229229 */
230230 'style="position:absolute;background:#' . $this->getMvdBgColor( $mvd_page ) . ';' .
231231 'width:' . $this->tl_width . 'px;';
232232 // set left based on array key:
233233 $keyOrder = array_search( strtolower( $mvd_page->mvd_type ), $this->mvd_tracks );
234 - // @@todo probably should throw an error:
 234+ // @@todo probably should throw an error:
235235 if ( $keyOrder === false )$keyOrder = 0;
236236 $out .= 'left:' . ( $keyOrder * $this->tl_width ) . 'px;';
237237 // check if duration is set (for php calculation of height position)
238238 if ( $this->duration ) {
239 - // print "master range: $this->start_time to $this->end_time \n";
240 - // max out ranges:
 239+ // print "master range: $this->start_time to $this->end_time \n";
 240+ // max out ranges:
241241 $page_start = ( $mvd_page->start_time < $this->start_time ) ? $this->start_time:$mvd_page->start_time;
242242 $page_end = ( $mvd_page->end_time > $this->end_time ) ? $this->end_time:$mvd_page->end_time;
243 -
 243+
244244 $page_duration = $page_end - $page_start;
245 - // print "page duration $page_end - $page_start: $page_duration \n";
 245+ // print "page duration $page_end - $page_start: $page_duration \n";
246246 $height_perc = round( 100 * ( $page_duration / $this->duration ), 2 );
247 -
 247+
248248 if ( $page_start == 0 ) { // avoid dividing zero
249249 $loc_perc = 0;
250250 } else {
@@ -255,7 +255,7 @@
256256 $height_perc = 100 - $loc_perc;
257257 }
258258 if ( $loc_perc < 0 )$loc_perc = 0;
259 -
 259+
260260 $out .= 'height:' . $height_perc . '%;' .
261261 'top:' . $loc_perc . '%"></div>' . "\n";
262262 } else {
@@ -263,7 +263,7 @@
264264 }
265265 return $out;
266266 }
267 -
 267+
268268 function getMVDhtml( &$mvd_page, $absolute_links = false ) {
269269 global $wgOut;
270270 // incase we call mid output (but really should use outputMVD in those cases)
@@ -285,24 +285,24 @@
286286 // print "js_log('missing: " .$mvd_page->wiki_title."');\n";
287287 return ;
288288 }
289 - // use the cache by default:
 289+ // use the cache by default:
290290 // $usepCache = (isset($mvd_page->usePcache))?$mvd_page->usePcache:true;
291 -
 291+
292292 /*try to pull from cache: separate out cache for internal links vs external links cache*/
293 - if( $wgEnableParserCache ) {
 293+ if( $wgEnableParserCache ) {
294294 $MvParserCache = & MV_ParserCache::singleton();
295295 $add_opt = ( $absolute_links ) ? 'a':'';
296296 // add the dbKey since I don't know how to easy purge the cache and we are getting cache missmatch
297297 $add_opt .= $mvdTitle->getDBkey();
298298 $MvParserCache->addToKey( $add_opt );
299 -
 299+
300300 $parserOutput = $MvParserCache->get( $mvdArticle, $wgUser );
301301 }else{
302302 $parserOutput=false;
303303 }
304304 if ( $parserOutput !== false ) {
305305 // print "js_log('found in cache: with hash: " . $MvParserCache->getKey( $mvdArticle, $wgUser )."');\n";
306 - // found in cache output and be done with it:
 306+ // found in cache output and be done with it:
307307 $wgOut->addParserOutput( $parserOutput );
308308 } else {
309309 // print "js_log('not found in cache');\n";
@@ -315,15 +315,15 @@
316316 if ( isset( $this->preMoveArtileText ) ) {
317317 $wikiText = & $this->preMoveArtileText;
318318 } else {
319 - // @@todo throw error:
 319+ // @@todo throw error:
320320 // print "error article: " . $mvd_page->wiki_title . " not there \n";
321321 print "js_log('missing: " . $mvd_page->wiki_title . "');\n";
322322 return ;
323323 }
324324 }
325325 $parserOutput = $this->parse_format_text( $wikiText, $mvdTitle, $mvd_page, $absolute_links );
326 -
327 - // if absolute_links set preg_replace with the server for every relative link:
 326+
 327+ // if absolute_links set preg_replace with the server for every relative link:
328328 if ( $absolute_links == true ) {
329329 global $wgServer;
330330 $parserOutput->mText = str_replace( array( 'href="https://www.mediawiki.org/', 'src="/' ), array( 'href="' . $wgServer . '/', 'src="' . $wgServer . '/' ), $parserOutput->mText );
@@ -349,7 +349,7 @@
350350 case 'anno_en':
351351 $play_link_o = '<a href="javascript:mv_do_play(' . htmlspecialchars( $mvd_page->id ) . ')">';
352352 $play_link_img_close = '<img border="0" src="' . htmlspecialchars( $mvgScriptPath ) . '/skins/images/button_play.png">' . '</a>';
353 -
 353+
354354 $smw_attr = $this->get_and_strip_semantic_tags( $text );
355355 foreach ( $smw_attr as $smw_key => $smw_attr_val ) {
356356 // do special display for given values:
@@ -360,7 +360,7 @@
361361 if( $pTitle->exists() ){
362362 $pimg = mv_get_person_img( $smw_attr_val );
363363 $pre_text_html .= '<p class="mvd_page_image">';
364 -
 364+
365365 if ( $mvd_page != '' ) {
366366 $pre_text_html .= $play_link_o;
367367 $added_play_link = true;
@@ -379,7 +379,7 @@
380380 if ( $template_key == 'anno_en' )
381381 $smw_text_html .= ucwords( $smwKeyTitle->getText() ) . ': ' . $sk->makeLinkObj( $valueTitle ) . '<br>';
382382 }
383 -
 383+
384384 if ( !$added_play_link && $mvd_page != '' ) {
385385 $pre_text_html .= '<p class="mvd_page_image">' . $play_link_o . $play_link_img_close . '</p>';
386386 // print "SHOULD HAVE PUT IN pre_text:$pre_text_html";
@@ -388,16 +388,16 @@
389389 if ( $mvd_page != '' ) {
390390 $pre_text_html .= '<span class="mvd_menu_header">' . $this->get_mvd_menu( $mvd_page ) . '</span>';
391391 }
392 - // if absolute links clear out links:
 392+ // if absolute links clear out links:
393393 if ( $absolute_links )
394394 $pre_text_html = '';
395395 $pre_text_html .= '<span class="description">';
396396 $pre_text_html .= $smw_text_html;
397 - // for ht_en add spoken by add name to start of text:
 397+ // for ht_en add spoken by add name to start of text:
398398 if ( $template_key == 'ht_en' ) {
399 - // if we have the person title add them to start of the text output:
 399+ // if we have the person title add them to start of the text output:
400400 if ( isset( $pTitle ) ) {
401 - // have to prepend it cuz of <p> insertion for first paragraph
 401+ // have to prepend it cuz of <p> insertion for first paragraph
402402 $text = '[[' . $pTitle->getText() . ']]: ' . trim( $text );
403403 }
404404 }
@@ -408,73 +408,73 @@
409409 }
410410 // now add the text with categories if present:
411411 $sk =& $wgUser->getSkin();
412 - // run via parser to add in Category info:
 412+ // run via parser to add in Category info:
413413 // $parserOptions = ParserOptions::newFromUser( $wgUser );
414414 $parserOptions = new ParserOptions();
415415 $parserOptions->setEditSection( false );
416416 $parserOptions->setTidy( true );
417417 $parserOutput = $wgParser->parse( $text , $mvdTile, $parserOptions, true, true );
418418 $wgOut->addCategoryLinks( $parserOutput->getCategories() );
419 -
 419+
420420 $parserOutput->mText .= $sk->getCategories();
421421 $parserOutput->mText = $pre_text_html . $parserOutput->mText . $post_text_html;
422 -
423 - // empty out the categories (should work)
 422+
 423+ // empty out the categories (should work)
424424 $wgOut->mCategoryLinks = array();
425425 $parserOutput->mCategories = null;
426426 return $parserOutput;
427427 }
428428 function get_add_disp( $baseTitle, $mvdType, $time_range ) {
429429 global $wgUser, $wgOut, $mvDefaultClipLength, $mvMVDTypeAllAvailable, $wgRequest;
430 -
 430+
431431 list( $this->start_context, $this->end_context ) = split( '/', $time_range );
432 - // first make sure its a valid mvd_type
 432+ // first make sure its a valid mvd_type
433433 if ( !in_array( $mvdType, $mvMVDTypeAllAvailable ) )return;
434434 # Or we could throw an exception:
435 - # throw new MWException( __METHOD__ . ' called invalid mvdType.' );
 435+ # throw new MWException( __METHOD__ . ' called invalid mvdType.' );
436436
437437 $mvd_page = new MV_MVD();
438438 $mvd_page->id = 'new';
439 -
440 - // print 'st ' . $this->start_context . "<br />" ;
441 - // $mvd_page->start_time = $start_context; //seconds2npt(0);
 439+
 440+ // print 'st ' . $this->start_context . "<br />" ;
 441+ // $mvd_page->start_time = $start_context; //seconds2npt(0);
442442 // $mvd_page->end_time = seconds2npt( npt2seconds($start_context) + $mvDefaultClipLength);
443443 $mvd_page->wiki_title = $mvdType . ':' . strtolower( $baseTitle ) . '/_new';
444444 $this->get_edit_disp( $mvd_page->wiki_title, 'new' );
445 -
446 -
 445+
 446+
447447 return $wgOut->getHTML();
448 -
449 - // make temporary unique "new" mvd title: (for now default to ht_en
450 - // but in the future default to no template type and let the user select)
451448
 449+ // make temporary unique "new" mvd title: (for now default to ht_en
 450+ // but in the future default to no template type and let the user select)
 451+
452452 // $wgTitle = Title::newFromText($titleKey, MV_NS_MVD);
453453
454 -
 454+
455455 // make a "new" mvd:
456456 // $mvd_page = new mvd_pageObj();
457457 // $mvd_page->id = 'new';
458458 // $mvd_page->start_time = seconds2npt(0);
459459 // $mvd_page->end_time = seconds2npt($mvDefaultClipLength);
460 - // $mvd_page->wiki_title = 'Ht_en:' . $baseTitle.'_'.rand(0,99999).'/'. $mvd_page->start_time . '/' . $mvd_page->end_time;
 460+ // $mvd_page->wiki_title = 'Ht_en:' . $baseTitle.'_'.rand(0,99999).'/'. $mvd_page->start_time . '/' . $mvd_page->end_time;
461461
462462 // $this->get_edit_disp($mvd_page->wiki_title,'new');
463463 // clear out html:
464464 // $wgOut->clearHTML();
465465
466 - // get encapsulated mvd:
 466+ // get encapsulated mvd:
467467 // $this->get_fd_mvd_page($mvd_page, $edit_html);
468468
469 - // get the edit page code:
 469+ // get the edit page code:
470470 }
471471 /*return transcript menu*/
472472 function get_mvd_menu( &$mvd_page ) {
473473 global $wgUser, $mvgScriptPath, $wgRequest;
474474 $sk = $wgUser->getSkin();
475 -
 475+
476476 // hack to get menu correct...
477477 $do_adjust = $wgRequest->getVal( 'do_adjust' );
478 - //fix boolean string issue:
 478+ //fix boolean string issue:
479479 $do_adjust = ( $do_adjust == 'false' ) ? false : $do_adjust;
480480 if ( $do_adjust ) {
481481 $tmpMvPage = new MV_Title( $wgRequest->getVal( 'newTitle' ) );
@@ -482,33 +482,33 @@
483483 $mvd_page->start_time = npt2seconds( $tmpMvPage->start_time );
484484 $mvd_page->end_time = npt2seconds( $tmpMvPage->end_time );
485485 }
486 -
 486+
487487 $out = '';
488488 // set up links:
489489 $plink = '';
490490 $elink = '<a title="' . htmlspecialchars( wfMsg( 'mv_edit_adjust_title' ) ) .
491491 '" href="javascript:mv_edit_disp(\'' . htmlspecialchars( $mvd_page->wiki_title ) .
492492 '\', \'' . htmlspecialchars( $mvd_page->id ) . '\')">' . wfMsg( 'mv_edit' ) . '</a>';
493 -
 493+
494494 // $alink = '<a title="'.wfMsg('mv_adjust_title').'" href="javascript:mv_adjust_disp(\''.$mvd_page->wiki_title.'\', \''.$mvd_page->id.'\')">'.wfMsg('mv_adjust').'</a>';
495495
496496 // print "wiki title: " . $mvd_page->wiki_title;
497497 $hTitle = Title::newFromText( $mvd_page->wiki_title, MV_NS_MVD );
498498 // print $hTitle->
499499 $hlink = $sk->makeKnownLinkObj( $hTitle, wfMsg( 'mv_history' ), 'action=history' );
500 -
 500+
501501 $dTitle = Title::newFromText( $mvd_page->wiki_title, MV_NS_MVD_TALK );
502502 $dlink = $sk->makeKnownLinkObj( $dTitle, wfMsg( 'talk' ) );
503 -
 503+
504504 // {s:\''.seconds2npt($mvd_page->start_time).'\',e:\''.seconds2npt($mvd_page->end_time).'\'}
505505 /*$plink='<a title="'.htmlspecialchars(wfMsg('mv_play').' '.seconds2npt($mvd_page->start_time) . ' to ' . seconds2npt($mvd_page->end_time)).' " ' .
506 - 'style="text-decoration:none;" ' .
 506+ 'style="text-decoration:none;" ' .
507507 'href="javascript:mv_do_play('.htmlspecialchars($mvd_page->id).');">' .
508508 '<span style="width:44px"><img src="'.htmlspecialchars($mvgScriptPath).'/skins/images/control_play_blue.png"></span>'.'</a>'.
509509 htmlspecialchars(seconds2npt($mvd_page->start_time) . ' to ' . htmlspecialchars(seconds2npt($mvd_page->end_time)));
510510 */
511511 $plink = htmlspecialchars( seconds2npt( $mvd_page->start_time ) ) . ' to ' . htmlspecialchars( seconds2npt( $mvd_page->end_time ) );
512 - // @@TODO set up conditional display: (view source if not logged on, protect, remove if given permission)
 512+ // @@TODO set up conditional display: (view source if not logged on, protect, remove if given permission)
513513 $out .= $plink;
514514 $out .= "( $elink $hlink $dlink";
515515 if ( $wgUser->isAllowed( 'mv_delete_mvd' ) ) {
@@ -551,22 +551,22 @@
552552 return $ret_ary;
553553 }
554554 /*
555 - * @@todo in the future dataHelpers could accommodate more.. (but lets avoid recreating the halo semantic mediaWiki extension).).
 555+ * @@todo in the future dataHelpers could accommodate more.. (but lets avoid recreating the halo semantic mediaWiki extension).).
556556 */
557557 function get_dataHelpers( $titleKey = 'new', $mvd_id = 'new' ) {
558558 global $mvMetaDataHelpers, $mvMetaCategoryHelper, $wgUser, $mvgScriptPath;
559559 $o = '';
560560 $sk = $wgUser->getSkin();
561561 $mvd_type = strtolower( array_shift( split( ':', $titleKey ) ) );
562 -
563 -
 562+
 563+
564564 // init metadata array: label
565565 $metaData = array( 'prop' => array(), 'categories' => array() );
566566 // just get msg and basic div layout: \
567567 // css layout of forms was F*@#!!! withing me for some reason so yay table :P
568568 $o .= '<span class="mv_basic_edit"><a href="#" onClick="mv_mvd_advs_toggle(' . htmlspecialchars( $mvd_id ) . ');return false;">' . wfMsg( 'mv_advanced_edit' ) . '</a></span>
569569 <span style="display:none" class="mv_advanced_edit"><a href="#" onClick="mv_mvd_advs_toggle(' . htmlspecialchars( $mvd_id ) . ');return false;">' . wfMsg( 'mv_basic_edit' ) . '</a></span>';
570 -
 570+
571571 $o .= '<input type="hidden" id="adv_basic_' . htmlspecialchars( $mvd_id ) . '" name="adv_basic" value="basic">';
572572 $o .= '<table class="mv_basic_edit mv_dataHelpers" id="mv_dataHelpers_' . htmlspecialchars( $mvd_id ) . '">';
573573 if ( isset( $mvMetaDataHelpers[strtolower( $mvd_type )] ) ) {
@@ -579,26 +579,26 @@
580580 }
581581 $metaData = $mvTitle->getMetaData();
582582 }
583 -
 583+
584584 foreach ( $mvMetaDataHelpers[strtolower( $mvd_type )] as $prop => $ac_index ) {
585585 $val = '';
586 - // normalize the
 586+ // normalize the
587587 $prop = str_replace( ' ', '_', $prop );
588588 // set existing "value"
589589 if ( isset( $metaData['prop'][$prop] ) ) {
590590 $val = $metaData['prop'][$prop];
591591 }
592 - // make sure the property exists:
 592+ // make sure the property exists:
593593 $swmTitle = Title::newFromText( (string)$prop, SMW_NS_PROPERTY );
594594 $smwImageHTML = '';
595595 if ( $swmTitle->exists() ) {
596596 // $help_img =$sk->makeKnownLinkObj($swmTitle, '<img src="'.htmlspecialchars($mvgScriptPath).'/skins/images/help_icon.png">');
597 - // special case for person image: (would be good to generalize but kind of complicated)
 597+ // special case for person image: (would be good to generalize but kind of complicated)
598598 if ( $swmTitle->getText() == 'Speech_by' ) {
599599 $img = mv_get_person_img( $val );
600600 $smwImageHTML = '<img id="smw_' . htmlspecialchars( $prop ) . '_img" style="display: block;margin-left: auto;margin-right: auto;" src="' . htmlspecialchars( $img->getURL() ) . '" width=\"44\">';
601601 }
602 -
 602+
603603 $o .= "<tr><td><label>" . htmlspecialchars( $swmTitle->getText() ) .
604604 ':</label></td><td>' . $smwImageHTML . '<input class="mv_anno_ac_' . htmlspecialchars( $mvd_id ) . '" ' .
605605 'size="40" name="smw_' . htmlspecialchars( $prop ) . '" type="text" value="' . htmlspecialchars( $val ) . '"> ' .
@@ -621,7 +621,7 @@
622622 $catTitle->getText() .
623623 '<a href="#" onclick="$j(\'#ext_cat_' . $i . '\').fadeOut(\'fast\').remove();return false;">
624624 <img border="0" src="' . $mvgScriptPath . '/skins/images/delete.png">
625 - </a>
 625+ </a>
626626 </span><br>';
627627 $i++;
628628 }
@@ -657,48 +657,22 @@
658658 $end_time = $mvTitle->getEndTime();
659659 }
660660 if($start_time == "null")
661 - $start_time = '0:00:00';
 661+ $start_time = '0:00:00';
662662 /*
663663 * @@todo move some of this to CSS
664664 */
665665 $mvd_id = htmlspecialchars( $mvd_id );
666666 $mvgScriptPath = htmlspecialchars( $mvgScriptPath );
667 - $out .= '
668 - <span id="mv_adjust_msg_' . $mvd_id . '"></span>
669 - <table style="background:transparent;position:relative" width="94%" border="0"><tr><td width="40">
670 -<span id="track_time_start_' . $mvd_id . '" style="font-size:small">0:00:00</span>
671 -</td><td>' .
672 -'<div id="container_track_' . $mvd_id . '" style="width:100%; height: 5px; background-color: rgb(170, 170, 170); border:1px solid black; position: relative">';
673 - // add some overlays to make the track look like it ends/starts at 0+-7px
674 - $out .= '<div style="position:absolute;left:0px;width:7px;height: 5px;background-color: white;border-right:1px solid black;"></div>' .
675 - '<div style="position:absolute;right:0px;width:7px;height: 5px;background-color: white;border-left:1px solid black;"></div>';
676 - // the reszie div structure:
677 - $out .= '<div id="resize_' . $mvd_id . '" style="height: 20px; position: absolute;">
678 - <div id="handle1_' . $mvd_id . '" style="background:no-repeat url(\'' . $mvgScriptPath . '/skins/images/slider_handle_green.gif\')"; class="ui-resizable-w ui-resizable-handle"></div>
679 - <div id="handle2_' . $mvd_id . '" style="background:no-repeat url(\'' . $mvgScriptPath . '/skins/images/slider_handle_red.gif\')"; class="ui-resizable-e ui-resizable-handle"></div>
680 - <div id="dragSpan_' . $mvd_id . '" class="ui-dragSpan"></div>
681 - </div>
682 -</div>' .
683 -// '<input type="hidden" id="wpPreview_stop_msg_' .$mvd_id.'" value="'.wfMsg('mv_adjust_preview_stop').'">'.
684 -// style="background: red url(\''.$mvgScriptPath.'/skins/mv_embed/images/slider_handle.gif\')"
685 - /*<div id="track_'.$mvd_id.'" style="width:100%;background-color: rgb(170, 170, 170); height: 5px; position: relative;">
686 - <div class="" id="handle1_'.$mvd_id.'" style="cursor: move;position:absolute;background-color:#5f5;height:20px;z-index:3">&nbsp;</div>
687 - <div class="" id="handle2_'.$mvd_id.'" style="cursor: move;position:absolute;background-color:#f55;height:20px;z-index:3">&nbsp;</div>
688 - <div class="" id="selected_'.$mvd_id.'" style="position:absolute;background-color:#55f;height:10px;z-index:1;overflow:hidden"></div>
689 - </div>*/
690 -'</td><td width="50">
691 -<span id="track_time_end_' . $mvd_id . '" style="font-size:small">0:00:00</span>
692 - </td></tr></table>
693 - <br />';
694 -
 667+ $out .= '<br><div class="inOutSlider"></div><br />';
 668+
695669 $out .= '<span style="float:left;"><label class="mv_css_form" for="mv_start_hr_' . $mvd_id . '"><i>' . wfMsg( 'mv_start_desc' ) . ':</i></label> ' .
696670 '<input class="mv_adj_hr" size="8" maxlength="8" value="' . htmlspecialchars( $start_time ) . '" id="mv_start_hr_' . $mvd_id . '" name="mv_start_hr_' . $mvd_id . '">' .
697671 '</span>';
698 -
 672+
699673 $out .= '<span style="float:left;"><label class="mv_css_form" for="mv_end_hr_' . $mvd_id . '"><i>' . wfMsg( 'mv_end_desc' ) . ':</i></label> ' .
700674 '<input class="mv_adj_hr" size="8" maxlength="8" value="' . htmlspecialchars( $end_time ) . '" id="mv_end_hr_' . $mvd_id . '" name="mv_end_hr_' . $mvd_id . '">' .
701675 '</span>';
702 -
 676+
703677 // output page text (if not "new")
704678 // if($mvd_id!='new')
705679 // $out.=$this->get_fd_mvd_request( $titleKey, $mvd_id);
@@ -727,34 +701,34 @@
728702 /*@@TODO document */
729703 function do_edit_submit( $titleKey, $mvd_id, $returnEncapsulated = false, $newTitleKey = '' ) {
730704 global $wgOut, $wgScriptPath, $wgUser, $wgTitle, $wgRequest, $wgContLang;
731 -
 705+
732706 if ( $mvd_id == 'new' ) {
733707 $titleKey = substr( $_REQUEST['title'], 0, strpos( $_REQUEST['title'], '/' ) ) .
734 - '/' . $_REQUEST['mv_start_hr_new'] . '/' . $_REQUEST['mv_end_hr_new'];
735 - }
 708+ '/' . $_REQUEST['mv_start_hr_new'] . '/' . $_REQUEST['mv_end_hr_new'];
 709+ }
736710 // if doing basic editing use basic wpTextBox:
737711 if ( $wgRequest->getVal( 'adv_basic' ) == 'basic' ) {
738712 $wpTextbox1 = $wgRequest->getVal( 'basic_wpTextbox' );
739713 } else {
740714 $wpTextbox1 = $wgRequest->getVal( 'wpTextbox1' );
741715 }
742 -
 716+
743717 // set up the title /article
744718 $wgTitle = Title::newFromText( $titleKey, MV_NS_MVD );
745719 $Article = new Article( $wgTitle );
746 -
 720+
747721 $wpTextbox1 = trim( $wpTextbox1 );
748722 // add all semantic form based attributes/relations to the posted body text
749723 $formSemanticText = '';
750724 foreach ( $_POST as $key => $val ) {
751725 $do_swm_include = true;
752726 if ( substr( $key, 0, 4 ) == 'smw_' ) {
753 - // try attribute
 727+ // try attribute
754728 $swmTitle = Title::newFromText( substr( $key, 4 ), SMW_NS_PROPERTY );
755729 if ( $swmTitle->exists() ) {
756 - // make sure the semantic is not empty:
 730+ // make sure the semantic is not empty:
757731 if ( trim( $val ) != '' ) {
758 - // @@todo update for other smw types:
 732+ // @@todo update for other smw types:
759733 if ( $swmTitle->getDBkey() == 'Spoken_By' ) {
760734 $wpTextbox1 = "[[" . $swmTitle->getText() . '::' . $val . ']] ' . $wpTextbox1;
761735 } else {
@@ -764,53 +738,53 @@
765739 }
766740 }
767741 }
768 - // add all categorizations:
 742+ // add all categorizations:
769743 $catNStxt = $wgContLang->getNsText( NS_CATEGORY );
770744 foreach ( $_POST as $k => $v ) {
771745 if ( strpos( $k, 'ext_cat_' ) !== false ) {
772746 $wpTextbox1 .= "\n[[" . $catNStxt . ":" . $v . "]]";
773747 }
774748 }
775 - // add the text to the end after a line break to not confuse manual editors
 749+ // add the text to the end after a line break to not confuse manual editors
776750 $editPageAjax = new MV_EditPageAjax( $Article );
777751 $editPageAjax->mvd_id = $mvd_id;
778 -
779 - // if preview just return the parsed preview
 752+
 753+ // if preview just return the parsed preview
780754 // @@todo refactor to use as much EditPage code as possible or (switch over to the API)
781 - // use the "livePreview" functionality of Edit page.
 755+ // use the "livePreview" functionality of Edit page.
782756 if ( isset( $_POST['wpPreview'] ) ) {
783757 // $out = $editPageAjax->getPreviewText();
784 - // $wgOut->addHTML($out);
 758+ // $wgOut->addHTML($out);
785759 $mvTitle = new MV_Title( $wgRequest->getVal( 'title' ) );
786 -
 760+
787761 $parserOutput = $this->parse_format_text( $wpTextbox1, $mvTitle );
788 -
 762+
789763 $wgOut->addParserOutput( $parserOutput );
790764 return $wgOut->getHTML() . '<div style="clear:both;"><hr></div>';
791765 }
792 -
 766+
793767 if ( $editPageAjax->edit( $wpTextbox1 ) == false ) {
794768 if ( $mvd_id == 'new' ) {
795 -
796 - // get context info to position timeline element:
 769+
 770+ // get context info to position timeline element:
797771 $rt = ( isset( $_REQUEST['wgTitle'] ) ) ? $_REQUEST['wgTitle']:null;
798772 $this->get_overlay_context_from_title( $rt );
799773
800 - // get updated mvd_id:
 774+ // get updated mvd_id:
801775 $dbr =& wfGetDB( DB_SLAVE );
802776 $result = & MV_Index::getMVDbyTitle( $titleKey, 'mv_page_id' );
803777 $mvd_id = $result->id;
804 - // update title key
805 -
 778+ // update title key
 779+
806780 // purge cache for parent stream and MVD
807781 MV_MVD::onEdit( $this->mvd_pages, $mvd_id );
808 -
 782+
809783 // return Encapsulated (since its a new mvd)
810784 $returnEncapsulated = true;
811785 } else {
812 - // purge cache for parent stream
 786+ // purge cache for parent stream
813787 MV_MVD::onEdit( $this->mvd_pages, $mvd_id );
814 - }
 788+ }
815789 if ( $returnEncapsulated ) {
816790 //print "get Encapsulated:\n";
817791 return php2jsObj( array( 'status' => 'ok',
@@ -839,24 +813,24 @@
840814 $this->duration = $mvContextTitle->getDuration();
841815 }
842816 /* do the move @@todo this could be abstracted to extend special move page
843 - * although special move_page is not very complex.
 817+ * although special move_page is not very complex.
844818 */
845819 // very similar to SpecialMovepage.php doSubmit()
846820 function do_adjust_submit( $titleKey, $mvd_id, $newTitle, $contextTitle, $outputMVD = '' ) {
847 - global $wgOut, $mvgIP, $wgUser;
 821+ global $wgOut, $mvgIP, $wgUser;
848822 // get context from MVStream request title:
849823 $this->get_overlay_context_from_title( $contextTitle );
850 -
 824+
851825 $this->reason = isset( $_REQUEST['wpSummary'] ) ? $_REQUEST['wpSummary']:wfMsg( 'mv_adjust_default_reason' );
852826 $this->moveTalk = true;
853827 $this->watch = false;
854 -
 828+
855829 // do the move:
856830 if ( $wgUser->pingLimiter( 'move' ) ) {
857831 $wgOut->rateLimited();
858832 return array( 'status' => 'error', 'error_txt' => $wgOut->getHTML() ) ;
859833 }
860 -
 834+
861835 // we should only be adjusting MVD namespace items:
862836 $ot = Title::newFromText( $titleKey, MV_NS_MVD );
863837 $nt = Title::newFromText( $newTitle, MV_NS_MVD );
@@ -864,8 +838,8 @@
865839 if ( !$ot->exists() ) {
866840 $wgOut->addHTML( '<p class="error">' . wfMsg( 'mv_adjust_old_title_missing', $ot->getText() ) . "</p>\n" );
867841 return array( 'status' => 'error', 'error_txt' => $wgOut->getHTML() );
868 - }
869 -
 842+ }
 843+
870844 // if the page we want to move to exists and starts with #REDIRECT override it
871845 if ( $nt->exists() ) {
872846 $ntArticle = new Article( $nt );
@@ -873,11 +847,11 @@
874848 if ( substr( $cur_text, 0, strlen( '#REDIRECT' ) ) == '#REDIRECT' ) {
875849 // remove page (normal users can "delete mvd_pages if they are redirects)
876850 $ntArticle->doDelete( wfMsgForContent( 'mv_redirect_and_delete_reason' ) );
877 - // clear deletion log msg:
 851+ // clear deletion log msg:
878852 $wgOut->clearHTML();
879853 }
880854 }
881 -
 855+
882856 # Delete to make way if requested (not dealt with for now)
883857 // if ( $wgUser->isAllowed( 'delete' ) && $this->deleteAndMove ) {
884858 // $article = new Article( $nt );
@@ -893,19 +867,19 @@
894868 $old_article = new Article( $ot );
895869 $this->preMoveArtileText = $old_article->getContent();
896870 unset( $old_article );
897 -
 871+
898872 // @@todo we should really just remove the old article (instead of putting a redirect there)
899873 $error = $ot->moveTo( $nt, true, $this->reason );
900 -
901 -
 874+
 875+
902876 if ( $error !== true ) {
903877 $wgOut->addWikiText( '<p class="error">' . wfMsg( $error ) . "</p>\n" );
904878 return array( 'status' => 'error', 'error_txt' => $wgOut->getHTML() );
905879 } else {
906880 /*print "js_log('should have moved the page');\n";
907881 print "js_log('new page title: ".$nt->getText()."');\n";
908 - //clear cache for title:
909 - //$nt->invalidateCache();
 882+ //clear cache for title:
 883+ //$nt->invalidateCache();
910884 //Article::onArticleEdit($nt);
911885 global $wgDeferredUpdateList, $mediaWiki;
912886 $mediaWiki->doUpdates( $wgDeferredUpdateList );
@@ -921,7 +895,7 @@
922896 if ( $ott->exists() ) {
923897 if ( $this->moveTalk && !$ot->isTalkPage() && !$nt->isTalkPage() ) {
924898 $ntt = $nt->getTalkPage();
925 -
 899+
926900 # Attempt the move
927901 $error = $ott->moveTo( $ntt, true, $this->reason );
928902 if ( $error === true ) {
@@ -945,44 +919,44 @@
946920 $wgUser->removeWatch( $ot );
947921 $wgUser->removeWatch( $nt );
948922 }
949 - // purge cache of parent stream & mvd_node:
 923+ // purge cache of parent stream & mvd_node:
950924 MV_MVD::onEdit( $this->mvd_pages, $mvd_id );
951925 // MV_MVD::onMove($this->mvd_pages, $mvd_id, $newTitle);
952926 // MV_MVD::disableCache($this->mvd_pages, $mvd_id);
953927
954928 // $tsTitle = Title::newFromText( $newTitle, MV_NS_MVD);
955929 // print "js_log('titleDB: ".$tsTitle->getDBkey() ."');\n";
956 - /*if($tsTitle->exists()){
 930+ /*if($tsTitle->exists()){
957931 print "js_log('{$tsTitle->getDBkey()} present:');\n";
958932 }else{
959933 print "js_log('{$tsTitle->getDBkey()} not present');\n";
960 - }*/
961 -
 934+ }*/
 935+
962936 # return the javascript object (so that the inteface can update the user)
963937 // get_fd_mvd_request($titleKey, $mvd_id, $mode='inner', $content='')
964938 return array( 'status' => 'ok',
965939 'error_txt' => $wgOut->getHTML(),
966940 'mv_adjust_ok_move' => wfMsg( 'mv_adjust_ok_move' ),
967 - 'titleKey' => $newTitle,
 941+ 'titleKey' => $newTitle,
968942 'tl_mvd' => $this->get_tl_mvd_request( $newTitle, $mvd_id )
969943 );
970944 }
971945 function get_edit_disp( $titleKey, $mvd_id = 'new', $ns = MV_NS_MVD ) {
972946 global $mvgIP, $wgOut, $wgScriptPath, $wgUser, $wgTitle, $mvMetaDataHelpers;
973 -
 947+
974948 $mvd_type = strtolower( array_shift( split( ':', $titleKey ) ) );
975949 // print "new article title: " . $titleKey;
976950 $wgTitle = Title::newFromText( $titleKey, $ns );
977 - // make a title article with global title:
 951+ // make a title article with global title:
978952 $Article = new Article( $wgTitle );
979 - // make the ediPageajax obj
 953+ // make the ediPageajax obj
980954
981955 $editPageAjax = new MV_EditPageAjax( $Article );
982956
983 -
 957+
984958 $customPreEditHtml = $this->get_adjust_disp( $titleKey, $mvd_id );
985 -
986 - // add custom data helpers if editing annotative layer:
 959+
 960+ // add custom data helpers if editing annotative layer:
987961 if ( $mvd_type == 'anno_en' ) {
988962 $editPageAjax->setBasicHtml( $this->get_dataHelpers( $titleKey, $mvd_id ) );
989963 // don't display "advanced" edit
@@ -991,16 +965,16 @@
992966
993967 // add in adjust code & hidden helpers
994968 $editPageAjax->setAdjustHtml( $customPreEditHtml );
995 - // set ts id:
 969+ // set ts id:
996970 $editPageAjax->mvd_id = $mvd_id;
997 -
998 - // fill wgOUt with edit form:
 971+
 972+ // fill wgOUt with edit form:
999973 $editPageAjax->edit();
1000974 return $wgOut->getHTML();
1001975 // @@todo base edit display off of template (some how?)
1002 - // special structure for editing type ht_en
 976+ // special structure for editing type ht_en
1003977 }
1004 -
 978+
1005979 function get_history_disp( $titleKey, $mvd_id ) {
1006980 global $mvgIP, $wgOut;
1007981 $title = Title::newFromText( $titleKey, MV_NS_MVD );
@@ -1022,9 +996,9 @@
1023997 global $wgOut;
1024998 $title = Title::newFromText( $titleKey, MV_NS_MVD );
1025999 $article = new Article( $title );
1026 - // purge parent article:
 1000+ // purge parent article:
10271001 MV_MVD::onEdit( $this->mvd_pages, $mvd_id );
1028 - // run the delete function:
 1002+ // run the delete function:
10291003 $article->doDelete( $_REQUEST['wpReason'] );
10301004 // check if delete
10311005 if ( $article->exists() ) {
@@ -1039,7 +1013,7 @@
10401014 @list( $width, $height ) = explode( 'x', $this->mv_interface->smwProperties['playback_resolution'] );
10411015 if ( isset( $width ) && isset( $height ) ) {
10421016 if ( is_numeric( $width ) && is_numeric( $height ) ) {
1043 - // offset in refrence to mv_custom.css
 1017+ // offset in refrence to mv_custom.css
10441018 $width += 2;
10451019 $height += 30;
10461020 $left = $width + 10 + 30;
@@ -1055,24 +1029,24 @@
10561030 class MV_MVD {
10571031 /*actions for mvd page edits */
10581032 function onEdit( &$mvd_pages_cache, $mvd_id ) {
1059 - // force update local mvd_page_cache from db:
 1033+ // force update local mvd_page_cache from db:
10601034 $mvd_pages_cache[$mvd_id] = MV_Index::getMVDbyId( $mvd_id );
1061 -
 1035+
10621036 $stream_name = MV_Stream::getStreamNameFromId( $this->mvd_pages[$mvd_id]->stream_id );
10631037 $streamTitle = Title::newFromText( $stream_name, MV_NS_STREAM );
10641038 // clear the cache for the parent stream page:
10651039 // print "clear parent stream: " . $streamTitle ."\n";
10661040 Article::onArticleEdit( $streamTitle );
1067 -
 1041+
10681042 }
10691043 // updates the current version cached version of mvd
10701044 function onMove( &$mvd_pages_cache, $mvd_id ) {
1071 - // if(!isset($mvd_pages_cache[$mvd_id]))
1072 - // $mvd_pages_cache[$mvd_id] = MV_Index::getMVDbyId($mvd_id);
 1045+ // if(!isset($mvd_pages_cache[$mvd_id]))
 1046+ // $mvd_pages_cache[$mvd_id] = MV_Index::getMVDbyId($mvd_id);
10731047 }
10741048 /*function disableCache($mvd_id){
1075 - if(!isset($mvd_pages_cache[$mvd_id]))
1076 - $mvd_pages_cache[$mvd_id] = MV_Index::getMVDbyId($mvd_id);
 1049+ if(!isset($mvd_pages_cache[$mvd_id]))
 1050+ $mvd_pages_cache[$mvd_id] = MV_Index::getMVDbyId($mvd_id);
10771051 $mvd_pages_cache[$mvd_id]->usePCache=false;
10781052 }*/
10791053 }

Status & tagging log