diff --git a/includes/CosmosTemplate.php b/includes/CosmosTemplate.php index 52bc13b1..82c15060 100644 --- a/includes/CosmosTemplate.php +++ b/includes/CosmosTemplate.php @@ -1,1805 +1,1814 @@ getSkin(); '@phan-var SkinCosmos $skin'; $this->config = $skin->config; $this->contentLanguage = $skin->contentLanguage; $this->cosmosRailBuilder = $skin->cosmosRailBuilder; $this->languageNameUtils = $skin->languageNameUtils; $this->permissionManager = $skin->permissionManager; $this->specialPageFactory = $skin->specialPageFactory; $this->titleFactory = $skin->titleFactory; $this->wordmarkLookup = $skin->wordmarkLookup; $html = $this->buildBanner(); $html .= $this->buildCreateArticleDialog(); $html .= Html::openElement( 'div', [ 'id' => 'mw-content-container', 'class' => 'ts-container' ] ); $html .= Html::openElement( 'div', [ 'id' => 'mw-content-block', 'class' => 'ts-inner' ] ); $html .= Html::openElement( 'div', [ 'id' => 'mw-content-wrapper' ] ); $html .= $this->buildWikiHeader(); $html .= $this->buildWiki(); $html .= Html::closeElement( 'div' ); $html .= Html::closeElement( 'div' ); $html .= Html::closeElement( 'div' ); $html .= $this->buildToolbar(); $html .= Html::closeElement( 'div' ); echo $html; } /** * @return string */ protected function buildBanner() { $html = ''; // Open container section for banner $html .= Html::openElement( 'section', [ 'id' => 'cosmos-banner' ] ); // Open container div for banner content $html .= Html::openElement( 'div', [ 'id' => 'cosmos-banner-content', 'class' => 'cosmos-pageAligned' ] ); // Build the mobile navigation $html .= Html::openElement( 'nav', [ 'class' => 'cosmos-mobile-navigation' ] ); $html .= Html::rawElement( 'div', [ 'class' => 'cosmos-button cosmos-button-primary cosmos-mobile-menu-button', 'onclick' => '$(".wds-tabs").toggle()' ], '☰' ); $html .= $this->buildNavigation(); $html .= Html::closeElement( 'nav' ); // Build the search bar $html .= $this->buildSearchBar(); // Build user options/login button (floats on the right of the div) $html .= $this->buildUserOptions(); // Close container div for banner content $html .= Html::closeElement( 'div' ); // Close banner section $html .= Html::closeElement( 'section' ); return $html; } /** * @return string */ protected function buildCreateArticleDialog() { $skin = $this->getSkin(); $html = ''; $html .= Html::openElement( 'div', [ 'id' => 'createPageModal', 'class' => 'cosmos-modal' ] ); $html .= Html::openElement( 'div', [ 'class' => 'cosmos-modal-content' ] ); $html .= Html::rawElement( 'span', [ 'class' => 'close' ], '×' ); $html .= Html::openElement( 'form', [ 'class' => 'wds-dialog__wrapper create-page-dialog__wrapper', 'action' => $this->get( 'wgScript' ), 'method' => 'get' ] ); $html .= Html::hidden( 'action', 'edit' ); $headerIcon = Icon::getIcon( 'close' )->makeSvg( 14, 14, [ 'class' => 'wds-icon wds-icon-small create-page-dialog__close' ] ); $html .= Html::rawElement( 'header', [ 'class' => 'wds-dialog__title' ], $this->getMsg( 'cosmos-createpage-header' )->escaped() . $headerIcon ); $html .= Html::openElement( 'div', [ 'class' => 'wds-dialog__content' ] ); $html .= Html::rawElement( 'div', [ 'id' => 'create-page-dialog__message' ], $this->getMsg( 'cosmos-createpage-input-label' )->escaped() ); $html .= Html::openElement( 'div', [ 'class' => 'wds-input create-page-dialog__title-wrapper' ] ); $html .= Html::input( 'title', '', 'text', [ 'class' => 'wds-input__field', 'id' => 'create-page-dialog__title' ] ); $html .= Html::closeElement( 'div' ); $html .= Html::rawElement( 'div', [ 'id' => 'create-page-dialog__message' ], $this->getMsg( 'cosmos-createpage-text', $skin->getLanguage()->formatNum( SiteStats::articles() ), $this->get( 'sitename' ), $this->config->get( 'CosmosEnableWantedPages' ) ? $this->getMsg( 'cosmos-createpage-wanted-pages' )->text() : $this->getMsg( 'cosmos-createpage-no-wanted-pages', SpecialPage::getTitleFor( 'Wantedpages' ) )->text() )->parse() ); $html .= Html::openElement( 'div', [ 'class' => 'create-page-dialog__proposals' ] ); $html .= Html::openElement( 'ul', [ 'class' => 'articleProposals' ] ); // Get most wanted pages if ( $this->config->get( 'CosmosEnableWantedPages' ) ) { foreach ( $this->getMostWantedPages() as $page ) { $html .= '