function getButtons()
 {
     $buttons = '';
     if ($this->mShowSubmit) {
         $attribs = array();
         if (isset($this->mSubmitID)) {
             $attribs['id'] = $this->mSubmitID;
         }
         if (isset($this->mSubmitName)) {
             $attribs['name'] = $this->mSubmitName;
         }
         if (isset($this->mSubmitTooltip)) {
             $attribs += Linker::tooltipAndAccesskeyAttribs($this->mSubmitTooltip);
         }
         $attribs['class'] = array('mw-htmlform-submit', 'mw-ui-button mw-ui-big mw-ui-block', $this->mSubmitModifierClass);
         $buttons .= Xml::submitButton($this->getSubmitText(), $attribs) . "\n";
     }
     if ($this->mShowReset) {
         $buttons .= Html::element('input', array('type' => 'reset', 'value' => $this->msg('htmlform-reset')->text(), 'class' => 'mw-ui-button mw-ui-big mw-ui-block')) . "\n";
     }
     foreach ($this->mButtons as $button) {
         $attrs = array('type' => 'submit', 'name' => $button['name'], 'value' => $button['value']);
         if ($button['attribs']) {
             $attrs += $button['attribs'];
         }
         if (isset($button['id'])) {
             $attrs['id'] = $button['id'];
         }
         $attrs['class'] = isset($attrs['class']) ? (array) $attrs['class'] : array();
         $attrs['class'][] = 'mw-ui-button mw-ui-big mw-ui-block';
         $buttons .= Html::element('input', $attrs) . "\n";
     }
     $html = Html::rawElement('div', array('class' => 'mw-htmlform-submit-buttons'), "\n{$buttons}") . "\n";
     return $html;
 }
Example #2
0
 function getButtons()
 {
     $buttons = '';
     // IE<8 has bugs with <button>, so we'll need to avoid them.
     $isBadIE = preg_match('/MSIE [1-7]\\./i', $this->getRequest()->getHeader('User-Agent'));
     if ($this->mShowSubmit) {
         $attribs = ['infusable' => true];
         if (isset($this->mSubmitID)) {
             $attribs['id'] = $this->mSubmitID;
         }
         if (isset($this->mSubmitName)) {
             $attribs['name'] = $this->mSubmitName;
         }
         if (isset($this->mSubmitTooltip)) {
             $attribs += Linker::tooltipAndAccesskeyAttribs($this->mSubmitTooltip);
         }
         $attribs['classes'] = ['mw-htmlform-submit'];
         $attribs['type'] = 'submit';
         $attribs['label'] = $this->getSubmitText();
         $attribs['value'] = $this->getSubmitText();
         $attribs['flags'] = $this->mSubmitFlags;
         $attribs['useInputTag'] = $isBadIE;
         $buttons .= new OOUI\ButtonInputWidget($attribs);
     }
     if ($this->mShowReset) {
         $buttons .= new OOUI\ButtonInputWidget(['type' => 'reset', 'label' => $this->msg('htmlform-reset')->text(), 'useInputTag' => $isBadIE]);
     }
     foreach ($this->mButtons as $button) {
         $attrs = [];
         if ($button['attribs']) {
             $attrs += $button['attribs'];
         }
         if (isset($button['id'])) {
             $attrs['id'] = $button['id'];
         }
         if ($isBadIE) {
             $label = $button['value'];
         } elseif (isset($button['label-message'])) {
             $label = new OOUI\HtmlSnippet($this->getMessage($button['label-message'])->parse());
         } elseif (isset($button['label'])) {
             $label = $button['label'];
         } elseif (isset($button['label-raw'])) {
             $label = new OOUI\HtmlSnippet($button['label-raw']);
         } else {
             $label = $button['value'];
         }
         $attrs['classes'] = isset($attrs['class']) ? (array) $attrs['class'] : [];
         $buttons .= new OOUI\ButtonInputWidget(['type' => 'submit', 'name' => $button['name'], 'value' => $button['value'], 'label' => $label, 'flags' => $button['flags'], 'useInputTag' => $isBadIE] + $attrs);
     }
     if (!$buttons) {
         return '';
     }
     return Html::rawElement('div', ['class' => 'mw-htmlform-submit-buttons'], "\n{$buttons}") . "\n";
 }
Example #3
0
 function getButtons()
 {
     $buttons = '';
     if ($this->mShowSubmit) {
         $attribs = [];
         if (isset($this->mSubmitID)) {
             $attribs['id'] = $this->mSubmitID;
         }
         if (isset($this->mSubmitName)) {
             $attribs['name'] = $this->mSubmitName;
         }
         if (isset($this->mSubmitTooltip)) {
             $attribs += Linker::tooltipAndAccesskeyAttribs($this->mSubmitTooltip);
         }
         $attribs['class'] = ['mw-htmlform-submit', 'mw-ui-button mw-ui-big mw-ui-block'];
         foreach ($this->mSubmitFlags as $flag) {
             $attribs['class'][] = 'mw-ui-' . $flag;
         }
         $buttons .= Xml::submitButton($this->getSubmitText(), $attribs) . "\n";
     }
     if ($this->mShowReset) {
         $buttons .= Html::element('input', ['type' => 'reset', 'value' => $this->msg('htmlform-reset')->text(), 'class' => 'mw-ui-button mw-ui-big mw-ui-block']) . "\n";
     }
     if ($this->mShowCancel) {
         $target = $this->mCancelTarget ?: Title::newMainPage();
         if ($target instanceof Title) {
             $target = $target->getLocalURL();
         }
         $buttons .= Html::element('a', ['class' => 'mw-ui-button mw-ui-big mw-ui-block', 'href' => $target], $this->msg('cancel')->text()) . "\n";
     }
     foreach ($this->mButtons as $button) {
         $attrs = ['type' => 'submit', 'name' => $button['name'], 'value' => $button['value']];
         if ($button['attribs']) {
             $attrs += $button['attribs'];
         }
         if (isset($button['id'])) {
             $attrs['id'] = $button['id'];
         }
         $attrs['class'] = isset($attrs['class']) ? (array) $attrs['class'] : [];
         $attrs['class'][] = 'mw-ui-button mw-ui-big mw-ui-block';
         $buttons .= Html::element('input', $attrs) . "\n";
     }
     if (!$buttons) {
         return '';
     }
     return Html::rawElement('div', ['class' => 'mw-htmlform-submit-buttons'], "\n{$buttons}") . "\n";
 }
Example #4
0
 function getButtons()
 {
     $buttons = '';
     if ($this->mShowSubmit) {
         $attribs = array('infusable' => true);
         if (isset($this->mSubmitID)) {
             $attribs['id'] = $this->mSubmitID;
         }
         if (isset($this->mSubmitName)) {
             $attribs['name'] = $this->mSubmitName;
         }
         if (isset($this->mSubmitTooltip)) {
             $attribs += Linker::tooltipAndAccesskeyAttribs($this->mSubmitTooltip);
         }
         $attribs['classes'] = array('mw-htmlform-submit');
         $attribs['type'] = 'submit';
         $attribs['label'] = $this->getSubmitText();
         $attribs['value'] = $this->getSubmitText();
         $attribs['flags'] = $this->mSubmitFlags;
         $buttons .= new OOUI\ButtonInputWidget($attribs);
     }
     if ($this->mShowReset) {
         $buttons .= new OOUI\ButtonInputWidget(array('type' => 'reset', 'label' => $this->msg('htmlform-reset')->text()));
     }
     foreach ($this->mButtons as $button) {
         $attrs = array();
         if ($button['attribs']) {
             $attrs += $button['attribs'];
         }
         if (isset($button['id'])) {
             $attrs['id'] = $button['id'];
         }
         $attrs['classes'] = isset($attrs['class']) ? (array) $attrs['class'] : array();
         $buttons .= new OOUI\ButtonInputWidget(array('type' => 'submit', 'name' => $button['name'], 'value' => $button['value'], 'label' => $button['value']) + $attrs);
     }
     $html = Html::rawElement('div', array('class' => 'mw-htmlform-submit-buttons'), "\n{$buttons}") . "\n";
     return $html;
 }
Example #5
0
 public function tooltipAndAccesskeyAttribs($name, array $msgParams = [])
 {
     return Linker::tooltipAndAccesskeyAttribs($name, $msgParams);
 }
Example #6
0
    function customBox($bar, $cont)
    {
        ?>

		<li class='widget-container' id='<?php 
        echo Sanitizer::escapeId("p-{$bar}");
        ?>
'<?php 
        echo Linker::tooltip('p-' . $bar);
        ?>
>
		<h3 class="widget-title">
			<?php 
        $out = wfMsg($bar);
        if (wfEmptyMsg($bar, $out)) {
            echo htmlspecialchars($bar);
        } else {
            echo htmlspecialchars($out);
        }
        ?>
		</h3>
<?php 
        if (is_array($cont)) {
            ?>
			<ul>
<?php 
            foreach ($cont as $key => $val) {
                ?>
				<li id="<?php 
                echo Sanitizer::escapeId($val['id']);
                ?>
"<?php 
                if ($val['active']) {
                    ?>
 class="active" <?php 
                }
                ?>
><a href="<?php 
                echo htmlspecialchars($val['href']);
                ?>
"<?php 
                echo Linker::tooltipAndAccesskeyAttribs($val['id']);
                ?>
>
					<?php 
                echo htmlspecialchars($val['text']);
                ?>
</a>
				</li>
<?php 
            }
            ?>
			</ul>
<?php 
        } else {
            # allow raw HTML block to be defined by extensions
            print $cont;
        }
        echo '</li>';
    }
Example #7
0
 /**
  * Creates begin of history list with a submit button
  *
  * @return string HTML output
  */
 function getStartBody()
 {
     $this->lastRow = false;
     $this->counter = 1;
     $this->oldIdChecked = 0;
     $this->getOutput()->wrapWikiMsg("<div class='mw-history-legend'>\n\$1\n</div>", 'histlegend');
     $s = Html::openElement('form', ['action' => wfScript(), 'id' => 'mw-history-compare']) . "\n";
     $s .= Html::hidden('title', $this->getTitle()->getPrefixedDBkey()) . "\n";
     $s .= Html::hidden('action', 'historysubmit') . "\n";
     $s .= Html::hidden('type', 'revision') . "\n";
     // Button container stored in $this->buttons for re-use in getEndBody()
     $this->buttons = '<div>';
     $className = 'historysubmit mw-history-compareselectedversions-button';
     $attrs = ['class' => $className] + Linker::tooltipAndAccesskeyAttribs('compareselectedversions');
     $this->buttons .= $this->submitButton($this->msg('compareselectedversions')->text(), $attrs) . "\n";
     $user = $this->getUser();
     $actionButtons = '';
     if ($user->isAllowed('deleterevision')) {
         $actionButtons .= $this->getRevisionButton('revisiondelete', 'showhideselectedversions');
     }
     if ($this->showTagEditUI) {
         $actionButtons .= $this->getRevisionButton('editchangetags', 'history-edit-tags');
     }
     if ($actionButtons) {
         $this->buttons .= Xml::tags('div', ['class' => 'mw-history-revisionactions'], $actionButtons);
     }
     if ($user->isAllowed('deleterevision') || $this->showTagEditUI) {
         $this->buttons .= (new ListToggle($this->getOutput()))->getHTML();
     }
     $this->buttons .= '</div>';
     $s .= $this->buttons;
     $s .= '<ul id="pagehistory">' . "\n";
     return $s;
 }
Example #8
0
 /**
  * Returns the attributes required for the tooltip and accesskey.
  *
  * @return array Attributes
  */
 public function getTooltipAndAccessKey()
 {
     if (empty($this->mParams['tooltip'])) {
         return array();
     }
     return Linker::tooltipAndAccesskeyAttribs($this->mParams['tooltip']);
 }
Example #9
0
 function tooltipAndAccesskey($name)
 {
     global $wgVersion;
     if (version_compare($wgVersion, '1.18.0', '<')) {
         return $this->skin->tooltipAndAccesskey($name);
     } else {
         $retrunString = ' ';
         foreach (Linker::tooltipAndAccesskeyAttribs($name) as $key => $item) {
             $retrunString += $key + '="' + $item + '" ';
         }
         return $retrunString;
     }
 }
Example #10
0
    /**
     * Prints the cactions bar.
     * Shared between MonoBook and Modern
     */
    function cactions()
    {
        ?>
	<div id="p-cactions" class="portlet">
		<h2><?php 
        $this->msg('views');
        ?>
</h2>
		<div class="pBody">
			<ul><?php 
        foreach ($this->data['content_actions'] as $key => $tab) {
            $linkAttribs = array('href' => $tab['href']);
            if (isset($tab["tooltiponly"]) && $tab["tooltiponly"]) {
                $title = Linker::titleAttrib("ca-{$key}");
                if ($title !== false) {
                    $linkAttribs['title'] = $title;
                }
            } else {
                $linkAttribs += Linker::tooltipAndAccesskeyAttribs("ca-{$key}");
            }
            $linkHtml = Html::element('a', $linkAttribs, $tab['text']);
            /* Surround with a <li> */
            $liAttribs = array('id' => Sanitizer::escapeId("ca-{$key}"));
            if ($tab['class']) {
                $liAttribs['class'] = $tab['class'];
            }
            echo '
				' . Html::rawElement('li', $liAttribs, $linkHtml);
        }
        ?>
			</ul>
		</div>
	</div>
<?php 
    }
