return $language_urls;
}
- /**
- * initialize various variables and generate the template
- *
- * @param $out OutputPage
- */
- function outputPage( OutputPage $out = null ) {
- global $wgContLang;
- global $wgScript, $wgStylePath;
- global $wgMimeType, $wgJsMimeType;
- global $wgXhtmlNamespaces, $wgHtml5Version;
- global $wgDisableCounters, $wgSitename, $wgLogo;
- global $wgMaxCredits, $wgShowCreditsIfMax;
- global $wgPageShowWatchingUsers;
- global $wgArticlePath, $wgScriptPath, $wgServer;
-
+ protected function setupTemplateForOutput() {
wfProfileIn( __METHOD__ );
- Profiler::instance()->setTemplated( true );
- $oldContext = null;
- if ( $out !== null ) {
- // @todo Add wfDeprecated in 1.20
- $oldContext = $this->getContext();
- $this->setContext( $out->getContext() );
- }
-
- $out = $this->getOutput();
$request = $this->getRequest();
$user = $this->getUser();
$title = $this->getTitle();
wfProfileIn( __METHOD__ . '-init' );
- $this->initPage( $out );
-
$tpl = $this->setupTemplate( $this->template, 'skins' );
wfProfileOut( __METHOD__ . '-init' );
wfProfileOut( __METHOD__ . '-stuff' );
+ wfProfileOut( __METHOD__ );
+
+ return $tpl;
+ }
+
+ /**
+ * initialize various variables and generate the template
+ *
+ * @param $out OutputPage
+ */
+ function outputPage( OutputPage $out = null ) {
+ global $wgContLang;
+ global $wgScript, $wgStylePath;
+ global $wgMimeType, $wgJsMimeType;
+ global $wgXhtmlNamespaces, $wgHtml5Version;
+ global $wgDisableCounters, $wgSitename, $wgLogo;
+ global $wgMaxCredits, $wgShowCreditsIfMax;
+ global $wgPageShowWatchingUsers;
+ global $wgArticlePath, $wgScriptPath, $wgServer;
+
+ wfProfileIn( __METHOD__ );
+ Profiler::instance()->setTemplated( true );
+
+ $oldContext = null;
+ if ( $out !== null ) {
+ // @todo Add wfDeprecated in 1.20
+ $oldContext = $this->getContext();
+ $this->setContext( $out->getContext() );
+ }
+
+ $out = $this->getOutput();
+ $request = $this->getRequest();
+ $user = $this->getUser();
+ $title = $this->getTitle();
+
+ wfProfileIn( __METHOD__ . '-init' );
+ $this->initPage( $out );
+ wfProfileOut( __METHOD__ . '-init' );
+
+ $tpl = $this->setupTemplateForOutput();
+
wfProfileIn( __METHOD__ . '-stuff-head' );
if ( !$this->useHeadElement ) {
$tpl->set( 'pagecss', false );
wfProfileOut( __METHOD__ );
}
+ /**
+ * Get the HTML for the p-personal list
+ * @return string
+ */
+ public function getPersonalToolsList() {
+ $tpl = $this->setupTemplateForOutput();
+ $tpl->set( 'personal_urls', $this->buildPersonalUrls() );
+ $html = '';
+ foreach ( $tpl->getPersonalTools() as $key => $item ) {
+ $html .= $tpl->makeListItem( $key, $item );
+ }
+ return $html;
+ }
+
/**
* Format language name for use in sidebar interlanguage links list.
* By default it is capitalized.
$params = $this->extractRequestParams();
$forceLinkUpdate = $params['forcelinkupdate'];
+ $forceRecursiveLinkUpdate = $params['forcerecursivelinkupdate'];
$pageSet = $this->getPageSet();
$pageSet->execute();
$page->doPurge(); // Directly purge and skip the UI part of purge().
$r['purged'] = '';
- if ( $forceLinkUpdate ) {
+ if ( $forceLinkUpdate || $forceRecursiveLinkUpdate ) {
if ( !$this->getUser()->pingLimiter() ) {
global $wgEnableParserCache;
$p_result = $content->getParserOutput( $title, $page->getLatest(), $popts, $wgEnableParserCache );
# Update the links tables
- $updates = $content->getSecondaryDataUpdates( $title, null, true, $p_result );
+ $updates = $content->getSecondaryDataUpdates(
+ $title, null, $forceRecursiveLinkUpdate, $p_result );
DataUpdate::runUpdates( $updates );
$r['linkupdate'] = '';
}
public function getAllowedParams( $flags = 0 ) {
- $result = array( 'forcelinkupdate' => false );
+ $result = array(
+ 'forcelinkupdate' => false,
+ 'forcerecursivelinkupdate' => false
+ );
if ( $flags ) {
$result += $this->getPageSet()->getFinalParams( $flags );
}
public function getParamDescription() {
return $this->getPageSet()->getFinalParamDescription()
- + array( 'forcelinkupdate' => 'Update the links tables' );
+ + array(
+ 'forcelinkupdate' => 'Update the links tables',
+ 'forcerecursivelinkupdate' => 'Update the links table, and update ' .
+ 'the links tables for any page that uses this page as a template',
+ );
}
public function getResultProperties() {