Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Overlay.php |
— | — | @@ -10,16 +10,16 @@ |
11 | 11 | // hide the fact box in any MV_Overlay driven view of mvd |
12 | 12 | global $smwgShowFactbox; |
13 | 13 | $smwgShowFactbox = SMW_FACTBOX_HIDDEN; |
14 | | - |
| 14 | + |
15 | 15 | class MV_Overlay extends MV_Component { |
16 | 16 | /*init function should load the target overlay*/ |
17 | | - // set up defaults: |
| 17 | + // set up defaults: |
18 | 18 | var $req = 'stream_transcripts'; |
19 | 19 | var $tl_width = '16'; |
20 | 20 | var $parserOutput = null; |
21 | 21 | var $oddEvenToggle = true; |
22 | 22 | var $mvd_pages = array(); |
23 | | - |
| 23 | + |
24 | 24 | /*structures the component output and call html code generation */ |
25 | 25 | function getHTML() { |
26 | 26 | switch( $this->req ) { |
— | — | @@ -31,14 +31,14 @@ |
32 | 32 | break; |
33 | 33 | } |
34 | 34 | } |
35 | | - |
36 | | - // renders recent changes in the MVD namespace |
| 35 | + |
| 36 | + // renders recent changes in the MVD namespace |
37 | 37 | function do_Recentchanges() { |
38 | 38 | global $wgOut; |
39 | | - // quick and easy way: |
| 39 | + // quick and easy way: |
40 | 40 | $wgOut->addWikiText( '{{Special:Recentchanges/namespace=' . MV_NS_MVD . '}}' ); |
41 | 41 | } |
42 | | - |
| 42 | + |
43 | 43 | function do_stream_transcripts() { |
44 | 44 | global $wgOut; |
45 | 45 | $this->procMVDReqSet(); |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | $out = ''; |
48 | 48 | // set up left hand side timeline |
49 | 49 | $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">' . |
51 | 51 | $this->get_video_timeline() . |
52 | 52 | '</div>'); |
53 | 53 | */ |
— | — | @@ -57,33 +57,33 @@ |
58 | 58 | $this->get_transcript_pages(); |
59 | 59 | $wgOut->addHTML( "</div>" ); |
60 | 60 | } |
61 | | - |
| 61 | + |
62 | 62 | function render_full() { |
63 | 63 | global $wgOut; |
64 | | - // "<div >" . |
| 64 | + // "<div >" . |
65 | 65 | $wgOut->addHTML( "<div id=\"selectionsBox\">\n" ); |
66 | 66 | $this->getHTML(); |
67 | 67 | $wgOut->addHTML( "</div>\n" ); |
68 | 68 | // add in contorls: |
69 | 69 | $wgOut->addHTML( $this->render_controls() ); |
70 | | - |
| 70 | + |
71 | 71 | } |
72 | | - |
| 72 | + |
73 | 73 | function render_controls() { |
74 | 74 | global $mvgShowLayerControls; |
75 | | - $ct = '<div class="layers"> |
| 75 | + $ct = '<div class="layers"> |
76 | 76 | <ul> |
77 | 77 | <li> |
78 | 78 | <a href="javascript:mv_disp_add_mvd(\'anno_en\')">' . wfMsg( 'mv_new_anno_en' ) . '</a> |
79 | 79 | </li> |
80 | 80 | <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> |
82 | 82 | </li>'; |
83 | 83 | if($mvgShowLayerControls){ |
84 | 84 | $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> |
86 | 86 | </li>'; |
87 | | - } |
| 87 | + } |
88 | 88 | $ct.=' </ul> |
89 | 89 | </div>'; |
90 | 90 | return $ct; |
— | — | @@ -92,7 +92,7 @@ |
93 | 93 | global $wgLang; |
94 | 94 | |
95 | 95 | $base_title = ''; |
96 | | - // set the base title to the stream name: |
| 96 | + // set the base title to the stream name: |
97 | 97 | if ( isset( $this->mv_interface->article->mvTitle ) ) { |
98 | 98 | $base_title = $this->mv_interface->article->mvTitle->getStreamName(); |
99 | 99 | } |
— | — | @@ -119,10 +119,10 @@ |
120 | 120 | foreach ( $this->mvd_pages as & $mvd_page ) { |
121 | 121 | $out .= $this->get_timeline_html( $mvd_page ); |
122 | 122 | } |
123 | | - // output the time stamps: |
| 123 | + // output the time stamps: |
124 | 124 | /*$out.='<div style="position:absolute;top:0%;z-index:2;background:#FFFFFF;font-size:x-small">'; |
125 | 125 | $out.=$start_str; |
126 | | - $out.='</div>'; |
| 126 | + $out.='</div>'; |
127 | 127 | $out.='<div style="position:absolute;top:100%;z-index:2;background:#FFFFFF;font-size:x-small">'; |
128 | 128 | $out.=$end_str; |
129 | 129 | $out.='</div>';*/ |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | function get_transcript_pages() { |
151 | 151 | global $wgUser, $mvgIP, $wgOut; |
152 | 152 | $sk = $wgUser->getSkin(); |
153 | | - |
| 153 | + |
154 | 154 | $out = ''; |
155 | 155 | if ( count( $this->mvd_pages ) == 0 ) { |
156 | 156 | $out = 'no mvd rows found'; |
— | — | @@ -164,15 +164,15 @@ |
165 | 165 | // print_r($mvd_page); |
166 | 166 | // "<div id=\"mv_ctail_{$mvd_page->id}\" style=\"position:relative\">" |
167 | 167 | 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 |
169 | 169 | $img_url = MV_StreamImage::getStreamImageURL( $mvd_page->stream_id, $mvd_page->start_time, null, true ); |
170 | 170 | } else { |
171 | 171 | $img_url = MV_StreamImage::getStreamImageURL( $mvd_page->stream_id, $mvd_page->start_time, $mvDefaultVideoPlaybackRes, true ); |
172 | 172 | } |
173 | 173 | $oe_class = ''; |
174 | | - //color annnotative layers seperatly: |
| 174 | + //color annnotative layers seperatly: |
175 | 175 | $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) |
177 | 177 | if ( $this->oddEvenToggle ) { |
178 | 178 | $this->oddEvenToggle = false; |
179 | 179 | $oe_class .= ' even'; |
— | — | @@ -180,14 +180,14 @@ |
181 | 181 | $this->oddEvenToggle = true; |
182 | 182 | $oe_class .= ' odd'; |
183 | 183 | } |
184 | | - |
| 184 | + |
185 | 185 | // style=\"background:#".$this->getMvdBgColor($mvd_page)."\" " |
186 | 186 | $wgOut->addHTML( '<fieldset class="mv_fd_mvd' . htmlspecialchars( $oe_class ) . '" id="mv_fd_mvd_' . htmlspecialchars( $mvd_page->id ) . '" ' . |
187 | 187 | 'name="' . htmlspecialchars( $mvd_page->wiki_title ) . '" ' . |
188 | 188 | '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) . |
192 | 192 | "</legend>");*/ |
193 | 193 | // $menu_html = $this->get_mvd_menu($mvd_page); |
194 | 194 | $wgOut->addHTML( "<div id=\"mv_fcontent_{$mvd_page->id}\">" ); |
— | — | @@ -206,7 +206,7 @@ |
207 | 207 | return $this->get_timeline_html( $this->mvd_pages[$mvd_id] ); |
208 | 208 | } |
209 | 209 | function get_fd_mvd_request( $titleKey, $mvd_id, $mode = 'inner', $content = '' ) { |
210 | | - global $wgOut; |
| 210 | + global $wgOut; |
211 | 211 | if ( !isset( $this->mvd_pages[$mvd_id] ) ) |
212 | 212 | $this->mvd_pages[$mvd_id] = MV_Index::getMVDbyId( $mvd_id ); |
213 | 213 | if ( $mode == 'inner' ) { |
— | — | @@ -223,27 +223,27 @@ |
224 | 224 | /* |
225 | 225 | * time_line actions added by jQuery |
226 | 226 | '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()" ' . |
229 | 229 | */ |
230 | 230 | 'style="position:absolute;background:#' . $this->getMvdBgColor( $mvd_page ) . ';' . |
231 | 231 | 'width:' . $this->tl_width . 'px;'; |
232 | 232 | // set left based on array key: |
233 | 233 | $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: |
235 | 235 | if ( $keyOrder === false )$keyOrder = 0; |
236 | 236 | $out .= 'left:' . ( $keyOrder * $this->tl_width ) . 'px;'; |
237 | 237 | // check if duration is set (for php calculation of height position) |
238 | 238 | 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: |
241 | 241 | $page_start = ( $mvd_page->start_time < $this->start_time ) ? $this->start_time:$mvd_page->start_time; |
242 | 242 | $page_end = ( $mvd_page->end_time > $this->end_time ) ? $this->end_time:$mvd_page->end_time; |
243 | | - |
| 243 | + |
244 | 244 | $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"; |
246 | 246 | $height_perc = round( 100 * ( $page_duration / $this->duration ), 2 ); |
247 | | - |
| 247 | + |
248 | 248 | if ( $page_start == 0 ) { // avoid dividing zero |
249 | 249 | $loc_perc = 0; |
250 | 250 | } else { |
— | — | @@ -255,7 +255,7 @@ |
256 | 256 | $height_perc = 100 - $loc_perc; |
257 | 257 | } |
258 | 258 | if ( $loc_perc < 0 )$loc_perc = 0; |
259 | | - |
| 259 | + |
260 | 260 | $out .= 'height:' . $height_perc . '%;' . |
261 | 261 | 'top:' . $loc_perc . '%"></div>' . "\n"; |
262 | 262 | } else { |
— | — | @@ -263,7 +263,7 @@ |
264 | 264 | } |
265 | 265 | return $out; |
266 | 266 | } |
267 | | - |
| 267 | + |
268 | 268 | function getMVDhtml( &$mvd_page, $absolute_links = false ) { |
269 | 269 | global $wgOut; |
270 | 270 | // incase we call mid output (but really should use outputMVD in those cases) |
— | — | @@ -285,24 +285,24 @@ |
286 | 286 | // print "js_log('missing: " .$mvd_page->wiki_title."');\n"; |
287 | 287 | return ; |
288 | 288 | } |
289 | | - // use the cache by default: |
| 289 | + // use the cache by default: |
290 | 290 | // $usepCache = (isset($mvd_page->usePcache))?$mvd_page->usePcache:true; |
291 | | - |
| 291 | + |
292 | 292 | /*try to pull from cache: separate out cache for internal links vs external links cache*/ |
293 | | - if( $wgEnableParserCache ) { |
| 293 | + if( $wgEnableParserCache ) { |
294 | 294 | $MvParserCache = & MV_ParserCache::singleton(); |
295 | 295 | $add_opt = ( $absolute_links ) ? 'a':''; |
296 | 296 | // add the dbKey since I don't know how to easy purge the cache and we are getting cache missmatch |
297 | 297 | $add_opt .= $mvdTitle->getDBkey(); |
298 | 298 | $MvParserCache->addToKey( $add_opt ); |
299 | | - |
| 299 | + |
300 | 300 | $parserOutput = $MvParserCache->get( $mvdArticle, $wgUser ); |
301 | 301 | }else{ |
302 | 302 | $parserOutput=false; |
303 | 303 | } |
304 | 304 | if ( $parserOutput !== false ) { |
305 | 305 | // 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: |
307 | 307 | $wgOut->addParserOutput( $parserOutput ); |
308 | 308 | } else { |
309 | 309 | // print "js_log('not found in cache');\n"; |
— | — | @@ -315,15 +315,15 @@ |
316 | 316 | if ( isset( $this->preMoveArtileText ) ) { |
317 | 317 | $wikiText = & $this->preMoveArtileText; |
318 | 318 | } else { |
319 | | - // @@todo throw error: |
| 319 | + // @@todo throw error: |
320 | 320 | // print "error article: " . $mvd_page->wiki_title . " not there \n"; |
321 | 321 | print "js_log('missing: " . $mvd_page->wiki_title . "');\n"; |
322 | 322 | return ; |
323 | 323 | } |
324 | 324 | } |
325 | 325 | $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: |
328 | 328 | if ( $absolute_links == true ) { |
329 | 329 | global $wgServer; |
330 | 330 | $parserOutput->mText = str_replace( array( 'href="https://www.mediawiki.org/', 'src="/' ), array( 'href="' . $wgServer . '/', 'src="' . $wgServer . '/' ), $parserOutput->mText ); |
— | — | @@ -349,7 +349,7 @@ |
350 | 350 | case 'anno_en': |
351 | 351 | $play_link_o = '<a href="javascript:mv_do_play(' . htmlspecialchars( $mvd_page->id ) . ')">'; |
352 | 352 | $play_link_img_close = '<img border="0" src="' . htmlspecialchars( $mvgScriptPath ) . '/skins/images/button_play.png">' . '</a>'; |
353 | | - |
| 353 | + |
354 | 354 | $smw_attr = $this->get_and_strip_semantic_tags( $text ); |
355 | 355 | foreach ( $smw_attr as $smw_key => $smw_attr_val ) { |
356 | 356 | // do special display for given values: |
— | — | @@ -360,7 +360,7 @@ |
361 | 361 | if( $pTitle->exists() ){ |
362 | 362 | $pimg = mv_get_person_img( $smw_attr_val ); |
363 | 363 | $pre_text_html .= '<p class="mvd_page_image">'; |
364 | | - |
| 364 | + |
365 | 365 | if ( $mvd_page != '' ) { |
366 | 366 | $pre_text_html .= $play_link_o; |
367 | 367 | $added_play_link = true; |
— | — | @@ -379,7 +379,7 @@ |
380 | 380 | if ( $template_key == 'anno_en' ) |
381 | 381 | $smw_text_html .= ucwords( $smwKeyTitle->getText() ) . ': ' . $sk->makeLinkObj( $valueTitle ) . '<br>'; |
382 | 382 | } |
383 | | - |
| 383 | + |
384 | 384 | if ( !$added_play_link && $mvd_page != '' ) { |
385 | 385 | $pre_text_html .= '<p class="mvd_page_image">' . $play_link_o . $play_link_img_close . '</p>'; |
386 | 386 | // print "SHOULD HAVE PUT IN pre_text:$pre_text_html"; |
— | — | @@ -388,16 +388,16 @@ |
389 | 389 | if ( $mvd_page != '' ) { |
390 | 390 | $pre_text_html .= '<span class="mvd_menu_header">' . $this->get_mvd_menu( $mvd_page ) . '</span>'; |
391 | 391 | } |
392 | | - // if absolute links clear out links: |
| 392 | + // if absolute links clear out links: |
393 | 393 | if ( $absolute_links ) |
394 | 394 | $pre_text_html = ''; |
395 | 395 | $pre_text_html .= '<span class="description">'; |
396 | 396 | $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: |
398 | 398 | 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: |
400 | 400 | 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 |
402 | 402 | $text = '[[' . $pTitle->getText() . ']]: ' . trim( $text ); |
403 | 403 | } |
404 | 404 | } |
— | — | @@ -408,73 +408,73 @@ |
409 | 409 | } |
410 | 410 | // now add the text with categories if present: |
411 | 411 | $sk =& $wgUser->getSkin(); |
412 | | - // run via parser to add in Category info: |
| 412 | + // run via parser to add in Category info: |
413 | 413 | // $parserOptions = ParserOptions::newFromUser( $wgUser ); |
414 | 414 | $parserOptions = new ParserOptions(); |
415 | 415 | $parserOptions->setEditSection( false ); |
416 | 416 | $parserOptions->setTidy( true ); |
417 | 417 | $parserOutput = $wgParser->parse( $text , $mvdTile, $parserOptions, true, true ); |
418 | 418 | $wgOut->addCategoryLinks( $parserOutput->getCategories() ); |
419 | | - |
| 419 | + |
420 | 420 | $parserOutput->mText .= $sk->getCategories(); |
421 | 421 | $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) |
424 | 424 | $wgOut->mCategoryLinks = array(); |
425 | 425 | $parserOutput->mCategories = null; |
426 | 426 | return $parserOutput; |
427 | 427 | } |
428 | 428 | function get_add_disp( $baseTitle, $mvdType, $time_range ) { |
429 | 429 | global $wgUser, $wgOut, $mvDefaultClipLength, $mvMVDTypeAllAvailable, $wgRequest; |
430 | | - |
| 430 | + |
431 | 431 | 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 |
433 | 433 | if ( !in_array( $mvdType, $mvMVDTypeAllAvailable ) )return; |
434 | 434 | # Or we could throw an exception: |
435 | | - # throw new MWException( __METHOD__ . ' called invalid mvdType.' ); |
| 435 | + # throw new MWException( __METHOD__ . ' called invalid mvdType.' ); |
436 | 436 | |
437 | 437 | $mvd_page = new MV_MVD(); |
438 | 438 | $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); |
442 | 442 | // $mvd_page->end_time = seconds2npt( npt2seconds($start_context) + $mvDefaultClipLength); |
443 | 443 | $mvd_page->wiki_title = $mvdType . ':' . strtolower( $baseTitle ) . '/_new'; |
444 | 444 | $this->get_edit_disp( $mvd_page->wiki_title, 'new' ); |
445 | | - |
446 | | - |
| 445 | + |
| 446 | + |
447 | 447 | 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) |
451 | 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) |
| 451 | + |
452 | 452 | // $wgTitle = Title::newFromText($titleKey, MV_NS_MVD); |
453 | 453 | |
454 | | - |
| 454 | + |
455 | 455 | // make a "new" mvd: |
456 | 456 | // $mvd_page = new mvd_pageObj(); |
457 | 457 | // $mvd_page->id = 'new'; |
458 | 458 | // $mvd_page->start_time = seconds2npt(0); |
459 | 459 | // $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; |
461 | 461 | |
462 | 462 | // $this->get_edit_disp($mvd_page->wiki_title,'new'); |
463 | 463 | // clear out html: |
464 | 464 | // $wgOut->clearHTML(); |
465 | 465 | |
466 | | - // get encapsulated mvd: |
| 466 | + // get encapsulated mvd: |
467 | 467 | // $this->get_fd_mvd_page($mvd_page, $edit_html); |
468 | 468 | |
469 | | - // get the edit page code: |
| 469 | + // get the edit page code: |
470 | 470 | } |
471 | 471 | /*return transcript menu*/ |
472 | 472 | function get_mvd_menu( &$mvd_page ) { |
473 | 473 | global $wgUser, $mvgScriptPath, $wgRequest; |
474 | 474 | $sk = $wgUser->getSkin(); |
475 | | - |
| 475 | + |
476 | 476 | // hack to get menu correct... |
477 | 477 | $do_adjust = $wgRequest->getVal( 'do_adjust' ); |
478 | | - //fix boolean string issue: |
| 478 | + //fix boolean string issue: |
479 | 479 | $do_adjust = ( $do_adjust == 'false' ) ? false : $do_adjust; |
480 | 480 | if ( $do_adjust ) { |
481 | 481 | $tmpMvPage = new MV_Title( $wgRequest->getVal( 'newTitle' ) ); |
— | — | @@ -482,33 +482,33 @@ |
483 | 483 | $mvd_page->start_time = npt2seconds( $tmpMvPage->start_time ); |
484 | 484 | $mvd_page->end_time = npt2seconds( $tmpMvPage->end_time ); |
485 | 485 | } |
486 | | - |
| 486 | + |
487 | 487 | $out = ''; |
488 | 488 | // set up links: |
489 | 489 | $plink = ''; |
490 | 490 | $elink = '<a title="' . htmlspecialchars( wfMsg( 'mv_edit_adjust_title' ) ) . |
491 | 491 | '" href="javascript:mv_edit_disp(\'' . htmlspecialchars( $mvd_page->wiki_title ) . |
492 | 492 | '\', \'' . htmlspecialchars( $mvd_page->id ) . '\')">' . wfMsg( 'mv_edit' ) . '</a>'; |
493 | | - |
| 493 | + |
494 | 494 | // $alink = '<a title="'.wfMsg('mv_adjust_title').'" href="javascript:mv_adjust_disp(\''.$mvd_page->wiki_title.'\', \''.$mvd_page->id.'\')">'.wfMsg('mv_adjust').'</a>'; |
495 | 495 | |
496 | 496 | // print "wiki title: " . $mvd_page->wiki_title; |
497 | 497 | $hTitle = Title::newFromText( $mvd_page->wiki_title, MV_NS_MVD ); |
498 | 498 | // print $hTitle-> |
499 | 499 | $hlink = $sk->makeKnownLinkObj( $hTitle, wfMsg( 'mv_history' ), 'action=history' ); |
500 | | - |
| 500 | + |
501 | 501 | $dTitle = Title::newFromText( $mvd_page->wiki_title, MV_NS_MVD_TALK ); |
502 | 502 | $dlink = $sk->makeKnownLinkObj( $dTitle, wfMsg( 'talk' ) ); |
503 | | - |
| 503 | + |
504 | 504 | // {s:\''.seconds2npt($mvd_page->start_time).'\',e:\''.seconds2npt($mvd_page->end_time).'\'} |
505 | 505 | /*$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;" ' . |
507 | 507 | 'href="javascript:mv_do_play('.htmlspecialchars($mvd_page->id).');">' . |
508 | 508 | '<span style="width:44px"><img src="'.htmlspecialchars($mvgScriptPath).'/skins/images/control_play_blue.png"></span>'.'</a>'. |
509 | 509 | htmlspecialchars(seconds2npt($mvd_page->start_time) . ' to ' . htmlspecialchars(seconds2npt($mvd_page->end_time))); |
510 | 510 | */ |
511 | 511 | $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) |
513 | 513 | $out .= $plink; |
514 | 514 | $out .= "( $elink $hlink $dlink"; |
515 | 515 | if ( $wgUser->isAllowed( 'mv_delete_mvd' ) ) { |
— | — | @@ -551,22 +551,22 @@ |
552 | 552 | return $ret_ary; |
553 | 553 | } |
554 | 554 | /* |
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).). |
556 | 556 | */ |
557 | 557 | function get_dataHelpers( $titleKey = 'new', $mvd_id = 'new' ) { |
558 | 558 | global $mvMetaDataHelpers, $mvMetaCategoryHelper, $wgUser, $mvgScriptPath; |
559 | 559 | $o = ''; |
560 | 560 | $sk = $wgUser->getSkin(); |
561 | 561 | $mvd_type = strtolower( array_shift( split( ':', $titleKey ) ) ); |
562 | | - |
563 | | - |
| 562 | + |
| 563 | + |
564 | 564 | // init metadata array: label |
565 | 565 | $metaData = array( 'prop' => array(), 'categories' => array() ); |
566 | 566 | // just get msg and basic div layout: \ |
567 | 567 | // css layout of forms was F*@#!!! withing me for some reason so yay table :P |
568 | 568 | $o .= '<span class="mv_basic_edit"><a href="#" onClick="mv_mvd_advs_toggle(' . htmlspecialchars( $mvd_id ) . ');return false;">' . wfMsg( 'mv_advanced_edit' ) . '</a></span> |
569 | 569 | <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 | + |
571 | 571 | $o .= '<input type="hidden" id="adv_basic_' . htmlspecialchars( $mvd_id ) . '" name="adv_basic" value="basic">'; |
572 | 572 | $o .= '<table class="mv_basic_edit mv_dataHelpers" id="mv_dataHelpers_' . htmlspecialchars( $mvd_id ) . '">'; |
573 | 573 | if ( isset( $mvMetaDataHelpers[strtolower( $mvd_type )] ) ) { |
— | — | @@ -579,26 +579,26 @@ |
580 | 580 | } |
581 | 581 | $metaData = $mvTitle->getMetaData(); |
582 | 582 | } |
583 | | - |
| 583 | + |
584 | 584 | foreach ( $mvMetaDataHelpers[strtolower( $mvd_type )] as $prop => $ac_index ) { |
585 | 585 | $val = ''; |
586 | | - // normalize the |
| 586 | + // normalize the |
587 | 587 | $prop = str_replace( ' ', '_', $prop ); |
588 | 588 | // set existing "value" |
589 | 589 | if ( isset( $metaData['prop'][$prop] ) ) { |
590 | 590 | $val = $metaData['prop'][$prop]; |
591 | 591 | } |
592 | | - // make sure the property exists: |
| 592 | + // make sure the property exists: |
593 | 593 | $swmTitle = Title::newFromText( (string)$prop, SMW_NS_PROPERTY ); |
594 | 594 | $smwImageHTML = ''; |
595 | 595 | if ( $swmTitle->exists() ) { |
596 | 596 | // $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) |
598 | 598 | if ( $swmTitle->getText() == 'Speech_by' ) { |
599 | 599 | $img = mv_get_person_img( $val ); |
600 | 600 | $smwImageHTML = '<img id="smw_' . htmlspecialchars( $prop ) . '_img" style="display: block;margin-left: auto;margin-right: auto;" src="' . htmlspecialchars( $img->getURL() ) . '" width=\"44\">'; |
601 | 601 | } |
602 | | - |
| 602 | + |
603 | 603 | $o .= "<tr><td><label>" . htmlspecialchars( $swmTitle->getText() ) . |
604 | 604 | ':</label></td><td>' . $smwImageHTML . '<input class="mv_anno_ac_' . htmlspecialchars( $mvd_id ) . '" ' . |
605 | 605 | 'size="40" name="smw_' . htmlspecialchars( $prop ) . '" type="text" value="' . htmlspecialchars( $val ) . '"> ' . |
— | — | @@ -621,7 +621,7 @@ |
622 | 622 | $catTitle->getText() . |
623 | 623 | '<a href="#" onclick="$j(\'#ext_cat_' . $i . '\').fadeOut(\'fast\').remove();return false;"> |
624 | 624 | <img border="0" src="' . $mvgScriptPath . '/skins/images/delete.png"> |
625 | | - </a> |
| 625 | + </a> |
626 | 626 | </span><br>'; |
627 | 627 | $i++; |
628 | 628 | } |
— | — | @@ -657,48 +657,22 @@ |
658 | 658 | $end_time = $mvTitle->getEndTime(); |
659 | 659 | } |
660 | 660 | if($start_time == "null") |
661 | | - $start_time = '0:00:00'; |
| 661 | + $start_time = '0:00:00'; |
662 | 662 | /* |
663 | 663 | * @@todo move some of this to CSS |
664 | 664 | */ |
665 | 665 | $mvd_id = htmlspecialchars( $mvd_id ); |
666 | 666 | $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"> </div> |
687 | | - <div class="" id="handle2_'.$mvd_id.'" style="cursor: move;position:absolute;background-color:#f55;height:20px;z-index:3"> </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 | + |
695 | 669 | $out .= '<span style="float:left;"><label class="mv_css_form" for="mv_start_hr_' . $mvd_id . '"><i>' . wfMsg( 'mv_start_desc' ) . ':</i></label> ' . |
696 | 670 | '<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 . '">' . |
697 | 671 | '</span>'; |
698 | | - |
| 672 | + |
699 | 673 | $out .= '<span style="float:left;"><label class="mv_css_form" for="mv_end_hr_' . $mvd_id . '"><i>' . wfMsg( 'mv_end_desc' ) . ':</i></label> ' . |
700 | 674 | '<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 . '">' . |
701 | 675 | '</span>'; |
702 | | - |
| 676 | + |
703 | 677 | // output page text (if not "new") |
704 | 678 | // if($mvd_id!='new') |
705 | 679 | // $out.=$this->get_fd_mvd_request( $titleKey, $mvd_id); |
— | — | @@ -727,34 +701,34 @@ |
728 | 702 | /*@@TODO document */ |
729 | 703 | function do_edit_submit( $titleKey, $mvd_id, $returnEncapsulated = false, $newTitleKey = '' ) { |
730 | 704 | global $wgOut, $wgScriptPath, $wgUser, $wgTitle, $wgRequest, $wgContLang; |
731 | | - |
| 705 | + |
732 | 706 | if ( $mvd_id == 'new' ) { |
733 | 707 | $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 | + } |
736 | 710 | // if doing basic editing use basic wpTextBox: |
737 | 711 | if ( $wgRequest->getVal( 'adv_basic' ) == 'basic' ) { |
738 | 712 | $wpTextbox1 = $wgRequest->getVal( 'basic_wpTextbox' ); |
739 | 713 | } else { |
740 | 714 | $wpTextbox1 = $wgRequest->getVal( 'wpTextbox1' ); |
741 | 715 | } |
742 | | - |
| 716 | + |
743 | 717 | // set up the title /article |
744 | 718 | $wgTitle = Title::newFromText( $titleKey, MV_NS_MVD ); |
745 | 719 | $Article = new Article( $wgTitle ); |
746 | | - |
| 720 | + |
747 | 721 | $wpTextbox1 = trim( $wpTextbox1 ); |
748 | 722 | // add all semantic form based attributes/relations to the posted body text |
749 | 723 | $formSemanticText = ''; |
750 | 724 | foreach ( $_POST as $key => $val ) { |
751 | 725 | $do_swm_include = true; |
752 | 726 | if ( substr( $key, 0, 4 ) == 'smw_' ) { |
753 | | - // try attribute |
| 727 | + // try attribute |
754 | 728 | $swmTitle = Title::newFromText( substr( $key, 4 ), SMW_NS_PROPERTY ); |
755 | 729 | if ( $swmTitle->exists() ) { |
756 | | - // make sure the semantic is not empty: |
| 730 | + // make sure the semantic is not empty: |
757 | 731 | if ( trim( $val ) != '' ) { |
758 | | - // @@todo update for other smw types: |
| 732 | + // @@todo update for other smw types: |
759 | 733 | if ( $swmTitle->getDBkey() == 'Spoken_By' ) { |
760 | 734 | $wpTextbox1 = "[[" . $swmTitle->getText() . '::' . $val . ']] ' . $wpTextbox1; |
761 | 735 | } else { |
— | — | @@ -764,53 +738,53 @@ |
765 | 739 | } |
766 | 740 | } |
767 | 741 | } |
768 | | - // add all categorizations: |
| 742 | + // add all categorizations: |
769 | 743 | $catNStxt = $wgContLang->getNsText( NS_CATEGORY ); |
770 | 744 | foreach ( $_POST as $k => $v ) { |
771 | 745 | if ( strpos( $k, 'ext_cat_' ) !== false ) { |
772 | 746 | $wpTextbox1 .= "\n[[" . $catNStxt . ":" . $v . "]]"; |
773 | 747 | } |
774 | 748 | } |
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 |
776 | 750 | $editPageAjax = new MV_EditPageAjax( $Article ); |
777 | 751 | $editPageAjax->mvd_id = $mvd_id; |
778 | | - |
779 | | - // if preview just return the parsed preview |
| 752 | + |
| 753 | + // if preview just return the parsed preview |
780 | 754 | // @@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. |
782 | 756 | if ( isset( $_POST['wpPreview'] ) ) { |
783 | 757 | // $out = $editPageAjax->getPreviewText(); |
784 | | - // $wgOut->addHTML($out); |
| 758 | + // $wgOut->addHTML($out); |
785 | 759 | $mvTitle = new MV_Title( $wgRequest->getVal( 'title' ) ); |
786 | | - |
| 760 | + |
787 | 761 | $parserOutput = $this->parse_format_text( $wpTextbox1, $mvTitle ); |
788 | | - |
| 762 | + |
789 | 763 | $wgOut->addParserOutput( $parserOutput ); |
790 | 764 | return $wgOut->getHTML() . '<div style="clear:both;"><hr></div>'; |
791 | 765 | } |
792 | | - |
| 766 | + |
793 | 767 | if ( $editPageAjax->edit( $wpTextbox1 ) == false ) { |
794 | 768 | if ( $mvd_id == 'new' ) { |
795 | | - |
796 | | - // get context info to position timeline element: |
| 769 | + |
| 770 | + // get context info to position timeline element: |
797 | 771 | $rt = ( isset( $_REQUEST['wgTitle'] ) ) ? $_REQUEST['wgTitle']:null; |
798 | 772 | $this->get_overlay_context_from_title( $rt ); |
799 | 773 | |
800 | | - // get updated mvd_id: |
| 774 | + // get updated mvd_id: |
801 | 775 | $dbr =& wfGetDB( DB_SLAVE ); |
802 | 776 | $result = & MV_Index::getMVDbyTitle( $titleKey, 'mv_page_id' ); |
803 | 777 | $mvd_id = $result->id; |
804 | | - // update title key |
805 | | - |
| 778 | + // update title key |
| 779 | + |
806 | 780 | // purge cache for parent stream and MVD |
807 | 781 | MV_MVD::onEdit( $this->mvd_pages, $mvd_id ); |
808 | | - |
| 782 | + |
809 | 783 | // return Encapsulated (since its a new mvd) |
810 | 784 | $returnEncapsulated = true; |
811 | 785 | } else { |
812 | | - // purge cache for parent stream |
| 786 | + // purge cache for parent stream |
813 | 787 | MV_MVD::onEdit( $this->mvd_pages, $mvd_id ); |
814 | | - } |
| 788 | + } |
815 | 789 | if ( $returnEncapsulated ) { |
816 | 790 | //print "get Encapsulated:\n"; |
817 | 791 | return php2jsObj( array( 'status' => 'ok', |
— | — | @@ -839,24 +813,24 @@ |
840 | 814 | $this->duration = $mvContextTitle->getDuration(); |
841 | 815 | } |
842 | 816 | /* 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. |
844 | 818 | */ |
845 | 819 | // very similar to SpecialMovepage.php doSubmit() |
846 | 820 | function do_adjust_submit( $titleKey, $mvd_id, $newTitle, $contextTitle, $outputMVD = '' ) { |
847 | | - global $wgOut, $mvgIP, $wgUser; |
| 821 | + global $wgOut, $mvgIP, $wgUser; |
848 | 822 | // get context from MVStream request title: |
849 | 823 | $this->get_overlay_context_from_title( $contextTitle ); |
850 | | - |
| 824 | + |
851 | 825 | $this->reason = isset( $_REQUEST['wpSummary'] ) ? $_REQUEST['wpSummary']:wfMsg( 'mv_adjust_default_reason' ); |
852 | 826 | $this->moveTalk = true; |
853 | 827 | $this->watch = false; |
854 | | - |
| 828 | + |
855 | 829 | // do the move: |
856 | 830 | if ( $wgUser->pingLimiter( 'move' ) ) { |
857 | 831 | $wgOut->rateLimited(); |
858 | 832 | return array( 'status' => 'error', 'error_txt' => $wgOut->getHTML() ) ; |
859 | 833 | } |
860 | | - |
| 834 | + |
861 | 835 | // we should only be adjusting MVD namespace items: |
862 | 836 | $ot = Title::newFromText( $titleKey, MV_NS_MVD ); |
863 | 837 | $nt = Title::newFromText( $newTitle, MV_NS_MVD ); |
— | — | @@ -864,8 +838,8 @@ |
865 | 839 | if ( !$ot->exists() ) { |
866 | 840 | $wgOut->addHTML( '<p class="error">' . wfMsg( 'mv_adjust_old_title_missing', $ot->getText() ) . "</p>\n" ); |
867 | 841 | return array( 'status' => 'error', 'error_txt' => $wgOut->getHTML() ); |
868 | | - } |
869 | | - |
| 842 | + } |
| 843 | + |
870 | 844 | // if the page we want to move to exists and starts with #REDIRECT override it |
871 | 845 | if ( $nt->exists() ) { |
872 | 846 | $ntArticle = new Article( $nt ); |
— | — | @@ -873,11 +847,11 @@ |
874 | 848 | if ( substr( $cur_text, 0, strlen( '#REDIRECT' ) ) == '#REDIRECT' ) { |
875 | 849 | // remove page (normal users can "delete mvd_pages if they are redirects) |
876 | 850 | $ntArticle->doDelete( wfMsgForContent( 'mv_redirect_and_delete_reason' ) ); |
877 | | - // clear deletion log msg: |
| 851 | + // clear deletion log msg: |
878 | 852 | $wgOut->clearHTML(); |
879 | 853 | } |
880 | 854 | } |
881 | | - |
| 855 | + |
882 | 856 | # Delete to make way if requested (not dealt with for now) |
883 | 857 | // if ( $wgUser->isAllowed( 'delete' ) && $this->deleteAndMove ) { |
884 | 858 | // $article = new Article( $nt ); |
— | — | @@ -893,19 +867,19 @@ |
894 | 868 | $old_article = new Article( $ot ); |
895 | 869 | $this->preMoveArtileText = $old_article->getContent(); |
896 | 870 | unset( $old_article ); |
897 | | - |
| 871 | + |
898 | 872 | // @@todo we should really just remove the old article (instead of putting a redirect there) |
899 | 873 | $error = $ot->moveTo( $nt, true, $this->reason ); |
900 | | - |
901 | | - |
| 874 | + |
| 875 | + |
902 | 876 | if ( $error !== true ) { |
903 | 877 | $wgOut->addWikiText( '<p class="error">' . wfMsg( $error ) . "</p>\n" ); |
904 | 878 | return array( 'status' => 'error', 'error_txt' => $wgOut->getHTML() ); |
905 | 879 | } else { |
906 | 880 | /*print "js_log('should have moved the page');\n"; |
907 | 881 | 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(); |
910 | 884 | //Article::onArticleEdit($nt); |
911 | 885 | global $wgDeferredUpdateList, $mediaWiki; |
912 | 886 | $mediaWiki->doUpdates( $wgDeferredUpdateList ); |
— | — | @@ -921,7 +895,7 @@ |
922 | 896 | if ( $ott->exists() ) { |
923 | 897 | if ( $this->moveTalk && !$ot->isTalkPage() && !$nt->isTalkPage() ) { |
924 | 898 | $ntt = $nt->getTalkPage(); |
925 | | - |
| 899 | + |
926 | 900 | # Attempt the move |
927 | 901 | $error = $ott->moveTo( $ntt, true, $this->reason ); |
928 | 902 | if ( $error === true ) { |
— | — | @@ -945,44 +919,44 @@ |
946 | 920 | $wgUser->removeWatch( $ot ); |
947 | 921 | $wgUser->removeWatch( $nt ); |
948 | 922 | } |
949 | | - // purge cache of parent stream & mvd_node: |
| 923 | + // purge cache of parent stream & mvd_node: |
950 | 924 | MV_MVD::onEdit( $this->mvd_pages, $mvd_id ); |
951 | 925 | // MV_MVD::onMove($this->mvd_pages, $mvd_id, $newTitle); |
952 | 926 | // MV_MVD::disableCache($this->mvd_pages, $mvd_id); |
953 | 927 | |
954 | 928 | // $tsTitle = Title::newFromText( $newTitle, MV_NS_MVD); |
955 | 929 | // print "js_log('titleDB: ".$tsTitle->getDBkey() ."');\n"; |
956 | | - /*if($tsTitle->exists()){ |
| 930 | + /*if($tsTitle->exists()){ |
957 | 931 | print "js_log('{$tsTitle->getDBkey()} present:');\n"; |
958 | 932 | }else{ |
959 | 933 | print "js_log('{$tsTitle->getDBkey()} not present');\n"; |
960 | | - }*/ |
961 | | - |
| 934 | + }*/ |
| 935 | + |
962 | 936 | # return the javascript object (so that the inteface can update the user) |
963 | 937 | // get_fd_mvd_request($titleKey, $mvd_id, $mode='inner', $content='') |
964 | 938 | return array( 'status' => 'ok', |
965 | 939 | 'error_txt' => $wgOut->getHTML(), |
966 | 940 | 'mv_adjust_ok_move' => wfMsg( 'mv_adjust_ok_move' ), |
967 | | - 'titleKey' => $newTitle, |
| 941 | + 'titleKey' => $newTitle, |
968 | 942 | 'tl_mvd' => $this->get_tl_mvd_request( $newTitle, $mvd_id ) |
969 | 943 | ); |
970 | 944 | } |
971 | 945 | function get_edit_disp( $titleKey, $mvd_id = 'new', $ns = MV_NS_MVD ) { |
972 | 946 | global $mvgIP, $wgOut, $wgScriptPath, $wgUser, $wgTitle, $mvMetaDataHelpers; |
973 | | - |
| 947 | + |
974 | 948 | $mvd_type = strtolower( array_shift( split( ':', $titleKey ) ) ); |
975 | 949 | // print "new article title: " . $titleKey; |
976 | 950 | $wgTitle = Title::newFromText( $titleKey, $ns ); |
977 | | - // make a title article with global title: |
| 951 | + // make a title article with global title: |
978 | 952 | $Article = new Article( $wgTitle ); |
979 | | - // make the ediPageajax obj |
| 953 | + // make the ediPageajax obj |
980 | 954 | |
981 | 955 | $editPageAjax = new MV_EditPageAjax( $Article ); |
982 | 956 | |
983 | | - |
| 957 | + |
984 | 958 | $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: |
987 | 961 | if ( $mvd_type == 'anno_en' ) { |
988 | 962 | $editPageAjax->setBasicHtml( $this->get_dataHelpers( $titleKey, $mvd_id ) ); |
989 | 963 | // don't display "advanced" edit |
— | — | @@ -991,16 +965,16 @@ |
992 | 966 | |
993 | 967 | // add in adjust code & hidden helpers |
994 | 968 | $editPageAjax->setAdjustHtml( $customPreEditHtml ); |
995 | | - // set ts id: |
| 969 | + // set ts id: |
996 | 970 | $editPageAjax->mvd_id = $mvd_id; |
997 | | - |
998 | | - // fill wgOUt with edit form: |
| 971 | + |
| 972 | + // fill wgOUt with edit form: |
999 | 973 | $editPageAjax->edit(); |
1000 | 974 | return $wgOut->getHTML(); |
1001 | 975 | // @@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 |
1003 | 977 | } |
1004 | | - |
| 978 | + |
1005 | 979 | function get_history_disp( $titleKey, $mvd_id ) { |
1006 | 980 | global $mvgIP, $wgOut; |
1007 | 981 | $title = Title::newFromText( $titleKey, MV_NS_MVD ); |
— | — | @@ -1022,9 +996,9 @@ |
1023 | 997 | global $wgOut; |
1024 | 998 | $title = Title::newFromText( $titleKey, MV_NS_MVD ); |
1025 | 999 | $article = new Article( $title ); |
1026 | | - // purge parent article: |
| 1000 | + // purge parent article: |
1027 | 1001 | MV_MVD::onEdit( $this->mvd_pages, $mvd_id ); |
1028 | | - // run the delete function: |
| 1002 | + // run the delete function: |
1029 | 1003 | $article->doDelete( $_REQUEST['wpReason'] ); |
1030 | 1004 | // check if delete |
1031 | 1005 | if ( $article->exists() ) { |
— | — | @@ -1039,7 +1013,7 @@ |
1040 | 1014 | @list( $width, $height ) = explode( 'x', $this->mv_interface->smwProperties['playback_resolution'] ); |
1041 | 1015 | if ( isset( $width ) && isset( $height ) ) { |
1042 | 1016 | if ( is_numeric( $width ) && is_numeric( $height ) ) { |
1043 | | - // offset in refrence to mv_custom.css |
| 1017 | + // offset in refrence to mv_custom.css |
1044 | 1018 | $width += 2; |
1045 | 1019 | $height += 30; |
1046 | 1020 | $left = $width + 10 + 30; |
— | — | @@ -1055,24 +1029,24 @@ |
1056 | 1030 | class MV_MVD { |
1057 | 1031 | /*actions for mvd page edits */ |
1058 | 1032 | 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: |
1060 | 1034 | $mvd_pages_cache[$mvd_id] = MV_Index::getMVDbyId( $mvd_id ); |
1061 | | - |
| 1035 | + |
1062 | 1036 | $stream_name = MV_Stream::getStreamNameFromId( $this->mvd_pages[$mvd_id]->stream_id ); |
1063 | 1037 | $streamTitle = Title::newFromText( $stream_name, MV_NS_STREAM ); |
1064 | 1038 | // clear the cache for the parent stream page: |
1065 | 1039 | // print "clear parent stream: " . $streamTitle ."\n"; |
1066 | 1040 | Article::onArticleEdit( $streamTitle ); |
1067 | | - |
| 1041 | + |
1068 | 1042 | } |
1069 | 1043 | // updates the current version cached version of mvd |
1070 | 1044 | 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); |
1073 | 1047 | } |
1074 | 1048 | /*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); |
1077 | 1051 | $mvd_pages_cache[$mvd_id]->usePCache=false; |
1078 | 1052 | }*/ |
1079 | 1053 | } |