Example #11
0
    /**
     * Outputs the entire contents of the (X)HTML page
     */
    public function execute()
    {
        global $wgLang, $wgVectorUseIconWatch;
        $this->skin = $this->data['skin'];
        // Build additional attributes for navigation urls
        //$nav = $this->skin->buildNavigationUrls();
        $nav = $this->data['content_navigation'];
        if ($wgVectorUseIconWatch) {
            $mode = $this->skin->getTitle()->userIsWatching() ? 'unwatch' : 'watch';
            if (isset($nav['actions'][$mode])) {
                $nav['views'][$mode] = $nav['actions'][$mode];
                $nav['views'][$mode]['class'] = rtrim('icon ' . $nav['views'][$mode]['class'], ' ');
                $nav['views'][$mode]['primary'] = true;
                unset($nav['actions'][$mode]);
            }
        }
        $xmlID = '';
        foreach ($nav as $section => $links) {
            foreach ($links as $key => $link) {
                if ($section == 'views' && !(isset($link['primary']) && $link['primary'])) {
                    $link['class'] = rtrim('collapsible ' . $link['class'], ' ');
                }
                $xmlID = isset($link['id']) ? $link['id'] : 'ca-' . $xmlID;
                $nav[$section][$key]['attributes'] = ' id="' . Sanitizer::escapeId($xmlID) . '"';
                if ($link['class']) {
                    $nav[$section][$key]['attributes'] .= ' class="' . htmlspecialchars($link['class']) . '"';
                    unset($nav[$section][$key]['class']);
                }
                if (isset($link['tooltiponly']) && $link['tooltiponly']) {
                    $nav[$section][$key]['key'] = Linker::tooltip($xmlID);
                } else {
                    $nav[$section][$key]['key'] = Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs($xmlID));
                }
            }
        }
        $this->data['namespace_urls'] = $nav['namespaces'];
        $this->data['view_urls'] = $nav['views'];
        $this->data['action_urls'] = $nav['actions'];
        $this->data['variant_urls'] = $nav['variants'];
        // Reverse horizontally rendered navigation elements
        if ($wgLang->isRTL()) {
            $this->data['view_urls'] = array_reverse($this->data['view_urls']);
            $this->data['namespace_urls'] = array_reverse($this->data['namespace_urls']);
            $this->data['personal_urls'] = array_reverse($this->data['personal_urls']);
        }
        // Output HTML Page
        $this->html('headelement');
        ?>
		<div id="mw-page-base" class="noprint"></div>
		<div id="mw-head-base" class="noprint"></div>
		<!-- content -->
		<div id="content">
			<a id="top"></a>
			<div id="mw-js-message" style="display:none;"<?php 
        $this->html('userlangattributes');
        ?>
></div>
			<?php 
        if ($this->data['sitenotice']) {
            ?>
			<!-- sitenotice -->
			<div id="siteNotice"><?php 
            $this->html('sitenotice');
            ?>
</div>
			<!-- /sitenotice -->
			<?php 
        }
        ?>
			<!-- firstHeading -->
			<h1 id="firstHeading" class="firstHeading"><?php 
        $this->html('title');
        ?>
</h1>
			<!-- /firstHeading -->
			<!-- bodyContent -->
			<div id="bodyContent">
				<?php 
        if ($this->data['isarticle']) {
            ?>
				<!-- tagline -->
				<div id="siteSub"><?php 
            $this->msg('tagline');
            ?>
</div>
				<!-- /tagline -->
				<?php 
        }
        ?>
				<!-- subtitle -->
				<div id="contentSub"<?php 
        $this->html('userlangattributes');
        ?>
><?php 
        $this->html('subtitle');
        ?>
</div>
				<!-- /subtitle -->
				<?php 
        if ($this->data['undelete']) {
            ?>
				<!-- undelete -->
				<div id="contentSub2"><?php 
            $this->html('undelete');
            ?>
</div>
				<!-- /undelete -->
				<?php 
        }
        ?>
				<?php 
        if ($this->data['newtalk']) {
            ?>
				<!-- newtalk -->
				<div class="usermessage"><?php 
            $this->html('newtalk');
            ?>
</div>
				<!-- /newtalk -->
				<?php 
        }
        ?>
				<?php 
        if ($this->data['showjumplinks']) {
            ?>
				<!-- jumpto -->
				<div id="jump-to-nav">
					<?php 
            $this->msg('jumpto');
            ?>
 <a href="#mw-head"><?php 
            $this->msg('jumptonavigation');
            ?>
</a>,
					<a href="#p-search"><?php 
            $this->msg('jumptosearch');
            ?>
</a>
				</div>
				<!-- /jumpto -->
				<?php 
        }
        ?>
				<!-- bodycontent -->
				<?php 
        $this->html('bodycontent');
        ?>
				<!-- /bodycontent -->
				<?php 
        if ($this->data['printfooter']) {
            ?>
				<!-- printfooter -->
				<div class="printfooter">
				<?php 
            $this->html('printfooter');
            ?>
				</div>
				<!-- /printfooter -->
				<?php 
        }
        ?>
				<?php 
        if ($this->data['catlinks']) {
            ?>
				<!-- catlinks -->
				<?php 
            $this->html('catlinks');
            ?>
				<!-- /catlinks -->
				<?php 
        }
        ?>
				<?php 
        if ($this->data['dataAfterContent']) {
            ?>
				<!-- dataAfterContent -->
				<?php 
            $this->html('dataAfterContent');
            ?>
				<!-- /dataAfterContent -->
				<?php 
        }
        ?>
				<div class="visualClear"></div>
				<!-- debughtml -->
				<?php 
        $this->html('debughtml');
        ?>
				<!-- /debughtml -->
			</div>
			<!-- /bodyContent -->
		</div>
		<!-- /content -->
		<!-- header -->
		<div id="mw-head" class="noprint">
			<?php 
        $this->renderNavigation('PERSONAL');
        ?>
			<div id="left-navigation">
				<?php 
        $this->renderNavigation(array('NAMESPACES', 'VARIANTS'));
        ?>
			</div>
			<div id="right-navigation">
				<?php 
        $this->renderNavigation(array('VIEWS', 'ACTIONS', 'SEARCH'));
        ?>
			</div>
		</div>
		<!-- /header -->
		<!-- panel -->
			<div id="mw-panel" class="noprint">
				<!-- logo -->
					<div id="p-logo"><a style="background-image: url(<?php 
        $this->text('logopath');
        ?>
);" href="<?php 
        echo htmlspecialchars($this->data['nav_urls']['mainpage']['href']);
        ?>
" <?php 
        echo Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs('p-logo'));
        ?>
></a></div>
				<!-- /logo -->
				<?php 
        $this->renderPortals($this->data['sidebar']);
        ?>
			</div>
		<!-- /panel -->
		<!-- footer -->
		<div id="footer"<?php 
        $this->html('userlangattributes');
        ?>
>
			<?php 
        foreach ($this->getFooterLinks() as $category => $links) {
            ?>
				<ul id="footer-<?php 
            echo $category;
            ?>
">
					<?php 
            foreach ($links as $link) {
                ?>
						<li id="footer-<?php 
                echo $category;
                ?>
-<?php 
                echo $link;
                ?>
"><?php 
                $this->html($link);
                ?>
</li>
					<?php 
            }
            ?>
				</ul>
			<?php 
        }
        ?>
			<?php 
        $footericons = $this->getFooterIcons("icononly");
        if (count($footericons) > 0) {
            ?>
				<ul id="footer-icons" class="noprint">
<?php 
            foreach ($footericons as $blockName => $footerIcons) {
                ?>
					<li id="footer-<?php 
                echo htmlspecialchars($blockName);
                ?>
ico">
<?php 
                foreach ($footerIcons as $icon) {
                    ?>
						<?php 
                    echo $this->skin->makeFooterIcon($icon);
                    ?>

<?php 
                }
                ?>
					</li>
<?php 
            }
            ?>
				</ul>
			<?php 
        }
        ?>
			<div style="clear:both"></div>
		</div>
		<!-- /footer -->
		<!-- fixalpha -->
		<script type="<?php 
        $this->text('jsmimetype');
        ?>
" src="<?php 
        global $wgScriptPath;
        echo $wgScriptPath . "/fix_alpha.js";
        ?>
"></script>
		<!-- /fixalpha -->
		<?php 
        $this->printTrail();
        ?>

	</body>
</html>
<?php 
    }
