MediaWiki REL1_30
MonoBookTemplate.php
Go to the documentation of this file.
1<?php
31
38 public function execute() {
39 $this->html( 'headelement' );
40 ?><div id="globalWrapper">
41 <div id="column-content">
42 <div id="content" class="mw-body" role="main">
43 <a id="top"></a>
44 <?php
45 if ( $this->data['sitenotice'] ) {
46 ?>
47 <div id="siteNotice" class="mw-body-content"><?php
48 $this->html( 'sitenotice' )
49 ?></div><?php
50 }
51 ?>
52
53 <?php
54 echo $this->getIndicators();
55 // Loose comparison with '!=' is intentional, to catch null and false too, but not '0'
56 if ( $this->data['title'] != '' ) {
57 ?>
58 <h1 id="firstHeading" class="firstHeading" lang="<?php
59 $this->data['pageLanguage'] =
60 $this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
61 $this->text( 'pageLanguage' );
62 ?>"><?php $this->html( 'title' ) ?></h1>
63 <?php
64 }
65 ?>
66
67 <div id="bodyContent" class="mw-body-content">
68 <div id="siteSub"><?php $this->msg( 'tagline' ) ?></div>
69 <div id="contentSub"<?php
70 $this->html( 'userlangattributes' ) ?>><?php $this->html( 'subtitle' )
71 ?></div>
72 <?php if ( $this->data['undelete'] ) { ?>
73 <div id="contentSub2"><?php $this->html( 'undelete' ) ?></div>
74 <?php
75 }
76 ?><?php
77 if ( $this->data['newtalk'] ) {
78 ?>
79 <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div>
80 <?php
81 }
82 ?>
83 <div id="jump-to-nav" class="mw-jump"><?php
84 $this->msg( 'jumpto' )
85 ?> <a href="#column-one"><?php
86 $this->msg( 'jumptonavigation' )
87 ?></a><?php
88 $this->msg( 'comma-separator' )
89 ?><a href="#searchInput"><?php
90 $this->msg( 'jumptosearch' )
91 ?></a></div>
92
93 <!-- start content -->
94 <?php $this->html( 'bodytext' ) ?>
95 <?php
96 if ( $this->data['catlinks'] ) {
97 $this->html( 'catlinks' );
98 }
99 ?>
100 <!-- end content -->
101 <?php
102 if ( $this->data['dataAfterContent'] ) {
103 $this->html( 'dataAfterContent' );
104 }
105 ?>
106 <div class="visualClear"></div>
107 </div>
108 </div>
109 <?php Hooks::run( 'MonoBookAfterContent' ); ?>
110 </div>
111 <div id="column-one"<?php $this->html( 'userlangattributes' ) ?>>
112 <h2><?php $this->msg( 'navigation-heading' ) ?></h2>
113 <?php $this->cactions(); ?>
114 <div class="portlet" id="p-personal" role="navigation">
115 <h3><?php $this->msg( 'personaltools' ) ?></h3>
116
117 <div class="pBody">
118 <ul<?php $this->html( 'userlangattributes' ) ?>>
119 <?php
120 $personalTools = $this->getPersonalTools();
121
122 if ( array_key_exists( 'uls', $personalTools ) ) {
123 echo $this->makeListItem( 'uls', $personalTools['uls'] );
124 unset( $personalTools['uls'] );
125 }
126
127 if ( !$this->getSkin()->getUser()->isLoggedIn() &&
128 User::groupHasPermission( '*', 'edit' )
129 ) {
130 echo Html::rawElement( 'li', [
131 'id' => 'pt-anonuserpage'
132 ], $this->getMsg( 'notloggedin' )->escaped() );
133 }
134
135 foreach ( $personalTools as $key => $item ) { ?>
136 <?php echo $this->makeListItem( $key, $item ); ?>
137
138 <?php
139 }
140 ?>
141 </ul>
142 </div>
143 </div>
144 <div class="portlet" id="p-logo" role="banner">
145 <?php
146 echo Html::element( 'a', [
147 'href' => $this->data['nav_urls']['mainpage']['href'],
148 'class' => 'mw-wiki-logo',
149 ]
151 ); ?>
152
153 </div>
154 <?php
155 $this->renderPortals( $this->data['sidebar'] );
156 ?>
157 </div><!-- end of the left (by default at least) column -->
158 <div class="visualClear"></div>
159 <?php
160 $validFooterIcons = $this->getFooterIcons( 'icononly' );
161 // Additional footer links
162 $validFooterLinks = $this->getFooterLinks( 'flat' );
163
164 if ( count( $validFooterIcons ) + count( $validFooterLinks ) > 0 ) {
165 ?>
166 <div id="footer" role="contentinfo"<?php $this->html( 'userlangattributes' ) ?>>
167 <?php
168 $footerEnd = '</div>';
169 } else {
170 $footerEnd = '';
171 }
172
173 foreach ( $validFooterIcons as $blockName => $footerIcons ) {
174 ?>
175 <div id="f-<?php echo htmlspecialchars( $blockName ); ?>ico">
176 <?php foreach ( $footerIcons as $icon ) { ?>
177 <?php echo $this->getSkin()->makeFooterIcon( $icon ); ?>
178
179 <?php
180 }
181 ?>
182 </div>
183 <?php
184 }
185
186 if ( count( $validFooterLinks ) > 0 ) {
187 ?>
188 <ul id="f-list">
189 <?php
190 foreach ( $validFooterLinks as $aLink ) {
191 ?>
192 <li id="<?php echo $aLink ?>"><?php $this->html( $aLink ) ?></li>
193 <?php
194 }
195 ?>
196 </ul>
197 <?php
198 }
199
200 echo $footerEnd;
201 ?>
202
203 </div>
204 <?php
205 $this->printTrail();
206 echo Html::closeElement( 'body' );
207 echo Html::closeElement( 'html' );
208 echo "\n";
209 }
210
214 protected function renderPortals( $sidebar ) {
215 if ( !isset( $sidebar['SEARCH'] ) ) {
216 $sidebar['SEARCH'] = true;
217 }
218 if ( !isset( $sidebar['TOOLBOX'] ) ) {
219 $sidebar['TOOLBOX'] = true;
220 }
221 if ( !isset( $sidebar['LANGUAGES'] ) ) {
222 $sidebar['LANGUAGES'] = true;
223 }
224
225 foreach ( $sidebar as $boxName => $content ) {
226 if ( $content === false ) {
227 continue;
228 }
229
230 // Numeric strings gets an integer when set as key, cast back - T73639
231 $boxName = (string)$boxName;
232
233 if ( $boxName == 'SEARCH' ) {
234 $this->searchBox();
235 } elseif ( $boxName == 'TOOLBOX' ) {
236 $this->toolbox();
237 } elseif ( $boxName == 'LANGUAGES' ) {
238 $this->languageBox();
239 } else {
240 $this->customBox( $boxName, $content );
241 }
242 }
243 }
244
245 function searchBox() {
246 ?>
247 <div id="p-search" class="portlet" role="search">
248 <h3><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h3>
249
250 <div id="searchBody" class="pBody">
251 <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
252 <input type="hidden" name="title" value="<?php $this->text( 'searchtitle' ) ?>"/>
253 <?php echo $this->makeSearchInput( [ 'id' => 'searchInput' ] ); ?>
254
255 <?php
256 echo $this->makeSearchButton(
257 'go',
258 [ 'id' => 'searchGoButton', 'class' => 'searchButton' ]
259 );
260
261 if ( $this->config->get( 'UseTwoButtonsSearchForm' ) ) {
262 ?>&#160;
263 <?php echo $this->makeSearchButton(
264 'fulltext',
265 [ 'id' => 'mw-searchButton', 'class' => 'searchButton' ]
266 );
267 } else {
268 ?>
269
270 <div><a href="<?php
271 $this->text( 'searchaction' )
272 ?>" rel="search"><?php $this->msg( 'powersearch-legend' ) ?></a></div><?php
273 } ?>
274
275 </form>
276
277 <?php $this->renderAfterPortlet( 'search' ); ?>
278 </div>
279 </div>
280 <?php
281 }
282
287 function cactions() {
288 ?>
289 <div id="p-cactions" class="portlet" role="navigation">
290 <h3><?php $this->msg( 'views' ) ?></h3>
291
292 <div class="pBody">
293 <ul><?php
294 foreach ( $this->data['content_actions'] as $key => $tab ) {
295 echo '
296 ' . $this->makeListItem( $key, $tab );
297 } ?>
298
299 </ul>
300 <?php $this->renderAfterPortlet( 'cactions' ); ?>
301 </div>
302 </div>
303 <?php
304 }
305
306 function toolbox() {
307 ?>
308 <div class="portlet" id="p-tb" role="navigation">
309 <h3><?php $this->msg( 'toolbox' ) ?></h3>
310
311 <div class="pBody">
312 <ul>
313 <?php
314 foreach ( $this->getToolbox() as $key => $tbitem ) {
315 ?>
316 <?php echo $this->makeListItem( $key, $tbitem ); ?>
317
318 <?php
319 }
320 // Avoid PHP 7.1 warnings
321 $skin = $this;
322 Hooks::run( 'MonoBookTemplateToolboxEnd', [ &$skin ] );
323 Hooks::run( 'SkinTemplateToolboxEnd', [ &$skin, true ] );
324 ?>
325 </ul>
326 <?php $this->renderAfterPortlet( 'tb' ); ?>
327 </div>
328 </div>
329 <?php
330 Hooks::run( 'MonoBookAfterToolbox' );
331 }
332
333 function languageBox() {
334 if ( $this->data['language_urls'] !== false ) {
335 ?>
336 <div id="p-lang" class="portlet" role="navigation">
337 <h3<?php $this->html( 'userlangattributes' ) ?>><?php $this->msg( 'otherlanguages' ) ?></h3>
338
339 <div class="pBody">
340 <ul>
341 <?php foreach ( $this->data['language_urls'] as $key => $langLink ) { ?>
342 <?php echo $this->makeListItem( $key, $langLink ); ?>
343
344 <?php
345 }
346 ?>
347 </ul>
348
349 <?php $this->renderAfterPortlet( 'lang' ); ?>
350 </div>
351 </div>
352 <?php
353 }
354 }
355
360 function customBox( $bar, $cont ) {
361 $portletAttribs = [
362 'class' => 'generated-sidebar portlet',
363 'id' => Sanitizer::escapeId( "p-$bar" ),
364 'role' => 'navigation'
365 ];
366
367 $tooltip = Linker::titleAttrib( "p-$bar" );
368 if ( $tooltip !== false ) {
369 $portletAttribs['title'] = $tooltip;
370 }
371 echo ' ' . Html::openElement( 'div', $portletAttribs );
372 $msgObj = wfMessage( $bar );
373 ?>
374
375 <h3><?php echo htmlspecialchars( $msgObj->exists() ? $msgObj->text() : $bar ); ?></h3>
376 <div class="pBody">
377 <?php
378 if ( is_array( $cont ) ) {
379 ?>
380 <ul>
381 <?php
382 foreach ( $cont as $key => $val ) {
383 ?>
384 <?php echo $this->makeListItem( $key, $val ); ?>
385
386 <?php
387 }
388 ?>
389 </ul>
390 <?php
391 } else {
392 # allow raw HTML block to be defined by extensions
393 print $cont;
394 }
395
396 $this->renderAfterPortlet( $bar );
397 ?>
398 </div>
399 </div>
400 <?php
401 }
402}
shown</td >< td > a href
New base template for a skin's template extended from QuickTemplate this class features helper method...
getFooterLinks( $option=null)
Returns an array of footerlinks trimmed down to only those footer links that are valid.
makeSearchButton( $mode, $attrs=[])
renderAfterPortlet( $name)
getToolbox()
Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate.
printTrail()
Output getTrail.
getPersonalTools()
Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate.
getFooterIcons( $option=null)
Returns an array of footer icons filtered down by options relevant to how the skin wishes to display ...
makeListItem( $key, $item, $options=[])
Generates a list item for a navigation, portlet, portal, sidebar... list.
getMsg( $name)
Get a Message object with its context set.
getIndicators()
Get the suggested HTML for page status indicators: icons (or short text snippets) usually displayed i...
makeSearchInput( $attrs=[])
static titleAttrib( $name, $options=null, array $msgParams=[])
Given the id of an interface element, constructs the appropriate title attribute from the system mess...
Definition Linker.php:1951
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[])
Returns the attributes for the tooltip and access key.
Definition Linker.php:2111
execute()
Template filter callback for MonoBook skin.
cactions()
Prints the content actions (cactions) bar.
customBox( $bar, $cont)
getSkin()
Get the Skin object related to this object.
print
Definition cleanup.php:99
info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED! Use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language & $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED! Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language & $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Array with elements of the form "language:title" in the order that they will be output. & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) action
Definition hooks.txt:1855
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
Definition hooks.txt:181
null means default in associative array form
Definition hooks.txt:1966
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt;div ...>$1&lt;/div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres as and are nearing end of but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type
Definition postgres.txt:36
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres as and are nearing end of but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN boolean columns are always mapped to as the code does not always treat the column as a and VARBINARY columns should simply be TEXT The only exception is when VARBINARY is used to store true binary such as the math_inputhash column
Definition postgres.txt:44