// Preload jquery.tablesorter for mediawiki.page.ready
if ( strpos( $out->getHTML(), 'sortable' ) !== false ) {
$modules['content'][] = 'jquery.tablesorter';
- $modules['styles']['content'][] = 'jquery.tablesorter.styles';
}
// Preload jquery.makeCollapsible for mediawiki.page.ready
if ( is_string( $icon ) ) {
$html = $icon;
} else { // Assuming array
- $url = isset( $icon["url"] ) ? $icon["url"] : null;
+ $url = $icon["url"] ?? null;
unset( $icon["url"] );
if ( isset( $icon["src"] ) && $withImage === 'withImage' ) {
// do this the lazy way, just pass icon data as an attribute array
if ( count( $newtalks ) == 1 && $newtalks[0]['wiki'] === wfWikiID() ) {
$uTalkTitle = $user->getTalkPage();
- $lastSeenRev = isset( $newtalks[0]['rev'] ) ? $newtalks[0]['rev'] : null;
+ $lastSeenRev = $newtalks[0]['rev'] ?? null;
$nofAuthors = 0;
if ( $lastSeenRev !== null ) {
$plural = true; // Default if we have a last seen revision: if unknown, use plural
}
/**
- * Create a section edit link. This supersedes editSectionLink() and
- * editSectionLinkForOther().
+ * Create a section edit link.
*
* @param Title $nt The title being linked to (may not be the same as
* the current page, if the section is included from a template)
* to be included in the link, like "§ion=$section"
* @param string $tooltip The tooltip to use for the link: will be escaped
* and wrapped in the 'editsectionhint' message
- * @param string $lang Language code
+ * @param Language|null $lang Language object, defaults to user interface language
* @return string HTML to use for edit link
*/
- public function doEditSectionLink( Title $nt, $section, $tooltip = null, $lang = false ) {
+ public function doEditSectionLink( Title $nt, $section, $tooltip = null, Language $lang = null ) {
// HTML generated here should probably have userlangattributes
// added to it for LTR text on RTL pages
- $lang = wfGetLangObj( $lang );
+ global $wgLang;
+ $lang = $lang ?: $wgLang;
$attribs = [];
if ( !is_null( $tooltip ) ) {