* @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.