Example #1
0
 /**
  * Called on every video page view.
  */
 public function view()
 {
     $this->video = new Video($this->getTitle(), $this->getContext());
     $out = $this->getContext()->getOutput();
     $videoLinksHTML = '<br />' . Xml::element('h2', array('id' => 'filelinks'), wfMsg('video-links')) . "\n";
     $sk = $this->getContext()->getSkin();
     // No need to display noarticletext, we use our own message
     if ($this->getID()) {
         parent::view();
     } else {
         // Just need to set the right headers
         $out->setArticleFlag(true);
         $out->setRobotPolicy('index,follow');
         $out->setPageTitle($this->mTitle->getPrefixedText());
     }
     if ($this->video->exists()) {
         // Display flash video
         $out->addHTML($this->video->getEmbedCode());
         // Force embed this code to have width of 300
         $this->video->setWidth(300);
         $out->addHTML($this->getEmbedThisTag());
         $this->videoHistory();
         //$wgOut->addHTML( $videoLinksHTML );
         //$this->videoLinks();
     } else {
         // Video doesn't exist, so give a link allowing user to add one with this name
         $title = SpecialPage::getTitleFor('AddVideo');
         $link = $sk->linkKnown($title, wfMsgHtml('video-novideo-linktext'), array(), array('wpTitle' => $this->video->getName()));
         $out->addHTML(wfMsgWikiHtml('video-novideo', $link));
         //$wgOut->addHTML( $videoLinksHTML );
         //$this->videoLinks();
         $this->viewUpdates();
     }
 }
 /**
  * Overwrite view() from Article.php to add additional HTML to the
  * output.
  */
 public function view()
 {
     global $wgRequest, $wgUser, $wgOut;
     if (!ApplicationFactory::getInstance()->getSettings()->get('smwgSemanticsEnabled')) {
         $wgOut->setPageTitle($this->getTitle()->getPrefixedText());
         $wgOut->addHTML(wfMessage('smw-semantics-not-enabled')->text());
         return;
     }
     if ($this->getTitle()->getNamespace() === SMW_NS_PROPERTY) {
         $this->findBasePropertyToRedirectFor($this->getTitle()->getText());
     }
     $this->initParameters();
     if (!isset($diff) || !$diffOnly) {
         // MW 1.25+
         if (method_exists($wgOut, 'setIndicators')) {
             $wgOut->setIndicators(array($this->getTopIndicator()));
         }
         $wgOut->addHTML($this->getIntroductoryText());
     }
     parent::view();
     // Copied from CategoryPage
     $diff = $wgRequest->getVal('diff');
     $diffOnly = $wgRequest->getBool('diffonly', $wgUser->getOption('diffonly'));
     if (!isset($diff) || !$diffOnly) {
         $this->showList();
     }
 }
 /**
  * Render Quiz namespace page
  */
 public function view()
 {
     global $wgOut, $wgUser, $wgTitle, $wgRequest;
     wfProfileIn(__METHOD__);
     // let MW handle basic stuff
     parent::view();
     // don't override history pages
     $action = $wgRequest->getVal('action');
     if (in_array($action, array('history', 'historysubmit'))) {
         wfProfileOut(__METHOD__);
         return;
     }
     // quiz doesn't exist
     if (!$wgTitle->exists() || empty($this->mQuiz)) {
         wfProfileOut(__METHOD__);
         return;
     }
     // set page title
     $title = $this->mQuiz->getTitle();
     $wgOut->setPageTitle($title);
     // add CSS/JS
     $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/WikiaQuiz/css/WikiaQuizBuilder.scss'));
     // render quiz page
     $wgOut->clearHTML();
     $wgOut->addHTML($this->mQuiz->render());
     wfProfileOut(__METHOD__);
 }
	public function view() {
		global $wgOut, $wgShowEXIF, $wgRequest, $wgUser;
		
		$diff = $wgRequest->getVal( 'diff' );
		$diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );

		if ( $this->mTitle->getNamespace() != NS_TIMEDTEXT || ( isset( $diff ) && $diffOnly ) ) {
			return parent::view();
		}
		$titleParts = explode( '.', $this->mTitle->getDBKey() );
		$srt = array_pop( $titleParts );
		$lanugaeKey = array_pop( $titleParts );
		$videoTitle = Title::newFromText( implode('.', $titleParts ), NS_FILE );
		
		// Look up the language name: 	
		$languages = Language::getTranslatedLanguageNames( 'en' );
		if( isset( $languages[ $lanugaeKey ] ) ) {
			$languageName = $languages[ $lanugaeKey ];
		} else {
			$languageName = $lanugaeKey;
		}
		
		// Set title 
		$wgOut->setPageTitle( wfMsg('mwe-timedtext-language-subtitles-for-clip', $languageName,  $videoTitle) );

		// Get the video with with a max of 600 pixel page
		$wgOut->addHTML( 
			xml::tags( 'table', array( 'style'=> 'border:none' ), 
				xml::tags( 'tr', null, 
					xml::tags( 'td', array( 'valign' => 'top',  'width' => self::$videoWidth ), $this->getVideoHTML( $videoTitle ) ) .
					xml::tags( 'td', array( 'valign' => 'top' ) , $this->getSrtHTML( $languageName ) )
				)
			)
		);	
	}
