Index: trunk/phase3/includes/parser/ParserOptions.php |
— | — | @@ -278,6 +278,9 @@ |
279 | 279 | function setNumberHeadings( $x ) { return wfSetVar( $this->mNumberHeadings, $x ); } |
280 | 280 | function setAllowSpecialInclusion( $x ) { return wfSetVar( $this->mAllowSpecialInclusion, $x ); } |
281 | 281 | function setTidy( $x ) { return wfSetVar( $this->mTidy, $x ); } |
| 282 | + |
| 283 | + /** @deprecated in 1.19; will be removed in 1.20 */ |
| 284 | + function setSkin( $x ) { wfDeprecated( __METHOD__, '1.19' ); } |
282 | 285 | function setInterfaceMessage( $x ) { return wfSetVar( $this->mInterfaceMessage, $x ); } |
283 | 286 | function setTargetLanguage( $x ) { return wfSetVar( $this->mTargetLanguage, $x, true ); } |
284 | 287 | function setMaxIncludeSize( $x ) { return wfSetVar( $this->mMaxIncludeSize, $x ); } |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -2129,6 +2129,34 @@ |
2130 | 2130 | } |
2131 | 2131 | |
2132 | 2132 | /** |
| 2133 | + * Protect css subpages of user pages: can $wgUser edit |
| 2134 | + * this page? |
| 2135 | + * |
| 2136 | + * @deprecated in 1.19; will be removed in 1.20. Use getUserPermissionsErrors() instead. |
| 2137 | + * @return Bool |
| 2138 | + */ |
| 2139 | + public function userCanEditCssSubpage() { |
| 2140 | + global $wgUser; |
| 2141 | + wfDeprecated( __METHOD__, '1.19' ); |
| 2142 | + return ( ( $wgUser->isAllowedAll( 'editusercssjs', 'editusercss' ) ) |
| 2143 | + || preg_match( '/^' . preg_quote( $wgUser->getName(), '/' ) . '\//', $this->mTextform ) ); |
| 2144 | + } |
| 2145 | + |
| 2146 | + /** |
| 2147 | + * Protect js subpages of user pages: can $wgUser edit |
| 2148 | + * this page? |
| 2149 | + * |
| 2150 | + * @deprecated in 1.19; will be removed in 1.20. Use getUserPermissionsErrors() instead. |
| 2151 | + * @return Bool |
| 2152 | + */ |
| 2153 | + public function userCanEditJsSubpage() { |
| 2154 | + global $wgUser; |
| 2155 | + wfDeprecated( __METHOD__, '1.19' ); |
| 2156 | + return ( ( $wgUser->isAllowedAll( 'editusercssjs', 'edituserjs' ) ) |
| 2157 | + || preg_match( '/^' . preg_quote( $wgUser->getName(), '/' ) . '\//', $this->mTextform ) ); |
| 2158 | + } |
| 2159 | + |
| 2160 | + /** |
2133 | 2161 | * Get a filtered list of all restriction types supported by this wiki. |
2134 | 2162 | * @param bool $exists True to get all restriction types that apply to |
2135 | 2163 | * titles that do exist, False for all restriction types that apply to |
— | — | @@ -2204,6 +2232,29 @@ |
2205 | 2233 | } |
2206 | 2234 | |
2207 | 2235 | /** |
| 2236 | + * Update the title protection status |
| 2237 | + * |
| 2238 | + * @deprecated in 1.19; will be removed in 1.20. Use WikiPage::doUpdateRestrictions() instead. |
| 2239 | + * @param $create_perm String Permission required for creation |
| 2240 | + * @param $reason String Reason for protection |
| 2241 | + * @param $expiry String Expiry timestamp |
| 2242 | + * @return boolean true |
| 2243 | + */ |
| 2244 | + public function updateTitleProtection( $create_perm, $reason, $expiry ) { |
| 2245 | + wfDeprecated( __METHOD__, '1.19' ); |
| 2246 | + |
| 2247 | + global $wgUser; |
| 2248 | + |
| 2249 | + $limit = array( 'create' => $create_perm ); |
| 2250 | + $expiry = array( 'create' => $expiry ); |
| 2251 | + |
| 2252 | + $page = WikiPage::factory( $this ); |
| 2253 | + $status = $page->doUpdateRestrictions( $limit, $expiry, false, $reason, $wgUser ); |
| 2254 | + |
| 2255 | + return $status->isOK(); |
| 2256 | + } |
| 2257 | + |
| 2258 | + /** |
2208 | 2259 | * Remove any title protection due to page existing |
2209 | 2260 | */ |
2210 | 2261 | public function deleteTitleProtection() { |
Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -1461,6 +1461,27 @@ |
1462 | 1462 | |
1463 | 1463 | return array( true, $info ); |
1464 | 1464 | } |
| 1465 | + |
| 1466 | + /** |
| 1467 | + * @deprecated in 1.19; will be removed in 1.20. |
| 1468 | + * @param $user User |
| 1469 | + * @return array |
| 1470 | + */ |
| 1471 | + public static function loadOldSearchNs( $user ) { |
| 1472 | + wfDeprecated( __METHOD__, '1.19' ); |
| 1473 | + |
| 1474 | + $searchableNamespaces = SearchEngine::searchableNamespaces(); |
| 1475 | + // Back compat with old format |
| 1476 | + $arr = array(); |
| 1477 | + |
| 1478 | + foreach ( $searchableNamespaces as $ns => $name ) { |
| 1479 | + if ( $user->getOption( 'searchNs' . $ns ) ) { |
| 1480 | + $arr[] = $ns; |
| 1481 | + } |
| 1482 | + } |
| 1483 | + |
| 1484 | + return $arr; |
| 1485 | + } |
1465 | 1486 | } |
1466 | 1487 | |
1467 | 1488 | /** Some tweaks to allow js prefs to work */ |
Index: trunk/phase3/includes/FakeTitle.php |
— | — | @@ -46,6 +46,7 @@ |
47 | 47 | function isNamespaceProtected( User $user ) { $this->error(); } |
48 | 48 | function userCan( $action, $user = null, $doExpensiveQueries = true ) { $this->error(); } |
49 | 49 | function getUserPermissionsErrors( $action, $user, $doExpensiveQueries = true, $ignoreErrors = array() ) { $this->error(); } |
| 50 | + function updateTitleProtection( $create_perm, $reason, $expiry ) { $this->error(); } |
50 | 51 | function deleteTitleProtection() { $this->error(); } |
51 | 52 | function isMovable() { $this->error(); } |
52 | 53 | function userCanRead() { $this->error(); } |
— | — | @@ -58,6 +59,9 @@ |
59 | 60 | function getSkinFromCssJsSubpage() { $this->error(); } |
60 | 61 | function isCssSubpage() { $this->error(); } |
61 | 62 | function isJsSubpage() { $this->error(); } |
| 63 | + function userCanEditCssJsSubpage() { $this->error(); } |
| 64 | + function userCanEditCssSubpage() { $this->error(); } |
| 65 | + function userCanEditJsSubpage() { $this->error(); } |
62 | 66 | function isCascadeProtected() { $this->error(); } |
63 | 67 | function getCascadeProtectionSources( $get_pages = true ) { $this->error(); } |
64 | 68 | function areRestrictionsCascading() { $this->error(); } |