* and eventually it spits out some HTML. Should have interface
* roughly equivalent to PHPTAL 0.7.
*
- * @param $classname string (or file)
+ * @param $classname String
* @param $repository string: subdirectory where we keep template files
* @param $cache_dir string
- * @return object
+ * @return QuickTemplate
* @private
*/
function setupTemplate( $classname, $repository = false, $cache_dir = false ) {
} else {
$tpl->set( 'copyright', false );
$tpl->set( 'viewcount', false );
- $tpl->set( 'lastmod', false );
+ $tpl->set( 'lastmod', false );
$tpl->set( 'credits', false );
$tpl->set( 'numberofwatchingusers', false );
}
$createaccount_url['class'] = 'link-https'; # FIXME class depends on skin
}
}
-
+
if( $this->showIPinHeader() ) {
$href = &$this->userpageUrlDetails['href'];
return $personal_urls;
}
+ /**
+ * TODO document
+ * @param $title Title
+ * @param $message String message key
+ * @param $selected Bool
+ * @param $query String
+ * @param $checkEdit Bool
+ * @return array
+ */
function tabAction( $title, $message, $selected, $query = '', $checkEdit = false ) {
$classes = array();
if( $selected ) {
/**
* a structured array of links usually used for the tabs in a skin
- *
+ *
* There are 4 standard sections
* namespaces: Used for namespace tabs like special, page, and talk namespaces
* views: Used for primary page views like read, edit, history
* actions: Used for most extra page actions like deletion, protection, etc...
* variants: Used to list the language variants for the page
- *
+ *
* Each section's value is a key/value array of links for that section.
* The links themseves have these common keys:
* - class: The css classes to apply to the tab
* - redundant: If true the tab will be dropped in skins using content_actions
* this is useful for tabs like "Read" which only have meaning in skins that
* take special meaning from the grouped structure of content_navigation
- *
+ *
* Views also have an extra key which can be used:
* - primary: If this is not true skins like vector may try to hide the tab
* when the user has limited space in their browser window
- *
+ *
* content_navigation using code also expects these ids to be present on the
* links, however these are usually automatically generated by SkinTemplate
* itself and are not necessary when using a hook. The only things these may
* - id: A "preferred" id, most skins are best off outputting this preferred id for best compatibility
* - tooltiponly: This is set to true for some tabs in cases where the system
* believes that the accesskey should not be added to the tab.
- *
+ *
* @return array
*/
protected function buildContentNavigationUrls( OutputPage $out ) {
global $wgDisableLangConversion;
wfProfileIn( __METHOD__ );
-
+
$title = $this->getRelevantTitle(); // Display tabs for the relevant title rather than always the title itself
$onPage = $title->equals($this->getTitle());
-
+
$content_navigation = array(
'namespaces' => array(),
'views' => array(),
'href' => $title->getLocalURL( 'action=' . $mode )
);
}
-
+
wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$content_navigation ) );
} else {
// If it's not content, it's got to be a special page
'href' => $wgRequest->getRequestURL(), // @bug 2457, 2510
'context' => 'subject'
);
-
+
wfRunHooks( 'SkinTemplateNavigation::SpecialPage', array( &$this, &$content_navigation ) );
}
$link['id'] = $xmlID;
}
}
-
+
# We don't want to give the watch tab an accesskey if the
# page is being edited, because that conflicts with the
# accesskey on the watch checkbox. We also don't want to
$content_navigation['actions']['unwatch']['tooltiponly'] = true;
}
}
-
+
wfProfileOut( __METHOD__ );
return $content_navigation;
// content_actions has been replaced with content_navigation for backwards
// compatibility and also for skins that just want simple tabs content_actions
// is now built by flattening the content_navigation arrays into one
-
+
$content_actions = array();
-
+
foreach ( $content_navigation as $links ) {
-
+
foreach ( $links as $key => $value ) {
-
+
if ( isset($value["redundant"]) && $value["redundant"] ) {
// Redundant tabs are dropped from content_actions
continue;
}
-
+
// content_actions used to have ids built using the "ca-$key" pattern
// so the xmlID based id is much closer to the actual $key that we want
// for that reason we'll just strip out the ca- if present and use
if ( isset($value["id"]) && substr($value["id"], 0, 3) == "ca-" ) {
$key = substr($value["id"], 3);
}
-
+
if ( isset($content_actions[$key]) ) {
wfDebug( __METHOD__ . ": Found a duplicate key for $key while flattening content_navigation into content_actions." );
continue;
}
-
+
$content_actions[$key] = $value;
-
+
}
-
+
}
-
+
wfProfileOut( __METHOD__ );
-
+
return $content_actions;
}
} else {
$id = 0;
$ip = false;
+ $rootUser = null;
}
if( $id || $ip ) { # both anons and non-anons have contribs list