Example #5
0
 /**
  * overwritten Article::view function
  */
 public function view()
 {
     global $wgOut, $wgUser, $wgRequest, $wgTitle, $wgContLang;
     global $wgStylePath, $wgLang;
     global $wgProblemReportsEnable, $wgNotificationEnableSend;
     $feed = $wgRequest->getText("feed", false);
     if ($feed && in_array($feed, array("rss", "atom"))) {
         $this->showFeed($feed);
     } elseif ($wgTitle->isSubpage()) {
         /**
          * blog article, show if exists
          */
         $oldPrefixedText = $this->mTitle->mPrefixedText;
         list($author, $prefixedText) = explode('/', $this->mTitle->getPrefixedText(), 2);
         if (isset($prefixedText) && !empty($prefixedText)) {
             $this->mTitle->mPrefixedText = $prefixedText;
         }
         $this->mTitle->mPrefixedText = $oldPrefixedText;
         $this->mProps = self::getProps($this->mTitle->getArticleID());
         Article::view();
     } else {
         /**
          * blog listing
          */
         $wgOut->setHTMLTitle($wgOut->getWikiaPageTitle($this->mTitle->getPrefixedText()));
         $this->showBlogListing();
     }
 }
Example #6
0
 public static function onUnknownAction($action, $article)
 {
     global $wgOut, $wgRequest, $wgUser, $wgParser, $wgBlikiPostGroup;
     if ($action == 'blog' && in_array($wgBlikiPostGroup, $wgUser->getEffectiveGroups())) {
         $newtitle = $wgRequest->getText('newtitle');
         $title = Title::newFromText($newtitle);
         $error = false;
         if (!is_object($title)) {
             $wgOut->addWikitext('<div class="previewnote">Error: Bad title!</div>');
             $error = true;
         } elseif ($title->exists()) {
             $wgOut->addWikitext('<div class="previewnote">Error: Title already exists!</div>');
             $error = true;
         }
         if (!$error) {
             $summary = $wgRequest->getText('summary');
             $content = $wgRequest->getText('content');
             $user = $wgUser->getName();
             $date = date('U');
             $sig = '<div class="blog-sig">{{BlogSig|' . "{$user}|@{$date}" . '}}</div>';
             $type = $wgRequest->getText('type');
             switch ($type) {
                 // Preview the item
                 case "Full preview":
                     $wikitext = "{$sig}\n{$summary}\n\n{$content}";
                     self::preview($type, $title, $wikitext);
                     $article->view();
                     break;
                     // Preview the item in news/blog format
                 // Preview the item in news/blog format
                 case "Summary preview":
                     $wikitext = "{|class=\"blog\"\n|\n== [[Post a blog item|{$newtitle}]] ==\n|-\n!{$sig}\n|-\n|{$summary}\n|}__NOEDITSECTION__";
                     $title = Title::newFromText('Blog');
                     self::preview($type, $title, $wikitext);
                     $article->view();
                     break;
                     // Create the item with tags as category links
                 // Create the item with tags as category links
                 case "Post":
                     $wikitext = '{{' . "Blog|1={$summary}|2={$content}" . '}}';
                     $wikitext .= "<noinclude>[[Category:Blog items]][[Category:Posts by {$user}]]";
                     foreach (array_keys($_POST) as $k) {
                         if (preg_match("|^tag(.+)\$|", $k, $m)) {
                             $wikitext .= '[[Category:' . str_replace('_', ' ', $m[1]) . ']]';
                         }
                     }
                     $wikitext .= "</noinclude>";
                     $article = new Article($title);
                     $article->doEdit($wikitext, 'Blog item created via post form', EDIT_NEW);
                     $wgOut->redirect($title->getFullURL());
                     break;
             }
         } else {
             $article->view();
         }
         return false;
     }
     return true;
 }
 function view()
 {
     global $wgOut, $wgRequest, $wgUser, $wgTitle, $wgHooks;
     if (!$wgTitle->exists()) {
         parent::view();
         return;
     }
     if (count($wgRequest->getVal('diff')) > 0) {
         return Article::view();
     }
     $restAction = $wgRequest->getVal('restaction');
     if ($restAction == 'pull-chunk') {
         $wgOut->setArticleBodyOnly(true);
         $start = $wgRequest->getInt('start');
         if (!$start) {
             return;
         }
         $categoryViewer = new WikihowCategoryViewer($wgTitle);
         $this->catStream = new WikihowArticleStream($categoryViewer, $start);
         $html = $this->catStream->getChunks(4, WikihowCategoryPage::SINGLE_WIDTH, WikihowCategoryPage::SINGLE_SPACING, WikihowCategoryPage::SINGLE_HEIGHT);
         $ret = json_encode(array('html' => $html));
         $wgOut->addHTML($ret);
     } else {
         $wgOut->setRobotPolicy('index,follow', 'Category Page');
         $wgOut->setPageTitle($wgTitle->getText());
         $from = $wgRequest->getVal('from');
         $until = $wgRequest->getVal('until');
         $viewer = new WikihowCategoryViewer($this->mTitle, $from, $until);
         $viewer->clearState();
         $viewer->doQuery();
         $viewer->finaliseCategoryState();
         if ($wgRequest->getVal('viewMode', 0)) {
             $wgOut->addHtml('<div class="section minor_section">');
             $wgOut->addHtml('<ul><li>');
             $wgOut->addHtml(implode("</li>\n<li>", $viewer->articles));
             $wgOut->addHtml('</li></ul>');
             $wgOut->addHtml('</div>');
         } else {
             $wgHooks['BeforePageDisplay'][] = array('WikihowCategoryPage::addCSSAndJs');
             $categoryViewer = new WikihowCategoryViewer($wgTitle);
             $this->catStream = new WikihowArticleStream($categoryViewer, 0);
             $html = $this->catStream->getChunks(self::STARTING_CHUNKS, WikihowCategoryPage::SINGLE_WIDTH, WikihowCategoryPage::SINGLE_SPACING, WikihowCategoryPage::SINGLE_HEIGHT);
             $wgOut->addHTML($html);
         }
         $sk = $wgUser->getSkin();
         $subCats = $viewer->shortListRD($viewer->children, $viewer->children_start_char);
         if ($subCats != "") {
             $subCats = "<h3>{$this->mTitle->getText()}</h3>{$subCats}";
             $sk->addWidget($subCats);
         }
         $furtherEditing = $viewer->getArticlesFurtherEditing($viewer->articles, $viewer->article_info);
         if ($furtherEditing != "") {
         }
         $sk->addWidget($furtherEditing);
     }
 }
