/** * * @param Title $oTitle * @return false|\ViewStateBarTopElement */ private function makeStateBarTopSubPages($oTitle) { if ($oTitle->hasSubpages() == false) { return false; } wfProfileIn('BS::' . __METHOD__); $oSubpageIcons = new ViewStateBarTopElement(); $oSubpageIcons->setKey('Subpages'); $oSubpageIcons->setIconSrc($this->getImagePath(true) . BsConfig::get('MW::ArticleInfo::ImageSubpages')); $oSubpageIcons->setIconAlt(wfMessage('bs-articleinfo-subpages-available')->plain()); $oSubpageIcons->setIconTogglesBody(true); $oSubpageIcons->setText(wfMessage('bs-articleinfo-subpages')->plain()); $oSubpageIcons->setTextLinkTitle(wfMessage('bs-articleinfo-subpages')->plain()); $oSubpageIcons->setTextLink('#'); wfRunHooks('BSArticleInfoBeforeSubpagesTopView', array($this, &$oSubpageIcons)); return $oSubpageIcons; }
private function makeStateBarTopResponsibleEditorsEntries($iArticleId) { global $wgScriptPath; $aResponsibleEditorIds = $this->getResponsibleEditorIdsByArticleId($iArticleId); if (empty($aResponsibleEditorIds)) { return false; } $oResponsibleEditorsTopView = new ViewStateBarTopElement(); $oFirstResponsibleEditor = User::newFromId($aResponsibleEditorIds[0]); $sDispalyName = $this->mCore->getUserDisplayName($oFirstResponsibleEditor); $oResponsibleEditorsTopView->setKey('ResponsibleEditors-Top'); $oResponsibleEditorsTopView->setIconSrc($wgScriptPath . '/extensions/BlueSpiceExtensions/' . $this->mInfo[EXTINFO::NAME] . '/resources/images/bs-infobar-responsibleeditor.png'); $oResponsibleEditorsTopView->setIconAlt(wfMessage('bs-responsibleeditors-statebartop-icon-alt')->plain()); $oResponsibleEditorsTopView->setText($sDispalyName); $oResponsibleEditorsTopView->setTextLinkTitle($sDispalyName); $oResponsibleEditorsTopView->setTextLink($oFirstResponsibleEditor->getUserPage()->getFullURL()); return $oResponsibleEditorsTopView; }
/** * Ads Shoutbox icon with number of shouts to the statebar * @global String $wgScriptPath * @param StateBar $oStateBar * @param array $aTopViews * @param User $oUser * @param Title $oTitle * @return boolean */ public function onStateBarBeforeTopViewAdd($oStateBar, &$aTopViews, $oUser, $oTitle) { $oShoutboxView = new ViewStateBarTopElement(); $iTotalShouts = self::getTotalShouts($oTitle->getArticleID()); if (!is_object($this->getTitle()) || $iTotalShouts == 0) { return true; } global $wgScriptPath; $oShoutboxView->setKey('Shoutbox'); $oShoutboxView->setIconSrc($wgScriptPath . '/extensions/BlueSpiceExtensions/ShoutBox/resources/images/icon-shoutbox.png'); $oShoutboxView->setIconAlt(wfMessage('bs-shoutbox-title')->plain()); $oShoutboxView->setText(wfMessage('bs-shoutbox-n-shouts', self::getTotalShouts($oTitle->getArticleID()))->text()); $oShoutboxView->setTextLink('#bs-shoutbox'); $aTopViews['statebartopshoutbox'] = $oShoutboxView; return true; }
/** * Renders status output to StatusBar top secion. * @param string $sIcon Filename of the icon to be displayed. Relative to extension image dir. * @return ViewStateBarTopElement View that is part of StateBar. */ public function makeStateBarTopReview($sIcon) { $oReviewView = new ViewStateBarTopElement(); if (is_object($this->getTitle())) { global $wgScriptPath; $oReviewView->setKey('Review'); $oReviewView->setIconSrc($wgScriptPath . '/extensions/BlueSpiceExtensions/Review/resources/images/' . $sIcon); $oReviewView->setIconAlt(wfMessage('bs-review-review')->plain()); $oReviewView->setText(wfMessage('bs-review-review')->plain()); } return $oReviewView; }
/** * Renders a note that someone is editing a page to the statebar * @param string $sUserName name of the user that is editing the page * @return ViewStateBarTopElement View that is to be displayed in StateBar Top */ public function makeStateBarTopSomeoneEditing($sUserName) { global $wgScriptPath; $oSaferEditView = new ViewStateBarTopElement(); $oSaferEditView->setKey('SaferEditSomeoneEditing'); $oSaferEditView->setIconSrc($wgScriptPath . '/extensions/BlueSpiceExtensions/SaferEdit/resources/images/bs-infobar-editing-orange.png'); if (BsConfig::get('MW::SaferEdit::ShowNameOfEditingUser')) { $oSaferEditView->setIconAlt(wfMessage('bs-saferedit-user-editing', $sUserName)->text()); $oSaferEditView->setText(wfMessage('bs-saferedit-user-editing', $sUserName)->text()); } else { $oSaferEditView->setIconAlt(wfMessage('bs-saferedit-someone-editing')->plain()); $oSaferEditView->setText(wfMessage('bs-saferedit-someone-editing')->plain()); } return $oSaferEditView; }