Example #12
0
 /**
  * Get the submit and (potentially) reset buttons.
  * @return string HTML.
  */
 function getButtons()
 {
     $buttons = '';
     $useMediaWikiUIEverywhere = $this->getConfig()->get('UseMediaWikiUIEverywhere');
     if ($this->mShowSubmit) {
         $attribs = array();
         if (isset($this->mSubmitID)) {
             $attribs['id'] = $this->mSubmitID;
         }
         if (isset($this->mSubmitName)) {
             $attribs['name'] = $this->mSubmitName;
         }
         if (isset($this->mSubmitTooltip)) {
             $attribs += Linker::tooltipAndAccesskeyAttribs($this->mSubmitTooltip);
         }
         $attribs['class'] = array('mw-htmlform-submit');
         if ($useMediaWikiUIEverywhere) {
             foreach ($this->mSubmitFlags as $flag) {
                 array_push($attribs['class'], 'mw-ui-' . $flag);
             }
             array_push($attribs['class'], 'mw-ui-button');
         }
         $buttons .= Xml::submitButton($this->getSubmitText(), $attribs) . "\n";
     }
     if ($this->mShowReset) {
         $buttons .= Html::element('input', array('type' => 'reset', 'value' => $this->msg('htmlform-reset')->text(), 'class' => $useMediaWikiUIEverywhere ? 'mw-ui-button' : null)) . "\n";
     }
     // IE<8 has bugs with <button>, so we'll need to avoid them.
     $isBadIE = preg_match('/MSIE [1-7]\\./i', $this->getRequest()->getHeader('User-Agent'));
     foreach ($this->mButtons as $button) {
         $attrs = array('type' => 'submit', 'name' => $button['name'], 'value' => $button['value']);
         if (isset($button['label-message'])) {
             $label = $this->msg($button['label-message'])->parse();
         } elseif (isset($button['label'])) {
             $label = htmlspecialchars($button['label']);
         } elseif (isset($button['label-raw'])) {
             $label = $button['label-raw'];
         } else {
             $label = htmlspecialchars($button['value']);
         }
         if ($button['attribs']) {
             $attrs += $button['attribs'];
         }
         if (isset($button['id'])) {
             $attrs['id'] = $button['id'];
         }
         if ($useMediaWikiUIEverywhere) {
             $attrs['class'] = isset($attrs['class']) ? (array) $attrs['class'] : array();
             $attrs['class'][] = 'mw-ui-button';
         }
         if ($isBadIE) {
             $buttons .= Html::element('input', $attrs) . "\n";
         } else {
             $buttons .= Html::rawElement('button', $attrs, $label) . "\n";
         }
     }
     $html = Html::rawElement('span', array('class' => 'mw-htmlform-submit-buttons'), "\n{$buttons}") . "\n";
     return $html;
 }
 private function showForm()
 {
     $action = $this->getPageTitle()->getLocalURL(array('action' => 'submit'));
     $user = $this->getUser();
     $out = $this->getOutput();
     $importSources = $this->getConfig()->get('ImportSources');
     if ($user->isAllowed('importupload')) {
         $out->addHTML(Xml::fieldset($this->msg('import-upload')->text()) . Xml::openElement('form', array('enctype' => 'multipart/form-data', 'method' => 'post', 'action' => $action, 'id' => 'mw-import-upload-form')) . $this->msg('importtext')->parseAsBlock() . Html::hidden('action', 'submit') . Html::hidden('source', 'upload') . Xml::openElement('table', array('id' => 'mw-import-table-upload')) . "<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-upload-filename')->text(), 'xmlimport') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Html::input('xmlimport', '', 'file', array('id' => 'xmlimport')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-comment')->text(), 'mw-import-comment') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('log-comment', 50, $this->sourceName == 'upload' ? $this->logcomment : '', array('id' => 'mw-import-comment', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-interwiki-rootpage')->text(), 'mw-interwiki-rootpage-upload') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('rootpage', 50, $this->rootpage, array('id' => 'mw-interwiki-rootpage-upload', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td class='mw-submit'>" . Xml::submitButton($this->msg('uploadbtn')->text()) . "</td>\n\t\t\t\t</tr>" . Xml::closeElement('table') . Html::hidden('editToken', $user->getEditToken()) . Xml::closeElement('form') . Xml::closeElement('fieldset'));
     } else {
         if (empty($importSources)) {
             $out->addWikiMsg('importnosources');
         }
     }
     if ($user->isAllowed('import') && !empty($importSources)) {
         # Show input field for import depth only if $wgExportMaxLinkDepth > 0
         $importDepth = '';
         if ($this->getConfig()->get('ExportMaxLinkDepth') > 0) {
             $importDepth = "<tr>\n\t\t\t\t\t\t\t<td class='mw-label'>" . $this->msg('export-pagelinks')->parse() . "</td>\n\t\t\t\t\t\t\t<td class='mw-input'>" . Xml::input('pagelink-depth', 3, 0) . "</td>\n\t\t\t\t</tr>";
         }
         $out->addHTML(Xml::fieldset($this->msg('importinterwiki')->text()) . Xml::openElement('form', array('method' => 'post', 'action' => $action, 'id' => 'mw-import-interwiki-form')) . $this->msg('import-interwiki-text')->parseAsBlock() . Html::hidden('action', 'submit') . Html::hidden('source', 'interwiki') . Html::hidden('editToken', $user->getEditToken()) . Xml::openElement('table', array('id' => 'mw-import-table-interwiki')) . "<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-interwiki-sourcewiki')->text(), 'interwiki') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::openElement('select', array('name' => 'interwiki', 'id' => 'interwiki')));
         $needSubprojectField = false;
         foreach ($importSources as $key => $value) {
             if (is_int($key)) {
                 $key = $value;
             } elseif ($value !== $key) {
                 $needSubprojectField = true;
             }
             $attribs = array('value' => $key);
             if (is_array($value)) {
                 $attribs['data-subprojects'] = implode(' ', $value);
             }
             if ($this->interwiki === $key) {
                 $attribs['selected'] = 'selected';
             }
             $out->addHTML(Html::element('option', $attribs, $key));
         }
         $out->addHTML(Xml::closeElement('select'));
         if ($needSubprojectField) {
             $out->addHTML(Xml::openElement('select', array('name' => 'subproject', 'id' => 'subproject')));
             $subprojectsToAdd = array();
             foreach ($importSources as $key => $value) {
                 if (is_array($value)) {
                     $subprojectsToAdd = array_merge($subprojectsToAdd, $value);
                 }
             }
             $subprojectsToAdd = array_unique($subprojectsToAdd);
             sort($subprojectsToAdd);
             foreach ($subprojectsToAdd as $subproject) {
                 $out->addHTML(Xml::option($subproject, $subproject, $this->subproject === $subproject));
             }
             $out->addHTML(Xml::closeElement('select'));
         }
         $out->addHTML("</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-interwiki-sourcepage')->text(), 'frompage') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('frompage', 50, $this->frompage, array('id' => 'frompage')) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel($this->msg('import-interwiki-history')->text(), 'interwikiHistory', 'interwikiHistory', $this->history) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel($this->msg('import-interwiki-templates')->text(), 'interwikiTemplates', 'interwikiTemplates', $this->includeTemplates) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t{$importDepth}\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-interwiki-namespace')->text(), 'namespace') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Html::namespaceSelector(array('selected' => $this->namespace, 'all' => ''), array('name' => 'namespace', 'id' => 'namespace', 'class' => 'namespaceselector')) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-comment')->text(), 'mw-interwiki-comment') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('log-comment', 50, $this->sourceName == 'interwiki' ? $this->logcomment : '', array('id' => 'mw-interwiki-comment', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-interwiki-rootpage')->text(), 'mw-interwiki-rootpage-interwiki') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('rootpage', 50, $this->rootpage, array('id' => 'mw-interwiki-rootpage-interwiki', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-submit'>" . Xml::submitButton($this->msg('import-interwiki-submit')->text(), Linker::tooltipAndAccesskeyAttribs('import')) . "</td>\n\t\t\t\t</tr>" . Xml::closeElement('table') . Xml::closeElement('form') . Xml::closeElement('fieldset'));
     }
 }
Example #14
0
 /**
  * Get the submit and (potentially) reset buttons.
  * @return String HTML.
  */
 function getButtons()
 {
     $buttons = '';
     if ($this->mShowSubmit) {
         $attribs = array();
         if (isset($this->mSubmitID)) {
             $attribs['id'] = $this->mSubmitID;
         }
         if (isset($this->mSubmitName)) {
             $attribs['name'] = $this->mSubmitName;
         }
         if (isset($this->mSubmitTooltip)) {
             $attribs += Linker::tooltipAndAccesskeyAttribs($this->mSubmitTooltip);
         }
         $attribs['class'] = array('mw-htmlform-submit');
         if ($this->isVForm()) {
             // mw-ui-block is necessary because the buttons aren't necessarily in an
             // immediate child div of the vform.
             // @todo Let client specify if the primary submit button is progressive or destructive
             array_push($attribs['class'], 'mw-ui-button', 'mw-ui-big', 'mw-ui-constructive', 'mw-ui-block');
         }
         $buttons .= Xml::submitButton($this->getSubmitText(), $attribs) . "\n";
     }
     if ($this->mShowReset) {
         $buttons .= Html::element('input', array('type' => 'reset', 'value' => $this->msg('htmlform-reset')->text())) . "\n";
     }
     foreach ($this->mButtons as $button) {
         $attrs = array('type' => 'submit', 'name' => $button['name'], 'value' => $button['value']);
         if ($button['attribs']) {
             $attrs += $button['attribs'];
         }
         if (isset($button['id'])) {
             $attrs['id'] = $button['id'];
         }
         $buttons .= Html::element('input', $attrs) . "\n";
     }
     $html = Html::rawElement('span', array('class' => 'mw-htmlform-submit-buttons'), "\n{$buttons}") . "\n";
     // Buttons are top-level form elements in table and div layouts,
     // but vform wants all elements inside divs to get spaced-out block
     // styling.
     if ($this->mShowSubmit && $this->isVForm()) {
         $html = Html::rawElement('div', null, "\n{$html}") . "\n";
     }
     return $html;
 }
    /**
     * Outputs the entire contents of the (X)HTML page
     */
    public function execute()
    {
        // Build additional attributes for navigation urls
        $nav = $this->data['content_navigation'];
        if ($this->config->get('VectorUseIconWatch')) {
            $mode = $this->getSkin()->getUser()->isWatched($this->getSkin()->getRelevantTitle()) ? 'unwatch' : 'watch';
            if (isset($nav['actions'][$mode])) {
                $nav['views'][$mode] = $nav['actions'][$mode];
                $nav['views'][$mode]['class'] = rtrim('icon ' . $nav['views'][$mode]['class'], ' ');
                $nav['views'][$mode]['primary'] = true;
                unset($nav['actions'][$mode]);
            }
        }
        $xmlID = '';
        foreach ($nav as $section => $links) {
            foreach ($links as $key => $link) {
                if ($section == 'views' && !(isset($link['primary']) && $link['primary'])) {
                    $link['class'] = rtrim('collapsible ' . $link['class'], ' ');
                }
                $xmlID = isset($link['id']) ? $link['id'] : 'ca-' . $xmlID;
                $nav[$section][$key]['attributes'] = ' id="' . Sanitizer::escapeId($xmlID) . '"';
                if ($link['class']) {
                    $nav[$section][$key]['attributes'] .= ' class="' . htmlspecialchars($link['class']) . '"';
                    unset($nav[$section][$key]['class']);
                }
                if (isset($link['tooltiponly']) && $link['tooltiponly']) {
                    $nav[$section][$key]['key'] = Linker::tooltip($xmlID);
                } else {
                    $nav[$section][$key]['key'] = Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs($xmlID));
                }
            }
        }
        $this->data['namespace_urls'] = $nav['namespaces'];
        $this->data['view_urls'] = $nav['views'];
        $this->data['action_urls'] = $nav['actions'];
        $this->data['variant_urls'] = $nav['variants'];
        // Reverse horizontally rendered navigation elements
        if ($this->data['rtl']) {
            $this->data['view_urls'] = array_reverse($this->data['view_urls']);
            $this->data['namespace_urls'] = array_reverse($this->data['namespace_urls']);
            $this->data['personal_urls'] = array_reverse($this->data['personal_urls']);
        }
        // Output HTML Page
        $this->html('headelement');
        ?>
		<div id="mw-page-base" class="noprint"></div>
		<div id="mw-head-base" class="noprint"></div>
		<div id="content" class="mw-body" role="main">
			<a id="top"></a>

			<?php 
        if ($this->data['sitenotice']) {
            ?>
				<div id="siteNotice"><?php 
            $this->html('sitenotice');
            ?>
</div>
			<?php 
        }
        ?>
			<h1 id="firstHeading" class="firstHeading" lang="<?php 
        $this->data['pageLanguage'] = $this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
        $this->text('pageLanguage');
        ?>
"><span dir="auto"><?php 
        $this->html('title');
        ?>
</span></h1>
			<?php 
        $this->html('prebodyhtml');
        ?>
			<div id="bodyContent" class="mw-body-content">
				<?php 
        if ($this->data['isarticle']) {
            ?>
					<div id="siteSub"><?php 
            $this->msg('tagline');
            ?>
</div>
				<?php 
        }
        ?>
				<div id="contentSub"<?php 
        $this->html('userlangattributes');
        ?>
><?php 
        $this->html('subtitle');
        ?>
</div>
				<?php 
        if ($this->data['undelete']) {
            ?>
					<div id="contentSub2"><?php 
            $this->html('undelete');
            ?>
</div>
				<?php 
        }
        ?>
				<?php 
        if ($this->data['newtalk']) {
            ?>
					<div class="usermessage"><?php 
            $this->html('newtalk');
            ?>
</div>
				<?php 
        }
        ?>
				<div id="jump-to-nav" class="mw-jump">
					<?php 
        $this->msg('jumpto');
        ?>
					<a href="#mw-navigation"><?php 
        $this->msg('jumptonavigation');
        ?>
</a><?php 
        $this->msg('comma-separator');
        ?>
					<a href="#p-search"><?php 
        $this->msg('jumptosearch');
        ?>
</a>
				</div>
				<?php 
        $this->html('bodycontent');
        ?>
				<?php 
        if ($this->data['printfooter']) {
            ?>
					<div class="printfooter">
						<?php 
            $this->html('printfooter');
            ?>
					</div>
				<?php 
        }
        ?>
				<?php 
        if ($this->data['catlinks']) {
            ?>
					<?php 
            $this->html('catlinks');
            ?>
				<?php 
        }
        ?>
				<?php 
        if ($this->data['dataAfterContent']) {
            ?>
					<?php 
            $this->html('dataAfterContent');
            ?>
				<?php 
        }
        ?>
				<div class="visualClear"></div>
				<?php 
        $this->html('debughtml');
        ?>
			</div>
		</div>
		<div id="mw-navigation">
			<h2><?php 
        $this->msg('navigation-heading');
        ?>
</h2>

			<div id="mw-head">
				<?php 
        $this->renderNavigation('PERSONAL');
        ?>
				<div id="left-navigation">
					<?php 
        $this->renderNavigation(array('NAMESPACES', 'VARIANTS'));
        ?>
				</div>
				<div id="right-navigation">
					<?php 
        $this->renderNavigation(array('VIEWS', 'ACTIONS', 'SEARCH'));
        ?>
				</div>
			</div>
			<div id="mw-panel">
				<div id="p-logo" role="banner"><a style="background-image: url(<?php 
        $this->text('logopath');
        ?>
);" href="<?php 
        echo htmlspecialchars($this->data['nav_urls']['mainpage']['href']);
        ?>
" <?php 
        echo Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs('p-logo'));
        ?>
></a></div>
				<?php 
        $this->renderPortals($this->data['sidebar']);
        ?>
			</div>
		</div>
		<div id="footer" role="contentinfo"<?php 
        $this->html('userlangattributes');
        ?>
>
			<?php 
        foreach ($this->getFooterLinks() as $category => $links) {
            ?>
				<ul id="footer-<?php 
            echo $category;
            ?>
">
					<?php 
            foreach ($links as $link) {
                ?>
						<li id="footer-<?php 
                echo $category;
                ?>
-<?php 
                echo $link;
                ?>
"><?php 
                $this->html($link);
                ?>
</li>
					<?php 
            }
            ?>
				</ul>
			<?php 
        }
        ?>
			<?php 
        $footericons = $this->getFooterIcons("icononly");
        if (count($footericons) > 0) {
            ?>
				<ul id="footer-icons" class="noprint">
					<?php 
            foreach ($footericons as $blockName => $footerIcons) {
                ?>
						<li id="footer-<?php 
                echo htmlspecialchars($blockName);
                ?>
ico">
							<?php 
                foreach ($footerIcons as $icon) {
                    ?>
								<?php 
                    echo $this->getSkin()->makeFooterIcon($icon);
                    ?>

							<?php 
                }
                ?>
						</li>
					<?php 
            }
            ?>
				</ul>
			<?php 
        }
        ?>
			<div style="clear:both"></div>
		</div>
		<?php 
        $this->printTrail();
        ?>

	</body>