Example #8
0
 /**
  * Overwrite view() from Article.php to add additional HTML to the
  * output.
  */
 public function view()
 {
     global $wgRequest, $wgUser;
     parent::view();
     // Copied from CategoryPage
     $diff = $wgRequest->getVal('diff');
     $diffOnly = $wgRequest->getBool('diffonly', $wgUser->getOption('diffonly'));
     if (!isset($diff) || !$diffOnly) {
         $this->showList();
     }
 }
Example #9
0
 function view()
 {
     global $wgOut, $wgTitle;
     $wgOut->setPageTitle($this->mTitle->getPrefixedText());
     // No need to display noarticletext, we use our own message
     if (!$this->user_id) {
         parent::view();
         return '';
     }
     $wgOut->addHTML('<div id="profile-top">');
     $wgOut->addHTML($this->getProfileTop($this->user_id, $this->user_name));
     $wgOut->addHTML('<div class="cleared"></div></div>');
     // User does not want social profile for User:user_name, so we just
     // show header + page content
     if ($wgTitle->getNamespace() == NS_USER && $this->profile_data['user_id'] && $this->profile_data['user_page_type'] == 0) {
         parent::view();
         return '';
     }
     // Left side
     $wgOut->addHTML('<div id="user-page-left" class="clearfix">');
     if (!wfRunHooks('UserProfileBeginLeft', array(&$this))) {
         wfDebug(__METHOD__ . ": UserProfileBeginLeft messed up profile!\n");
     }
     $wgOut->addHTML($this->getRelationships($this->user_name, 1));
     $wgOut->addHTML($this->getRelationships($this->user_name, 2));
     $wgOut->addHTML($this->getGifts($this->user_name));
     $wgOut->addHTML($this->getAwards($this->user_name));
     $wgOut->addHTML($this->getCustomInfo($this->user_name));
     $wgOut->addHTML($this->getInterests($this->user_name));
     $wgOut->addHTML($this->getFanBoxes($this->user_name));
     $wgOut->addHTML($this->getUserStats($this->user_id, $this->user_name));
     if (!wfRunHooks('UserProfileEndLeft', array(&$this))) {
         wfDebug(__METHOD__ . ": UserProfileEndLeft messed up profile!\n");
     }
     $wgOut->addHTML('</div>');
     wfDebug("profile start right\n");
     // Right side
     $wgOut->addHTML('<div id="user-page-right" class="clearfix">');
     if (!wfRunHooks('UserProfileBeginRight', array(&$this))) {
         wfDebug(__METHOD__ . ": UserProfileBeginRight messed up profile!\n");
     }
     $wgOut->addHTML($this->getPersonalInfo($this->user_id, $this->user_name));
     $wgOut->addHTML($this->getActivity($this->user_name));
     // Hook for BlogPage
     if (!wfRunHooks('UserProfileRightSideAfterActivity', array($this))) {
         wfDebug(__METHOD__ . ": UserProfileRightSideAfterActivity hook messed up profile!\n");
     }
     $wgOut->addHTML($this->getCasualGames($this->user_id, $this->user_name));
     $wgOut->addHTML($this->getUserBoard($this->user_id, $this->user_name));
     if (!wfRunHooks('UserProfileEndRight', array(&$this))) {
         wfDebug(__METHOD__ . ": UserProfileEndRight messed up profile!\n");
     }
     $wgOut->addHTML('</div><div class="cleared"></div>');
 }
	function view() {
		// From CategoryPage::view()
		if( NS_CATEGORY == $this->mTitle->getNamespace() ) {
		$this->openShowCategory();
		}

		Article::view();

		// Customization
		if( NS_CATEGORY == $this->mTitle->getNamespace() ) {
			$this->closeShowCategory();
		}
	}
 public function view()
 {
     global $wgRequest, $wgUser, $wgOut;
     // @@TODO fix stream view() for old versions ... will likely have to replicate Article::view()
     // include the metavid headers (for embedding video in the page)
     // copied from CategoryPage ...
     $diff = $wgRequest->getVal('diff');
     $diffOnly = $wgRequest->getBool('diffonly', $wgUser->getOption('diffonly'));
     if (isset($diff) && $diffOnly) {
         return Article::view();
     }
     $text = $this->getContent();
     $this->outputWikiText($text);
 }
 /**
  * @desc Render hubs page
  */
 public function view()
 {
     wfProfileIn(__METHOD__);
     // let MW handle basic stuff
     parent::view();
     //render hub page
     $app = F::app();
     if (!empty($this->verticalId)) {
         RequestContext::getMain()->getRequest()->setVal('verticalid', $this->verticalId);
     }
     $app->wg->Out->clearHTML();
     $app->wg->Out->addHTML($app->sendRequest('SpecialWikiaHubsV2Controller', 'index'));
     wfProfileOut(__METHOD__);
 }
 /**
  * @desc Render hubs page
  */
 public function view()
 {
     wfProfileIn(__METHOD__);
     // Don't show the category bar
     F::app()->wg->SuppressArticleCategories = true;
     // Get all the MW stuff out of the way first
     parent::view();
     $out = $this->getContext()->getOutput();
     $html = F::app()->renderView('VideoHomePageController', 'index');
     $out->clearHTML();
     $html .= F::app()->renderView('VideoHomePage', 'partners');
     $out->addHTML($html);
     wfProfileOut(__METHOD__);
 }
