function __construct($title)
 {
     global $wgRequest;
     mvfAddHTMLHeader('sequence');
     parent::__construct($title);
     return $this;
 }
 function doSearchPage($term = '')
 {
     global $wgRequest, $wgOut;
     $this->setUpFilters();
     //do the search
     $this->doSearch();
     //page control:
     $this->outputInlineHeader = false;
     if ($wgRequest->getVal('seq_inline') == 'true') {
         $this->outputContainer = false;
         $this->outputSeqLinks = true;
         //@@todo add a absolute link to search results
         print $this->getResultsHTML(true);
         //@@todo cleaner exit
         exit;
     } else {
         //add nessesary js to wgOut:
         mvfAddHTMLHeader('search');
         //add the search placeholder
         $wgOut->addWikiText(wfMsg('searchresulttext'));
         $wgOut->addHTML($this->dynamicSearchControl());
         //$wgOut->addHTML($this->getResultsBar());
         $wgOut->addHTML($this->getResultsHTML());
     }
 }
Ejemplo n.º 3
0
 function outputWikiText($text, $cache = true)
 {
     global $wgOut, $wgUser;
     wfProfileIn(__METHOD__);
     $MV_MetavidInterface = new MV_MetavidInterface('stream', $this);
     //will require the mv_embed script for video playback:
     mvfAddHTMLHeader('stream_interface');
     $MV_MetavidInterface->render_full();
     wfProfileOut(__METHOD__);
 }
 function doSearchPage()
 {
     global $wgRequest, $wgOut;
     //add nessesary js to wgOut:
     mvfAddHTMLHeader('search');
     //add the search placeholder
     $wgOut->addHTML($this->dynamicSearchControl());
     $this->doSearch();
     $wgOut->addHTML($this->getHTMLResults());
 }