</html>
	<?php 
    }
    /**
     * Render logo
     */
    private function renderLogo()
    {
        $mainPageLink = $this->data['nav_urls']['mainpage']['href'];
        $toolTip = Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs('p-logo'));
        ?>
        <div id="p-logo" class="text-center">
            <a href="<?php 
        echo htmlspecialchars($this->data['nav_urls']['mainpage']['href']);
        ?>
" <?php 
        echo Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs('p-logo'));
        ?>
><img class="logo_image" src="<?php 
        $this->text('logopath');
        ?>
" alt="<?php 
        $this->html('sitename');
        ?>
" /></a>
        </div>
        <?php 
    }
Example #17
0
 /**
  * Returns an array of html code of the following buttons:
  * save, diff, preview and live
  *
  * @param int $tabindex Current tabindex
  *
  * @return array
  */
 public function getEditButtons(&$tabindex)
 {
     global $wgUseMediaWikiUIEverywhere;
     $buttons = array();
     $attribs = array('id' => 'wpSave', 'name' => 'wpSave', 'type' => 'submit', 'tabindex' => ++$tabindex, 'value' => wfMessage('savearticle')->text()) + Linker::tooltipAndAccesskeyAttribs('save');
     if ($wgUseMediaWikiUIEverywhere) {
         $attribs['class'] = 'mw-ui-button mw-ui-constructive';
     }
     $buttons['save'] = Xml::element('input', $attribs, '');
     ++$tabindex;
     // use the same for preview and live preview
     $attribs = array('id' => 'wpPreview', 'name' => 'wpPreview', 'type' => 'submit', 'tabindex' => $tabindex, 'value' => wfMessage('showpreview')->text()) + Linker::tooltipAndAccesskeyAttribs('preview');
     if ($wgUseMediaWikiUIEverywhere) {
         $attribs['class'] = 'mw-ui-button mw-ui-progressive';
     }
     $buttons['preview'] = Xml::element('input', $attribs, '');
     $buttons['live'] = '';
     $attribs = array('id' => 'wpDiff', 'name' => 'wpDiff', 'type' => 'submit', 'tabindex' => ++$tabindex, 'value' => wfMessage('showdiff')->text()) + Linker::tooltipAndAccesskeyAttribs('diff');
     if ($wgUseMediaWikiUIEverywhere) {
         $attribs['class'] = 'mw-ui-button mw-ui-progressive';
     }
     $buttons['diff'] = Xml::element('input', $attribs, '');
     wfRunHooks('EditPageBeforeEditButtons', array(&$this, &$buttons, &$tabindex));
     return $buttons;
 }
Example #18
0
 /**
  * Returns an array of html code of the following buttons:
  * save, diff, preview and live
  *
  * @param int $tabindex Current tabindex
  *
  * @return array
  */
 public function getEditButtons(&$tabindex)
 {
     $buttons = array();
     $attribs = array('id' => 'wpSave', 'name' => 'wpSave', 'tabindex' => ++$tabindex) + Linker::tooltipAndAccesskeyAttribs('save');
     $buttons['save'] = Html::submitButton(wfMessage('savearticle')->text(), $attribs, array('mw-ui-constructive'));
     ++$tabindex;
     // use the same for preview and live preview
     $attribs = array('id' => 'wpPreview', 'name' => 'wpPreview', 'tabindex' => $tabindex) + Linker::tooltipAndAccesskeyAttribs('preview');
     $buttons['preview'] = Html::submitButton(wfMessage('showpreview')->text(), $attribs);
     $buttons['live'] = '';
     $attribs = array('id' => 'wpDiff', 'name' => 'wpDiff', 'tabindex' => ++$tabindex) + Linker::tooltipAndAccesskeyAttribs('diff');
     $buttons['diff'] = Html::submitButton(wfMessage('showdiff')->text(), $attribs);
     Hooks::run('EditPageBeforeEditButtons', array(&$this, &$buttons, &$tabindex));
     return $buttons;
 }
Example #19
0
    /**
     * Template filter callback for MonoBook skin.
     * Takes an associative array of data set from a SkinTemplate-based
     * class, and a wrapper for MediaWiki's localization database, and
     * outputs a formatted page.
     *
     * @access private
     */
    function execute()
    {
        // Suppress warnings to prevent notices about missing indexes in $this->data
        wfSuppressWarnings();
        $this->html('headelement');
        ?>
<div id="globalWrapper">
<div id="column-content"><div id="content" class="mw-body-primary" role="main">
	<a id="top"></a>
	<?php 
        if ($this->data['sitenotice']) {
            ?>
<div id="siteNotice"><?php 
            $this->html('sitenotice');
            ?>
</div><?php 
        }
        ?>

	<h1 id="firstHeading" class="firstHeading" lang="<?php 
        $this->data['pageLanguage'] = $this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
        $this->text('pageLanguage');
        ?>
"><span dir="auto"><?php 
        $this->html('title');
        ?>
</span></h1>
	<div id="bodyContent" class="mw-body">
		<div id="siteSub"><?php 
        $this->msg('tagline');
        ?>
</div>
		<div id="contentSub"<?php 
        $this->html('userlangattributes');
        ?>
><?php 
        $this->html('subtitle');
        ?>
</div>
<?php 
        if ($this->data['undelete']) {
            ?>
		<div id="contentSub2"><?php 
            $this->html('undelete');
            ?>
</div>
<?php 
        }
        if ($this->data['newtalk']) {
            ?>
		<div class="usermessage"><?php 
            $this->html('newtalk');
            ?>
</div>
<?php 
        }
        ?>
		<div id="jump-to-nav" class="mw-jump"><?php 
        $this->msg('jumpto');
        ?>
 <a href="#column-one"><?php 
        $this->msg('jumptonavigation');
        ?>
</a><?php 
        $this->msg('comma-separator');
        ?>
<a href="#searchInput"><?php 
        $this->msg('jumptosearch');
        ?>
</a></div>

		<!-- start content -->
<?php 
        $this->html('bodytext');
        ?>
		<?php 
        if ($this->data['catlinks']) {
            $this->html('catlinks');
        }
        ?>
		<!-- end content -->
		<?php 
        if ($this->data['dataAfterContent']) {
            $this->html('dataAfterContent');
        }
        ?>
		<div class="visualClear"></div>
	</div>
</div></div>
<div id="column-one"<?php 
        $this->html('userlangattributes');
        ?>
>
	<h2><?php 
        $this->msg('navigation-heading');
        ?>
</h2>
<?php 
        $this->cactions();
        ?>
	<div class="portlet" id="p-personal" role="navigation">
		<h3><?php 
        $this->msg('personaltools');
        ?>
</h3>
		<div class="pBody">
			<ul<?php 
        $this->html('userlangattributes');
        ?>
>
<?php 
        foreach ($this->getPersonalTools() as $key => $item) {
            ?>
				<?php 
            echo $this->makeListItem($key, $item);
            ?>

<?php 
        }
        ?>
			</ul>
		</div>
	</div>
	<div class="portlet" id="p-logo" role="banner">
<?php 
        echo Html::element('a', array('href' => $this->data['nav_urls']['mainpage']['href'], 'style' => "background-image: url({$this->data['logopath']});") + Linker::tooltipAndAccesskeyAttribs('p-logo'));
        ?>

	</div>
<?php 
        $this->renderPortals($this->data['sidebar']);
        ?>
</div><!-- end of the left (by default at least) column -->
<div class="visualClear"></div>
<?php 
        $validFooterIcons = $this->getFooterIcons("icononly");
        $validFooterLinks = $this->getFooterLinks("flat");
        // Additional footer links
        if (count($validFooterIcons) + count($validFooterLinks) > 0) {
            ?>
<div id="footer" role="contentinfo"<?php 
            $this->html('userlangattributes');
            ?>
>
<?php 
            $footerEnd = '</div>';
        } else {
            $footerEnd = '';
        }
        foreach ($validFooterIcons as $blockName => $footerIcons) {
            ?>
	<div id="f-<?php 
            echo htmlspecialchars($blockName);
            ?>
ico">
<?php 
            foreach ($footerIcons as $icon) {
                ?>
		<?php 
                echo $this->getSkin()->makeFooterIcon($icon);
                ?>

<?php 
            }
            ?>
	</div>
<?php 
        }
        if (count($validFooterLinks) > 0) {
            ?>
	<ul id="f-list">
<?php 
            foreach ($validFooterLinks as $aLink) {
                ?>
		<li id="<?php 
                echo $aLink;
                ?>
"><?php 
                $this->html($aLink);
                ?>
</li>
<?php 
            }
            ?>
	</ul>
<?php 
        }
        echo $footerEnd;
        ?>

</div>
<?php 
        $this->printTrail();
        echo Html::closeElement('body');
        echo Html::closeElement('html');
        wfRestoreWarnings();
    }
Example #20
0
    /**
     * Outputs the entire contents of the (X)HTML page
     */
    public function execute()
    {
        global $wgSitename, $wgApexLogo, $wgStylePath;
        // Build additional attributes for navigation urls
        $nav = $this->data['content_navigation'];
        $mode = $this->getSkin()->getUser()->isWatched($this->getSkin()->getRelevantTitle()) ? 'unwatch' : 'watch';
        if (isset($nav['actions'][$mode])) {
            $nav['views'][$mode] = $nav['actions'][$mode];
            $nav['views'][$mode]['primary'] = true;
            unset($nav['actions'][$mode]);
        }
        // TODO: Move defining the logo path to a resource loader module with media queries to add
        // support for high DPI displays - this will also improve caching situation
        $this->data['logopath-1x'] = $wgApexLogo['1x'] ? $wgApexLogo['1x'] : "{$wgStylePath}/apex/images/logos/mediawiki-1x.png";
        $this->data['logopath-2x'] = $wgApexLogo['2x'] ? $wgApexLogo['2x'] : "{$wgStylePath}/apex/images/logos/mediawiki-2x.png";
        $xmlID = '';
        foreach ($nav as $section => $links) {
            foreach ($links as $key => $link) {
                if ($section == 'views' && !(isset($link['primary']) && $link['primary'])) {
                    $link['class'] = rtrim('apex-nav-stashable ' . $link['class'], ' ');
                }
                $xmlID = isset($link['id']) ? $link['id'] : 'ca-' . $xmlID;
                $nav[$section][$key]['attributes'] = ' id="' . Sanitizer::escapeId($xmlID) . '"';
                if ($link['class']) {
                    $nav[$section][$key]['attributes'] .= ' class="' . htmlspecialchars($link['class']) . '"';
                    unset($nav[$section][$key]['class']);
                }
                if (isset($link['tooltiponly']) && $link['tooltiponly']) {
                    $nav[$section][$key]['key'] = Linker::tooltip($xmlID);
                } else {
                    $nav[$section][$key]['key'] = Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs($xmlID));
                }
            }
        }
        $this->data['namespace_urls'] = $nav['namespaces'];
        $this->data['view_urls'] = $nav['views'];
        $this->data['action_urls'] = $nav['actions'];
        $this->data['variant_urls'] = $nav['variants'];
        // Reverse horizontally rendered navigation elements
        if ($this->data['rtl']) {
            $this->data['view_urls'] = array_reverse($this->data['view_urls']);
            $this->data['namespace_urls'] = array_reverse($this->data['namespace_urls']);
            $this->data['personal_urls'] = array_reverse($this->data['personal_urls']);
        }
        // Output HTML Page
        $this->html('headelement');
        ?>
		<div class="apex-content-wrapper">
			<div id="content" class="mw-body">
				<a id="top"></a>
				<div id="mw-js-message" style="display:none;"<?php 
        $this->html('userlangattributes');
        ?>
></div>
				<?php 
        if ($this->data['sitenotice']) {
            ?>
				<div id="siteNotice"><?php 
            $this->html('sitenotice');
            ?>
</div>
				<?php 
        }
        ?>
				<h1 id="firstHeading" class="firstHeading"><?php 
        $this->html('title');
        ?>
</h1>
				<div id="bodyContent">
					<?php 
        if ($this->data['isarticle']) {
            ?>
					<div id="siteSub"><?php 
            $this->msg('tagline');
            ?>
</div>
					<?php 
        }
        ?>
					<div id="contentSub"<?php 
        $this->html('userlangattributes');
        ?>
><?php 
        $this->html('subtitle');
        ?>
</div>
					<?php 
        if ($this->data['undelete']) {
            ?>
					<div id="contentSub2"><?php 
            $this->html('undelete');
            ?>
</div>
					<?php 
        }
        ?>
					<?php 
        if ($this->data['newtalk']) {
            ?>
					<div class="usermessage"><?php 
            $this->html('newtalk');
            ?>
</div>
					<?php 
        }
        ?>
					<?php 
        if ($this->data['showjumplinks']) {
            ?>
					<div id="jump-to-nav" class="mw-jump">
						<?php 
            $this->msg('jumpto');
            ?>
						<a href="#mw-head"><?php 
            $this->msg('jumptonavigation');
            ?>
</a><?php 
            $this->msg('comma-separator');
            ?>
						<a href="#p-search"><?php 
            $this->msg('jumptosearch');
            ?>
</a>
					</div>
					<?php 
        }
        ?>
					<?php 
        $this->html('bodycontent');
        ?>
					<?php 
        if ($this->data['printfooter']) {
            ?>
					<div class="printfooter">
					<?php 
            $this->html('printfooter');
            ?>
					</div>
					<?php 
        }
        ?>
					<?php 
        if ($this->data['catlinks']) {
            ?>
					<?php 
            $this->html('catlinks');
            ?>
					<?php 
        }
        ?>
					<?php 
        if ($this->data['dataAfterContent']) {
            ?>
					<?php 
            $this->html('dataAfterContent');
            ?>
					<?php 
        }
        ?>
					<div class="visualClear"></div>
					<?php 
        $this->html('debughtml');
        ?>
				</div>
			</div>
		</div>
		<div id="mw-head" class="noprint">
			<div id="p-logo"><a style="background-image: url(<?php 
        $this->text('logopath-1x');
        ?>
);" href="<?php 
        echo htmlspecialchars($this->data['nav_urls']['mainpage']['href']);
        ?>
