Ejemplo n.º 1
0
 function update_index_title($old_title, $new_title)
 {
     global $mvIndexTableName;
     //make sure the new title is valid:
     $mvTitle = new MV_Title($new_title);
     if ($mvTitle->validRequestTitle()) {
         //build the update row
         $update_ary = array('wiki_title' => $mvTitle->getWikiTitle(), 'mvd_type' => $mvTitle->getTypeMarker(), 'stream_id' => $mvTitle->getStreamId(), 'start_time' => $mvTitle->getStartTimeSeconds(), 'end_time' => $mvTitle->getEndTimeSeconds());
         //get old row
         $mvd_row = MV_Index::getMVDbyTitle($old_title);
         $dbw =& wfGetDB(DB_WRITE);
         $dbw->update($mvIndexTableName, $update_ary, array('mv_page_id' => $mvd_row->mv_page_id));
     } else {
         //print "NOT VALID MOVE";
         //@@todo better error handling (tyring to move a MVD data into bad request form)
         throw new MWException("Invalid Page name for MVD namespace \n");
     }
 }
Ejemplo n.º 2
0
 function get_adjust_disp($titleKey = 'new', $mvd_id = 'new')
 {
     global $mvgScriptPath;
     //
     $out = '';
     if ($mvd_id == 'new' || $mvd_id == 'seq') {
         global $mvDefaultClipLength;
         $start_time = isset($this->start_context) ? $this->start_context : seconds2npt(0);
         $end_time = isset($this->end_context) ? seconds2npt(npt2seconds($this->start_context) + $mvDefaultClipLength) : seconds2npt($mvDefaultClipLength);
     } else {
         $mvTitle = new MV_Title($titleKey);
         if (!$mvTitle->validRequestTitle()) {
             return wfMsg('mvMVDFormat');
         }
         $start_time = $mvTitle->getStartTime();
         $end_time = $mvTitle->getEndTime();
     }
     if ($start_time == "null") {
         $start_time = '0:00:00';
     }
     /*
      * @@todo move some of this to CSS
      */
     $mvd_id = htmlspecialchars($mvd_id);
     $mvgScriptPath = htmlspecialchars($mvgScriptPath);
     $out .= '<br /><div class="inOutSlider"></div><br />';
     $out .= '<span style="float:left;"><label class="mv_css_form" for="mv_start_hr_' . $mvd_id . '"><i>' . wfMsg('mv_start_desc') . ':</i></label> ' . '<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 . '">' . '</span>';
     $out .= '<span style="float:left;"><label class="mv_css_form" for="mv_end_hr_' . $mvd_id . '"><i>' . wfMsg('mv_end_desc') . ':</i></label> ' . '<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 . '">' . '</span>';
     // output page text (if not "new")
     // if($mvd_id!='new')
     //	$out.=$this->get_fd_mvd_request( $titleKey, $mvd_id);
     /*$out.='<table width="100%">'.
     		'<tr><td>'.wfMsg('mv_start_desc').'</td>'.
     		'<td><input name="mv_start_hr_'.$mvd_id.'" type="text" value=""></td>'.
     		'</tr><tr>'.
     		'<input type="text" value=""><br />
     		*/
     // clear any floats:
     $out .= '<div style="clear:both"></div>';
     // $out.='</form>';
     return $out;
 }
