- function getDistantTemplates() {
- global $wgEnableInterwikiTemplatesTracking;
- if ( !$wgEnableInterwikiTemplatesTracking ) {
- return array( );
- }
- if ( $this->preview || $this->section != '' ) {
- $templates = array();
- if ( !isset( $this->mParserOutput ) ) return $templates;
- $templatesList = $this->mParserOutput->getDistantTemplates();
- foreach( $templatesList as $prefix => $templatesbyns ) {
- foreach( $templatesbyns as $ns => $template ) {
- foreach( array_keys( $template ) as $dbk ) {
- $templates[] = Title::makeTitle( $ns, $dbk, null, $prefix );
- }
- }
- }
- return $templates;
- } else {
- return $this->mArticle->getUsedDistantTemplates();
- }
- }
-