)->text();
}
- $ilInterwikiCodeBCP47 = wfBCP47( $ilInterwikiCode );
+ $ilInterwikiCodeBCP47 = LanguageCode::bcp47( $ilInterwikiCode );
$languageLink = [
'href' => $languageLinkTitle->getFullURL(),
'text' => $ilLangName,
* @return string
*/
public function getPersonalToolsList() {
+ return $this->makePersonalToolsList();
+ }
+
+ /**
+ * Get the HTML for the personal tools list
+ *
+ * @since 1.31
+ *
+ * @param array $personalTools
+ * @param array $options
+ * @return string
+ */
+ public function makePersonalToolsList( $personalTools = null, $options = [] ) {
$tpl = $this->setupTemplateForOutput();
$tpl->set( 'personal_urls', $this->buildPersonalUrls() );
$html = '';
- foreach ( $tpl->getPersonalTools() as $key => $item ) {
- $html .= $tpl->makeListItem( $key, $item );
+
+ if ( $personalTools === null ) {
+ $personalTools = $tpl->getPersonalTools();
}
+
+ foreach ( $personalTools as $key => $item ) {
+ $html .= $tpl->makeListItem( $key, $item, $options );
+ }
+
return $html;
}
+ /**
+ * Get personal tools for the user
+ *
+ * @since 1.31
+ *
+ * @return array Array of personal tools
+ */
+ public function getStructuredPersonalTools() {
+ $tpl = $this->setupTemplateForOutput();
+ $tpl->set( 'personal_urls', $this->buildPersonalUrls() );
+
+ return $tpl->getPersonalTools();
+ }
+
/**
* Format language name for use in sidebar interlanguage links list.
* By default it is capitalized.
}
}
- Hooks::run( 'PersonalUrls', [ &$personal_urls, &$title, $this ] );
+ Hooks::runWithoutAbort( 'PersonalUrls', [ &$personal_urls, &$title, $this ] );
return $personal_urls;
}
// Avoid PHP 7.1 warning of passing $this by reference
$skinTemplate = $this;
- Hooks::run( 'SkinTemplateNavigation', [ &$skinTemplate, &$content_navigation ] );
+ Hooks::runWithoutAbort(
+ 'SkinTemplateNavigation',
+ [ &$skinTemplate, &$content_navigation ]
+ );
if ( $userCanRead && !$wgDisableLangConversion ) {
$pageLang = $title->getPageLanguage();
'class' => ( $code == $preferred ) ? 'selected' : false,
'text' => $varname,
'href' => $title->getLocalURL( [ 'variant' => $code ] + $params ),
- 'lang' => wfBCP47( $code ),
- 'hreflang' => wfBCP47( $code ),
+ 'lang' => LanguageCode::bcp47( $code ),
+ 'hreflang' => LanguageCode::bcp47( $code ),
];
}
}
// Avoid PHP 7.1 warning of passing $this by reference
$skinTemplate = $this;
- Hooks::run( 'SkinTemplateNavigation::SpecialPage',
+ Hooks::runWithoutAbort( 'SkinTemplateNavigation::SpecialPage',
[ &$skinTemplate, &$content_navigation ] );
}
// Avoid PHP 7.1 warning of passing $this by reference
$skinTemplate = $this;
// Equiv to SkinTemplateContentActions
- Hooks::run( 'SkinTemplateNavigation::Universal', [ &$skinTemplate, &$content_navigation ] );
+ Hooks::runWithoutAbort( 'SkinTemplateNavigation::Universal',
+ [ &$skinTemplate, &$content_navigation ] );
// Setup xml ids and tooltip info
foreach ( $content_navigation as $section => &$links ) {