Example #14
0
 /**
  * Overwrite view() from Article.php to add additional HTML to the
  * output.
  */
 public function view()
 {
     global $wgRequest, $wgUser;
     if ($this->getTitle()->getNamespace() === SMW_NS_PROPERTY) {
         $this->findBasePropertyToRedirectFor($this->getTitle()->getText());
     }
     parent::view();
     // Copied from CategoryPage
     $diff = $wgRequest->getVal('diff');
     $diffOnly = $wgRequest->getBool('diffonly', $wgUser->getOption('diffonly'));
     if (!isset($diff) || !$diffOnly) {
         $this->showList();
     }
 }
Example #15
0
 function view()
 {
     global $wgOut, $wgShowEXIF;
     $this->img = new Image($this->mTitle);
     if ($this->mTitle->getNamespace() == NS_IMAGE) {
         if ($wgShowEXIF && $this->img->exists()) {
             $exif = $this->img->getExifData();
             $showmeta = count($exif) ? true : false;
         } else {
             $exif = false;
             $showmeta = false;
         }
         if ($this->img->exists()) {
             $wgOut->addHTML($this->showTOC($showmeta));
         }
         $this->openShowImage();
         # No need to display noarticletext, we use our own message, output in openShowImage()
         if ($this->getID()) {
             Article::view();
         } else {
             # Just need to set the right headers
             $wgOut->setArticleFlag(true);
             $wgOut->setRobotpolicy('index,follow');
             $wgOut->setPageTitle($this->mTitle->getPrefixedText());
             $this->viewUpdates();
         }
         # Show shared description, if needed
         if ($this->mExtraDescription) {
             $fol = wfMsg('shareddescriptionfollows');
             if ($fol != '-') {
                 $wgOut->addWikiText($fol);
             }
             $wgOut->addHTML('<div id="shared-image-desc">' . $this->mExtraDescription . '</div>');
         }
         $this->closeShowImage();
         $this->imageHistory();
         $this->imageLinks();
         if ($exif) {
             global $wgStylePath;
             $expand = htmlspecialchars(wfEscapeJsString(wfMsg('metadata-expand')));
             $collapse = htmlspecialchars(wfEscapeJsString(wfMsg('metadata-collapse')));
             $wgOut->addHTML("<h2 id=\"metadata\">" . wfMsgHtml('metadata') . "</h2>\n");
             $wgOut->addWikiText($this->makeMetadataTable($exif));
             $wgOut->addHTML("<script type=\"text/javascript\" src=\"{$wgStylePath}/common/metadata.js\"></script>\n" . "<script type=\"text/javascript\">attachMetadataToggle('mw_metadata', '{$expand}', '{$collapse}');</script>\n");
         }
     } else {
         Article::view();
     }
 }
 function view()
 {
     global $wgOut, $wgShowEXIF, $wgRequest, $wgUser;
     $diff = $wgRequest->getVal('diff');
     $diffOnly = $wgRequest->getBool('diffonly', $wgUser->getOption('diffonly'));
     if ($this->mTitle->getNamespace() != NS_IMAGE || isset($diff) && $diffOnly) {
         return Article::view();
     }
     if ($wgShowEXIF && $this->img->exists()) {
         // FIXME: bad interface, see note on MediaHandler::formatMetadata().
         $formattedMetadata = $this->img->formatMetadata();
         $showmeta = $formattedMetadata !== false;
     } else {
         $showmeta = false;
     }
     if ($this->img->exists()) {
         $wgOut->addHTML($this->showTOC($showmeta));
     }
     $this->openShowImage();
     # No need to display noarticletext, we use our own message, output in openShowImage()
     if ($this->getID()) {
         Article::view();
     } else {
         # Just need to set the right headers
         $wgOut->setArticleFlag(true);
         $wgOut->setRobotpolicy('noindex,nofollow');
         $wgOut->setPageTitle($this->mTitle->getPrefixedText());
         $this->viewUpdates();
     }
     # Show shared description, if needed
     if ($this->mExtraDescription) {
         $fol = wfMsgNoTrans('shareddescriptionfollows');
         if ($fol != '-' && !wfEmptyMsg('shareddescriptionfollows', $fol)) {
             $wgOut->addWikiText($fol);
         }
         $wgOut->addHTML('<div id="shared-image-desc">' . $this->mExtraDescription . '</div>');
     }
     $this->closeShowImage();
     $this->imageHistory();
     $this->imageLinks();
     if ($showmeta) {
         global $wgStylePath, $wgStyleVersion;
         $expand = htmlspecialchars(wfEscapeJsString(wfMsg('metadata-expand')));
         $collapse = htmlspecialchars(wfEscapeJsString(wfMsg('metadata-collapse')));
         $wgOut->addHTML(Xml::element('h2', array('id' => 'metadata'), wfMsg('metadata')) . "\n");
         $wgOut->addWikiText($this->makeMetadataTable($formattedMetadata));
         $wgOut->addHTML("<script type=\"text/javascript\" src=\"{$wgStylePath}/common/metadata.js?{$wgStyleVersion}\"></script>\n" . "<script type=\"text/javascript\">attachMetadataToggle('mw_metadata', '{$expand}', '{$collapse}');</script>\n");
     }
 }
 public function view()
 {
     global $wgRequest, $wgUser, $wgOut;
     // copied from CategoryPage ...
     $diff = $wgRequest->getVal('diff');
     $diffOnly = $wgRequest->getBool('diffonly', $wgUser->getOption('diffonly'));
     if (isset($diff) || $diffOnly) {
         return Article::view();
     }
     // include the metavid headers (for embedding video in the page)
     $wgOut->setPageTitle($this->mvTitle->getTitleDesc());
     $wgOut->addHTML($this->mvArticleTop());
     Article::view();
     $wgOut->addHTML($this->mvArticleBot());
 }
 public function view()
 {
     global $wgRequest, $wgUser, $wgOut, $wgTitle, $wgJsMimeType, $mvgScriptPath;
     //include the metavid headers (for embedding video in the page)
     mvfAddHTMLHeader('embed');
     // copied from CategoryPage ...
     $diff = $wgRequest->getVal('diff');
     $diffOnly = $wgRequest->getBool('diffonly', $wgUser->getOption('diffonly'));
     if (isset($diff) && $diffOnly) {
         return Article::view();
     }
     $wgOut->setPageTitle($this->mvTitle->getTitleDesc());
     $wgOut->addHtml($this->mvArticleTop());
     Article::view();
     $wgOut->addHtml($this->mvArticleBot());
 }
