Page MenuHomePhabricator

portlettitle_rewrite.patch

Authored By
bzimport
Nov 21 2014, 11:56 PM
Size
1 KB
Referenced Files
None
Subscribers
None

portlettitle_rewrite.patch

Index: includes/SkinTemplate.php
===================================================================
--- includes/SkinTemplate.php (revision 99358)
+++ includes/SkinTemplate.php (working copy)
@@ -1645,8 +1645,11 @@
* If you don't want an accesskey, set $item['tooltiponly'] = true;
*/
function makeLink( $key, $item ) {
+ $attrs = $item;
+
if ( isset( $item['text'] ) ) {
$text = $item['text'];
+ unset( $attrs['text'] );
} else {
$text = $this->translator->translate( isset( $item['msg'] ) ? $item['msg'] : $key );
}
@@ -1655,13 +1658,6 @@
return htmlspecialchars( $text );
}
- $attrs = array();
- foreach ( array( 'href', 'id', 'class', 'rel', 'type', 'target') as $attr ) {
- if ( isset( $item[$attr] ) ) {
- $attrs[$attr] = $item[$attr];
- }
- }
-
if ( isset( $item['id'] ) ) {
$item['single-id'] = $item['id'];
}
@@ -1677,6 +1673,7 @@
Linker::tooltipAndAccesskeyAttribs( $item['single-id'] )
);
}
+ unset( $attrs['single-id'] );
}
return Html::element( 'a', $attrs, $text );
@@ -1708,12 +1705,9 @@
$html .= $this->makeLink( $linkKey, $link );
}
} else {
- $link = array();
- foreach ( array( 'text', 'msg', 'href', 'rel', 'type', 'tooltiponly', 'target' ) as $k ) {
- if ( isset( $item[$k] ) ) {
- $link[$k] = $item[$k];
- }
- }
+ $link = $item;
+ unset( $link['id'] );
+ unset( $link['class'] );
if ( isset( $item['id'] ) ) {
// The id goes on the <li> not on the <a> for single links
// but makeSidebarLink still needs to know what id to use when

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7793
Default Alt Text
portlettitle_rewrite.patch (1 KB)

Event Timeline