/**
  * Prevent editing of unknown pages in Translations namespace.
  * Hook: getUserPermissionsErrorsExpensive
  */
 public static function preventUnknownTranslations(Title $title, User $user, $action, &$result)
 {
     $handle = new MessageHandle($title);
     if ($handle->isPageTranslation() && $action === 'edit') {
         if (!$handle->isValid()) {
             $result = array('tpt-unknown-page');
             return false;
         }
     }
     return true;
 }
예제 #2
0
 public static function preventCategorization($updater)
 {
     $handle = new MessageHandle($updater->getTitle());
     if ($handle->isPageTranslation() && !$handle->isDoc()) {
         $updater->mCategories = array();
     }
     return true;
 }