* - 'no-change': don't update the article count, ever
*/
public function doEditUpdates( Revision $revision, User $user, array $options = array() ) {
- global $wgRCWatchCategoryMembership;
+ global $wgRCWatchCategoryMembership, $wgContLang;
$options += array(
'changed' => true,
}
MessageCache::singleton()->replace( $shortTitle, $msgtext );
+
+ if ( $wgContLang->hasVariants() ) {
+ $wgContLang->updateConversionTable( $this->mTitle );
+ }
}
if ( $options['created'] ) {
* @param Title $title
*/
public static function onArticleDelete( Title $title ) {
+ global $wgContLang;
+
// Update existence markers on article/talk tabs...
$other = $title->getOtherPage();
// Messages
if ( $title->getNamespace() == NS_MEDIAWIKI ) {
MessageCache::singleton()->replace( $title->getDBkey(), false );
+
+ if ( $wgContLang->hasVariants() ) {
+ $wgContLang->updateConversionTable( $title );
+ }
}
// Images
function translate( $text, $variant ) {
return $text;
}
+
+ public function updateConversionTable( Title $title ) {
+ }
}
return $this->mConverter->getParsedTitle();
}
+ /**
+ * Refresh the cache of conversion tables when
+ * MediaWiki:Conversiontable* is updated.
+ *
+ * @param Title $titleobj The Title of the page being updated
+ */
+ public function updateConversionTable( Title $title ) {
+ $this->mConverter->updateConversionTable( $title );
+ }
+
/**
* Prepare external link text for conversion. When the text is
* a URL, it shouldn't be converted, and it'll be wrapped in
}
/**
- * Hook to refresh the cache of conversion tables when
+ * Refresh the cache of conversion tables when
* MediaWiki:Conversiontable* is updated.
- * @private
*
- * @param WikiPage $page
- * @param User $user User object for the current user
- * @param Content $content New page content
- * @param string $summary Edit summary of the edit
- * @param bool $isMinor Was the edit marked as minor?
- * @param null $isWatch Unused.
- * @param null $section Unused.
- * @param int $flags Bitfield
- * @param Revision|null $revision New Revision object or null
- * @return bool True
+ * @param Title $titleobj The Title of the page being updated
*/
- function OnPageContentSaveComplete( $page, $user, $content, $summary, $isMinor,
- $isWatch, $section, $flags, $revision ) {
- $titleobj = $page->getTitle();
+ public function updateConversionTable( Title $titleobj ) {
if ( $titleobj->getNamespace() == NS_MEDIAWIKI ) {
$title = $titleobj->getDBkey();
$t = explode( '/', $title, 3 );
}
}
}
- return true;
}
/**
*/
class LanguageGan extends LanguageZh {
function __construct() {
- global $wgHooks;
parent::__construct();
$variants = array( 'gan', 'gan-hans', 'gan-hant' );
$variants, $variantfallbacks,
array(),
$ml );
-
- $wgHooks['PageContentSaveComplete'][] = $this->mConverter;
}
/**
*/
class LanguageIu extends Language {
function __construct() {
- global $wgHooks;
-
parent::__construct();
$variants = array( 'iu', 'ike-cans', 'ike-latn' );
$flags = array();
$this->mConverter = new IuConverter( $this, 'iu', $variants, $variantfallbacks, $flags );
- $wgHooks['PageContentSaveComplete'][] = $this->mConverter;
}
}
*/
class LanguageKk extends LanguageKk_cyrl {
function __construct() {
- global $wgHooks;
parent::__construct();
$variants = array( 'kk', 'kk-cyrl', 'kk-latn', 'kk-arab', 'kk-kz', 'kk-tr', 'kk-cn' );
);
$this->mConverter = new KkConverter( $this, 'kk', $variants, $variantfallbacks );
-
- $wgHooks['PageContentSaveComplete'][] = $this->mConverter;
}
/**
class LanguageKu extends LanguageKu_ku {
function __construct() {
- global $wgHooks;
parent::__construct();
$variants = array( 'ku', 'ku-arab', 'ku-latn' );
);
$this->mConverter = new KuConverter( $this, 'ku', $variants, $variantfallbacks );
- $wgHooks['PageContentSaveComplete'][] = $this->mConverter;
}
}
*/
class LanguageShi extends Language {
function __construct() {
- global $wgHooks;
-
parent::__construct();
$variants = array( 'shi', 'shi-tfng', 'shi-latn' );
$flags = array();
$this->mConverter = new ShiConverter( $this, 'shi', $variants, $variantfallbacks, $flags );
- $wgHooks['PageContentSaveComplete'][] = $this->mConverter;
}
}
*/
class LanguageSr extends Language {
function __construct() {
- global $wgHooks;
-
parent::__construct();
$variants = array( 'sr', 'sr-ec', 'sr-el' );
'W' => 'W', 'реч' => 'W', 'reč' => 'W', 'ријеч' => 'W', 'riječ' => 'W'
);
$this->mConverter = new SrConverter( $this, 'sr', $variants, $variantfallbacks, $flags );
- $wgHooks['PageContentSaveComplete'][] = $this->mConverter;
}
}
*/
class LanguageUz extends Language {
function __construct() {
- global $wgHooks;
parent::__construct();
$variants = array( 'uz', 'uz-latn', 'uz-cyrl' );
);
$this->mConverter = new UzConverter( $this, 'uz', $variants, $variantfallbacks );
- $wgHooks['PageContentSaveComplete'][] = $this->mConverter;
}
}
*/
class LanguageZh extends LanguageZh_hans {
function __construct() {
- global $wgHooks;
-
parent::__construct();
$variants = array(
$variants, $variantfallbacks,
array(),
$ml );
-
- $wgHooks['PageContentSaveComplete'][] = $this->mConverter;
}
/**