" <?php 
        echo Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs('p-logo'));
        ?>
><span><?php 
        echo $wgSitename;
        ?>
</span></a></div>
			<?php 
        $this->renderNavigation(array('SEARCH', 'PERSONAL'));
        ?>
			<div class="apex-nav">
				<div class="apex-nav-primary">
					<?php 
        $this->renderNavigation(array('NAMESPACES', 'VARIANTS'));
        ?>
				</div>
				<div class="apex-nav-secondary">
					<?php 
        $this->renderNavigation(array('VIEWS', 'ACTIONS'));
        ?>
				</div>
			</div>
		</div>
		<div id="mw-panel" class="noprint">
			<div class="apex-flyout-pull"></div>
			<?php 
        $this->renderPortals($this->data['sidebar']);
        ?>
		</div>
		<div id="footer"<?php 
        $this->html('userlangattributes');
        ?>
>
			<?php 
        foreach ($this->getFooterLinks() as $category => $links) {
            ?>
				<ul id="footer-<?php 
            echo $category;
            ?>
">
					<?php 
            foreach ($links as $link) {
                ?>
						<li id="footer-<?php 
                echo $category;
                ?>
-<?php 
                echo $link;
                ?>
">
							<?php 
                $this->html($link);
                ?>
						</li>
					<?php 
            }
            ?>
				</ul>
			<?php 
        }
        ?>
			<?php 
        $footericons = $this->getFooterIcons("icononly");
        if (count($footericons) > 0) {
            ?>
				<ul id="footer-icons" class="noprint">
					<?php 
            foreach ($footericons as $blockName => $footerIcons) {
                ?>
					<li id="footer-<?php 
                echo htmlspecialchars($blockName);
                ?>
ico">
						<?php 
                foreach ($footerIcons as $icon) {
                    ?>
						<?php 
                    echo $this->getSkin()->makeFooterIcon($icon);
                    ?>
						<?php 
                }
                ?>
					</li>
					<?php 
            }
            ?>
				</ul>
			<?php 
        }
        ?>
			<div style="clear:both"></div>
		</div>
		<?php 
        $this->printTrail();
        ?>
	</body>
</html>
<?php 
    }
Example #21
0
 function tooltipAndAccesskey($value)
 {
     return Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs($value));
 }
