From: Antoine Musso Date: Sun, 12 Feb 2012 19:25:28 +0000 (+0000) Subject: revert r111234 (deprecated methods removal) X-Git-Tag: 1.31.0-rc.0~24750 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=d5d15859007ea6390a8a44db7864f151943cb410;p=lhc%2Fweb%2Fwiklou.git revert r111234 (deprecated methods removal) Reasons invoked by Rob Lanphier are: * ongoing code slush * backwards compatilibility issues --- diff --git a/includes/FakeTitle.php b/includes/FakeTitle.php index 38455d660f..8415ec08bd 100644 --- a/includes/FakeTitle.php +++ b/includes/FakeTitle.php @@ -46,6 +46,7 @@ class FakeTitle extends Title { function isNamespaceProtected( User $user ) { $this->error(); } function userCan( $action, $user = null, $doExpensiveQueries = true ) { $this->error(); } function getUserPermissionsErrors( $action, $user, $doExpensiveQueries = true, $ignoreErrors = array() ) { $this->error(); } + function updateTitleProtection( $create_perm, $reason, $expiry ) { $this->error(); } function deleteTitleProtection() { $this->error(); } function isMovable() { $this->error(); } function userCanRead() { $this->error(); } @@ -58,6 +59,9 @@ class FakeTitle extends Title { function getSkinFromCssJsSubpage() { $this->error(); } function isCssSubpage() { $this->error(); } function isJsSubpage() { $this->error(); } + function userCanEditCssJsSubpage() { $this->error(); } + function userCanEditCssSubpage() { $this->error(); } + function userCanEditJsSubpage() { $this->error(); } function isCascadeProtected() { $this->error(); } function getCascadeProtectionSources( $get_pages = true ) { $this->error(); } function areRestrictionsCascading() { $this->error(); } diff --git a/includes/Preferences.php b/includes/Preferences.php index 08bcab896a..3fe6a8cc0e 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -1461,6 +1461,27 @@ class Preferences { return array( true, $info ); } + + /** + * @deprecated in 1.19; will be removed in 1.20. + * @param $user User + * @return array + */ + public static function loadOldSearchNs( $user ) { + wfDeprecated( __METHOD__, '1.19' ); + + $searchableNamespaces = SearchEngine::searchableNamespaces(); + // Back compat with old format + $arr = array(); + + foreach ( $searchableNamespaces as $ns => $name ) { + if ( $user->getOption( 'searchNs' . $ns ) ) { + $arr[] = $ns; + } + } + + return $arr; + } } /** Some tweaks to allow js prefs to work */ diff --git a/includes/Title.php b/includes/Title.php index 14f90d5b59..0ef4cda26b 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2128,6 +2128,34 @@ class Title { return $errors; } + /** + * Protect css subpages of user pages: can $wgUser edit + * this page? + * + * @deprecated in 1.19; will be removed in 1.20. Use getUserPermissionsErrors() instead. + * @return Bool + */ + public function userCanEditCssSubpage() { + global $wgUser; + wfDeprecated( __METHOD__, '1.19' ); + return ( ( $wgUser->isAllowedAll( 'editusercssjs', 'editusercss' ) ) + || preg_match( '/^' . preg_quote( $wgUser->getName(), '/' ) . '\//', $this->mTextform ) ); + } + + /** + * Protect js subpages of user pages: can $wgUser edit + * this page? + * + * @deprecated in 1.19; will be removed in 1.20. Use getUserPermissionsErrors() instead. + * @return Bool + */ + public function userCanEditJsSubpage() { + global $wgUser; + wfDeprecated( __METHOD__, '1.19' ); + return ( ( $wgUser->isAllowedAll( 'editusercssjs', 'edituserjs' ) ) + || preg_match( '/^' . preg_quote( $wgUser->getName(), '/' ) . '\//', $this->mTextform ) ); + } + /** * Get a filtered list of all restriction types supported by this wiki. * @param bool $exists True to get all restriction types that apply to @@ -2203,6 +2231,29 @@ class Title { return $this->mTitleProtection; } + /** + * Update the title protection status + * + * @deprecated in 1.19; will be removed in 1.20. Use WikiPage::doUpdateRestrictions() instead. + * @param $create_perm String Permission required for creation + * @param $reason String Reason for protection + * @param $expiry String Expiry timestamp + * @return boolean true + */ + public function updateTitleProtection( $create_perm, $reason, $expiry ) { + wfDeprecated( __METHOD__, '1.19' ); + + global $wgUser; + + $limit = array( 'create' => $create_perm ); + $expiry = array( 'create' => $expiry ); + + $page = WikiPage::factory( $this ); + $status = $page->doUpdateRestrictions( $limit, $expiry, false, $reason, $wgUser ); + + return $status->isOK(); + } + /** * Remove any title protection due to page existing */ diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index ba5dc7e900..bf9611f365 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -278,6 +278,9 @@ class ParserOptions { function setNumberHeadings( $x ) { return wfSetVar( $this->mNumberHeadings, $x ); } function setAllowSpecialInclusion( $x ) { return wfSetVar( $this->mAllowSpecialInclusion, $x ); } function setTidy( $x ) { return wfSetVar( $this->mTidy, $x ); } + + /** @deprecated in 1.19; will be removed in 1.20 */ + function setSkin( $x ) { wfDeprecated( __METHOD__, '1.19' ); } function setInterfaceMessage( $x ) { return wfSetVar( $this->mInterfaceMessage, $x ); } function setTargetLanguage( $x ) { return wfSetVar( $this->mTargetLanguage, $x, true ); } function setMaxIncludeSize( $x ) { return wfSetVar( $this->mMaxIncludeSize, $x ); }