Example #19
0
 function view()
 {
     if (!wfRunHooks('CategoryPageView', array(&$this))) {
         return;
     }
     if (NS_CATEGORY == $this->mTitle->getNamespace()) {
         $this->openShowCategory();
     }
     Article::view();
     # If the article we've just shown is in the "Image" namespace,
     # follow it with the history list and link list for the image
     # it describes.
     if (NS_CATEGORY == $this->mTitle->getNamespace()) {
         $this->closeShowCategory();
     }
 }
 public function view()
 {
     global $wgOut, $wgTitle;
     $data = $this->prepareData();
     $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
     $oTmpl->set_vars(array("data" => $data));
     $wgOut->setHTMLTitle(wfMsg('hub-header', $data['title']));
     // does not add a h1, this is done later
     if (F::app()->checkSkin('oasis')) {
         $hubName = $wgTitle->getText();
         $wgOut->addHTML(F::app()->renderView('BlogsInHubs', 'HotNews', array('hubName' => $hubName)));
         $wgOut->addHTML(F::app()->renderView('CorporateSite', 'TopHubWikis'));
         parent::view();
     } else {
         $wgOut->addHTML($oTmpl->render("article"));
     }
 }
 function view()
 {
     global $wgUseExternalEditor, $wgOut, $wgShowEXIF;
     $this->img = new Image($this->mTitle);
     if ($this->mTitle->getNamespace() == NS_IMAGE) {
         if ($wgShowEXIF && $this->img->exists()) {
             $exif = $this->img->getExifData();
             $showmeta = count($exif) ? true : false;
         } else {
             $exif = false;
             $showmeta = false;
         }
         if ($this->img->exists()) {
             $wgOut->addHTML($this->showTOC($showmeta));
         }
         $this->openShowImage();
         if ($exif) {
             $wgOut->addWikiText($this->makeMetadataTable($exif));
         }
         # No need to display noarticletext, we use our own message, output in openShowImage()
         if ($this->getID()) {
             Article::view();
         } else {
             # Just need to set the right headers
             $wgOut->setArticleFlag(true);
             $wgOut->setRobotpolicy('index,follow');
             $wgOut->setPageTitle($this->mTitle->getPrefixedText());
             $wgOut->addMetaTags();
             $this->viewUpdates();
         }
         if ($this->mExtraDescription) {
             $fol = wfMsg('shareddescriptionfollows');
             if ($fol != '-') {
                 $wgOut->addWikiText(wfMsg('shareddescriptionfollows'));
             }
             $wgOut->addHTML($this->mExtraDescription);
         }
         $this->closeShowImage();
         $this->imageHistory();
         $this->imageLinks();
     } else {
         Article::view();
     }
 }