Ejemplo n.º 5
0
 function getPreviewText()
 {
     //enable embed video:
     mvfAddHTMLHeader('embed');
     $html = '';
     $html .= '<span style="float:left;margin:10px;">';
     $html .= $this->mArticle->mvTitle->getEmbedVideoHtml();
     $html .= '</span>';
     return $html . parent::getPreviewText();
 }
 function toHTML()
 {
     global $wgLang, $mvDefaultAspectRatio;
     $sk = $this->getSkin();
     $attribs = Sanitizer::mergeAttributes(array('class' => 'gallery', 'cellspacing' => '0', 'cellpadding' => '0'), $this->mAttribs);
     $s = Xml::openElement('table', $attribs);
     if ($this->mCaption) {
         $s .= "\n\t<caption>{$this->mCaption}</caption>";
     }
     $params = array('width' => $this->mWidths, 'height' => $this->mHeights);
     $i = 0;
     $this->already_named_resource = array();
     foreach ($this->mImages as $pair) {
         $nt = $pair[0];
         $text = $pair[1];
         # Give extensions a chance to select the file revision for us
         $time = false;
         wfRunHooks('BeforeGalleryFindFile', array(&$this, &$nt, &$time));
         $img = wfFindFile($nt, $time);
         if ($nt->getNamespace() == MV_NS_MVD || $nt->getNamespace() == MV_NS_STREAM || $nt->getNamespace() == MV_NS_SEQUENCE) {
             //@@todo fix sequence embed
             //$vpad = floor( ( 1.25*$this->mHeights - $thumb->height ) /2 ) - 2;
             $mvTitle = new MV_Title($nt);
             //remap MVD namespace links into the Stream view (so contextual metadata is present)
             if ($nt->getNamespace() == MV_NS_MVD) {
                 $nt = Title::MakeTitle(MV_NS_STREAM, ucfirst($mvTitle->getStreamName()) . '/' . $mvTitle->getTimeRequest());
             }
             $vidH = round($this->mWidths * $mvDefaultAspectRatio);
             $vidRes = $this->mWidths . 'x' . $vidH;
             //make sure we have the mv_embed header:
             mvfAddHTMLHeader('embed');
             //print "img url: " . 	$mvTitle->getStreamImageURL();
             $thumbhtml = "\n\t\t\t" . '<div class="thumb" style="padding: 4px 0; width: ' . ($this->mWidths + 5) . 'px;">' . '<div style="margin-left: auto; margin-right: auto; width: ' . $this->mWidths . 'px;">' . $mvTitle->getEmbedVideoHtml('', $vidRes) . '</div>' . '<span style="clear:both"></div>' . '<span class="gallerytext" style="float:left">' . $sk->makeKnownLinkObj($nt, $mvTitle->getStreamNameText() . ' ' . $mvTitle->getTimeDesc()) . '</span>' . '</div>';
             $nb = '';
             $textlink = '';
         } else {
             if ($nt->getNamespace() != NS_IMAGE || !$img) {
                 # We're dealing with a non-image, spit out the name and be done with it.
                 $thumbhtml = "\n\t\t\t" . '<div style="height: ' . ($this->mHeights * 1.25 + 2) . 'px;">' . htmlspecialchars($nt->getText()) . '</div>';
             } elseif ($this->mHideBadImages && wfIsBadImage($nt->getDBkey(), $this->getContextTitle())) {
                 # The image is blacklisted, just show it as a text link.
                 $thumbhtml = "\n\t\t\t" . '<div style="height: ' . ($this->mHeights * 1.25 + 2) . 'px;">' . $sk->makeKnownLinkObj($nt, htmlspecialchars($nt->getText())) . '</div>';
             } elseif (!($thumb = $img->transform($params))) {
                 # Error generating thumbnail.
                 $thumbhtml = "\n\t\t\t" . '<div style="height: ' . ($this->mHeights * 1.25 + 2) . 'px;">' . htmlspecialchars($img->getLastError()) . '</div>';
             } else {
                 $vpad = floor((1.25 * $this->mHeights - $thumb->height) / 2) - 2;
                 $thumbhtml = "\n\t\t\t" . '<div class="thumb" style="padding: ' . $vpad . 'px 0; width: ' . ($this->mWidths + 30) . 'px;">' . '<div style="margin-left: auto; margin-right: auto; width: ' . $this->mWidths . 'px;">' . $thumb->toHtml(array('desc-link' => true)) . '</div></div>';
                 // Call parser transform hook
                 if ($this->mParser && $img->getHandler()) {
                     $img->getHandler()->parserTransformHook($this->mParser, $img);
                 }
             }
             //TODO
             //$ul = $sk->makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut );
             if ($this->mShowBytes) {
                 if ($img) {
                     $nb = wfMsgExt('nbytes', array('parsemag', 'escape'), $wgLang->formatNum($img->getSize()));
                 } else {
                     $nb = wfMsgHtml('filemissing');
                 }
                 $nb = "{$nb}<br />\n";
             } else {
                 $nb = '';
             }
             $textlink = $this->mShowFilename ? $sk->makeKnownLinkObj($nt, htmlspecialchars($wgLang->truncate($nt->getText(), 20, '...'))) . "<br />\n" : '';
         }
         # ATTENTION: The newline after <div class="gallerytext"> is needed to accommodate htmltidy which
         # in version 4.8.6 generated crackpot html in its absence, see:
         # http://bugzilla.wikimedia.org/show_bug.cgi?id=1765 -Ævar
         if ($i % $this->mPerRow == 0) {
             $s .= "\n\t<tr>";
         }
         $s .= "\n\t\t" . '<td><div class="gallerybox" style="width: ' . ($this->mWidths + 10) . 'px;">' . $thumbhtml . "\n\t\t\t" . '<div class="gallerytext">' . "\n" . $textlink . $text . $nb . "\n\t\t\t</div>" . "\n\t\t</div></td>";
         if ($i % $this->mPerRow == $this->mPerRow - 1) {
             $s .= "\n\t</tr>";
         }
         ++$i;
     }
     if ($i % $this->mPerRow != 0) {
         $s .= "\n\t</tr>";
     }
     $s .= "\n</table>";
     return $s;
 }