Index: trunk/extensions/RandomImageByCategory/RandomImageByCategory.php |
— | — | @@ -0,0 +1,120 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * RandomImageByCategory extension |
| 5 | + * Usage example: <randomimagebycategory width="200" categories="Featured Image"/> |
| 6 | + * Supported parameters: width, limit, categories |
| 7 | + * |
| 8 | + * @file |
| 9 | + * @ingroup Extensions |
| 10 | + * @author Aaron Wright <aaron.wright@gmail.com> |
| 11 | + * @author David Pean <david.pean@gmail.com> |
| 12 | + * @author Jack Phoenix <jack@countervandalism.net> |
| 13 | + * @version 1.0 |
| 14 | + * @link http://www.mediawiki.org/wiki/Extension:RandomImageByCategory Documentation |
| 15 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 16 | + */ |
| 17 | + |
| 18 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 19 | + die( "Not a valid entry point.\n" ); |
| 20 | +} |
| 21 | + |
| 22 | +// Extension credits that will show up on Special:Version |
| 23 | +$wgExtensionCredits['parserhook'][] = array( |
| 24 | + 'name' => 'RandomImageByCategory', |
| 25 | + 'version' => '1.0', |
| 26 | + 'author' => array( 'Aaron Wright', 'David Pean', 'Jack Phoenix' ), |
| 27 | + 'description' => 'Displays a random image from a given category', |
| 28 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:RandomImageByCategory', |
| 29 | +); |
| 30 | + |
| 31 | +$wgHooks['ParserFirstCallInit'][] = 'wfRandomImageByCategory'; |
| 32 | + |
| 33 | +function wfRandomImageByCategory( &$parser ) { |
| 34 | + $parser->setHook( 'randomimagebycategory', 'getRandomImage' ); |
| 35 | + return true; |
| 36 | +} |
| 37 | + |
| 38 | +function getRandomImage( $input, $args, $parser ) { |
| 39 | + global $wgOut, $wgMemc; |
| 40 | + |
| 41 | + wfProfileIn( __METHOD__ ); |
| 42 | + |
| 43 | + $parser->disableCache(); |
| 44 | + |
| 45 | + $categories = ( isset( $args['categories'] ) ) ? trim( $args['categories'] ) : ''; |
| 46 | + |
| 47 | + if ( isset( $args['limit'] ) && is_numeric( $args['limit'] ) ) { |
| 48 | + $limit = $args['limit']; |
| 49 | + } else { |
| 50 | + $limit = 10; |
| 51 | + } |
| 52 | + |
| 53 | + if ( isset( $args['width'] ) && is_numeric( $args['width'] ) ) { |
| 54 | + $width = $args['width']; |
| 55 | + } else { |
| 56 | + $width = 200; |
| 57 | + } |
| 58 | + |
| 59 | + $key = wfMemcKey( 'image', 'random', $limit, str_replace( ' ', '', $categories ) ); |
| 60 | + $data = $wgMemc->get( $key ); |
| 61 | + $image_list = array(); |
| 62 | + if( !$data ) { |
| 63 | + wfDebug( "Getting random image list from DB\n" ); |
| 64 | + $p = new Parser(); |
| 65 | + $ctg = $p->transformMsg( $categories, $wgOut->parserOptions() ); |
| 66 | + $ctg = str_replace( "\,", '#comma#', $ctg ); |
| 67 | + $aCat = explode( ',', $ctg ); |
| 68 | + |
| 69 | + $category_match = array(); |
| 70 | + foreach( $aCat as $sCat ) { |
| 71 | + if( $sCat != '' ) { |
| 72 | + $category_match[] = Title::newFromText( trim( str_replace( '#comma#', ',', $sCat ) ) )->getDBkey(); |
| 73 | + } |
| 74 | + } |
| 75 | + |
| 76 | + if( count( $category_match ) == 0 ) { |
| 77 | + return ''; |
| 78 | + } |
| 79 | + |
| 80 | + $params['ORDER BY'] = 'page_id'; |
| 81 | + if( !empty( $limit ) ) { |
| 82 | + $params['LIMIT'] = $limit; |
| 83 | + } |
| 84 | + |
| 85 | + $dbr = wfGetDB( DB_SLAVE ); |
| 86 | + $res = $dbr->select( |
| 87 | + array( 'page', 'categorylinks' ), |
| 88 | + array( 'page_title' ), |
| 89 | + array( 'cl_to' => $category_match, 'page_namespace' => NS_FILE ), |
| 90 | + __METHOD__, |
| 91 | + $params, |
| 92 | + array( 'categorylinks' => array( 'INNER JOIN', 'cl_from=page_id' ) ) |
| 93 | + ); |
| 94 | + $image_list = array(); |
| 95 | + foreach ( $res as $row ) { |
| 96 | + $image_list[] = $row->page_title; |
| 97 | + } |
| 98 | + $wgMemc->set( $key, $image_list, 60 * 15 ); |
| 99 | + } else { |
| 100 | + $image_list = $data; |
| 101 | + wfDebug( "Cache hit for random image list\n" ); |
| 102 | + } |
| 103 | + |
| 104 | + $random_image = ''; |
| 105 | + $thumbnail = ''; |
| 106 | + if( count( $image_list ) > 1 ) { |
| 107 | + $random_image = $image_list[ array_rand( $image_list, 1 ) ]; |
| 108 | + } |
| 109 | + |
| 110 | + if( $random_image ) { |
| 111 | + $image_title = Title::makeTitle( NS_FILE, $random_image ); |
| 112 | + $render_image = wfFindFile( $random_image ); |
| 113 | + |
| 114 | + $thumb_image = $render_image->getThumbnail( $width ); |
| 115 | + $thumbnail = "<a href=\"{$image_title->escapeFullURL()}\">{$thumb_image->toHtml()}</a>"; |
| 116 | + } |
| 117 | + |
| 118 | + wfProfileOut( __METHOD__ ); |
| 119 | + |
| 120 | + return $thumbnail; |
| 121 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/RandomImageByCategory/RandomImageByCategory.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 122 | + native |
Index: trunk/extensions/ProtectSite/ProtectSite.alias.php |
— | — | @@ -0,0 +1,19 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Aliases for ProtectSite extension. |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
| 8 | + */ |
| 9 | + |
| 10 | +$aliases = array(); |
| 11 | + |
| 12 | +/** English */ |
| 13 | +$aliases['en'] = array( |
| 14 | + 'ProtectSite' => array( 'ProtectSite' ), |
| 15 | +); |
| 16 | + |
| 17 | +/** Finnish (Suomi) */ |
| 18 | +$aliases['fi'] = array( |
| 19 | + 'ProtectSite' => array( 'SuojaaSivusto', 'Suojaa sivusto' ), |
| 20 | +); |
\ No newline at end of file |
Property changes on: trunk/extensions/ProtectSite/ProtectSite.alias.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 21 | + native |
Index: trunk/extensions/ProtectSite/ProtectSite.body.php |
— | — | @@ -0,0 +1,314 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Two classes for providing Special:ProtectSite page. |
| 5 | + * @file |
| 6 | + * @ingroup Extensions |
| 7 | + */ |
| 8 | + |
| 9 | +class ProtectSite extends SpecialPage { |
| 10 | + |
| 11 | + /** |
| 12 | + * Constructor |
| 13 | + */ |
| 14 | + public function __construct() { |
| 15 | + parent::__construct( 'ProtectSite'/*class*/, 'protectsite'/*restriction*/ ); |
| 16 | + } |
| 17 | + |
| 18 | + /** |
| 19 | + * Show the special page |
| 20 | + * |
| 21 | + * @param $par Mixed: parameter passed to the page or null |
| 22 | + */ |
| 23 | + public function execute( $par ) { |
| 24 | + global $wgOut, $wgUser, $wgRequest; |
| 25 | + |
| 26 | + # If the user doesn't have 'protectsite' permission, display an error |
| 27 | + if ( !$wgUser->isAllowed( 'protectsite' ) ) { |
| 28 | + $this->displayRestrictionError(); |
| 29 | + return; |
| 30 | + } |
| 31 | + |
| 32 | + # Show a message if the database is in read-only mode |
| 33 | + if ( wfReadOnly() ) { |
| 34 | + $wgOut->readOnlyPage(); |
| 35 | + return; |
| 36 | + } |
| 37 | + |
| 38 | + # If user is blocked, s/he doesn't need to access this page |
| 39 | + if ( $wgUser->isBlocked() ) { |
| 40 | + $wgOut->blockedPage(); |
| 41 | + return; |
| 42 | + } |
| 43 | + |
| 44 | + wfLoadExtensionMessages( 'ProtectSite' ); |
| 45 | + $this->setHeaders(); |
| 46 | + |
| 47 | + $form = new ProtectsiteForm( $wgRequest ); |
| 48 | + } |
| 49 | + |
| 50 | +} |
| 51 | + |
| 52 | +/** |
| 53 | + * Class that handles the actual Special:ProtectSite page |
| 54 | + * This is a modified version of the old HTMLForm class. |
| 55 | + */ |
| 56 | +class ProtectsiteForm { |
| 57 | + var $mRequest, $action, $persist_data; |
| 58 | + |
| 59 | + /* Constructor */ |
| 60 | + function __construct( &$request ) { |
| 61 | + global $wgMessageCache, $wgMemc; |
| 62 | + |
| 63 | + if( !class_exists( 'BagOStuff' ) || !class_exists( 'MediaWikiBagOStuff' ) ) { |
| 64 | + global $IP; |
| 65 | + require_once( $IP . '/includes/BagOStuff.php' ); |
| 66 | + } |
| 67 | + $titleObj = SpecialPage::getTitleFor( 'ProtectSite' ); |
| 68 | + $this->action = $titleObj->escapeLocalURL(); |
| 69 | + $this->mRequest =& $request; |
| 70 | + $this->persist_data = new MediaWikiBagOStuff(); |
| 71 | + |
| 72 | + /** |
| 73 | + * These are dynamically created here because they don't need to vary |
| 74 | + * from the common messages and they save on the total count. |
| 75 | + */ |
| 76 | + $wgMessageCache->addMessages( |
| 77 | + array( |
| 78 | + 'protectsite-createaccount-0' => wfMsg( 'protectsite-allowall' ), |
| 79 | + 'protectsite-createaccount-1' => wfMsg( 'protectsite-allowusersysop' ), |
| 80 | + 'protectsite-createaccount-2' => wfMsg( 'protectsite-allowsysop' ), |
| 81 | + 'protectsite-createpage-0' => wfMsg( 'protectsite-allowall' ), |
| 82 | + 'protectsite-createpage-1' => wfMsg( 'protectsite-allowusersysop' ), |
| 83 | + 'protectsite-createpage-2' => wfMsg( 'protectsite-allowsysop' ), |
| 84 | + 'protectsite-edit-0' => wfMsg( 'protectsite-allowall' ), |
| 85 | + 'protectsite-edit-1' => wfMsg( 'protectsite-allowusersysop' ), |
| 86 | + 'protectsite-edit-2' => wfMsg( 'protectsite-allowsysop' ), |
| 87 | + 'protectsite-move-0' => wfMsg( 'protectsite-allowusersysop' ), |
| 88 | + 'protectsite-move-1' => wfMsg( 'protectsite-allowsysop' ), |
| 89 | + 'protectsite-upload-0' => wfMsg( 'protectsite-allowusersysop' ), |
| 90 | + 'protectsite-upload-1' => wfMsg( 'protectsite-allowsysop' ) |
| 91 | + ) |
| 92 | + ); |
| 93 | + |
| 94 | + /* Get data into the value variable/array */ |
| 95 | + $prot = $wgMemc->get( wfMemcKey( 'protectsite' ) ); |
| 96 | + if( !$prot ) { |
| 97 | + $prot = $this->persist_data->get( 'protectsite' ); |
| 98 | + } |
| 99 | + |
| 100 | + /* If this was a GET request */ |
| 101 | + if( !$this->mRequest->wasPosted() ) { |
| 102 | + /* If $value is an array, protection is set, allow unsetting */ |
| 103 | + if( is_array( $prot ) ) { |
| 104 | + $this->unProtectsiteForm( $prot ); |
| 105 | + } else { |
| 106 | + /* If $value is not an array, protection is not set */ |
| 107 | + $this->setProtectsiteForm(); |
| 108 | + } |
| 109 | + } else { |
| 110 | + /* If this was a POST request, process the data sent */ |
| 111 | + if( $this->mRequest->getVal( 'protect' ) ) { |
| 112 | + $this->setProtectsite(); |
| 113 | + } else { |
| 114 | + $this->unProtectsite(); |
| 115 | + } |
| 116 | + } |
| 117 | + } |
| 118 | + |
| 119 | + function setProtectsite() { |
| 120 | + global $wgOut, $wgMemc, $wgProtectsiteLimit; |
| 121 | + |
| 122 | + /* Get the request data */ |
| 123 | + $request = $this->mRequest->getValues(); |
| 124 | + |
| 125 | + /* Check to see if the time limit exceeds the limit. */ |
| 126 | + $curr_time = time(); |
| 127 | + if( |
| 128 | + ( ( $until = strtotime( '+' . $request['timeout'], $curr_time ) ) === false ) || |
| 129 | + ( $until < $curr_time ) |
| 130 | + ) { |
| 131 | + $wgOut->addWikiMsg( 'protectsite-timeout-error' ); |
| 132 | + $this->setProtectsiteForm(); |
| 133 | + } else { |
| 134 | + /* Set the array values */ |
| 135 | + $prot['createaccount'] = $request['createaccount']; |
| 136 | + $prot['createpage'] = $request['createpage']; |
| 137 | + $prot['edit'] = $request['edit']; |
| 138 | + $prot['move'] = $request['move']; |
| 139 | + $prot['upload'] = $request['upload']; |
| 140 | + $prot['comment'] = isset( $request['comment'] ) ? $request['comment'] : ''; |
| 141 | + |
| 142 | + if( isset( $wgProtectsiteLimit ) && |
| 143 | + ( $until > strtotime( '+' . $wgProtectsiteLimit, $curr_time ) ) |
| 144 | + ) { |
| 145 | + $request['timeout'] = $wgProtectsiteLimit; |
| 146 | + } |
| 147 | + |
| 148 | + /* Set the limits */ |
| 149 | + $prot['until'] = strtotime( '+' . $request['timeout'], $curr_time ); |
| 150 | + $prot['timeout'] = $request['timeout']; |
| 151 | + |
| 152 | + /* Write the array out to the database */ |
| 153 | + $this->persist_data->set( 'protectsite', $prot, $prot['until'] ); |
| 154 | + $wgMemc->set( wfMemcKey( 'protectsite' ), $prot, $prot['until'] ); |
| 155 | + |
| 156 | + /* Create a log entry */ |
| 157 | + $log = new LogPage( 'protect' ); |
| 158 | + $log->addEntry( |
| 159 | + 'protect', |
| 160 | + SpecialPage::getTitleFor( 'Allpages' ), |
| 161 | + $prot['timeout'] . |
| 162 | + ( strlen( $prot['comment'] ) > 0 ? '; ' . $prot['comment'] : '' ) |
| 163 | + ); |
| 164 | + |
| 165 | + /* Call the Unprotect Form function to display the current state. */ |
| 166 | + $this->unProtectsiteForm( $prot ); |
| 167 | + } |
| 168 | + } |
| 169 | + |
| 170 | + function unProtectsite() { |
| 171 | + global $wgMemc; |
| 172 | + /* Get the request data */ |
| 173 | + $request = $this->mRequest->getValues(); |
| 174 | + |
| 175 | + /* Remove the data from the database to disable extension. */ |
| 176 | + $this->persist_data->delete( 'protectsite' ); |
| 177 | + $wgMemc->delete( wfMemcKey( 'protectsite' ) ); |
| 178 | + |
| 179 | + /* Create a log entry */ |
| 180 | + $log = new LogPage( 'protect' ); |
| 181 | + $log->addEntry( |
| 182 | + 'unprotect', |
| 183 | + SpecialPage::getTitleFor( 'Allpages' ), |
| 184 | + $request['ucomment'] |
| 185 | + ); |
| 186 | + |
| 187 | + /* Call the Protect Form function to display the current state. */ |
| 188 | + $this->setProtectsiteForm(); |
| 189 | + } |
| 190 | + |
| 191 | + /** |
| 192 | + * @param $name String: name of the fieldset. |
| 193 | + * @param $content String: HTML content to put in. |
| 194 | + * @return string HTML fieldset |
| 195 | + */ |
| 196 | + private function fieldset( $name, $content ) { |
| 197 | + return '<fieldset><legend>' . wfMsg( 'protectsite-' . $name ) . |
| 198 | + "</legend>\n" . $content . "\n</fieldset>\n"; |
| 199 | + } |
| 200 | + |
| 201 | + /** |
| 202 | + * Override the broken function in the HTMLForm class |
| 203 | + * This was fixed in r16320 of the MW source; WM bugzilla bug #7188. |
| 204 | + */ |
| 205 | + private function radiobox( $varname, $fields ) { |
| 206 | + $s = ''; |
| 207 | + foreach( $fields as $value => $checked ) { |
| 208 | + $s .= "<div><label><input type=\"radio\" name=\"{$varname}\" value=\"{$value}\"" . ( $checked ? ' checked="checked"' : '' ) . ' />' |
| 209 | + . wfMsg( 'protectsite-' . $varname . '-' . $value ) . |
| 210 | + "</label></div>\n"; |
| 211 | + } |
| 212 | + |
| 213 | + return $this->fieldset( $varname, $s ); |
| 214 | + } |
| 215 | + |
| 216 | + /** |
| 217 | + * Overridden textbox method, allowing for the inclusion of something |
| 218 | + * after the text box itself. |
| 219 | + */ |
| 220 | + private function textbox( $varname, $value = '', $append = '' ) { |
| 221 | + if( $this->mRequest->wasPosted() ) { |
| 222 | + $value = $this->mRequest->getText( $varname, $value ); |
| 223 | + } |
| 224 | + |
| 225 | + $value = htmlspecialchars( $value ); |
| 226 | + return '<div><label>' . wfMsg( 'protectsite-' . $varname ) . |
| 227 | + "<input type=\"text\" name=\"{$varname}\" value=\"{$value}\" /> " . |
| 228 | + $append . |
| 229 | + "</label></div>\n"; |
| 230 | + } |
| 231 | + |
| 232 | + /* This function outputs the field status. */ |
| 233 | + private function showField( $name, $state ) { |
| 234 | + return '<b>' . wfMsg( 'protectsite-' . $name ) . ' - <i>' . |
| 235 | + '<span style="color: ' . ( ( $state > 0 ) ? 'red' : 'green' ) . '">' . |
| 236 | + wfMsg( 'protectsite-' . $name . '-' . $state ) . '</span>' . |
| 237 | + "</i></b><br />\n"; |
| 238 | + } |
| 239 | + |
| 240 | + function unProtectsiteForm( $prot ) { |
| 241 | + global $wgOut, $wgLang; |
| 242 | + |
| 243 | + /* Construct page data and add to output. */ |
| 244 | + $wgOut->addWikiMsg( 'protectsite-text-unprotect' ); |
| 245 | + $wgOut->addHTML( |
| 246 | + '<form name="unProtectsite" action="' . $this->action . '" method="post">' . "\n" . |
| 247 | + $this->fieldset( 'title', |
| 248 | + $this->showField( 'createaccount', $prot['createaccount'] ) . |
| 249 | + $this->showField( 'createpage', $prot['createpage'] ) . |
| 250 | + $this->showField( 'edit', $prot['edit'] ) . |
| 251 | + $this->showField( 'move', $prot['move'] ) . |
| 252 | + $this->showField( 'upload', $prot['upload'] ) . |
| 253 | + '<b>' . wfMsg( 'protectsite-timeout' ) . ' </b> ' . |
| 254 | + '<i>' . $wgLang->timeAndDate( wfTimestamp( TS_MW, $prot['until'] ), true ) . '</i>' . |
| 255 | + '<br />' . |
| 256 | + ( $prot['comment'] != '' ? |
| 257 | + '<b>' . wfMsg( 'protectsite-comment' ) . ' </b> ' . |
| 258 | + '<i>' . $prot['comment'] . '</i>' . |
| 259 | + '<br />' : '' ) . |
| 260 | + "<br />\n" . |
| 261 | + $this->textbox( 'ucomment' ) . |
| 262 | + '<br />' . |
| 263 | + Xml::element( 'input', array( |
| 264 | + 'type' => 'submit', |
| 265 | + 'name' => 'unprotect', |
| 266 | + 'value' => wfMsg( 'protectsite-unprotect' ) ) |
| 267 | + ) |
| 268 | + ) . |
| 269 | + '</form>' |
| 270 | + ); |
| 271 | + } |
| 272 | + |
| 273 | + function setProtectsiteForm() { |
| 274 | + global $wgOut, $wgProtectsiteDefaultTimeout, $wgProtectsiteLimit; |
| 275 | + |
| 276 | + $request = $this->mRequest->getValues(); |
| 277 | + $createaccount = array( 0 => false, 1 => false, 2 => false ); |
| 278 | + $createaccount[(isset( $request['createaccount'] ) ? $request['createaccount'] : 0)] = true; |
| 279 | + $createpage = array( 0 => false, 1 => false, 2 => false ); |
| 280 | + $createpage[(isset( $request['createpage'] ) ? $request['createpage'] : 0)] = true; |
| 281 | + $edit = array( 0 => false, 1 => false, 2 => false ); |
| 282 | + $edit[(isset( $request['edit'] ) ? $request['edit'] : 0)] = true; |
| 283 | + $move = array( 0 => false, 1 => false ); |
| 284 | + $move[(isset( $request['move'] ) ? $request['move'] : 0)] = true; |
| 285 | + $upload = array( 0 => false, 1 => false ); |
| 286 | + $upload[(isset( $request['upload'] ) ? $request['upload'] : 0)] = true; |
| 287 | + |
| 288 | + /* Construct page data and add to output. */ |
| 289 | + $wgOut->addWikiMsg( 'protectsite-text-protect' ); |
| 290 | + $wgOut->addHTML( |
| 291 | + '<form name="Protectsite" action="' . $this->action . '" method="post">' . "\n" . |
| 292 | + $this->fieldset( 'title', |
| 293 | + $this->radiobox( 'createaccount', $createaccount ) . |
| 294 | + $this->radiobox( 'createpage', $createpage ) . |
| 295 | + $this->radiobox( 'edit', $edit ) . |
| 296 | + $this->radiobox( 'move', $move ) . |
| 297 | + $this->radiobox( 'upload', $upload ) . |
| 298 | + $this->textbox( 'timeout', $wgProtectsiteDefaultTimeout, |
| 299 | + ( isset( $wgProtectsiteLimit ) ? |
| 300 | + ' (' . wfMsg( 'protectsite-maxtimeout', $wgProtectsiteLimit ) . ')' : |
| 301 | + '' |
| 302 | + )) . |
| 303 | + "\n<br />" . |
| 304 | + $this->textbox( 'comment', isset( $request['comment'] ) ? $request['comment'] : '' ) . |
| 305 | + "\n<br />" . |
| 306 | + Xml::element( 'input', array( |
| 307 | + 'type' => 'submit', |
| 308 | + 'name' => 'protect', |
| 309 | + 'value' => wfMsg( 'protectsite-protect' ) ) |
| 310 | + ) |
| 311 | + ) . |
| 312 | + '</form>' |
| 313 | + ); |
| 314 | + } |
| 315 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/ProtectSite/ProtectSite.body.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 316 | + native |
Index: trunk/extensions/ProtectSite/ProtectSite.i18n.php |
— | — | @@ -0,0 +1,580 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Internationalization file for ProtectSite extension. |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
| 8 | + */ |
| 9 | + |
| 10 | +$messages = array(); |
| 11 | + |
| 12 | +/** English |
| 13 | + * @author Eric Johnston <e.wolfie@gmail.com> |
| 14 | + */ |
| 15 | +$messages['en'] = array( |
| 16 | + 'protectsite' => 'Protect site', |
| 17 | + 'protectsite-text-protect' => '<!-- Instructions/Comments/Policy for use -->', |
| 18 | + 'protectsite-text-unprotect' => '<!-- Instructions/Comments when protected -->', |
| 19 | + 'protectsite-title' => 'Site protection settings', |
| 20 | + 'protectsite-allowall' => 'All users', |
| 21 | + 'protectsite-allowusersysop' => 'Registered users and sysops', |
| 22 | + 'protectsite-allowsysop' => 'Sysops only', |
| 23 | + 'protectsite-createaccount' => 'Allow creation of new accounts by', |
| 24 | + 'protectsite-createpage' => 'Allow creation of pages by', |
| 25 | + 'protectsite-edit' => 'Allow editing of pages by', |
| 26 | + 'protectsite-move' => 'Allow moving of pages by', |
| 27 | + 'protectsite-upload' => 'Allow file uploads by', |
| 28 | + 'protectsite-timeout' => 'Timeout:', |
| 29 | + 'protectsite-timeout-error' => "'''Invalid Timeout.'''", |
| 30 | + 'protectsite-maxtimeout' => 'Maximum: $1', |
| 31 | + 'protectsite-comment' => 'Comment:', |
| 32 | + 'protectsite-ucomment' => 'Unprotect comment: ', |
| 33 | + 'protectsite-until' => 'Protected until: ', |
| 34 | + 'protectsite-protect' => 'Protect', |
| 35 | + 'protectsite-unprotect' => 'Unprotect', |
| 36 | + 'right-protectsite' => 'Limit actions that can be performed for some groups for a limited time', |
| 37 | +); |
| 38 | + |
| 39 | +/** Afrikaans (Afrikaans) |
| 40 | + * @author Naudefj |
| 41 | + */ |
| 42 | +$messages['af'] = array( |
| 43 | + 'protectsite-allowall' => 'Alle gebruikers', |
| 44 | + 'protectsite-protect' => 'Beskerm', |
| 45 | + 'protectsite-unprotect' => 'Verwyder beskerming', |
| 46 | +); |
| 47 | + |
| 48 | +/** Breton (Brezhoneg) |
| 49 | + * @author Y-M D |
| 50 | + * @author Gwenn-Ael |
| 51 | + */ |
| 52 | +$messages['br'] = array( |
| 53 | + 'protectsite' => "Gwareziñ al lec'hienn", |
| 54 | + 'protectsite-allowall' => 'An holl implijerien', |
| 55 | + 'protectsite-allowsysop' => 'Merourien hepken', |
| 56 | + 'protectsite-allowusersysop' => 'Implijerien enrollet ha merourien', |
| 57 | + 'protectsite-comment' => 'Evezhiadenn :', |
| 58 | + 'protectsite-createaccount' => 'Aotren da grouiñ kontoù nevez dre', |
| 59 | + 'protectsite-createpage' => 'Aotren da grouiñ pajennoù dre', |
| 60 | + 'protectsite-edit' => 'Aotren da gemm pajennoù dre', |
| 61 | + 'protectsite-maxtimeout' => 'Maximum : $1', |
| 62 | + 'protectsite-move' => 'Aotren da adenvel pajennoù dre', |
| 63 | + 'protectsite-protect' => 'Gwareziñ', |
| 64 | + 'protectsite-text-protect' => '<!-- Kemennoù / Displegadennoù / Reolennoù implijout -->', |
| 65 | + 'protectsite-text-unprotect' => '<!-- Kemennoù / Displegadennoù pa vez gwarezet -->', |
| 66 | + 'protectsite-timeout' => 'Termen', |
| 67 | + 'protectsite-timeout-error' => "'''Termen direizh.'''", |
| 68 | + 'protectsite-title' => "Arventennoù gwareziñ al lec'hienn", |
| 69 | + 'protectsite-ucomment' => 'Evezhiadenn war an diwareziñ', |
| 70 | + 'protectsite-unprotect' => 'Diwareziñ', |
| 71 | + 'protectsite-until' => 'Gwarezet betek :', |
| 72 | + 'protectsite-upload' => 'Aotren da enporzhiañ restroù dre', |
| 73 | +); |
| 74 | + |
| 75 | +/** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца)) |
| 76 | + * @author EugeneZelenko |
| 77 | + */ |
| 78 | +$messages['be-tarask'] = array( |
| 79 | + 'protectsite' => 'Абарона сайту', |
| 80 | + 'protectsite-text-protect' => '<!-- Інструкцыі/Камэнтары/Правілы выкарыстаньня -->', |
| 81 | + 'protectsite-text-unprotect' => '<!-- Інструкцыі/Камэнтары, калі працуе абарона -->', |
| 82 | + 'protectsite-title' => 'Устаноўкі абароны сайту', |
| 83 | + 'protectsite-allowall' => 'Усім удзельнікам', |
| 84 | + 'protectsite-allowusersysop' => 'Зарэгістраваным удзельнікам і адміністратарам', |
| 85 | + 'protectsite-allowsysop' => 'Толькі адміністратарам', |
| 86 | + 'protectsite-createaccount' => 'Дазволіць стварэньне новых рахункаў', |
| 87 | + 'protectsite-createpage' => 'Дазволіць стварэньне старонак', |
| 88 | + 'protectsite-edit' => 'Дазволіць рэдагаваньне старонак', |
| 89 | + 'protectsite-move' => 'Дазволіць перанос старонак', |
| 90 | + 'protectsite-upload' => 'Дазволіць загрузку файлаў', |
| 91 | + 'protectsite-timeout' => 'Час дзеяньня абароны:', |
| 92 | + 'protectsite-timeout-error' => "'''Няслушны час дзеяньня абароны.'''", |
| 93 | + 'protectsite-maxtimeout' => 'Максымум:', |
| 94 | + 'protectsite-comment' => 'Камэнтар:', |
| 95 | + 'protectsite-ucomment' => 'Камэнтар зьняцьця абароны:', |
| 96 | + 'protectsite-until' => 'Абаронены да:', |
| 97 | + 'protectsite-protect' => 'Абараніць', |
| 98 | + 'protectsite-unprotect' => 'Зьняць абарону', |
| 99 | +); |
| 100 | + |
| 101 | +/** German (Deutsch) |
| 102 | + * @author LWChris |
| 103 | + */ |
| 104 | +$messages['de'] = array( |
| 105 | + 'protectsite' => 'Seite schützen', |
| 106 | + 'protectsite-text-protect' => '<!-- Anweisungen/Kommentare/Richtlinie zur Verwendung -->', |
| 107 | + 'protectsite-text-unprotect' => '<!-- Anweisungen/Kommentare wenn geschützt -->', |
| 108 | + 'protectsite-title' => 'Seitenschutz Einstellungen', |
| 109 | + 'protectsite-allowall' => 'Alle Benutzer', |
| 110 | + 'protectsite-allowusersysop' => 'Registrierte Benutzer und Administratoren', |
| 111 | + 'protectsite-allowsysop' => 'Nur Administratoren', |
| 112 | + 'protectsite-createaccount' => 'Erlaube die Erstellung neuer Accounts von', |
| 113 | + 'protectsite-createpage' => 'Erlaube Erstellung von Seiten von', |
| 114 | + 'protectsite-edit' => 'Erlaube Bearbeiten von Seiten von', |
| 115 | + 'protectsite-move' => 'Erlaube Verschieben von Seiten von', |
| 116 | + 'protectsite-upload' => 'Erlaube Datei-Uploads von', |
| 117 | + 'protectsite-timeout' => 'Sperrdauer:', |
| 118 | + 'protectsite-timeout-error' => "'''Ungültige Sperrdauer.'''", |
| 119 | + 'protectsite-maxtimeout' => 'Maximum:', |
| 120 | + 'protectsite-comment' => 'Grund:', |
| 121 | + 'protectsite-ucomment' => 'Aufhebungsgrund:', |
| 122 | + 'protectsite-until' => 'Geschützt bis:', |
| 123 | + 'protectsite-protect' => 'Schützen', |
| 124 | + 'protectsite-unprotect' => 'Freigeben', |
| 125 | +); |
| 126 | + |
| 127 | +/** German (formal address) (Deutsch (Sie-Form)) |
| 128 | + * @author LWChris |
| 129 | + */ |
| 130 | +$messages['de-formal'] = array( |
| 131 | + 'protectsite' => 'Seite schützen', |
| 132 | + 'protectsite-text-protect' => '<!-- Anweisungen/Kommentare/Richtlinie zur Verwendung -->', |
| 133 | + 'protectsite-text-unprotect' => '<!-- Anweisungen/Kommentare wenn geschützt -->', |
| 134 | + 'protectsite-title' => 'Seitenschutz Einstellungen', |
| 135 | + 'protectsite-allowall' => 'Alle Benutzer', |
| 136 | + 'protectsite-allowusersysop' => 'Registrierte Benutzer und Administratoren', |
| 137 | + 'protectsite-allowsysop' => 'Nur Administratoren', |
| 138 | + 'protectsite-createaccount' => 'Erlaube die Erstellung neuer Accounts von', |
| 139 | + 'protectsite-createpage' => 'Erlaube Erstellung von Seiten von', |
| 140 | + 'protectsite-edit' => 'Erlaube Bearbeiten von Seiten von', |
| 141 | + 'protectsite-move' => 'Erlaube Verschieben von Seiten von', |
| 142 | + 'protectsite-upload' => 'Erlaube Datei-Uploads von', |
| 143 | + 'protectsite-timeout' => 'Sperrdauer:', |
| 144 | + 'protectsite-timeout-error' => "'''Ungültige Sperrdauer.'''", |
| 145 | + 'protectsite-maxtimeout' => 'Maximum:', |
| 146 | + 'protectsite-comment' => 'Grund:', |
| 147 | + 'protectsite-ucomment' => 'Aufhebungsgrund:', |
| 148 | + 'protectsite-until' => 'Geschützt bis:', |
| 149 | + 'protectsite-protect' => 'Schützen', |
| 150 | + 'protectsite-unprotect' => 'Freigeben', |
| 151 | +); |
| 152 | + |
| 153 | +/** Spanish (Español) |
| 154 | + * @author Crazymadlover |
| 155 | + * @author Peter17 |
| 156 | + * @author Translationista |
| 157 | + */ |
| 158 | +$messages['es'] = array( |
| 159 | + 'protectsite' => 'Proteger el sitio', |
| 160 | + 'protectsite-text-protect' => '<!-- Instrucciones/Comentario/Políticas de uso -->', |
| 161 | + 'protectsite-text-unprotect' => '<!-- Instrucciones/Comentarios al estar protegidos-->', |
| 162 | + 'protectsite-title' => 'Configuraciones de protección de sitio', |
| 163 | + 'protectsite-allowall' => 'Todos los usuarios', |
| 164 | + 'protectsite-allowusersysop' => 'Usuarios registrados y administradores de sistema', |
| 165 | + 'protectsite-allowsysop' => 'Sólo administradores de sistema', |
| 166 | + 'protectsite-createaccount' => 'Permitir creción de nuevas cuentas por', |
| 167 | + 'protectsite-createpage' => 'Permitir creación de páginas por', |
| 168 | + 'protectsite-edit' => 'Permitir edición de páginas por', |
| 169 | + 'protectsite-move' => 'Permitir movimiento de páginas por', |
| 170 | + 'protectsite-upload' => 'Permitir cargas de archivo por', |
| 171 | + 'protectsite-timeout' => 'Tiempo de espera:', |
| 172 | + 'protectsite-timeout-error' => "'''Tiempo de espera inválido.'''", |
| 173 | + 'protectsite-maxtimeout' => 'Máximo:', |
| 174 | + 'protectsite-comment' => 'Comentario:', |
| 175 | + 'protectsite-ucomment' => 'Desproteger comentario:', |
| 176 | + 'protectsite-until' => 'Protegido hasta:', |
| 177 | + 'protectsite-protect' => 'Proteger', |
| 178 | + 'protectsite-unprotect' => 'Desproteger', |
| 179 | +); |
| 180 | + |
| 181 | +/** Finnish (Suomi) |
| 182 | + * @author Jack Phoenix <jack@shoutwiki.com> |
| 183 | + */ |
| 184 | +$messages['fi'] = array( |
| 185 | + 'protectsite' => 'Suojaa sivusto', |
| 186 | + 'protectsite-title' => 'Sivuston suojauksen asetukset', |
| 187 | + 'protectsite-allowall' => 'Kaikki käyttäjät', |
| 188 | + 'protectsite-allowusersysop' => 'Rekisteröityneet käyttäjät ja ylläpitäjät', |
| 189 | + 'protectsite-allowsysop' => 'Vain ylläpitäjät', |
| 190 | + 'protectsite-createaccount' => 'Salli seuraavien luoda uusia tunnuksia', |
| 191 | + 'protectsite-createpage' => 'Salli seuraavien luoda uusia sivuja', |
| 192 | + 'protectsite-edit' => 'Salli seuraavien muokata sivuja', |
| 193 | + 'protectsite-move' => 'Salli seuraavien siirtää sivuja', |
| 194 | + 'protectsite-upload' => 'Salli seuraavien tallentaa tiedostoja', |
| 195 | + 'protectsite-timeout' => 'Aikakatkaisu:', |
| 196 | + 'protectsite-timeout-error' => "'''Kelpaamaton aikakatkaisu.'''", |
| 197 | + 'protectsite-maxtimeout' => 'Maksimi: $1', |
| 198 | + 'protectsite-comment' => 'Kommentti:', |
| 199 | + 'protectsite-ucomment' => 'Suojauksen poiston kommentti: ', |
| 200 | + 'protectsite-protect' => 'Suojaa', |
| 201 | + 'protectsite-unprotect' => 'Poista suojaus', |
| 202 | + 'right-protectsite' => 'Rajoittaa toimintoja, joita jotkin ryhmät voivat tehdä, tietyn aikaa', |
| 203 | +); |
| 204 | + |
| 205 | +/** French (Français) |
| 206 | + * @author Alexandre Emsenhuber |
| 207 | + */ |
| 208 | +$messages['fr'] = array( |
| 209 | + 'protectsite' => 'Protéger le site', |
| 210 | + 'protectsite-text-protect' => "<!-- Instructions / Commentaires / Règles d'utilisation -->", |
| 211 | + 'protectsite-text-unprotect' => '<!-- Instructions / Commentaires lorsque protégé -->', |
| 212 | + 'protectsite-title' => 'Paramètres de la protection du site', |
| 213 | + 'protectsite-allowall' => 'Tous les utilisateurs', |
| 214 | + 'protectsite-allowusersysop' => 'Utilisateurs enregistrés et administrateurs', |
| 215 | + 'protectsite-allowsysop' => 'Administrateurs seulement', |
| 216 | + 'protectsite-createaccount' => 'Autoriser la création de nouveaux comptes par', |
| 217 | + 'protectsite-createpage' => 'Autoriser la création de comptes par', |
| 218 | + 'protectsite-edit' => 'Autoriser les modifications de pages par', |
| 219 | + 'protectsite-move' => 'Autoriser le renommage de pages par', |
| 220 | + 'protectsite-upload' => 'Autoriser les imports de fichiers par', |
| 221 | + 'protectsite-timeout' => 'Expiration :', |
| 222 | + 'protectsite-timeout-error' => "'''Expiration invalide.'''", |
| 223 | + 'protectsite-maxtimeout' => 'Maximum : $1', |
| 224 | + 'protectsite-comment' => 'Commentaire :', |
| 225 | + 'protectsite-ucomment' => 'Commentaire de déprotection : ', |
| 226 | + 'protectsite-until' => "Protéger jusqu'à : ", |
| 227 | + 'protectsite-protect' => 'Protéger', |
| 228 | + 'protectsite-unprotect' => 'Déprotéger', |
| 229 | +); |
| 230 | + |
| 231 | +/** Galician (Galego) |
| 232 | + * @author Toliño |
| 233 | + */ |
| 234 | +$messages['gl'] = array( |
| 235 | + 'protectsite' => 'Protexer o sitio', |
| 236 | + 'protectsite-text-protect' => '<!-- Instrucións/Comentarios/Política de uso -->', |
| 237 | + 'protectsite-text-unprotect' => '<!-- Instrucións/Comentarios durante a protección -->', |
| 238 | + 'protectsite-title' => 'Configuración da protección do sitio', |
| 239 | + 'protectsite-allowall' => 'Todos os usuarios', |
| 240 | + 'protectsite-allowusersysop' => 'Usuarios rexistrados e administradores', |
| 241 | + 'protectsite-allowsysop' => 'Administradores soamente', |
| 242 | + 'protectsite-createaccount' => 'Permitir a creación de novas contas por', |
| 243 | + 'protectsite-createpage' => 'Permitir a creación de páxinas por', |
| 244 | + 'protectsite-edit' => 'Permitir a edición de páxinas por', |
| 245 | + 'protectsite-move' => 'Permitir o traslado de páxinas por', |
| 246 | + 'protectsite-upload' => 'Permitir a carga de ficheiros por', |
| 247 | + 'protectsite-timeout' => 'Remate:', |
| 248 | + 'protectsite-timeout-error' => "'''Tempo de caducidade inválido.'''", |
| 249 | + 'protectsite-maxtimeout' => 'Máximo: $1', |
| 250 | + 'protectsite-comment' => 'Comentario:', |
| 251 | + 'protectsite-ucomment' => 'Comentario de desprotección: ', |
| 252 | + 'protectsite-until' => 'Protexido ata: ', |
| 253 | + 'protectsite-protect' => 'Protexer', |
| 254 | + 'protectsite-unprotect' => 'Desprotexer', |
| 255 | +); |
| 256 | + |
| 257 | +/** Hungarian (Magyar) |
| 258 | + * @author Glanthor Reviol |
| 259 | + */ |
| 260 | +$messages['hu'] = array( |
| 261 | + 'protectsite' => 'Oldal védelme', |
| 262 | + 'protectsite-title' => 'Oldal védelmi beállításai', |
| 263 | + 'protectsite-allowall' => 'Összes felhasználó', |
| 264 | + 'protectsite-allowsysop' => 'Csak adminisztrátorok', |
| 265 | + 'protectsite-timeout' => 'Időtúllépés:', |
| 266 | + 'protectsite-maxtimeout' => 'Legfeljebb:', |
| 267 | + 'protectsite-comment' => 'Megjegyzés:', |
| 268 | + 'protectsite-ucomment' => 'Védelem feloldása megjegyzés:', |
| 269 | + 'protectsite-protect' => 'Védelem', |
| 270 | + 'protectsite-unprotect' => 'Védelem feloldása', |
| 271 | +); |
| 272 | + |
| 273 | +/** Interlingua (Interlingua) |
| 274 | + * @author McDutchie |
| 275 | + */ |
| 276 | +$messages['ia'] = array( |
| 277 | + 'protectsite' => 'Proteger sito', |
| 278 | + 'protectsite-text-protect' => '<!-- Instructiones/Commentos/Politica pro uso -->', |
| 279 | + 'protectsite-text-unprotect' => '<!-- Instructiones/Commentos quando protegite -->', |
| 280 | + 'protectsite-title' => 'Configuration del protection del sito', |
| 281 | + 'protectsite-allowall' => 'Tote le usatores', |
| 282 | + 'protectsite-allowusersysop' => 'Usatores registrate e administratores', |
| 283 | + 'protectsite-allowsysop' => 'Administratores solmente', |
| 284 | + 'protectsite-createaccount' => 'Permitter le creation de nove contos per', |
| 285 | + 'protectsite-createpage' => 'Permitter le creation de paginas per', |
| 286 | + 'protectsite-edit' => 'Permitter le modification de paginas per', |
| 287 | + 'protectsite-move' => 'Permitter le renomination de paginas per', |
| 288 | + 'protectsite-upload' => 'Permitter le incargamento de files per', |
| 289 | + 'protectsite-timeout' => 'Expiration:', |
| 290 | + 'protectsite-timeout-error' => "'''Expiration invalide.'''", |
| 291 | + 'protectsite-maxtimeout' => 'Maximo:', |
| 292 | + 'protectsite-comment' => 'Commento:', |
| 293 | + 'protectsite-ucomment' => 'Commento de disprotection:', |
| 294 | + 'protectsite-until' => 'Protegite usque a:', |
| 295 | + 'protectsite-protect' => 'Proteger', |
| 296 | + 'protectsite-unprotect' => 'Disproteger', |
| 297 | +); |
| 298 | + |
| 299 | +/** Indonesian (Bahasa Indonesia) |
| 300 | + * @author Kenrick95 |
| 301 | + */ |
| 302 | +$messages['id'] = array( |
| 303 | + 'protectsite-comment' => 'Komentar:', |
| 304 | + 'protectsite-protect' => 'Lindungi', |
| 305 | +); |
| 306 | + |
| 307 | +/** Italian (Italiano) */ |
| 308 | +$messages['it'] = array( |
| 309 | + 'protectsite-allowall' => 'Tutti gli utenti', |
| 310 | + 'protectsite-maxtimeout' => 'Massimo:', |
| 311 | + 'protectsite-comment' => 'Oggetto:', |
| 312 | +); |
| 313 | + |
| 314 | +/** Japanese (日本語) |
| 315 | + * @author Tommy6 |
| 316 | + * @author 青子守歌 |
| 317 | + */ |
| 318 | +$messages['ja'] = array( |
| 319 | + 'protectsite' => 'サイトの保護', |
| 320 | + 'protectsite-text-protect' => '<!-- 利用時の方針/コメント/指示 -->', |
| 321 | + 'protectsite-text-unprotect' => '<!-- 保護された時のコメント/指示 -->', |
| 322 | + 'protectsite-title' => 'サイト保護の設定', |
| 323 | + 'protectsite-allowall' => '全利用者', |
| 324 | + 'protectsite-allowusersysop' => '登録利用者および管理者', |
| 325 | + 'protectsite-allowsysop' => '管理者のみ', |
| 326 | + 'protectsite-createaccount' => '新規アカウント作成を許可する利用者グループ', |
| 327 | + 'protectsite-createpage' => 'ページ作成を許可する利用者グループ', |
| 328 | + 'protectsite-edit' => '編集を許可する利用者グループ', |
| 329 | + 'protectsite-move' => 'ページの移動を許可する利用者グループ', |
| 330 | + 'protectsite-upload' => 'ファイルのアップロードを許可する利用者グループ', |
| 331 | + 'protectsite-timeout' => '期間:', |
| 332 | + 'protectsite-timeout-error' => "'''期間設定が不適切です'''", |
| 333 | + 'protectsite-maxtimeout' => '最大:', |
| 334 | + 'protectsite-comment' => '保護の理由:', |
| 335 | + 'protectsite-ucomment' => '保護解除の理由:', |
| 336 | + 'protectsite-until' => '保護期限:', |
| 337 | + 'protectsite-protect' => '保護', |
| 338 | + 'protectsite-unprotect' => '保護解除', |
| 339 | +); |
| 340 | + |
| 341 | +/** Luxembourgish (Lëtzebuergesch) |
| 342 | + * @author Robby |
| 343 | + */ |
| 344 | +$messages['lb'] = array( |
| 345 | + 'protectsite' => 'Site schützen', |
| 346 | + 'protectsite-text-protect' => '<!-- Instruktiounen/Commentairen/Richtlinne fir de Gebrauch -->', |
| 347 | + 'protectsite-title' => 'Astellunge vun de Späre vum Site', |
| 348 | + 'protectsite-allowall' => 'All Benotzer', |
| 349 | + 'protectsite-allowusersysop' => 'Registréiert Benotzer an Administrateuren', |
| 350 | + 'protectsite-allowsysop' => 'Nëmmen Administrateuren', |
| 351 | + 'protectsite-createaccount' => 'Erlabe vum Uleeë vun neie Benotzerkonten duerch', |
| 352 | + 'protectsite-createpage' => "Erlaabt d'Uleeë vu Säiten duerch", |
| 353 | + 'protectsite-edit' => 'Erlabe vum Ännere vu Säiten duerch', |
| 354 | + 'protectsite-move' => "D'Réckele vu Säiten erlaben fir", |
| 355 | + 'protectsite-upload' => "D'Eropluede vu Fichieren erlaben fir", |
| 356 | + 'protectsite-maxtimeout' => 'Maximum:', |
| 357 | + 'protectsite-comment' => 'Bemierkung:', |
| 358 | + 'protectsite-ucomment' => "Grond fir d'Ophiewe vun der Spär:", |
| 359 | + 'protectsite-until' => 'Gespaart bis:', |
| 360 | + 'protectsite-protect' => 'Spären', |
| 361 | + 'protectsite-unprotect' => 'Spär ophiewen', |
| 362 | +); |
| 363 | + |
| 364 | +/** Macedonian (Македонски) |
| 365 | + * @author Bjankuloski06 |
| 366 | + */ |
| 367 | +$messages['mk'] = array( |
| 368 | + 'protectsite' => 'Заштити веб-страница', |
| 369 | + 'protectsite-text-protect' => '<!-- Инструкции/Коментари/Правила на употреба -->', |
| 370 | + 'protectsite-text-unprotect' => '<!-- Инструкции/Коментари кога е заштитено -->', |
| 371 | + 'protectsite-title' => 'Нагодувања на заштитата на веб-страната', |
| 372 | + 'protectsite-allowall' => 'Сите корисници', |
| 373 | + 'protectsite-allowusersysop' => 'Регистрирани корисници и систем-оператори', |
| 374 | + 'protectsite-allowsysop' => 'Само систем-оператори', |
| 375 | + 'protectsite-createaccount' => 'Дозволи создавање на нови сметки од', |
| 376 | + 'protectsite-createpage' => 'Дозволи создавање на страници од', |
| 377 | + 'protectsite-edit' => 'Дозволи уредување на страници од', |
| 378 | + 'protectsite-move' => 'Дозволи преместување на страници од', |
| 379 | + 'protectsite-upload' => 'Дозволи подигање на податотеки од', |
| 380 | + 'protectsite-timeout' => 'Истекува:', |
| 381 | + 'protectsite-timeout-error' => "'''Неважечки истек.'''", |
| 382 | + 'protectsite-maxtimeout' => 'Максимум: $1', |
| 383 | + 'protectsite-comment' => 'Коментар:', |
| 384 | + 'protectsite-ucomment' => 'Тргни заштита од коментар: ', |
| 385 | + 'protectsite-until' => 'Заштитено до: ', |
| 386 | + 'protectsite-protect' => 'Заштити', |
| 387 | + 'protectsite-unprotect' => 'Тргни заштита', |
| 388 | +); |
| 389 | + |
| 390 | +/** Dutch (Nederlands) |
| 391 | + * @author Mark van Alphen |
| 392 | + */ |
| 393 | +$messages['nl'] = array( |
| 394 | + 'protectsite' => 'Beveilig site', |
| 395 | + 'protectsite-title' => 'Site beveilig instellingen', |
| 396 | + 'protectsite-allowall' => 'Alle gebruikers', |
| 397 | + 'protectsite-allowusersysop' => 'Geregistreerde gebruikers en beheerders', |
| 398 | + 'protectsite-allowsysop' => 'Alleen beheerders', |
| 399 | + 'protectsite-createaccount' => 'Sta creatie van nieuwe accounts toe voor', |
| 400 | + 'protectsite-createpage' => "Sta creatie van pagina's toe voor", |
| 401 | + 'protectsite-edit' => "Sta bewerken van pagina's toe voor", |
| 402 | + 'protectsite-move' => "Sta hernoemen van pagina's toe voor", |
| 403 | + 'protectsite-upload' => 'Sta bestand-uploads toe voor', |
| 404 | + 'protectsite-timeout' => 'Verloop:', |
| 405 | + 'protectsite-timeout-error' => "'''Ongeldig verloop.'''", |
| 406 | + 'protectsite-maxtimeout' => 'Maximum: $1', |
| 407 | + 'protectsite-comment' => 'Opmerking:', |
| 408 | + 'protectsite-ucomment' => 'Beveiliging-opheffing opmerkingen: ', |
| 409 | + 'protectsite-until' => 'Beveiligd tot: ', |
| 410 | + 'protectsite-protect' => 'Beveilig', |
| 411 | +); |
| 412 | + |
| 413 | +/** Norwegian (bokmål) (Norsk (bokmål)) |
| 414 | + * @author Nghtwlkr |
| 415 | + */ |
| 416 | +$messages['no'] = array( |
| 417 | + 'protectsite' => 'Beskytt side', |
| 418 | + 'protectsite-text-protect' => '<!-- Instruksjoner/kommentarer/fremgangsmåte for bruk -->', |
| 419 | + 'protectsite-text-unprotect' => '<!-- Instruksjoner/kommentarer når beskyttet -->', |
| 420 | + 'protectsite-title' => 'Innstillinger for sidebeskyttelse', |
| 421 | + 'protectsite-allowall' => 'Alle brukere', |
| 422 | + 'protectsite-allowusersysop' => 'Registrerte brukere og systemoperatører', |
| 423 | + 'protectsite-allowsysop' => 'Kun systemoperatører', |
| 424 | + 'protectsite-createaccount' => 'Tillat opprettelse av nye kontoer av', |
| 425 | + 'protectsite-createpage' => 'Tillat opprettelse av sider av', |
| 426 | + 'protectsite-edit' => 'Tillat redigering av sider av', |
| 427 | + 'protectsite-move' => 'Tillat flytting av sider av', |
| 428 | + 'protectsite-upload' => 'Tillat filopplasting av', |
| 429 | + 'protectsite-timeout' => 'Tidsavbrudd:', |
| 430 | + 'protectsite-timeout-error' => "'''Ugyldig tidsavbrudd.'''", |
| 431 | + 'protectsite-maxtimeout' => 'Maksimum:', |
| 432 | + 'protectsite-comment' => 'Kommentar:', |
| 433 | + 'protectsite-ucomment' => 'Opphev beskyttelse av kommentar:', |
| 434 | + 'protectsite-until' => 'Beskyttet til:', |
| 435 | + 'protectsite-protect' => 'Beskytt', |
| 436 | + 'protectsite-unprotect' => 'Opphev beskyttelse', |
| 437 | +); |
| 438 | + |
| 439 | +/** Deitsch (Deitsch) |
| 440 | + * @author Xqt |
| 441 | + */ |
| 442 | +$messages['pdc'] = array( |
| 443 | + 'protectsite-comment' => 'Grund:', |
| 444 | +); |
| 445 | + |
| 446 | +/** Piedmontese (Piemontèis) |
| 447 | + * @author Dragonòt |
| 448 | + */ |
| 449 | +$messages['pms'] = array( |
| 450 | + 'protectsite' => 'Sit protet', |
| 451 | + 'protectsite-text-protect' => '<!-- Istrussion/Coment/Polìtica për dovragi -->', |
| 452 | + 'protectsite-text-unprotect' => '<!-- Istrussion/Coment quand protet -->', |
| 453 | + 'protectsite-title' => 'Ampostassion ëd protession dël sit', |
| 454 | + 'protectsite-allowall' => "Tùit j'utent", |
| 455 | + 'protectsite-allowusersysop' => 'Utent registrà e aministrador', |
| 456 | + 'protectsite-allowsysop' => 'Mach aministrador', |
| 457 | + 'protectsite-createaccount' => 'Përmëtt creassion ëd neuv utent da', |
| 458 | + 'protectsite-createpage' => 'Përmëtt creassion ëd pàgine da', |
| 459 | + 'protectsite-edit' => 'Përmëtt modìfica ëd pàgine da', |
| 460 | + 'protectsite-move' => 'Përmëtt tramuda ëd pàgine da', |
| 461 | + 'protectsite-upload' => 'Përmëtt caria ëd pàgine da', |
| 462 | + 'protectsite-timeout' => 'Timeout:', |
| 463 | + 'protectsite-timeout-error' => "'''Timeout pa bon.'''", |
| 464 | + 'protectsite-maxtimeout' => 'Màssim: $1', |
| 465 | + 'protectsite-comment' => 'Coment:', |
| 466 | + 'protectsite-ucomment' => 'Sprotegg coment: ', |
| 467 | + 'protectsite-until' => 'Protegg fin a: ', |
| 468 | + 'protectsite-protect' => 'Protet', |
| 469 | + 'protectsite-unprotect' => 'Sprotet', |
| 470 | +); |
| 471 | + |
| 472 | +/** Pashto (پښتو) |
| 473 | + * @author Ahmed-Najib-Biabani-Ibrahimkhel |
| 474 | + */ |
| 475 | +$messages['ps'] = array( |
| 476 | + 'protectsite-allowall' => 'ټول کارنان', |
| 477 | + 'protectsite-protect' => 'ژغورل', |
| 478 | + 'protectsite-unprotect' => 'نه ژغورل', |
| 479 | +); |
| 480 | + |
| 481 | +/** Brazilian Portuguese (Português do Brasil) |
| 482 | + * @author Luckas Blade |
| 483 | + */ |
| 484 | +$messages['pt-br'] = array( |
| 485 | + 'protectsite-allowall' => 'Todos os usuários', |
| 486 | + 'protectsite-allowusersysop' => 'Usuários registrados e administradores', |
| 487 | + 'protectsite-allowsysop' => 'Somente administradores', |
| 488 | + 'protectsite-maxtimeout' => 'Máximo:', |
| 489 | + 'protectsite-protect' => 'Proteger', |
| 490 | + 'protectsite-unprotect' => 'Desproteger', |
| 491 | +); |
| 492 | + |
| 493 | +/** Russian (Русский) |
| 494 | + * @author Lockal |
| 495 | + */ |
| 496 | +$messages['ru'] = array( |
| 497 | + 'protectsite' => 'Защита сайта', |
| 498 | + 'protectsite-allowall' => 'Всем участникам', |
| 499 | + 'protectsite-allowusersysop' => 'Зарегистрированным участникам и администраторам', |
| 500 | + 'protectsite-allowsysop' => 'Только администраторам', |
| 501 | + 'protectsite-createaccount' => 'Разрешить создание новых учётных записей', |
| 502 | + 'protectsite-createpage' => 'Разрешить создание страниц', |
| 503 | + 'protectsite-edit' => 'Разрешить правку страниц', |
| 504 | + 'protectsite-maxtimeout' => 'Максимум:', |
| 505 | + 'protectsite-move' => 'Разрешить переименование страниц', |
| 506 | + 'protectsite-protect' => 'Защитить', |
| 507 | + 'protectsite-text-protect' => '<!-- Инструкции/Комментарии/Правила для использования -->', |
| 508 | + 'protectsite-text-unprotect' => '<!-- Инструкции/Комментарии при установленной защите -->', |
| 509 | + 'protectsite-timeout' => 'Время истечения:', |
| 510 | + 'protectsite-timeout-error' => "'''Неверное время истечения.'''", |
| 511 | + 'protectsite-title' => 'Настройки защиты сайта', |
| 512 | + 'protectsite-ucomment' => 'Комментарий снятия защиты:', |
| 513 | + 'protectsite-unprotect' => 'Снять защиту', |
| 514 | + 'protectsite-until' => 'Защищено до:', |
| 515 | + 'protectsite-upload' => 'Разрешить загрузку файлов', |
| 516 | +); |
| 517 | + |
| 518 | +/** Serbian Cyrillic ekavian (Српски (ћирилица)) |
| 519 | + * @author Verlor |
| 520 | + */ |
| 521 | +$messages['sr-ec'] = array( |
| 522 | + 'protectsite-allowall' => 'Сви корисници', |
| 523 | + 'protectsite-allowusersysop' => 'Регистровани корисници и Администратори', |
| 524 | + 'protectsite-allowsysop' => 'Само администратори', |
| 525 | + 'protectsite-createpage' => 'Дозволи стварање страна од', |
| 526 | + 'protectsite-edit' => 'Дозволи уређивање страна од стране', |
| 527 | + 'protectsite-move' => 'Дозволи преусмеравање страна од стране', |
| 528 | + 'protectsite-timeout' => 'Време истекло (тајмаут)', |
| 529 | + 'protectsite-maxtimeout' => 'Максимум:', |
| 530 | + 'protectsite-comment' => 'Коментар:', |
| 531 | + 'protectsite-until' => 'Заштићена јединица', |
| 532 | + 'protectsite-protect' => 'Заштити', |
| 533 | + 'protectsite-unprotect' => 'Скини заштиту', |
| 534 | +); |
| 535 | + |
| 536 | +/** Telugu (తెలుగు) |
| 537 | + * @author Veeven |
| 538 | + */ |
| 539 | +$messages['te'] = array( |
| 540 | + 'protectsite-text-protect' => '<!-- ఉపయోగించడానికి సూచనలు/వ్యాఖ్యలు/విధానం -->', |
| 541 | + 'protectsite-title' => 'సైటు సంరక్షణ అమరికలు', |
| 542 | + 'protectsite-allowall' => 'అందరు వాడుకరులు', |
| 543 | + 'protectsite-allowusersysop' => 'నమోదైన వాడుకరులు మరియు నిర్వాహకులు', |
| 544 | + 'protectsite-allowsysop' => 'నిర్వాహకులు మాత్రమే', |
| 545 | + 'protectsite-maxtimeout' => 'గరిష్ఠం:', |
| 546 | + 'protectsite-comment' => 'వ్యాఖ్య:', |
| 547 | + 'protectsite-protect' => 'సంరక్షించు', |
| 548 | +); |
| 549 | + |
| 550 | +/** Tagalog (Tagalog) |
| 551 | + * @author AnakngAraw |
| 552 | + */ |
| 553 | +$messages['tl'] = array( |
| 554 | + 'protectsite' => 'Prutektahan ang sayt', |
| 555 | + 'protectsite-text-protect' => '<!-- Magagamit na mga tagubilin/Mga puna/Patakaran -->', |
| 556 | + 'protectsite-text-unprotect' => '<!-- Mga tagubilin/Mga puna kapag nakasanggalang -->', |
| 557 | + 'protectsite-title' => 'Mga katakdaang pamprutekta ng sityo', |
| 558 | + 'protectsite-allowall' => 'Lahat ng mga tagagamit', |
| 559 | + 'protectsite-allowusersysop' => 'Nakatalang mga tagagamit at mga tagapagpaandar ng sistema', |
| 560 | + 'protectsite-allowsysop' => 'Mga tagapagpaandar lang ng sistema', |
| 561 | + 'protectsite-createaccount' => 'Ipahintulot ang paglikha ng bagong mga akawnt sa pamamagitan ng', |
| 562 | + 'protectsite-createpage' => 'Ipahintulot ang paglikha ng pahina sa pamamagitan ng', |
| 563 | + 'protectsite-edit' => 'Pahintulutan ang pamamatnugot ng mga pahina sa pamamagitan ng', |
| 564 | + 'protectsite-move' => 'Ipahintulot ang paglipat ng mga pahina sa pamamagitan ng', |
| 565 | + 'protectsite-upload' => 'Ipahintulot ang paitaas na pagkakarga ng mga talaksan sa pamamagitan ng', |
| 566 | + 'protectsite-timeout' => 'Pamamahinga:', |
| 567 | + 'protectsite-timeout-error' => "'''Hindi Tanggap na Pamamahinga.'''", |
| 568 | + 'protectsite-maxtimeout' => 'Pinakamataas:', |
| 569 | + 'protectsite-comment' => 'Puna:', |
| 570 | + 'protectsite-ucomment' => 'Huwag prutektahan ang puna:', |
| 571 | + 'protectsite-until' => 'Isanggalang hanggang:', |
| 572 | + 'protectsite-protect' => 'Isanggalang', |
| 573 | + 'protectsite-unprotect' => 'Huwag isanggalang', |
| 574 | +); |
| 575 | + |
| 576 | +/** Ukrainian (Українська) |
| 577 | + * @author Prima klasy4na |
| 578 | + */ |
| 579 | +$messages['uk'] = array( |
| 580 | + 'protectsite-title' => 'Налаштування захисту сайту', |
| 581 | +); |
\ No newline at end of file |
Property changes on: trunk/extensions/ProtectSite/ProtectSite.i18n.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 582 | + native |
Index: trunk/extensions/ProtectSite/ProtectSite.php |
— | — | @@ -0,0 +1,130 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * This extension provides Special:ProtectSite, which makes it possible for |
| 5 | + * users with protectsite permissions to quickly lock down and restore various |
| 6 | + * privileges for anonymous and registered users on a wiki. |
| 7 | + * |
| 8 | + * Knobs: |
| 9 | + * 'protectsite' - Group permission to use the special page. |
| 10 | + * $wgProtectsiteLimit - Maximum time allowed for protection of the site. |
| 11 | + * $wgProtectsiteDefaultTimeout - Default protection time. |
| 12 | + * $wgProtectsiteExempt - Array of non-sysop usergroups to be not effected by rights changes |
| 13 | + * |
| 14 | + * @file |
| 15 | + * @ingroup Extensions |
| 16 | + * @version 0.3.3 |
| 17 | + * @author Eric Johnston <e.wolfie@gmail.com> |
| 18 | + * @author Chris Stafford <c.stafford@gmail.com> |
| 19 | + * @author Jack Phoenix <jack@shoutwiki.com> |
| 20 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 21 | + */ |
| 22 | + |
| 23 | +/** |
| 24 | + * Protect against register_globals vulnerabilities. |
| 25 | + * This line must be present before any global variable is referenced. |
| 26 | + */ |
| 27 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 28 | + die( "This is not a valid entry point.\n" ); |
| 29 | +} |
| 30 | + |
| 31 | +/* Extension Credits. Splarka wants me to be so UN:VAIN! Haet haet hat! */ |
| 32 | +$wgExtensionCredits['specialpage'][] = array( |
| 33 | + 'name' => 'Protect Site', |
| 34 | + 'version' => '0.3.3', |
| 35 | + 'author' => array( '[http://uncyclopedia.org/wiki/User:Dawg Eric Johnston]', 'Chris Stafford', 'Jack Phoenix' ), |
| 36 | + 'description' => 'Allows a site administrator to temporarily block various site modifications', |
| 37 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:ProtectSite', |
| 38 | +); |
| 39 | + |
| 40 | +/* Register the new user rights level */ |
| 41 | +$wgAvailableRights[] = 'protectsite'; |
| 42 | + |
| 43 | +/* Set the group access permissions */ |
| 44 | +$wgGroupPermissions['bureaucrat']['protectsite'] = true; |
| 45 | +$wgGroupPermissions['staff']['protectsite'] = true; |
| 46 | + |
| 47 | +/* Add this Special page to the Special page listing array */ |
| 48 | +$dir = dirname( __FILE__ ) . '/'; |
| 49 | +$wgExtensionMessagesFiles['ProtectSite'] = $dir . 'ProtectSite.i18n.php'; |
| 50 | +$wgExtensionAliasesFiles['ProtectSite'] = $dir . 'ProtectSite.alias.php'; |
| 51 | +$wgAutoloadClasses['ProtectSite'] = $dir . 'ProtectSite.body.php'; |
| 52 | +$wgSpecialPages['ProtectSite'] = 'ProtectSite'; |
| 53 | + |
| 54 | +/* Set the default timeout. */ |
| 55 | +$wgProtectsiteDefaultTimeout = '1 hour'; |
| 56 | + |
| 57 | +/* Register initialization function */ |
| 58 | +$wgExtensionFunctions[] = 'wfSetupProtectsite'; |
| 59 | + |
| 60 | +/** |
| 61 | + * Persistent data is unserialized from a record in the objectcache table |
| 62 | + * which is set in the Special page. It will change the permissions for |
| 63 | + * various functions for anonymous and registered users based on the data |
| 64 | + * in the array. The data expires after the set amount of time, just like |
| 65 | + * a block. |
| 66 | + */ |
| 67 | +function wfSetupProtectsite() { |
| 68 | + /* Globals */ |
| 69 | + global $wgGroupPermissions, $wgMemc, $wgProtectsiteExempt, $wgCommandLineMode; |
| 70 | + |
| 71 | + // macbre: don't run code below when running in command line mode (memcache starts to act strange) |
| 72 | + if ( !empty( $wgCommandLineMode ) ) { |
| 73 | + return; |
| 74 | + } |
| 75 | + |
| 76 | + /* Load i18n messages */ |
| 77 | + wfLoadExtensionMessages( 'ProtectSite' ); |
| 78 | + |
| 79 | + /* Initialize Object */ |
| 80 | + $persist_data = new MediaWikiBagOStuff(); |
| 81 | + |
| 82 | + /* Get data into the prot hash */ |
| 83 | + $prot = $wgMemc->get( wfMemcKey( 'protectsite' ) ); |
| 84 | + if( !$prot ) { |
| 85 | + $prot = $persist_data->get( 'protectsite' ); |
| 86 | + if( !$prot ) { |
| 87 | + $wgMemc->set( wfMemcKey( 'protectsite' ), 'disabled' ); |
| 88 | + } |
| 89 | + } |
| 90 | + |
| 91 | + /* Logic to disable the selected user rights */ |
| 92 | + if( is_array( $prot ) ) { |
| 93 | + /* MW doesn't timeout correctly, this handles it */ |
| 94 | + if( time() >= $prot['until'] ) { |
| 95 | + $persist_data->delete( 'protectsite' ); |
| 96 | + } |
| 97 | + |
| 98 | + /* Protection-related code for MediaWiki 1.8+ */ |
| 99 | + $wgGroupPermissions['*']['createaccount'] = !($prot['createaccount'] >= 1); |
| 100 | + $wgGroupPermissions['user']['createaccount'] = !($prot['createaccount'] == 2); |
| 101 | + |
| 102 | + $wgGroupPermissions['*']['createpage'] = !($prot['createpage'] >= 1); |
| 103 | + $wgGroupPermissions['*']['createtalk'] = !($prot['createpage'] >= 1); |
| 104 | + $wgGroupPermissions['user']['createpage'] = !($prot['createpage'] == 2); |
| 105 | + $wgGroupPermissions['user']['createtalk'] = !($prot['createpage'] == 2); |
| 106 | + |
| 107 | + $wgGroupPermissions['*']['edit'] = !($prot['edit'] >= 1); |
| 108 | + $wgGroupPermissions['user']['edit'] = !($prot['edit'] == 2); |
| 109 | + $wgGroupPermissions['sysop']['edit'] = true; |
| 110 | + |
| 111 | + $wgGroupPermissions['user']['move'] = !($prot['move'] == 1); |
| 112 | + $wgGroupPermissions['user']['upload'] = !($prot['upload'] == 1); |
| 113 | + $wgGroupPermissions['user']['reupload'] = !($prot['upload'] == 1); |
| 114 | + $wgGroupPermissions['user']['reupload-shared'] = !($prot['upload'] == 1); |
| 115 | + |
| 116 | + // are there any groups that should not get affected by ProtectSite's lockdown? |
| 117 | + if( !empty( $wgProtectsiteExempt ) && is_array( $wgProtectsiteExempt ) ) { |
| 118 | + // there are, so loop over them, and force these rights to be true |
| 119 | + // will resolve any problems from inheriting rights from 'user' or 'sysop' |
| 120 | + foreach( $wgProtectsiteExempt as $exemptGroup ) { |
| 121 | + $wgGroupPermissions[$exemptGroup]['edit'] = 1; |
| 122 | + $wgGroupPermissions[$exemptGroup]['createpage'] = 1; |
| 123 | + $wgGroupPermissions[$exemptGroup]['createtalk'] = 1; |
| 124 | + $wgGroupPermissions[$exemptGroup]['move'] = 1; |
| 125 | + $wgGroupPermissions[$exemptGroup]['upload'] = 1; |
| 126 | + $wgGroupPermissions[$exemptGroup]['reupload'] = 1; |
| 127 | + $wgGroupPermissions[$exemptGroup]['reupload-shared'] = 1; |
| 128 | + } |
| 129 | + } |
| 130 | + } |
| 131 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/ProtectSite/ProtectSite.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 132 | + native |