Example #22
0
 public function execute($par)
 {
     global $wgSitename, $wgExportAllowListContributors, $wgExportFromNamespaces;
     global $wgExportAllowHistory, $wgExportMaxHistory, $wgExportMaxLinkDepth;
     global $wgExportAllowAll;
     $this->setHeaders();
     $this->outputHeader();
     // Set some variables
     $this->curonly = true;
     $this->doExport = false;
     $request = $this->getRequest();
     $this->templates = $request->getCheck('templates');
     $this->images = $request->getCheck('images');
     // Doesn't do anything yet
     $this->pageLinkDepth = $this->validateLinkDepth($request->getIntOrNull('pagelink-depth'));
     $nsindex = '';
     $exportall = false;
     if ($request->getCheck('addcat')) {
         $page = $request->getText('pages');
         $catname = $request->getText('catname');
         if ($catname !== '' && $catname !== null && $catname !== false) {
             $t = Title::makeTitleSafe(NS_MAIN, $catname);
             if ($t) {
                 /**
                  * @todo FIXME: This can lead to hitting memory limit for very large
                  * categories. Ideally we would do the lookup synchronously
                  * during the export in a single query.
                  */
                 $catpages = $this->getPagesFromCategory($t);
                 if ($catpages) {
                     $page .= "\n" . implode("\n", $catpages);
                 }
             }
         }
     } elseif ($request->getCheck('addns') && $wgExportFromNamespaces) {
         $page = $request->getText('pages');
         $nsindex = $request->getText('nsindex', '');
         if (strval($nsindex) !== '') {
             /**
              * Same implementation as above, so same @todo
              */
             $nspages = $this->getPagesFromNamespace($nsindex);
             if ($nspages) {
                 $page .= "\n" . implode("\n", $nspages);
             }
         }
     } elseif ($request->getCheck('exportall') && $wgExportAllowAll) {
         $this->doExport = true;
         $exportall = true;
     } elseif ($request->wasPosted() && $par == '') {
         $page = $request->getText('pages');
         $this->curonly = $request->getCheck('curonly');
         $rawOffset = $request->getVal('offset');
         if ($rawOffset) {
             $offset = wfTimestamp(TS_MW, $rawOffset);
         } else {
             $offset = null;
         }
         $limit = $request->getInt('limit');
         $dir = $request->getVal('dir');
         $history = array('dir' => 'asc', 'offset' => false, 'limit' => $wgExportMaxHistory);
         $historyCheck = $request->getCheck('history');
         if ($this->curonly) {
             $history = WikiExporter::CURRENT;
         } elseif (!$historyCheck) {
             if ($limit > 0 && ($wgExportMaxHistory == 0 || $limit < $wgExportMaxHistory)) {
                 $history['limit'] = $limit;
             }
             if (!is_null($offset)) {
                 $history['offset'] = $offset;
             }
             if (strtolower($dir) == 'desc') {
                 $history['dir'] = 'desc';
             }
         }
         if ($page != '') {
             $this->doExport = true;
         }
     } else {
         // Default to current-only for GET requests.
         $page = $request->getText('pages', $par);
         $historyCheck = $request->getCheck('history');
         if ($historyCheck) {
             $history = WikiExporter::FULL;
         } else {
             $history = WikiExporter::CURRENT;
         }
         if ($page != '') {
             $this->doExport = true;
         }
     }
     if (!$wgExportAllowHistory) {
         // Override
         $history = WikiExporter::CURRENT;
     }
     $list_authors = $request->getCheck('listauthors');
     if (!$this->curonly || !$wgExportAllowListContributors) {
         $list_authors = false;
     }
     if ($this->doExport) {
         $this->getOutput()->disable();
         // Cancel output buffering and gzipping if set
         // This should provide safer streaming for pages with history
         wfResetOutputBuffers();
         $request->response()->header("Content-type: application/xml; charset=utf-8");
         if ($request->getCheck('wpDownload')) {
             // Provide a sane filename suggestion
             $filename = urlencode($wgSitename . '-' . wfTimestampNow() . '.xml');
             $request->response()->header("Content-disposition: attachment;filename={$filename}");
         }
         $this->doExport($page, $history, $list_authors, $exportall);
         return;
     }
     $out = $this->getOutput();
     $out->addWikiMsg('exporttext');
     $form = Xml::openElement('form', array('method' => 'post', 'action' => $this->getTitle()->getLocalUrl('action=submit')));
     $form .= Xml::inputLabel(wfMsg('export-addcattext'), 'catname', 'catname', 40) . '&#160;';
     $form .= Xml::submitButton(wfMsg('export-addcat'), array('name' => 'addcat')) . '<br />';
     if ($wgExportFromNamespaces) {
         $form .= Xml::namespaceSelector($nsindex, null, 'nsindex', wfMsg('export-addnstext')) . '&#160;';
         $form .= Xml::submitButton(wfMsg('export-addns'), array('name' => 'addns')) . '<br />';
     }
     if ($wgExportAllowAll) {
         $form .= Xml::checkLabel(wfMsg('exportall'), 'exportall', 'exportall', $request->wasPosted() ? $request->getCheck('exportall') : false) . '<br />';
     }
     $form .= Xml::element('textarea', array('name' => 'pages', 'cols' => 40, 'rows' => 10), $page, false);
     $form .= '<br />';
     if ($wgExportAllowHistory) {
         $form .= Xml::checkLabel(wfMsg('exportcuronly'), 'curonly', 'curonly', $request->wasPosted() ? $request->getCheck('curonly') : true) . '<br />';
     } else {
         $out->addHTML(wfMsgExt('exportnohistory', 'parse'));
     }
     $form .= Xml::checkLabel(wfMsg('export-templates'), 'templates', 'wpExportTemplates', $request->wasPosted() ? $request->getCheck('templates') : false) . '<br />';
     if ($wgExportMaxLinkDepth || $this->userCanOverrideExportDepth()) {
         $form .= Xml::inputLabel(wfMsg('export-pagelinks'), 'pagelink-depth', 'pagelink-depth', 20, 0) . '<br />';
     }
     // Enable this when we can do something useful exporting/importing image information. :)
     //$form .= Xml::checkLabel( wfMsg( 'export-images' ), 'images', 'wpExportImages', false ) . '<br />';
     $form .= Xml::checkLabel(wfMsg('export-download'), 'wpDownload', 'wpDownload', $request->wasPosted() ? $request->getCheck('wpDownload') : true) . '<br />';
     if ($wgExportAllowListContributors) {
         $form .= Xml::checkLabel(wfMsg('exportlistauthors'), 'listauthors', 'listauthors', $request->wasPosted() ? $request->getCheck('listauthors') : false) . '<br />';
     }
     $form .= Xml::submitButton(wfMsg('export-submit'), Linker::tooltipAndAccesskeyAttribs('export'));
     $form .= Xml::closeElement('form');
     $out->addHTML($form);
 }
 private function showForm()
 {
     global $wgImportSources, $wgExportMaxLinkDepth;
     $action = $this->getTitle()->getLocalUrl(array('action' => 'submit'));
     $user = $this->getUser();
     $out = $this->getOutput();
     if ($user->isAllowed('importupload')) {
         $out->addHTML(Xml::fieldset($this->msg('import-upload')->text()) . Xml::openElement('form', array('enctype' => 'multipart/form-data', 'method' => 'post', 'action' => $action, 'id' => 'mw-import-upload-form')) . $this->msg('importtext')->parseAsBlock() . Html::hidden('action', 'submit') . Html::hidden('source', 'upload') . Xml::openElement('table', array('id' => 'mw-import-table')) . "<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-upload-filename')->text(), 'xmlimport') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('xmlimport', 50, '', array('type' => 'file')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-comment')->text(), 'mw-import-comment') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('log-comment', 50, '', array('id' => 'mw-import-comment', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-interwiki-rootpage')->text(), 'mw-interwiki-rootpage') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('rootpage', 50, $this->rootpage, array('id' => 'mw-interwiki-rootpage', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td class='mw-submit'>" . Xml::submitButton($this->msg('uploadbtn')->text()) . "</td>\n\t\t\t\t</tr>" . Xml::closeElement('table') . Html::hidden('editToken', $user->getEditToken()) . Xml::closeElement('form') . Xml::closeElement('fieldset'));
     } else {
         if (empty($wgImportSources)) {
             $out->addWikiMsg('importnosources');
         }
     }
     if ($user->isAllowed('import') && !empty($wgImportSources)) {
         # Show input field for import depth only if $wgExportMaxLinkDepth > 0
         $importDepth = '';
         if ($wgExportMaxLinkDepth > 0) {
             $importDepth = "<tr>\n\t\t\t\t\t\t\t<td class='mw-label'>" . $this->msg('export-pagelinks')->parse() . "</td>\n\t\t\t\t\t\t\t<td class='mw-input'>" . Xml::input('pagelink-depth', 3, 0) . "</td>\n\t\t\t\t\t\t</tr>";
         }
         $out->addHTML(Xml::fieldset($this->msg('importinterwiki')->text()) . Xml::openElement('form', array('method' => 'post', 'action' => $action, 'id' => 'mw-import-interwiki-form')) . $this->msg('import-interwiki-text')->parseAsBlock() . Html::hidden('action', 'submit') . Html::hidden('source', 'interwiki') . Html::hidden('editToken', $user->getEditToken()) . Xml::openElement('table', array('id' => 'mw-import-table')) . "<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-interwiki-source')->text(), 'interwiki') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::openElement('select', array('name' => 'interwiki')));
         foreach ($wgImportSources as $prefix) {
             $selected = $this->interwiki === $prefix ? ' selected="selected"' : '';
             $out->addHTML(Xml::option($prefix, $prefix, $selected));
         }
         $out->addHTML(Xml::closeElement('select') . Xml::input('frompage', 50, $this->frompage) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel($this->msg('import-interwiki-history')->text(), 'interwikiHistory', 'interwikiHistory', $this->history) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel($this->msg('import-interwiki-templates')->text(), 'interwikiTemplates', 'interwikiTemplates', $this->includeTemplates) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t{$importDepth}\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-interwiki-namespace')->text(), 'namespace') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Html::namespaceSelector(array('selected' => $this->namespace, 'all' => ''), array('name' => 'namespace', 'id' => 'namespace', 'class' => 'namespaceselector')) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-comment')->text(), 'mw-interwiki-comment') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('log-comment', 50, '', array('id' => 'mw-interwiki-comment', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-interwiki-rootpage')->text(), 'mw-interwiki-rootpage') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('rootpage', 50, $this->rootpage, array('id' => 'mw-interwiki-rootpage', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-submit'>" . Xml::submitButton($this->msg('import-interwiki-submit')->text(), Linker::tooltipAndAccesskeyAttribs('import')) . "</td>\n\t\t\t\t</tr>" . Xml::closeElement('table') . Xml::closeElement('form') . Xml::closeElement('fieldset'));
     }
 }
 /**
  * Show the form to edit group memberships.
  *
  * @param User|UserRightsProxy $user User or UserRightsProxy you're editing
  * @param array $groups Array of groups the user is in
  */
 protected function showEditUserGroupsForm($user, $groups)
 {
     $list = array();
     $membersList = array();
     foreach ($groups as $group) {
         $list[] = self::buildGroupLink($group);
         $membersList[] = self::buildGroupMemberLink($group);
     }
     $autoList = array();
     $autoMembersList = array();
     if ($user instanceof User) {
         foreach (Autopromote::getAutopromoteGroups($user) as $group) {
             $autoList[] = self::buildGroupLink($group);
             $autoMembersList[] = self::buildGroupMemberLink($group);
         }
     }
     $language = $this->getLanguage();
     $displayedList = $this->msg('userrights-groupsmember-type')->rawParams($language->listToText($list), $language->listToText($membersList))->escaped();
     $displayedAutolist = $this->msg('userrights-groupsmember-type')->rawParams($language->listToText($autoList), $language->listToText($autoMembersList))->escaped();
     $grouplist = '';
     $count = count($list);
     if ($count > 0) {
         $grouplist = $this->msg('userrights-groupsmember')->numParams($count)->params($user->getName())->parse();
         $grouplist = '<p>' . $grouplist . ' ' . $displayedList . "</p>\n";
     }
     $count = count($autoList);
     if ($count > 0) {
         $autogrouplistintro = $this->msg('userrights-groupsmember-auto')->numParams($count)->params($user->getName())->parse();
         $grouplist .= '<p>' . $autogrouplistintro . ' ' . $displayedAutolist . "</p>\n";
     }
     $userToolLinks = Linker::userToolLinks($user->getId(), $user->getName(), false, Linker::TOOL_LINKS_EMAIL);
     $this->getOutput()->addHTML(Xml::openElement('form', array('method' => 'post', 'action' => $this->getPageTitle()->getLocalURL(), 'name' => 'editGroup', 'id' => 'mw-userrights-form2')) . Html::hidden('user', $this->mTarget) . Html::hidden('wpEditToken', $this->getUser()->getEditToken($this->mTarget)) . Html::hidden('conflictcheck-originalgroups', implode(',', $user->getGroups())) . Xml::openElement('fieldset') . Xml::element('legend', array(), $this->msg('userrights-editusergroup', $user->getName())->text()) . $this->msg('editinguser')->params(wfEscapeWikiText($user->getName()))->rawParams($userToolLinks)->parse() . $this->msg('userrights-groups-help', $user->getName())->parse() . $grouplist . $this->groupCheckboxes($groups, $user) . Xml::openElement('table', array('id' => 'mw-userrights-table-outer')) . "<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('userrights-reason')->text(), 'wpReason') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('user-reason', 60, $this->getRequest()->getVal('user-reason', false), array('id' => 'wpReason', 'maxlength' => 255)) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td class='mw-submit'>" . Xml::submitButton($this->msg('saveusergroups')->text(), array('name' => 'saveusergroups') + Linker::tooltipAndAccesskeyAttribs('userrights-set')) . "</td>\n\t\t\t\t</tr>" . Xml::closeElement('table') . "\n" . Xml::closeElement('fieldset') . Xml::closeElement('form') . "\n");
 }
 /**
  * Creates begin of history list with a submit button
  *
  * @return string HTML output
  */
 function getStartBody()
 {
     $this->lastRow = false;
     $this->counter = 1;
     $this->oldIdChecked = 0;
     $this->getOutput()->wrapWikiMsg("<div class='mw-history-legend'>\n\$1\n</div>", 'histlegend');
     $s = Html::openElement('form', array('action' => wfScript(), 'id' => 'mw-history-compare')) . "\n";
     $s .= Html::hidden('title', $this->getTitle()->getPrefixedDBkey()) . "\n";
     $s .= Html::hidden('action', 'historysubmit') . "\n";
     // Button container stored in $this->buttons for re-use in getEndBody()
     $this->buttons = '<div>';
     $className = 'historysubmit mw-history-compareselectedversions-button';
     if ($this->getConfig()->get('UseMediaWikiUIEverywhere')) {
         $className .= ' mw-ui-button mw-ui-constructive';
     }
     $this->buttons .= $this->submitButton($this->msg('compareselectedversions')->text(), array('class' => $className) + Linker::tooltipAndAccesskeyAttribs('compareselectedversions')) . "\n";
     if ($this->getUser()->isAllowed('deleterevision')) {
         $this->buttons .= $this->getRevisionButton('revisiondelete', 'showhideselectedversions');
     }
     $this->buttons .= '</div>';
     $s .= $this->buttons;
     $s .= '<ul id="pagehistory">' . "\n";
     return $s;
 }
    /**
     * Outputs the entire contents of the (X)HTML page
     */
    public function execute()
    {
        global $wgLang, $wgVectorUseIconWatch;
        $this->skin = $this->data['skin'];
        // Build additional attributes for navigation urls
        //$nav = $this->skin->buildNavigationUrls();
        $nav = $this->data['content_navigation'];
        if ($wgVectorUseIconWatch) {
            $mode = $this->skin->getTitle()->userIsWatching() ? 'unwatch' : 'watch';
            if (isset($nav['actions'][$mode])) {
                $nav['views'][$mode] = $nav['actions'][$mode];
                $nav['views'][$mode]['class'] = rtrim('icon ' . $nav['views'][$mode]['class'], ' ');
                $nav['views'][$mode]['primary'] = true;
                unset($nav['actions'][$mode]);
            }
        }
        $xmlID = '';
        foreach ($nav as $section => $links) {
            foreach ($links as $key => $link) {
                if ($section == 'views' && !(isset($link['primary']) && $link['primary'])) {
                    $link['class'] = rtrim('collapsible ' . $link['class'], ' ');
                }
                $xmlID = isset($link['id']) ? $link['id'] : 'ca-' . $xmlID;
                $nav[$section][$key]['attributes'] = ' id="' . Sanitizer::escapeId($xmlID) . '"';
                if ($link['class']) {
                    $nav[$section][$key]['attributes'] .= ' class="' . htmlspecialchars($link['class']) . '"';
                    unset($nav[$section][$key]['class']);
                }
                if (isset($link['tooltiponly']) && $link['tooltiponly']) {
                    $nav[$section][$key]['key'] = Linker::tooltip($xmlID);
                } else {
                    $nav[$section][$key]['key'] = Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs($xmlID));
                }
            }
        }
        $this->data['namespace_urls'] = $nav['namespaces'];
        $this->data['view_urls'] = $nav['views'];
        $this->data['action_urls'] = $nav['actions'];
        $this->data['variant_urls'] = $nav['variants'];
        // Reverse horizontally rendered navigation elements
        if ($wgLang->isRTL()) {
            $this->data['view_urls'] = array_reverse($this->data['view_urls']);
            $this->data['namespace_urls'] = array_reverse($this->data['namespace_urls']);
        }
        // Output HTML Page
        $this->html('headelement');
        global $Cppreference2SkinRootLink;
        $root_link = '/';
        if (isset($Cppreference2SkinRootLink)) {
            $root_link = htmlspecialchars($Cppreference2SkinRootLink);
        }
        ?>
        <!-- header -->
        <div id="mw-head" class="noprint">
            <div id="cpp-head-first-base">
                <div id="cpp-head-first">
                    <h5><a href="<?php 
        echo $root_link;
        ?>
">
                        <?php 
        global $wgSitename;
        echo $wgSitename;
        ?>
                    </a></h5>
                    <div id="cpp-head-search">
                        <?php 
        $this->renderNavigation('SEARCH');
        ?>
                    </div>
                    <div id="cpp-head-personal">
                        <?php 
        $this->renderNavigation('PERSONAL');
        ?>
                    </div>

                </div>
            </div>
            <div id="cpp-head-second-base">
                <div id="cpp-head-second">
                    <div id="cpp-head-tools-left">
                        <?php 
        $this->renderNavigation(array('NAMESPACES', 'VARIANTS'));
        ?>
                    </div>
                    <div id="cpp-head-tools-right">
                        <?php 
        $this->renderNavigation(array('VIEWS', 'ACTIONS'));
        ?>
                    </div>
                </div>
            </div>
        </div>
        <!-- /header -->
        <!-- content -->
        <div id="cpp-content-base">
            <div id="content">
                <a id="top"></a>
                <div id="mw-js-message" style="display:none;"<?php 
        $this->html('userlangattributes');
        ?>
></div>
                <?php 
        if ($this->data['sitenotice']) {
            ?>
                <!-- sitenotice -->
                <div id="siteNotice"><?php 
            $this->html('sitenotice');
            ?>
</div>
                <!-- /sitenotice -->
                <?php 
        }
        ?>
                <!-- firstHeading -->
                <h1 id="firstHeading" class="firstHeading"><?php 
        $this->html('title');
        ?>
</h1>
                <!-- /firstHeading -->
                <!-- bodyContent -->
                <div id="bodyContent">
                    <?php 
        if ($this->data['isarticle']) {
            ?>
                    <!-- tagline -->
                    <div id="siteSub"><?php 
            $this->msg('tagline');
            ?>
</div>
                    <!-- /tagline -->
                    <?php 
        }
        ?>
                    <!-- subtitle -->
                    <div id="contentSub"<?php 
        $this->html('userlangattributes');
        ?>
><?php 
        $this->html('subtitle');
        ?>
</div>
                    <!-- /subtitle -->
                    <?php 
        if ($this->data['undelete']) {
            ?>
                    <!-- undelete -->
                    <div id="contentSub2"><?php 
            $this->html('undelete');
            ?>
</div>
                    <!-- /undelete -->
                    <?php 
        }
        ?>
                    <?php 
        if ($this->data['newtalk']) {
            ?>
                    <!-- newtalk -->
                    <div class="usermessage"><?php 
            $this->html('newtalk');
            ?>
</div>
                    <!-- /newtalk -->
                    <?php 
        }
        ?>
                    <!-- bodycontent -->
                    <?php 
        $this->html('bodycontent');
        ?>
                    <!-- /bodycontent -->
                    <?php 
        if ($this->data['printfooter']) {
            ?>
                    <!-- printfooter -->
                    <div class="printfooter">
                    <?php 
            $this->html('printfooter');
            ?>
                    </div>
                    <!-- /printfooter -->
                    <?php 
        }
        ?>
                    <?php 
        if ($this->data['catlinks']) {
            ?>
                    <!-- catlinks -->
                    <?php 
            $this->html('catlinks');
            ?>
                    <!-- /catlinks -->
                    <?php 
        }
        ?>
                    <?php 
        if ($this->data['dataAfterContent']) {
            ?>
                    <!-- dataAfterContent -->
                    <?php 
            $this->html('dataAfterContent');
            ?>
                    <!-- /dataAfterContent -->
                    <?php 
        }
        ?>
                    <div class="visualClear"></div>
                    <!-- debughtml -->
                    <?php 
        $this->html('debughtml');
        ?>
                    <!-- /debughtml -->
                </div>
                <!-- /bodyContent -->
            </div>
        </div>
        <!-- /content -->
        <!-- footer -->
        <div id="cpp-footer-base" class="noprint">
            <div id="footer"<?php 
        $this->html('userlangattributes');
        ?>
>
                <?php 
        $this->renderBottomNavigation();
        ?>
                <?php 
        $this->renderToolbox();
        ?>
                <?php 
        $this->renderFooter();
        ?>
            </div>
        </div>
        <!-- /footer -->
        <?php 
        $this->printTrail();
        ?>

	</body>
</html>
<?php 
    }
Example #27
0
 function makeSearchButton($mode, $attrs = [])
 {
     switch ($mode) {
         case 'go':
         case 'fulltext':
             $realAttrs = ['type' => 'submit', 'name' => $mode, 'value' => $this->translator->translate($mode == 'go' ? 'searcharticle' : 'searchbutton')];
             $realAttrs = array_merge($realAttrs, Linker::tooltipAndAccesskeyAttribs("search-{$mode}"), $attrs);
             return Html::element('input', $realAttrs);
         case 'image':
             $buttonAttrs = ['type' => 'submit', 'name' => 'button'];
             $buttonAttrs = array_merge($buttonAttrs, Linker::tooltipAndAccesskeyAttribs('search-fulltext'), $attrs);
             unset($buttonAttrs['src']);
             unset($buttonAttrs['alt']);
             unset($buttonAttrs['width']);
             unset($buttonAttrs['height']);
             $imgAttrs = ['src' => $attrs['src'], 'alt' => isset($attrs['alt']) ? $attrs['alt'] : $this->translator->translate('searchbutton'), 'width' => isset($attrs['width']) ? $attrs['width'] : null, 'height' => isset($attrs['height']) ? $attrs['height'] : null];
             return Html::rawElement('button', $buttonAttrs, Html::element('img', $imgAttrs));
         default:
             throw new MWException('Unknown mode passed to BaseTemplate::makeSearchButton');
     }
 }
Example #28
0
 /**
  * Standard summary input and label (wgSummary), abstracted so EditPage
  * subclasses may reorganize the form.
  * Note that you do not need to worry about the label's for=, it will be
  * inferred by the id given to the input. You can remove them both by
  * passing array( 'id' => false ) to $userInputAttrs.
  *
  * @param $summary string The value of the summary input
  * @param $labelText string The html to place inside the label
  * @param $inputAttrs array of attrs to use on the input
  * @param $spanLabelAttrs array of attrs to use on the span inside the label
  *
  * @return array An array in the format array( $label, $input )
  */
 function getSummaryInput($summary = "", $labelText = null, $inputAttrs = null, $spanLabelAttrs = null)
 {
     //Note: the maxlength is overriden in JS to 250 and to make it use UTF-8 bytes, not characters.
     $inputAttrs = (is_array($inputAttrs) ? $inputAttrs : array()) + array('id' => 'wpSummary', 'maxlength' => '200', 'tabindex' => '1', 'size' => 60, 'spellcheck' => 'true') + Linker::tooltipAndAccesskeyAttribs('summary');
     $spanLabelAttrs = (is_array($spanLabelAttrs) ? $spanLabelAttrs : array()) + array('class' => $this->missingSummary ? 'mw-summarymissed' : 'mw-summary', 'id' => "wpSummaryLabel");
     $label = null;
     if ($labelText) {
         $label = Xml::tags('label', $inputAttrs['id'] ? array('for' => $inputAttrs['id']) : null, $labelText);
         $label = Xml::tags('span', $spanLabelAttrs, $label);
     }
     $input = Html::input('wpSummary', $summary, 'text', $inputAttrs);
     return array($label, $input);
 }
Example #29
0
    /**
     * Outputs the entire contents of the (X)HTML page
     */
    public function execute()
    {
        global $wgVectorUseIconWatch;
        // Build additional attributes for navigation urls
        $nav = $this->data['content_navigation'];
        if ($wgVectorUseIconWatch) {
            $mode = $this->getSkin()->getTitle()->userIsWatching() ? 'unwatch' : 'watch';
            if (isset($nav['actions'][$mode])) {
                $nav['views'][$mode] = $nav['actions'][$mode];
                $nav['views'][$mode]['class'] = rtrim('icon ' . $nav['views'][$mode]['class'], ' ');
                $nav['views'][$mode]['primary'] = true;
                unset($nav['actions'][$mode]);
            }
        }
        $xmlID = '';
        foreach ($nav as $section => $links) {
            foreach ($links as $key => $link) {
                if ($section == 'views' && !(isset($link['primary']) && $link['primary'])) {
                    $link['class'] = rtrim('collapsible ' . $link['class'], ' ');
                }
                $xmlID = isset($link['id']) ? $link['id'] : 'ca-' . $xmlID;
                $nav[$section][$key]['attributes'] = ' id="' . Sanitizer::escapeId($xmlID) . '"';
                if ($link['class']) {
                    $nav[$section][$key]['attributes'] .= ' class="' . htmlspecialchars($link['class']) . '"';
                    unset($nav[$section][$key]['class']);
                }
                if (isset($link['tooltiponly']) && $link['tooltiponly']) {
                    $nav[$section][$key]['key'] = Linker::tooltip($xmlID);
                } else {
                    $nav[$section][$key]['key'] = Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs($xmlID));
                }
            }
        }
        $this->data['namespace_urls'] = $nav['namespaces'];
        $this->data['view_urls'] = $nav['views'];
        $this->data['action_urls'] = $nav['actions'];
        $this->data['variant_urls'] = $nav['variants'];
        // Reverse horizontally rendered navigation elements
        if ($this->data['rtl']) {
            $this->data['view_urls'] = array_reverse($this->data['view_urls']);
            $this->data['namespace_urls'] = array_reverse($this->data['namespace_urls']);
            $this->data['personal_urls'] = array_reverse($this->data['personal_urls']);
        }
        // Output HTML Page
        $this->html('headelement');
        ?>
		<div id="mw-page-base" class="noprint"></div>
		<div id="mw-head-base" class="noprint"></div>
		<!-- content -->
		<div id="content" class="mw-body">
			<a id="top"></a>
			<div id="mw-js-message" style="display:none;"<?php 
        $this->html('userlangattributes');
        ?>
></div>
			<?php 
        if ($this->data['sitenotice']) {
            ?>
			<!-- sitenotice -->
			<div id="siteNotice"><?php 
            $this->html('sitenotice');
            ?>
</div>
			<!-- /sitenotice -->
			<?php 
        }
        ?>
			<!-- firstHeading -->
			<h1 id="firstHeading" class="firstHeading">
				<span dir="auto"><?php 
        $this->html('title');
        ?>
</span>
			</h1>
			<!-- /firstHeading -->
			<!-- bodyContent -->
			<div id="bodyContent">
				<?php 
        if ($this->data['isarticle']) {
            ?>
				<!-- tagline -->
				<div id="siteSub"><?php 
            $this->msg('tagline');
            ?>
</div>
				<!-- /tagline -->
				<?php 
        }
        ?>
				<!-- subtitle -->
				<div id="contentSub"<?php 
        $this->html('userlangattributes');
        ?>
><?php 
        $this->html('subtitle');
        ?>
</div>
				<!-- /subtitle -->
				<?php 
        if ($this->data['undelete']) {
            ?>
				<!-- undelete -->
				<div id="contentSub2"><?php 
            $this->html('undelete');
            ?>
</div>
				<!-- /undelete -->
				<?php 
        }
        ?>
				<?php 
        if ($this->data['newtalk']) {
            ?>
				<!-- newtalk -->
				<div class="usermessage"><?php 
            $this->html('newtalk');
            ?>
</div>
				<!-- /newtalk -->
				<?php 
        }
        ?>
				<?php 
        if ($this->data['showjumplinks']) {
            ?>
				<!-- jumpto -->
				<div id="jump-to-nav" class="mw-jump">
					<?php 
            $this->msg('jumpto');
            ?>
 <a href="#mw-head"><?php 
            $this->msg('jumptonavigation');
            ?>
</a>,
					<a href="#p-search"><?php 
            $this->msg('jumptosearch');
            ?>
</a>
				</div>
				<!-- /jumpto -->
				<?php 
        }
        ?>
				<!-- bodycontent -->
				<?php 
        $this->html('bodycontent');
        ?>
				<!-- /bodycontent -->
				<?php 
        if ($this->data['printfooter']) {
            ?>
				<!-- printfooter -->
				<div class="printfooter">
				<?php 
            $this->html('printfooter');
            ?>
				</div>
				<!-- /printfooter -->
				<?php 
        }
        ?>
				<?php 
        if ($this->data['catlinks']) {
            ?>
				<!-- catlinks -->
				<?php 
            $this->html('catlinks');
            ?>
				<!-- /catlinks -->
				<?php 
        }
        ?>
				<?php 
        if ($this->data['dataAfterContent']) {
            ?>
				<!-- dataAfterContent -->
				<?php 
            $this->html('dataAfterContent');
            ?>
				<!-- /dataAfterContent -->
				<?php 
        }
        ?>
				<div class="visualClear"></div>
				<!-- debughtml -->
				<?php 
        $this->html('debughtml');
        ?>
				<!-- /debughtml -->
			</div>
			<!-- /bodyContent -->
		</div>
		<!-- /content -->
		<!-- header -->
		<div id="mw-head" class="noprint">
			<?php 
        $this->renderNavigation('PERSONAL');
        ?>
			<div id="left-navigation">
				<?php 
        $this->renderNavigation(array('NAMESPACES', 'VARIANTS'));
        ?>
			</div>
			<div id="right-navigation">
				<?php 
        $this->renderNavigation(array('VIEWS', 'ACTIONS', 'SEARCH'));
        ?>
			</div>
		</div>
		<!-- /header -->
		<!-- panel -->
			<div id="mw-panel" class="noprint">
				<!-- logo -->
					<div id="p-logo"><a style="background-image: url(<?php 
        $this->text('logopath');
        ?>
);" href="<?php 
        echo htmlspecialchars($this->data['nav_urls']['mainpage']['href']);
        ?>