Ejemplo n.º 3
0
    function get_adjust_disp($titleKey = 'new', $mvd_id = 'new', $disp_buttons = true)
    {
        global $mvgScriptPath;
        //
        $out = '';
        //some good old fashioned variable overloading:
        if ($mvd_id == 'new' || $mvd_id == 'seq') {
            global $mvDefaultClipLength;
            //$out.='start context: ' .$this->start_context . '<br />';
            //$out.='end context: ' .$this->end_context . '<br />';
            $start_time = isset($this->start_context) ? $this->start_context : seconds2ntp(0);
            $end_time = isset($this->end_context) ? seconds2ntp(ntp2seconds($this->start_context) + $mvDefaultClipLength) : seconds2ntp($mvDefaultClipLength);
            //$mvd_type = '';
        } else {
            $mvTitle = new MV_Title($titleKey);
            if (!$mvTitle->validRequestTitle()) {
                return wfMsg('mvMVDFormat');
            }
            $start_time = $mvTitle->getStartTime();
            $end_time = $mvTitle->getEndTime();
            //$mvd_type = $mvTitle->getMvdTypeKey();
        }
        /*
         * @@todo move some of this to CSS
         */
        $out .= ' 
	<span id="mv_adjust_msg_' . $mvd_id . '"></span> 
	<table style="background:transparent;position:relative" width="94%" border="0"><tr><td width="40">
<span id="track_time_start_' . $mvd_id . '" style="font-size:small">0:00:00</span>
</td><td>' . '<div id="container_track_' . $mvd_id . '" style="width:100%; height: 5px; background-color: rgb(170, 170, 170); border:1px solid black; position: relative">';
        //add some overlays to make the track look like it ends/starts at 0+-7px
        $out .= '<div style="position:absolute;left:0px;width:7px;height: 5px;background-color: white;border-right:1px solid black;"></div>' . '<div style="position:absolute;right:0px;width:7px;height: 5px;background-color: white;border-left:1px solid black;"></div>';
        //the reszie div structure:
        $out .= '<div id="resize_' . $mvd_id . '" style="height: 20px; position: absolute;">
		<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>	
		<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>	
		<div id="dragSpan_' . $mvd_id . '" class="ui-dragSpan"></div>		
	</div>
</div>' . '</td><td width="50">
<span id="track_time_end_' . $mvd_id . '" style="font-size:small">0:00:00</span>
	</td></tr></table>
  <br />';
        //output a dummy form
        /*$out.='<form class="mv_css_form" id="mvd_adj_form_'.$mvd_id.'" method="GET" action="" ' . 
        		'onSubmit="mv_adjust_submit(\''.$mvd_id.'\');return false;">';*/
        $out .= '<span style="float:left;"><label class="mv_css_form" for="mv_start_hr_' . $mvd_id . '"><i>' . wfMsg('mv_start_desc') . ':</i></label> ' . '<input class="mv_adj_hr" size="8" maxlength="8" value="' . $start_time . '" id="mv_start_hr_' . $mvd_id . '" name="mv_start_hr_' . $mvd_id . '">' . '</span>';
        $out .= '<span style="float:left;"><label class="mv_css_form" for="mv_end_hr_' . $mvd_id . '"><i>' . wfMsg('mv_end_desc') . ':</i></label> ' . '<input class="mv_adj_hr" size="8" maxlength="8" value="' . $end_time . '" id="mv_end_hr_' . $mvd_id . '" name="mv_end_hr_' . $mvd_id . '">' . '</span>';
        //output page text (if not "new")
        //if($mvd_id!='new')
        //	$out.=$this->get_fd_mvd_request( $titleKey, $mvd_id);
        /*$out.='<table width="100%">'.
        		'<tr><td>'.wfMsg('mv_start_desc').'</td>'.
        		'<td><input name="mv_start_hr_'.$mvd_id.'" type="text" value=""></td>'.
        		'</tr><tr>'.
        		'<input type="text" value=""><br />
        		*/
        //clear any floats:
        $out .= '<div style="clear:both"></div>';
        //not used now that adjust is integrated with edit:
        /*if($disp_buttons){
        			$out.='<input style="font-weight:bold;" type="submit" value="'.wfMsg('mv_adjust_submit').'"> ';
        			$out.='<input id="mv_adjust_preview_'.$mvd_id.'" type="button" value="'.wfMsg('mv_adjust_preview').'" onClick="mv_adjust_preview(\''.$mvd_id.'\')"> ';
        			$out.='<input type="hidden" id="mv_adjust_preview_stop_'.$mvd_id.'" value="'.wfMsg('mv_adjust_preview_stop').'">';	
        			$out.= '<a href="javascript:mv_disp_mvd(\''.$titleKey. '\',\''.
        						 $mvd_id.'\');return false;">' . wfMsgExt('cancel', array('parseinline')).'</a>';
        		}*/
        //$out.='</form>';
        return $out;
    }
Ejemplo n.º 4
0
function mvDoMvPage(&$title, &$article, $doOutput = true)
{
    //add js
    mvAddPerNamespaceJS($title);
    //do page replace:
    if ($title->getNamespace() == NS_CATEGORY) {
        $article = new MV_CategoryPage($title);
    } elseif ($title->getNamespace() == MV_NS_SEQUENCE) {
        $article = new MV_SequencePage($title);
    } elseif ($title->getNamespace() == MV_NS_STREAM) {
        mvDoMetavidStreamPage($title, $article);
    } elseif ($title->getNamespace() == MV_NS_MVD) {
        $mvTitle = new MV_Title($title->getDBkey());
        // check if mvd type exist
        if ($mvTitle->validRequestTitle()) {
            if ($title->exists()) {
                // this page can be edited seen the MVD page:
                $article = new MV_DataPage($title, $mvTitle);
            }
            // $title = 'Stream: ' . $mvTitle['type_marker'] . $mvTitle['stream_name'];
            // $body = 'body content';
            // mvOutputSpecialPage($title,$body);
        } else {
            // @@TODO get type of error: & put this in the language file
            // $title = 'missing type, stream missing, or not valid time format';
            if ($doOutput) {
                mvOutputSpecialPage(wfMsg('mvBadMVDtitle'), wfMsg('mvMVDFormat'));
            }
            return false;
        }
    }
    return true;
}
 function expand_wt($mvd_id, $terms_ary)
 {
     global $wgOut, $mvgIP;
     global $mvDefaultSearchVideoPlaybackRes;
     $mvd = MV_Index::getMVDbyId($mvd_id);
     if (count($mvd) != 0) {
         $mvTitle = new MV_Title($mvd->wiki_title);
         // validate title and load stream ref:
         if ($mvTitle->validRequestTitle()) {
             list($vWidth, $vHeight) = explode('x', $mvDefaultSearchVideoPlaybackRes);
             $embedHTML = '<span style="float:left;width:' . htmlspecialchars($vWidth + 20) . 'px">' . $mvTitle->getEmbedVideoHtml(array('id' => 'vid_' . $mvd_id, 'size' => $mvDefaultSearchVideoPlaybackRes, 'autoplay' => true)) . '</span>';
             $wgOut->clearHTML();
             $MvOverlay = new MV_Overlay();
             $MvOverlay->outputMVD($mvd, $mvTitle);
             $pageHTML = '<span style="padding-top:10px;float:left;width:450px">' . $wgOut->getHTML() . '</span>';
             // return page html:
             return $embedHTML . $pageHTML . '<div style="clear: both;"/>';
         } else {
             return wfMsg('mvBadMVDtitle');
         }
     } else {
         return wfMsg('mv_error_mvd_not_found');
     }
     // $title = Title::MakeTitle(MV_NS_MVD, $wiki_title);
     // $article = new Article($title);
     // output table with embed left, and content right
     // return $wgOut->parse($article->getContent());
 }