Example #22
0
 function view()
 {
     global $wgRequest, $wgUser;
     $diff = $wgRequest->getVal('diff');
     $diffOnly = $wgRequest->getBool('diffonly', $wgUser->getOption('diffonly'));
     if (isset($diff) && $diffOnly) {
         return parent::view();
     }
     if (!wfRunHooks('CategoryPageView', array(&$this))) {
         return;
     }
     if (NS_CATEGORY == $this->mTitle->getNamespace()) {
         $this->openShowCategory();
     }
     parent::view();
     if (NS_CATEGORY == $this->mTitle->getNamespace()) {
         $this->closeShowCategory();
     }
 }
Example #23
0
 /**
  * Designed similar to CategoryPage.
  *
  * @see Article::view
  *
  * @since 3.0
  */
 public function view()
 {
     global $wgRequest, $wgUser;
     $diff = $wgRequest->getVal('diff');
     $diffOnly = $wgRequest->getBool('diffonly', $wgUser->getOption('diffonly'));
     if (isset($diff) && $diffOnly) {
         return parent::view();
     }
     if (!wfRunHooks('MapsLayerPageView', array(&$this))) {
         return;
     }
     if (Maps_NS_LAYER == $this->mTitle->getNamespace()) {
         $this->openShowLayer();
     }
     parent::view();
     if (Maps_NS_LAYER == $this->mTitle->getNamespace()) {
         $this->closeShowLayer();
     }
 }
    function view()
    {
        global $wgOut, $wgUser, $wgTitle, $wgFanBoxScripts;
        $wgOut->addScriptFile($wgFanBoxScripts . '/FanBoxes.js');
        $wgOut->setHTMLTitle($wgTitle->getText());
        $wgOut->setPageTitle($wgTitle->getText());
        $this->fan = new FanBox($this->getTitle());
        $fanboxTitle = Title::makeTitle(NS_FANTAG, $this->fan->getName());
        // Don't throw a bunch of E_NOTICEs when we're viewing the page of a
        // nonexistent fanbox
        if (!$this->getID()) {
            parent::view();
            return '';
        }
        $output = '';
        $output .= "<h1 class=\"firstHeading\">{$fanboxTitle->getPrefixedText()}</h1>";
        $output .= '<div class="fanbox-page-container clearfix">' . $this->fan->outputFanBox();
        $fantag_id = $this->fan->getFanBoxId();
        $output .= '<div id="show-message-container' . $fantag_id . '">';
        if ($wgUser->isLoggedIn()) {
            $check = $this->fan->checkIfUserHasFanBox();
            if ($check == 0) {
                $output .= $this->fan->outputIfUserDoesntHaveFanBox();
            } else {
                $output .= $this->fan->outputIfUserHasFanBox();
            }
        } else {
            $output .= $this->fan->outputIfUserNotLoggedIn();
        }
        $output .= '</div>
			<div class="user-embed-tag">' . $this->getEmbedThisTag() . '</div>
			<div class="users-with-fanbox">
				<h2>' . wfMsg('fanbox-users-with-fanbox') . '</h2>
				<div class="users-with-fanbox-message">' . wfMsg('fanbox-users-with-fanbox-message') . '</div>' . $this->fanBoxHolders() . "\n" . '</div>
		</div>';
        $wgOut->addHTML($output);
        global $wgFanBoxPageDisplay;
        // Display comments, if we want to display those.
        if ($wgFanBoxPageDisplay['comments']) {
            $wgOut->addWikiText('<comments/>');
        }
        parent::view();
    }
