+ // Use the regular navigational link, but replace its text. Everything else stays unmodified.
+ $namespacesLinks = $this->data['content_navigation']['namespaces'];
+ $link = $this->processNavlinkForDocument( $namespacesLinks[ $key ] );
+ $link['text'] = wfMessage( $message )->text();
+
+ return $this->makeListItem( $message, $link, array( 'tag' => 'span' ) );
+ }
+
+ /**
+ * Takes a navigational link generated by SkinTemplate in whichever way
+ * and mangles attributes unsuitable for repeated use. In particular, this modifies the ids
+ * and removes the accesskeys. This is necessary to be able to use the same navlink twice,
+ * e.g. in sidebar and in footer.
+ *
+ * @param $navlink array Navigational link generated by SkinTemplate
+ * @param $idPrefix mixed Prefix to add to id of this navlink. If false, id is removed entirely. Default is 'cb-'.
+ */
+ function processNavlinkForDocument( $navlink, $idPrefix='cb-' ) {
+ if ( $navlink['id'] ) {
+ $navlink['single-id'] = $navlink['id']; // to allow for tooltip generation
+ $navlink['tooltiponly'] = true; // but no accesskeys
+
+ // mangle or remove the id
+ if ( $idPrefix === false ) {
+ unset( $navlink['id'] );
+ } else {
+ $navlink['id'] = $idPrefix . $navlink['id'];
+ }
+ }
+
+ return $navlink;