" <?php 
        echo Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs('p-logo'));
        ?>
></a></div>
				<!-- /logo -->

		<!-- von mir hier eingesetzter toc_halter -->
		<div id="toc_sidebar_holder" class="tocholder"></div> 

			<?php 
        $this->renderPortals($this->data['sidebar']);
        ?>
			</div>
		<!-- /panel -->
		<!-- footer -->
		<div id="footer"<?php 
        $this->html('userlangattributes');
        ?>
>
			<?php 
        foreach ($this->getFooterLinks() as $category => $links) {
            ?>
				<ul id="footer-<?php 
            echo $category;
            ?>
">
					<?php 
            foreach ($links as $link) {
                ?>
						<li id="footer-<?php 
                echo $category;
                ?>
-<?php 
                echo $link;
                ?>
"><?php 
                $this->html($link);
                ?>
</li>
					<?php 
            }
            ?>
				</ul>
			<?php 
        }
        ?>
			<?php 
        $footericons = $this->getFooterIcons("icononly");
        if (count($footericons) > 0) {
            ?>
				<ul id="footer-icons" class="noprint">
<?php 
            foreach ($footericons as $blockName => $footerIcons) {
                ?>
					<li id="footer-<?php 
                echo htmlspecialchars($blockName);
                ?>
ico">
<?php 
                foreach ($footerIcons as $icon) {
                    ?>
						<?php 
                    echo $this->getSkin()->makeFooterIcon($icon);
                    ?>

<?php 
                }
                ?>
					</li>
<?php 
            }
            ?>
				</ul>
			<?php 
        }
        ?>
			<div style="clear:both"></div>
		</div>
		<!-- /footer -->
		<?php 
        $this->printTrail();
        ?>

	</body>
<!-- Das folgende Script muß innerhalb der HTML-Tags stehen, um ausgeführt zu werden -->
<!-- Es liest den div "toc" aus und, wenn der toc_holder vorhanden ist, löscht es den toc und kopiert ihn in toc_holder -->
 <script type="text/javascript">
    var toc = document.getElementById('toc');
    var toc_holder = document.getElementById('toc_sidebar_holder');
      if(toc && toc_holder){
	toc.parentNode.removeChild(toc);
	toc_holder.appendChild(toc);
	}
</script>


</html>
<?php 
    }