Example #25
0
 function view()
 {
     $request = $this->getContext()->getRequest();
     $diff = $request->getVal('diff');
     $diffOnly = $request->getBool('diffonly', $this->getContext()->getUser()->getGlobalPreference('diffonly'));
     if (isset($diff) && $diffOnly) {
         parent::view();
         return;
     }
     if (!wfRunHooks('CategoryPageView', array(&$this))) {
         return;
     }
     $title = $this->getTitle();
     if (NS_CATEGORY == $title->getNamespace()) {
         $this->openShowCategory();
     }
     parent::view();
     if (NS_CATEGORY == $title->getNamespace()) {
         $this->closeShowCategory();
     }
 }
Example #26
0
 function view()
 {
     $request = $this->getContext()->getRequest();
     $diff = $request->getVal('diff');
     $diffOnly = $request->getBool('diffonly', $this->getContext()->getUser()->getOption('diffonly'));
     if ($diff !== null && $diffOnly) {
         parent::view();
         return;
     }
     if (!Hooks::run('CategoryPageView', [&$this])) {
         return;
     }
     $title = $this->getTitle();
     if ($title->inNamespace(NS_CATEGORY)) {
         $this->openShowCategory();
     }
     parent::view();
     if ($title->inNamespace(NS_CATEGORY)) {
         $this->closeShowCategory();
     }
 }
