コード例 #1
0
 function get_fd_mvd_page(&$mvd_page, $content = '')
 {
     global $wgOut, $mvDefaultVideoPlaybackRes;
     // print_r($mvd_page);
     // "<div id=\"mv_ctail_{$mvd_page->id}\" style=\"position:relative\">"
     if (isset($this->mv_interface->smwProperties['playback_resolution'])) {
         // for now just put in a hack that forces no size adjustment
         $img_url = MV_StreamImage::getStreamImageURL($mvd_page->stream_id, $mvd_page->start_time, null, true);
     } else {
         $img_url = MV_StreamImage::getStreamImageURL($mvd_page->stream_id, $mvd_page->start_time, $mvDefaultVideoPlaybackRes, true);
     }
     $oe_class = '';
     //color annnotative layers seperatly:
     $oe_class .= ' ' . htmlspecialchars(strtolower($mvd_page->mvd_type));
     //preset classes for rendering on page load (will repaint but whatever)
     if ($this->oddEvenToggle) {
         $this->oddEvenToggle = false;
         $oe_class .= ' even';
     } else {
         $this->oddEvenToggle = true;
         $oe_class .= ' odd';
     }
     // style=\"background:#".$this->getMvdBgColor($mvd_page)."\" "
     $wgOut->addHTML('<fieldset class="mv_fd_mvd' . htmlspecialchars($oe_class) . '" id="mv_fd_mvd_' . htmlspecialchars($mvd_page->id) . '" ' . 'name="' . htmlspecialchars($mvd_page->wiki_title) . '" ' . 'image_url="' . htmlspecialchars($img_url) . '" >');
     /*$wgOut->addHTML("<legend id=\"mv_ld_{$mvd_page->id}\">" .
     		$this->get_mvd_menu($mvd_page) .
     		"</legend>");*/
     // $menu_html = $this->get_mvd_menu($mvd_page);
     $wgOut->addHTML("<div id=\"mv_fcontent_{$mvd_page->id}\">");
     if ($content == '') {
         $this->outputMVD($mvd_page);
     } else {
         $wgOut->addHTML($content);
     }
     $wgOut->addHTML("</div>");
     $wgOut->addHTML("</fieldset>");
 }
コード例 #2
0
 function getStreamImageURL($size = null, $req_time = null, $foce_server = '')
 {
     global $mvDefaultVideoPlaybackRes;
     if ($size == null) {
         $size = $mvDefaultVideoPlaybackRes;
     }
     if ($req_time == null) {
         $req_time = $this->getStartTime();
         if (!$req_time) {
             $req_time = '0:00:00';
         }
     }
     if ($foce_server == '') {
         //get the image path: (and generate the image if necessary)
         return MV_StreamImage::getStreamImageURL($this->getStreamId(), $req_time, $size);
     } else {
         return $foce_server . $this->getStreamName() . '?t=' . $req_time;
     }
 }
コード例 #3
0
 function get_fd_mvd_page(&$mvd_page, $content = '')
 {
     global $wgOut;
     //print_r($mvd_page);
     //"<div id=\"mv_ctail_{$mvd_page->id}\" style=\"position:relative\">"
     if (isset($this->mv_interface->smwProperties['playback_resolution'])) {
         //for now just put in a hack that forces no size adjustment
         $img_url = MV_StreamImage::getStreamImageURL($mvd_page->stream_id, $mvd_page->start_time, null, true);
     } else {
         $img_url = MV_StreamImage::getStreamImageURL($mvd_page->stream_id, $mvd_page->start_time, 'medium', true);
     }
     $type = substr($mvd_page->wiki_title, 0, strpos($mvd_page->wiki_title, ':'));
     $wgOut->addHTML("<fieldset class=\"mv_fd_mvd {$type}\" style=\"background:#" . $this->getMvdBgColor($mvd_page) . "\" " . "id=\"mv_fd_mvd_{$mvd_page->id}\" name=\"{$mvd_page->wiki_title}\" " . "image_url=\"{$img_url}\" >");
     $wgOut->addHTML("<legend id=\"mv_ld_{$mvd_page->id}\">" . $this->get_mvd_menu($mvd_page) . "</legend>");
     $wgOut->addHTML("<div id=\"mv_fcontent_{$mvd_page->id}\">");
     if ($content == '') {
         $this->outputMVD($mvd_page);
     } else {
         $wgOut->addHTML($content);
     }
     $wgOut->addHTML("</div>\n");
     $wgOut->addHTML("</fieldset>");
 }
コード例 #4
0
function mv_frame_server($stream_name = '', $req_time = '', $req_size = '')
{
    global $wgRequest;
    $stream_id = '';
    // try loading vals from $wgRequest if not set
    $stream_name = $stream_name == '' ? $wgRequest->getVal('stream_name') : $stream_name;
    if ($stream_name == null) {
        $stream_id = $wgRequest->getVal('stream_id');
    }
    $req_time = $req_time == '' ? $wgRequest->getVal('t') : $req_time;
    $req_size = $req_size == '' ? $wgRequest->getVal('size') : $req_size;
    $redirect_req = $wgRequest->getVal('redirect') == 'true' ? true : false;
    if ($stream_id == '') {
        $mvStream = mvGetMVStream($stream_name);
        $stream_id = $mvStream->getStreamId();
    } else {
        $mvStream = new MV_Stream(array('id' => $stream_id));
    }
    if ($mvStream->db_load_stream()) {
        global $mvServeImageRedirect, $mvExternalImages;
        if ($mvServeImageRedirect || $redirect_req || $mvExternalImages) {
            header("Location:" . MV_StreamImage::getStreamImageURL($stream_id, $req_time, $req_size, true));
        } else {
            // serve up the image directly
            MV_StreamImage::getStreamImageRaw($stream_id, $req_time, $req_size, true);
        }
        exit;
    } else {
        return 'error: invalid stream name';
    }
}
コード例 #5
0
 function formatResult($skin, $result)
 {
     global $wgUser, $wgLang, $mvImageArchive;
     $sit = new MV_Sitting(array('id' => $this->sitting_id));
     $sit->db_load_sitting();
     #make sure the first letter is upper case (makeTitle() should do that)
     $result->title = strtoupper($result->title[0]) . substr($result->title, 1);
     $img_url = $mvImageArchive . $result->title . '?size=icon&time=0:00:00';
     $img_url = MV_StreamImage::getStreamImageURL($result->stream_id, '0:00:00', 'icon', true);
     $img_html = '<img src="' . $img_url . '" width="80" height="60">';
     $title = Title::makeTitle(MV_NS_STREAM, $result->title);
     $rlink = $skin->makeLinkObj($title, $img_html . ' ' . $title->getText());
     //if admin expose an edit link
     if ($this->existing == 'false') {
         $rlink .= ' ' . $skin->makeKnownLinkObj(Title::makeTitle(MV_NS_STREAM, $title->getText()), 'edit', 'action=edit');
     } else {
         $rlink .= ' ' . $skin->makeKnownLinkObj(Title::makeTitle(MV_NS_SITTING, $sit->name), 'add', 'action=edit&mv_action=add&stream_id=' . $result->stream_id);
     }
     return $rlink;
 }