Example #30
0
    /**
     * Outputs the entire contents of the (X)HTML page
     */
    public function execute()
    {
        global $wgVectorUseIconWatch, $wgUser;
        // Build additional attributes for navigation urls
        $nav = $this->data['content_navigation'];
        if ($this->config->get('NewiWikiUseIconWatch')) {
            $mode = $this->getSkin()->getUser()->isWatched($this->getSkin()->getRelevantTitle()) ? 'unwatch' : 'watch';
            if (isset($nav['actions'][$mode])) {
                $nav['views'][$mode] = $nav['actions'][$mode];
                $nav['views'][$mode]['class'] = rtrim('icon ' . $nav['views'][$mode]['class'], ' ');
                $nav['views'][$mode]['primary'] = true;
                unset($nav['actions'][$mode]);
            }
        }
        $xmlID = '';
        foreach ($nav as $section => $links) {
            foreach ($links as $key => $link) {
                if ($section == 'views' && !(isset($link['primary']) && $link['primary'])) {
                    $link['class'] = rtrim('collapsible ' . $link['class'], ' ');
                }
                $xmlID = isset($link['id']) ? $link['id'] : 'ca-' . $xmlID;
                $nav[$section][$key]['attributes'] = ' id="' . Sanitizer::escapeId($xmlID) . '"';
                if ($link['class']) {
                    $nav[$section][$key]['attributes'] .= ' class="' . htmlspecialchars($link['class']) . '"';
                    unset($nav[$section][$key]['class']);
                }
                if (isset($link['tooltiponly']) && $link['tooltiponly']) {
                    $nav[$section][$key]['key'] = Linker::tooltip($xmlID);
                } else {
                    $nav[$section][$key]['key'] = Xml::expandAttributes(Linker::tooltipAndAccesskeyAttribs($xmlID));
                }
            }
        }
        $this->data['namespace_urls'] = $nav['namespaces'];
        $this->data['view_urls'] = $nav['views'];
        $this->data['action_urls'] = $nav['actions'];
        $this->data['variant_urls'] = $nav['variants'];
        // Reverse horizontally rendered navigation elements
        if ($this->data['rtl']) {
            $this->data['view_urls'] = array_reverse($this->data['view_urls']);
            $this->data['namespace_urls'] = array_reverse($this->data['namespace_urls']);
            $this->data['personal_urls'] = array_reverse($this->data['personal_urls']);
        }
        $userLinks = $this->getPersonalTools();
        $user = $wgUser->isLoggedIn() ? array_shift($userLinks) : array_pop($userLinks);
        $userLink = $user['links'][0];
        // Output HTML Page
        $this->html('headelement');
        ?>
		<div id="mw-page-base" class="noprint"></div>
		<div id="mw-head-base" class="noprint"></div>
		<div id="body_wrap" class="container-fluid">
		<div class="top_navi">
		<div class="navbar navbar-iWiki navbar-fixed-top">
			<div class="container-fluid">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle navbar-left collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
						<span class="sr-only">Toggle navigation</span>
						<span class="glyphicon glyphicon-th-large" aria-hidden="true"></span>
					</button>
					<form class="navbar-form navbar-right navbar-small-form" action="<?php 
        $this->text('wgScript');
        ?>
">
						<input type='hidden' name="title" value="<?php 
        $this->text('searchtitle');
        ?>
"/>
						<?php 
        echo $this->makeSearchInput(array("id" => "searchInput", "class" => "form-control", "placeholder" => "검색어"));
        ?>
					</form>
					<button type="button" class="navbar-toggle navbar-toogle-right collapsed" data-toggle="collapse" <?php 
        if ($wgUser->isLoggedIn()) {
            ?>
data-target="#personalbar" <?php 
        } else {
            ?>
onclick="location.href='<?php 
            echo $userLink['href'];
            ?>
'"<?php 
        }
        ?>
aria-expanded="false" aria-controls="personalbar">
						<span class="sr-only">Toggle navigation</span>
						<span class="glyphicon glyphicon-user" aria-hidden="true"></span>
					</button>
					<a class="navbar-brand" href="/wiki/FrontPage"><?php 
        $this->msg('tagline');
        ?>
</a>
				</div>
				<div id="navbar" class="navbar-collapse collapse">
					<ul class="nav navbar-nav navbar-left">
						<?php 
        $this->customBox('navigaion', $this->data['sidebar']['navigation']);
        ?>
					</ul>
					<?php 
        if ($wgUser->isLoggedIn()) {
            $notificationCount = MWEchoNotifUser::newFromUser($this->getSkin()->getUser())->getNotificationCount();
            ?>
					<button type="button" class="btn <?php 
            if ($notificationCount) {
                echo "btn-danger";
            } else {
                echo "btn-success";
            }
            ?>
 loginbtn navbar-right" data-toggle="collapse" href="#personalbar" aria-expanded="false" aria-controls="personalbar">
					<?php 
            echo $wgUser->getName();
            ?>
					<?php 
            ?>
					</button>
					<?php 
        } else {
            echo Linker::linkKnown(SpecialPage::getTitleFor('Userlogin'), wfMsg('login'), array('class' => 'navbar-right btn btn-warning loginbtn '));
        }
        ?>
				</div>
				<div id="personalbar" class="navbar-personal collapse">
					<ul class="nav nav-stacked navbar-personalbar">
						<?php 
        $this->renderNavigation('PERSONAL');
        ?>
					</ul>
				</div>
			</div>
		</div>
	</div>
	<div class="row main_content">
		<div class="col-xs-9">
			<div id="content" class="mw-body" role="main">
				<a id="top"></a>
				<div class="top_menu">
					<ul>
					<?php 
        $title = $this->getSkin()->getTitle();
        if ($title->getNamespace() != NS_SPECIAL) {
            $companionTitle = $title->isTalkPage() ? $title->getSubjectPage() : $title->getTalkPage();
            //echo $title->getArticleID();
            //echo $this->getSkin()->getOldID();
            //echo $this->getSkin()->getActionName();
            ?>
						<li><?php 
            echo Linker::linkKnown($title, '<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> 편집', array(), array('action' => 'edit', 'oldid' => $this->getSkin()->getRevisionId()));
            ?>
</li>
						<li><?php 
            echo Linker::linkKnown($title, '<span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> 새문단', array(), array('action' => 'edit', 'section' => 'new'));
            ?>
</li>
						<li><?php 
            echo Linker::linkKnown($title, '<span class="glyphicon glyphicon-time" aria-hidden="true"></span> 기록', array(), array('action' => 'history'));
            ?>
</li>
					<?php 
            if ($companionTitle) {
                if ($title->getNamespace() == NS_TALK || $title->getNamespace() == NS_PROJECT_TALK || $title->getNamespace() == NS_FILE_TALK || $title->getNamespace() == NS_TEMPLATE_TALK) {
                    ?>
                    <li><?php 
                    echo Linker::linkKnown($companionTitle, '<span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span> 본문');
                    ?>
</li>
                    <?php 
                } else {
                    ?>
                    <li><?php 
                    echo Linker::linkKnown($companionTitle, '<span class="glyphicon glyphicon-fire" aria-hidden="true"></span> 토론');
                    ?>
</li>
                    <?php 
                }
            }
            ?>
			<li><?php 
            echo Linker::linkKnown(SpecialPage::getTitleFor('WhatLinksHere', $title), '<span class="glyphicon glyphicon-pushpin" aria-hidden="true"></span> 역링크');
            ?>
</li>
            <?php 
            $mode = $this->getSkin()->getUser()->isWatched($this->getSkin()->getRelevantTitle()) ? 'unwatch' : 'watch';
            if ($mode != 'watch') {
                $watchname = '주시해제';
                $emptystar = '';
            } else {
                $watchname = '주시';
                $emptystar = '-empty';
            }
            if ($title->getNamespace() != NS_SPECIAL) {
                ?>
            <li><?php 
                echo Linker::linkKnown($title, '<span class="glyphicon glyphicon-star' . $emptystar . '" aria-hidden="true"></span> ' . $watchname, array(), array('action' => $mode));
                ?>
</li>
            <?php 
            }
            ?>
            <li><?php 
            echo Linker::linkKnown(SpecialPage::getTitleFor('Movepage', $title), '<span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span> 옮기기');
            ?>
</li>
            <?php 
            if ($title->quickUserCan('protect', $user)) {
                ?>
            <li><?php 
                echo Linker::linkKnown($title, '<span class="glyphicon glyphicon-lock" aria-hidden="true"></span> 보호', array(), array('action' => 'protect'));
                ?>
</li>
            <?php 
            }
            ?>
            <?php 
            if ($title->quickUserCan('delete', $user)) {
                ?>
            <li><?php 
                echo Linker::linkKnown($title, '<span class="glyphicon glyphicon-trash" aria-hidden="true"></span> 삭제', array(), array('action' => 'delete'));
                ?>
</li>
            <?php 
            }
        }
        ?>
					</ul>
				</div>

				<div id="mw-js-message" style="display:none;"<?php 
        $this->html('userlangattributes');
        ?>
></div>
				<?php 
        if ($this->data['sitenotice']) {
            ?>
					<div id="alertmsg" class="alert alert-info siteNotice alert-dismissible" role="alert">
						<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
						<?php 
            $this->html('sitenotice');
            ?>
					</div>
				<?php 
        }
        ?>

									<!-- Footer ad -->
								<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
								<ins class="adsbygoogle"
									 style="display:block; min-width:320px; width:100%; height:90px;margin-top:15px;"
									 data-ad-client="ca-pub-2664061841343191"
									 data-ad-slot="6502738263"
									 data-ad-format="auto"></ins>
								<script>
									(adsbygoogle = window.adsbygoogle || []).push({});
								</script>
				<h1 id="firstHeading" class="firstHeading" lang="<?php 
        $this->data['pageLanguage'] = $this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
        $this->text('pageLanguage');
        ?>
"><span dir="auto"><?php 
        $this->html('title');
        ?>
</span></h1>
				<?php 
        $this->html('prebodyhtml');
        ?>
				<div id="bodyContent">
				<?php 
        if ($this->data['isarticle']) {
            ?>
					<div id="siteSub"><?php 
            $this->msg('tagline');
            ?>
</div>
				<?php 
        }
        ?>
					<div id="contentSub"<?php 
        $this->html('userlangattributes');
        ?>
><?php 
        $this->html('subtitle');
        ?>
</div>
				<?php 
        if ($this->data['undelete']) {
            ?>
					<div id="contentSub2"><?php 
            $this->html('undelete');
            ?>
</div>
				<?php 
        }
        ?>
				<?php 
        if ($this->data['newtalk']) {
            ?>
					<div class="usermessage"><?php 
            $this->html('newtalk');
            ?>
</div>
				<?php 
        }
        ?>
				<div id="jump-to-nav" class="mw-jump">
					<?php 
        $this->msg('jumpto');
        ?>
					<a href="#mw-navigation"><?php 
        $this->msg('jumptonavigation');
        ?>
</a><?php 
        $this->msg('comma-separator');
        ?>
					<a href="#p-search"><?php 
        $this->msg('jumptosearch');
        ?>
</a>
				</div>
				<?php 
        $this->html('bodycontent');
        ?>
				<?php 
        if ($this->data['printfooter']) {
            ?>
					<div class="printfooter">
						<?php 
            $this->html('printfooter');
            ?>
					</div>
				<?php 
        }
        ?>
				<?php 
        if ($this->data['catlinks']) {
            ?>
				<?php 
            $this->html('catlinks');
            ?>
				<?php 
        }
        ?>
				<?php 
        if ($this->data['dataAfterContent']) {
            ?>
				<?php 
            $this->html('dataAfterContent');
            ?>
				<?php 
        }
        ?>
				<div class="visualClear"></div>
				<?php 
        $this->html('debughtml');
        ?>
			</div>
		</div>
		<div id="footer" role="contentinfo"<?php 
        $this->html('userlangattributes');
        ?>
>
                        <?php 
        foreach ($this->getFooterLinks() as $category => $links) {
            ?>
                                <ul id="footer-<?php 
            echo $category;
            ?>
">
                                        <?php 
            foreach ($links as $link) {
                ?>
                                                <li id="footer-<?php 
                echo $category;
                ?>
-<?php 
                echo $link;
                ?>
"><?php 
                $this->html($link);
                ?>
</li>
                                        <?php 
            }
            ?>
                                </ul>
                        <?php 
        }
        ?>
                        <?php 
        $footericons = $this->getFooterIcons("icononly");
        if (count($footericons) > 0) {
            ?>
                                <ul id="footer-icons">
<?php 
            foreach ($footericons as $blockName => $footerIcons) {
                ?>
                                        <li id="footer-<?php 
                echo htmlspecialchars($blockName);
                ?>
ico">
<?php 
                foreach ($footerIcons as $icon) {
                    ?>
                                                <?php 
                    echo $this->getSkin()->makeFooterIcon($icon);
                    ?>

<?php 
                }
                ?>
                                        </li>
<?php 
            }
            ?>
                                </ul>
                        <?php 
        }
        ?>
                        <div style="clear:both"></div>
                                </div>
                                </div>
                                <div class="col-xs-3">
                                        <div class="right_col">
                                                <form class="right_search" action="<?php 
        $this->text('wgScript');
        ?>
">
                                    <input type='hidden' name="title" value="<?php 
        $this->text('searchtitle');
        ?>
"/>
                            <?php 
        echo $this->makeSearchInput(array("id" => "searchInput", "class" => "form-control", "placeholder" => "검색어"));
        ?>
                            </form>
                                                <div id="right_toc">
                                                </div>
                                                <div id = "recent-list-div">
                                                        <div id="recent-title">
                                                                <h2>최근 바뀜
                                                                        <span class="recent-more">
                                                                                <span class="mw-editsection-bracket">[</span>
                                                                                <a href="/wiki/특수:최근바뀜" title="최근바뀜문서">more</a>
                                                                                <span class="mw-editsection-bracket">]</span>
                                                                        </span>
                                                                </h2>
                                                        </div>
                                                        <ul id = "recent-list">
                                                        </ul>
                                                </div>

																								<!-- sidebar ad -->
																								<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
																								<!-- 사이드바 -->
																								<ins class="adsbygoogle"
																								     style="display:block;max-width:230px;margin-top:10px;margin-left:10px;height:100%;max-height:600px;"
																								     data-ad-client="ca-pub-2664061841343191"
																								     data-ad-slot="2751059465"
																								     data-ad-format="auto"></ins>
																								<script>
																								(adsbygoogle = window.adsbygoogle || []).push({});
																								</script>
                                        </div>
                </div>
                        </div>
                </div>
                <div class="top_scroll">
                        <a href="#" class="top_s_btn">
                                <span class="glyphicon glyphicon-open"></span>
                        </a>
                </div>

		<?php 
        $this->printTrail();
        ?>
	</body>
</html>
	<?php 
    }