Example #27
0
 function view()
 {
     global $wgRequest, $wgUser;
     $diff = $wgRequest->getVal('diff');
     $diffOnly = $wgRequest->getBool('diffonly', $wgUser->getOption('diffonly'));
     if (isset($diff) && $diffOnly) {
         return Article::view();
     }
     if (!wfRunHooks('CategoryPageView', array(&$this))) {
         return;
     }
     if (NS_CATEGORY == $this->mTitle->getNamespace()) {
         $this->openShowCategory();
     }
     Article::view();
     # If the article we've just shown is in the "Image" namespace,
     # follow it with the history list and link list for the image
     # it describes.
     if (NS_CATEGORY == $this->mTitle->getNamespace()) {
         $this->closeShowCategory();
     }
 }
 /**
  * Render Poll namespace page
  */
 public function view()
 {
     wfProfileIn(__METHOD__);
     // let MW handle basic stuff
     parent::view();
     $wg = F::app()->wg;
     // poll doesn't exist
     if (!$wg->Title->exists() || empty($this->mPoll)) {
         wfProfileOut(__METHOD__);
         return;
     }
     // set page title
     $question = wfMsg('wikiapoll-question', $this->mPoll->getTitle());
     $wg->Out->setPageTitle($question);
     // add CSS/JS
     $wg->Out->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/WikiaPoll/css/WikiaPoll.scss'));
     $jsFile = JSSnippets::addToStack(array('/extensions/wikia/WikiaPoll/js/WikiaPoll.js'), array(), 'WikiaPoll.init');
     // render poll page
     $wg->Out->clearHTML();
     $wg->Out->addHTML($jsFile);
     $wg->Out->addHTML($this->mPoll->render());
     wfProfileOut(__METHOD__);
 }
Example #29
0
 function view()
 {
     $request = $this->getContext()->getRequest();
     $diff = $request->getVal('diff');
     $diffOnly = $request->getBool('diffonly', $this->getContext()->getUser()->getOption('diffonly'));
     if ($diff !== null && $diffOnly) {
         parent::view();
         return;
     }
     if (!Hooks::run('CategoryPageView', [&$this])) {
         return;
     }
     $title = $this->getTitle();
     if ($title->inNamespace(NS_CATEGORY)) {
         $this->openShowCategory();
     }
     parent::view();
     if ($title->inNamespace(NS_CATEGORY)) {
         $this->closeShowCategory();
     }
     # Use adaptive TTLs for CDN so delayed/failed purges are noticed less often
     $outputPage = $this->getContext()->getOutput();
     $outputPage->adaptCdnTTL($this->mPage->getTouched(), IExpiringStore::TTL_MINUTE);
 }
 function addUserTalkHTML($targetUser)
 {
     global $wgOut, $wgTitle, $wgArticle;
     // the joys of globals...got this idea from docs/globals.txt
     $oldTitle = $wgTitle;
     $oldArticle = $wgArticle;
     $wgTitle = Title::makeTitle(NS_USER_TALK, $targetUser->getName());
     $wgArticle = new Article($wgTitle);
     if ($wgArticle) {
         $wgOut->addHTML("<div id='content-talkpage' class='ww_content wh_block'> ");
         $wgOut->addHTML($wgArticle->view());
     } else {
         $wgOut->addHTML("no user talk info");
     }
     $wgTitle = $oldTitle;
     $wgArticle = $oldArticle;
     $wgOut->addHTML("</div>");
 }