[MediaWiki-CVS] SVN: [67061] trunk/extensions/FlaggedRevs
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67061 Revision: 67061 Author: aaron Date: 2010-05-30 01:40:54 + (Sun, 30 May 2010) Log Message: --- * Some hook cleanup * Added label to edit checkbox * Bumped style version Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedArticleView.php trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php trunk/extensions/FlaggedRevs/FlaggedRevs.php trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php Modified: trunk/extensions/FlaggedRevs/FlaggedArticleView.php === --- trunk/extensions/FlaggedRevs/FlaggedArticleView.php 2010-05-30 00:49:31 UTC (rev 67060) +++ trunk/extensions/FlaggedRevs/FlaggedArticleView.php 2010-05-30 01:40:54 UTC (rev 67061) @@ -1525,6 +1525,40 @@ } /** + * Add a "review pending changes" checkbox to the edit form + * if there are currently any revisions pending. (bug 16713) + */ + public function addReviewCheck( $editPage, &$checkboxes, &$tabindex ) { + global $wgUser, $wgRequest; + if ( !$wgUser->isAllowed( 'review' ) ) { + return true; + } elseif ( FlaggedRevs::autoReviewNewPages() && !$this->article->exists() ) { + return true; // not needed + } + if ( $this->article->isReviewable() ) { + $srev = $this->article->getStableRev(); + # For pages with either no stable version, or an outdated one, let + # the user decide if he/she wants it reviewed on the spot. One might + # do this if he/she just saw the diff-to-stable and *then* decided to edit. + if ( !$srev || $srev->getRevId() != $this->article->getLatest() ) { + $checkbox = Xml::check( + 'wpReviewEdit', + $wgRequest->getCheck( 'wpReviewEdit' ), + array( 'tabindex' => ++$tabindex, 'id' => 'wpReviewEdit' ) + ); + $attribs = array( + 'for' => 'wpReviewEdit', + 'title' => wfMsg( 'revreview-check-flag-title' ) + ); + $label = Xml::element( 'label', $attribs, + wfMsgExt( 'revreview-check-flag', 'parseinline' ) ); + $checkboxes['reviewed'] = $checkbox . ' ' . $label; + } + } + return true; + } + + /** * (a) Add a hidden field that has the rev ID the text is based off. * (b) If an edit was undone, add a hidden field that has the rev ID of that edit. * Needed for autoreview and user stats (for autopromote). Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2010-05-30 00:49:31 UTC (rev 67060) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2010-05-30 01:40:54 UTC (rev 67061) @@ -1634,7 +1634,7 @@ return true; } - public static function imagePageFindFile( $imagePage, &$normalFile, &$displayFile ) { + public static function onImagePageFindFile( $imagePage, &$normalFile, &$displayFile ) { $view = FlaggedArticleView::singleton(); $view->imagePageFindFile( $normalFile, $displayFile ); return true; @@ -1998,30 +1998,9 @@ return true; } - // TODO: move to articleview class? - // FIXME: add title attrib public static function addReviewCheck( $editPage, &$checkboxes, &$tabindex ) { - global $wgUser, $wgRequest; - if ( !$wgUser->isAllowed( 'review' ) ) { - return true; - } - if ( FlaggedRevs::autoReviewNewPages() && !$editPage->getArticle()->getId() ) { - return true; // not needed - } - $fa = FlaggedArticleView::globalArticleInstance(); - if ( $fa->isReviewable() ) { - $srev = $fa->getStableRev(); - # For pages with either no stable version, or an outdated one, let - # the user decide if he/she wants it reviewed on the spot. One might - # do this if he/she just saw the diff-to-stable and *then* decided to edit. - if ( !$srev || $srev->getRevId() != $editPage->getArticle()->getLatest() ) { - $reviewLabel = wfMsgExt( 'revreview-check-flag', 'parseinline' ); -
[MediaWiki-CVS] SVN: [67060] trunk/extensions/FlaggedRevs
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67060 Revision: 67060 Author: aaron Date: 2010-05-30 00:49:31 + (Sun, 30 May 2010) Log Message: --- * Change submit button text if edit will need review * Clarified some messages * made onUserCan() cache page visibility settings * getVisibilitySettings()/isStableShownByDefault() cleanup Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedArticle.php trunk/extensions/FlaggedRevs/FlaggedArticleView.php trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php trunk/extensions/FlaggedRevs/FlaggedRevs.php trunk/extensions/FlaggedRevs/client/flaggedrevs.js trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php Modified: trunk/extensions/FlaggedRevs/FlaggedArticle.php === --- trunk/extensions/FlaggedRevs/FlaggedArticle.php 2010-05-29 23:45:02 UTC (rev 67059) +++ trunk/extensions/FlaggedRevs/FlaggedArticle.php 2010-05-30 00:49:31 UTC (rev 67060) @@ -5,7 +5,7 @@ * FlaggedArticle::getTitleInstance() is preferred over constructor calls */ class FlaggedArticle extends Article { - # Process cache variables + /* Process cache variables */ protected $stableRev = null; protected $pageConfig = null; @@ -43,6 +43,39 @@ } /** +* Do edits have to be reviewed before being shown by default? + * @param int $flags, FR_MASTER +* @returns bool +*/ + public function editsRequireReview( $flags = 0 ) { + return ( + $this->isReviewable( $flags ) && // reviewable page + $this->isStableShownByDefault( $flags ) && // and stable versions override + $this->getStableRev( $flags ) // and there is a stable version + ); + } + + /** +* Are edits to this page currently pending? + * @param int $flags, FR_MASTER +* @returns bool +*/ + public function editsArePending( $flags = 0 ) { + if ( $this->isReviewable() ) { + $srev = $this->getStableRev( $flags ); + if ( $srev ) { + if ( $flags & FR_MASTER ) { + $latest = $this->getTitle()->getLatestRevID( GAID_FOR_UPDATE ); + } else { + $latest = $this->getLatest(); + } + return ( $srev->getRevId() != $latest ); // edits need review + } + } + return false; // all edits go live + } + + /** * Is this page less open than the site defaults? * @returns bool */ @@ -122,9 +155,7 @@ if ( !( $flags & FR_MASTER ) && $this->pageConfig !== null ) { return $this->pageConfig; } - # Get the content page, skip talk - $title = $this->getTitle()->getSubjectPage(); - $config = FlaggedRevs::getPageVisibilitySettings( $title, $flags ); + $config = FlaggedRevs::getPageVisibilitySettings( $this->getTitle(), $flags ); $this->pageConfig = $config; return $config; } Modified: trunk/extensions/FlaggedRevs/FlaggedArticleView.php === --- trunk/extensions/FlaggedRevs/FlaggedArticleView.php 2010-05-29 23:45:02 UTC (rev 67059) +++ trunk/extensions/FlaggedRevs/FlaggedArticleView.php 2010-05-30 00:49:31 UTC (rev 67060) @@ -100,8 +100,11 @@ */ public function isStableShownByDefaultUser() { $this->load(); - $config = $this->article->getVisibilitySettings(); // page configuration - return ( $config['override'] && !FlaggedRevs::ignoreDefaultVersion() ); + if ( $this->article->isReviewable() ) { + $config = $this->article->getVisibilitySettings(); // page configuration + return ( $config['override'] && !FlaggedRevs::ignoreDefaultVersion() ); + } + return false; // no stable } /** @@ -1492,6 +1495,36 @@ } /** + * If submitting the edit will leave it pending, then change the button text + * Note: interacts with 'review pending changes' checkbox + * @TODO: would be nice if hook passed in button attribs, not XML + */ + public function changeSaveButton( EditPage $editPage, array &$buttons ) { + if ( !$this->article->editsRequireReview() ) { + return true; // edit will go live immediatly + } elseif ( !$this->article->editsArePending() + && $this->article->getTitle()->userCan( 'autoreview' ) ) +
[MediaWiki-CVS] SVN: [67059] trunk/phase3/includes/SiteStats.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67059 Revision: 67059 Author: ashley Date: 2010-05-29 23:45:02 + (Sat, 29 May 2010) Log Message: --- coding style & doxygen tweaks Modified Paths: -- trunk/phase3/includes/SiteStats.php Modified: trunk/phase3/includes/SiteStats.php === --- trunk/phase3/includes/SiteStats.php 2010-05-29 23:21:25 UTC (rev 67058) +++ trunk/phase3/includes/SiteStats.php 2010-05-29 23:45:02 UTC (rev 67059) @@ -104,23 +104,27 @@ */ static function admins() { wfDeprecated(__METHOD__); - return self::numberingroup('sysop'); + return self::numberingroup( 'sysop' ); } /** * Find the number of users in a given user group. -* @param string $group Name of group -* @return int +* @param $group String: name of group +* @return Integer */ - static function numberingroup($group) { + static function numberingroup( $group ) { if ( !isset( self::$groupMemberCounts[$group] ) ) { global $wgMemc; $key = wfMemcKey( 'SiteStats', 'groupcounts', $group ); $hit = $wgMemc->get( $key ); if ( !$hit ) { $dbr = wfGetDB( DB_SLAVE ); - $hit = $dbr->selectField( 'user_groups', 'COUNT(*)', - array( 'ug_group' => $group ), __METHOD__ ); + $hit = $dbr->selectField( + 'user_groups', + 'COUNT(*)', + array( 'ug_group' => $group ), + __METHOD__ + ); $wgMemc->set( $key, $hit, 3600 ); } self::$groupMemberCounts[$group] = $hit; @@ -131,9 +135,9 @@ static function jobs() { if ( !isset( self::$jobs ) ) { $dbr = wfGetDB( DB_SLAVE ); - self::$jobs = $dbr->estimateRowCount('job'); + self::$jobs = $dbr->estimateRowCount( 'job' ); /* Zero rows still do single row read for row that doesn't exist, but people are annoyed by that */ - if (self::$jobs == 1) { + if ( self::$jobs == 1 ) { self::$jobs = 0; } } @@ -144,7 +148,12 @@ wfProfileIn( __METHOD__ ); if( !isset( self::$pageCount[$ns] ) ) { $dbr = wfGetDB( DB_SLAVE ); - $pageCount[$ns] = (int)$dbr->selectField( 'page', 'COUNT(*)', array( 'page_namespace' => $ns ), __METHOD__ ); + $pageCount[$ns] = (int)$dbr->selectField( + 'page', + 'COUNT(*)', + array( 'page_namespace' => $ns ), + __METHOD__ + ); } wfProfileOut( __METHOD__ ); return $pageCount[$ns]; @@ -163,7 +172,7 @@ foreach( array( 'total_views', 'total_edits', 'good_articles', 'total_pages', 'users', 'admins', 'images' ) as $member ) { if( - $row->{"ss_$member"} > 20 + $row->{"ss_$member"} > 20 or $row->{"ss_$member"} < 0 ) { return false; @@ -225,16 +234,25 @@ } public static function cacheUpdate( $dbw ) { - $dbr = wfGetDB( DB_SLAVE, array( 'SpecialStatistics', 'vslow') ); + $dbr = wfGetDB( DB_SLAVE, array( 'SpecialStatistics', 'vslow' ) ); # Get non-bot users than did some recent action other than making accounts. # If account creation is included, the number gets inflated ~20+ fold on enwiki. - $activeUsers = $dbr->selectField( 'recentchanges', 'COUNT( DISTINCT rc_user_text )', - array( 'rc_user != 0', 'rc_bot' => 0, "rc_log_type != 'newusers' OR rc_log_type IS NULL" ), - __METHOD__ ); - $dbw->update( 'site_stats', - array( 'ss_active_users' => intval($activeUsers) ), - array( 'ss_row_id' => 1 ), __METHOD__ + $activeUsers = $dbr->selectField( + 'recentchanges', + 'COUNT( DISTINCT rc_user_text )', + array( + 'rc_user != 0', +
[MediaWiki-CVS] SVN: [67058] trunk/extensions/Translate
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67058 Revision: 67058 Author: siebrand Date: 2010-05-29 23:21:25 + (Sat, 29 May 2010) Log Message: --- Update code formatting, add some FIXMEs and remove use of wfLoadExtensionMessages. Modified Paths: -- trunk/extensions/Translate/FFS.php trunk/extensions/Translate/Groups.php trunk/extensions/Translate/MessageChecks.php trunk/extensions/Translate/MessageCollection.php trunk/extensions/Translate/MessageGroups.php trunk/extensions/Translate/RcFilter.php trunk/extensions/Translate/SpecialTranslationChanges.php trunk/extensions/Translate/SpecialTranslationStats.php trunk/extensions/Translate/SpecialTranslations.php trunk/extensions/Translate/Translate.php trunk/extensions/Translate/TranslateEditAddons.php trunk/extensions/Translate/TranslateTasks.php trunk/extensions/Translate/_autoload.php trunk/extensions/Translate/ffs/WikiExtension.php trunk/extensions/Translate/groups/MediaWiki/Checker.php trunk/extensions/Translate/tag/RenderJob.php trunk/extensions/Translate/utils/ToolBox.php Modified: trunk/extensions/Translate/FFS.php === --- trunk/extensions/Translate/FFS.php 2010-05-29 21:07:01 UTC (rev 67057) +++ trunk/extensions/Translate/FFS.php 2010-05-29 23:21:25 UTC (rev 67058) @@ -41,12 +41,18 @@ public function read( $code ) { $filename = $this->group->getSourceFilePath( $code ); - if ( $filename === null ) return false; + if ( $filename === null ) { + return false; + } - if ( !file_exists( $filename ) ) return false; + if ( !file_exists( $filename ) ) { + return false; + } $input = file_get_contents( $filename ); - if ( $input === false ) throw new MWException( "Unable to read file $filename" ); + if ( $input === false ) { + throw new MWException( "Unable to read file $filename" ); + } return $this->readFromVariable( $input ); } @@ -54,16 +60,24 @@ public function readFromVariable( $data ) { $parts = explode( "\0\0\0\0", $data ); - if ( count( $parts ) !== 2 ) throw new MWException( 'Wrong number of parts' ); + if ( count( $parts ) !== 2 ) { + throw new MWException( 'Wrong number of parts' ); + } list( $authorsPart, $messagesPart ) = $parts; $authors = explode( "\0", $authorsPart ); $messages = array(); + foreach ( explode( "\0", $messagesPart ) as $line ) { - if ( $line === '' ) continue; + if ( $line === '' ) { + continue; + } + $lineParts = explode( '=', $line, 2 ); - if ( count( $lineParts ) !== 2 ) throw new MWException( "Wrong number of parts in line $line" ); + if ( count( $lineParts ) !== 2 ) { + throw new MWException( "Wrong number of parts in line $line" ); + } list( $key, $message ) = $lineParts; $key = trim( $key ); @@ -81,10 +95,18 @@ public function write( MessageCollection $collection ) { $writePath = $this->writePath; - if ( $writePath === null ) throw new MWException( "Write path is not set" ); - if ( !file_exists( $writePath ) ) throw new MWException( "Write path '$writePath' does not exists" ); - if ( !is_writable( $writePath ) ) throw new MWException( "Write path '$writePath' is not writable" ); + if ( $writePath === null ) { + throw new MWException( "Write path is not set" ); + } + if ( !file_exists( $writePath ) ) { + throw new MWException( "Write path '$writePath' does not exists" ); + } + + if ( !is_writable( $writePath ) ) { + throw new MWException( "Write path '$writePath' is not writable" ); + } + $targetFile = $writePath . '/' . $this->group->getTargetFilename( $collection->code ); if ( file_exists( $targetFile ) ) { @@ -104,6 +126,7 @@ public function writeIntoVariable( MessageCollection $collection ) { $sourceFile = $this->group->getSourceFilePath( $collection->code ); $this->tryReadSource( $sourceFile, $collection ); + return $this->writeReal( $collection ); } @@ -116,6 +139,7 @@ $output .= "\0\0\0\0"; $mangler = $this->group
[MediaWiki-CVS] SVN: [67057] trunk/extensions/SemanticMediaWiki
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67057 Revision: 67057 Author: jeroendedauw Date: 2010-05-29 21:07:01 + (Sat, 29 May 2010) Log Message: --- Fixed more yoda-conditions and style improvements Modified Paths: -- trunk/extensions/SemanticMediaWiki/includes/SMW_QP_Category.php trunk/extensions/SemanticMediaWiki/includes/SMW_QP_List.php trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php trunk/extensions/SemanticMediaWiki/specials/Export/SMW_SpecialOWLExport.php Modified: trunk/extensions/SemanticMediaWiki/includes/SMW_QP_Category.php === --- trunk/extensions/SemanticMediaWiki/includes/SMW_QP_Category.php 2010-05-29 21:06:48 UTC (rev 67056) +++ trunk/extensions/SemanticMediaWiki/includes/SMW_QP_Category.php 2010-05-29 21:07:01 UTC (rev 67057) @@ -106,6 +106,7 @@ $found_values = false; // has anything but the first column been printed? foreach ( $row as $field ) { $first_value = true; + while ( ( $text = $field->getNextText( SMW_OUTPUT_WIKI, $this->getLinker( $first_col ) ) ) !== false ) { if ( !$first_col && !$found_values ) { // first values after first column $result .= ' ('; @@ -114,25 +115,32 @@ // any value after '(' or non-first values on first column $result .= ', '; } + if ( $first_value ) { // first value in any column, print header $first_value = false; - if ( $this->mShowHeaders && ( '' != $field->getPrintRequest()->getLabel() ) ) { + + if ( $this->mShowHeaders && ( $field->getPrintRequest()->getLabel() != '' ) ) { $result .= $field->getPrintRequest()->getText( SMW_OUTPUT_WIKI, $this->mLinker ) . ' '; } } + $result .= $text; // actual output value } + $first_col = false; } + if ( $found_values ) $result .= ')'; } + $result .= ''; $row = $nextrow; // end list if we're at the end of the column // or the page - if ( ( $rowindex + 1 ) % $rows_per_column == 0 && ( $rowindex + 1 ) < $num ) + if ( ( $rowindex + 1 ) % $rows_per_column == 0 && ( $rowindex + 1 ) < $num ) { $result .= "\n "; + } $rowindex++; } Modified: trunk/extensions/SemanticMediaWiki/includes/SMW_QP_List.php === --- trunk/extensions/SemanticMediaWiki/includes/SMW_QP_List.php 2010-05-29 21:06:48 UTC (rev 67056) +++ trunk/extensions/SemanticMediaWiki/includes/SMW_QP_List.php 2010-05-29 21:07:01 UTC (rev 67057) @@ -140,21 +140,26 @@ } if ( $first_value ) { // first value in any column, print header $first_value = false; - if ( ( $this->mShowHeaders != SMW_HEADERS_HIDE ) && ( '' != $field->getPrintRequest()->getLabel() ) ) { + + if ( ( $this->mShowHeaders != SMW_HEADERS_HIDE ) && ( $field->getPrintRequest()->getLabel() != '' ) ) { $result .= $field->getPrintRequest()->getText( SMW_OUTPUT_WIKI, ( $this->mShowHeaders == SMW_HEADERS_PLAIN ? null:$this->mLinker ) ) . ' ';
[MediaWiki-CVS] SVN: [67056] trunk/extensions/SemanticForms
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67056 Revision: 67056 Author: jeroendedauw Date: 2010-05-29 21:06:48 + (Sat, 29 May 2010) Log Message: --- Fixed more yoda-conditions Modified Paths: -- trunk/extensions/SemanticForms/includes/SF_LinkUtils.php trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php trunk/extensions/SemanticForms/specials/SF_FormStart.php Modified: trunk/extensions/SemanticForms/includes/SF_LinkUtils.php === --- trunk/extensions/SemanticForms/includes/SF_LinkUtils.php2010-05-29 21:00:30 UTC (rev 67055) +++ trunk/extensions/SemanticForms/includes/SF_LinkUtils.php2010-05-29 21:06:48 UTC (rev 67056) @@ -31,7 +31,7 @@ global $wgCapitalLinks; $namespace = wfUrlencode( $title->getNsText() ); - if ( '' != $namespace ) { + if ( $namespace != '' ) { $namespace .= ':'; } if ( $wgCapitalLinks ) { @@ -50,7 +50,7 @@ global $wgCapitalLinks; $namespace = $title->getNsText(); - if ( '' != $namespace ) { + if ( $namespace != '' ) { $namespace .= ':'; } if ( $wgCapitalLinks ) { @@ -67,13 +67,17 @@ * (which should be a category, property, or namespace page) */ static function getFormsThatPagePointsTo( $page_name, $page_namespace, $prop_smw_id, $backup_prop_smw_id, $prop_id ) { - if ( $page_name == NULL ) + if ( $page_name == NULL ) { return array(); + } global $sfgContLang; - // produce a useful error message if SMW isn't installed - if ( ! function_exists( 'smwfGetStore' ) ) + + // Produce a useful error message if SMW isn't installed. + if ( ! function_exists( 'smwfGetStore' ) ) { die( "ERROR: http://semantic-mediawiki.org\";>Semantic MediaWiki must be installed for Semantic Forms to run!" ); + } + $store = smwfGetStore(); $title = Title::makeTitleSafe( $page_namespace, $page_name ); $property = SMWPropertyValue::makeProperty( $prop_smw_id ); Modified: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php === --- trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php 2010-05-29 21:00:30 UTC (rev 67055) +++ trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php 2010-05-29 21:06:48 UTC (rev 67056) @@ -351,7 +351,7 @@ foreach ( $values_array as $cur_value ) { $cur_value = trim( $cur_value ); // ignore a value if it's null - if ( '' != $cur_value ) { + if ( $cur_value != '' ) { // remove whitespaces $results[] = str_replace( $var, $cur_value, $formula ); } @@ -399,14 +399,16 @@ $values_array = explode( $parser->mStripState->unstripNoWiki( $delimiter ), $value ); $results = array(); $template = trim( $template ); + foreach ( $values_array as $cur_value ) { $cur_value = trim( $cur_value ); // ignore a value if it's null - if ( '' != $cur_value ) { + if ( $cur_value != '' ) { // remove whitespaces $results[] = '{{' . $template . '|' . $cur_value . '}}'; } } + return array( implode( $new_delimiter, $results ), 'noparse' => false, 'isHTML' => false ); } Modified: trunk/extensions/SemanticForms/specials/SF_FormStart.php === --- trunk/extensions/SemanticForms/specials/SF_FormStart.php2010-05-29 21:00:30 UTC (rev 67055) +++ trunk/extensions/SemanticForms/specials/SF_FormStart.php2010-05-29 21:06:48 UTC (rev 67056) @@ -60,11 +60,11 @@ $page_name = $wgRequest->getVal( 'page_name' ); // This form can be used to create a sub-page for an // existing page - if ( '' != $super_page ) + if ( $super_page != '' ) { $page_name = "$super_page/$page_name"; } - if ( '' != $page_name ) { + if ( $page_name != '' ) { // Append th
[MediaWiki-CVS] SVN: [67055] trunk/extensions/SemanticMediaWiki/includes
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67055 Revision: 67055 Author: jeroendedauw Date: 2010-05-29 21:00:30 + (Sat, 29 May 2010) Log Message: --- Code/doc/style improvements Modified Paths: -- trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php trunk/extensions/SemanticMediaWiki/includes/SMW_SemanticData.php Modified: trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php === --- trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php 2010-05-29 20:23:22 UTC (rev 67054) +++ trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php 2010-05-29 21:00:30 UTC (rev 67055) @@ -107,8 +107,8 @@ if ( $showfactbox == SMW_FACTBOX_HIDDEN ) { // use shortcut return ''; } - // deal with complete dataset only if needed: - if ( !isset( $parseroutput->mSMWData ) || $parseroutput->mSMWData->stubobject ) { + // Deal with complete dataset only if needed: + if ( !isset( $parseroutput->mSMWData ) || $parseroutput->mSMWData->stubObject ) { $semdata = smwfGetStore()->getSemanticData( $title ); } else { $semdata = $parseroutput->mSMWData; Modified: trunk/extensions/SemanticMediaWiki/includes/SMW_SemanticData.php === --- trunk/extensions/SemanticMediaWiki/includes/SMW_SemanticData.php 2010-05-29 20:23:22 UTC (rev 67054) +++ trunk/extensions/SemanticMediaWiki/includes/SMW_SemanticData.php 2010-05-29 21:00:30 UTC (rev 67055) @@ -1,6 +1,6 @@ subject = $subject; - $this->m_noduplicates = $noduplicates; - $this->stubobject = false; + /** +* Constructor. +* +* @param SMWWikiPageValue $subject +* @param boolean $noDuplicates +*/ + public function __construct( $subject, $noDuplicates = true ) { + $this->mSubject = $subject; + $this->mNoDuplicates = $noDuplicates; + $this->stubObject = false; } /** @@ -57,7 +106,10 @@ * subject is serialised, yielding a minimal stub data container after unserialisation. This is a little safer than serialising * nothing: if, for any reason, SMW should ever access an unserialised parser output, then the Semdata container will at least * look as if properly initialised (though empty). +* * @note It might be even better to have other members with stub object data that is used for serializing, thus using much less data. +* +* @return array */ public function __sleep() { return array( 'subject' ); @@ -65,10 +117,11 @@ /** * Return subject to which the stored semantic annotation refer to. +* * @return SMWWikiPageValue subject */ public function getSubject() { - return $this->subject; + return $this->mSubject; } /** @@ -76,36 +129,39 @@ */ public function getProperties() { $this->unstubProperties(); - ksort( $this->properties, SORT_STRING ); - return $this->properties; + ksort( $this->mProperties, SORT_STRING ); + + return $this->mProperties; } /** * Get the array of all stored values for some property. * * @param SMWPropertyValue $property +* +* @return array */ public function getPropertyValues( SMWPropertyValue $property ) { - if ( array_key_exists( $property->getDBkey(), $this->stubpropvals ) ) { + if ( array_key_exists( $property->getDBkey(), $this->mStubPropVals ) ) { // Unstub those entries completely. $this->unstubProperty( $property->getDBkey(), $property ); - foreach ( $this->stubpropvals[$property->getDBkey()] as $dbkeys ) { + foreach ( $this->mStubPropVals[$property->getDBkey()] as $dbkeys ) { $dv = SMWDataValueFactory::newPropertyObjectValue( $property ); $dv->setDBkeys( $dbkeys ); - if ( $this->m_noduplicates ) { - $this->propvals[$property->getDBkey()][$dv->getHash()] = $dv; + if ( $this->mNoDuplicates ) { + $this->mPropVals[$property->getDBkey()][$dv->getHash()] = $dv; } else { - $this->propvals[$property->getDBkey()][] = $dv; +
[MediaWiki-CVS] SVN: [67054] trunk/extensions/SemanticMediaWiki/includes
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67054 Revision: 67054 Author: jeroendedauw Date: 2010-05-29 20:23:22 + (Sat, 29 May 2010) Log Message: --- Code/doc/style improvements Modified Paths: -- trunk/extensions/SemanticMediaWiki/includes/SMW_ParseData.php trunk/extensions/SemanticMediaWiki/includes/SMW_ParserExtensions.php trunk/extensions/SemanticMediaWiki/includes/SMW_SemanticData.php Modified: trunk/extensions/SemanticMediaWiki/includes/SMW_ParseData.php === --- trunk/extensions/SemanticMediaWiki/includes/SMW_ParseData.php 2010-05-29 19:54:07 UTC (rev 67053) +++ trunk/extensions/SemanticMediaWiki/includes/SMW_ParseData.php 2010-05-29 20:23:22 UTC (rev 67054) @@ -95,6 +95,8 @@ * @param mixed $caption string or false * @param Parser $parser * @param boolean $storeAnnotation +* +* @return SMWDataValue */ static public function addProperty( $propertyName, $value, $caption, Parser $parser, $storeAnnotation = true ) { wfProfileIn( "SMWParseData::addProperty (SMW)" ); @@ -111,7 +113,8 @@ } elseif ( $storeAnnotation && ( self::getSMWData( $parser ) !== null ) ) { self::getSMWData( $parser )->addPropertyObjectValue( $property, $result ); - if ( !$result->isValid() ) { // take note of the error for storage (do this here and not in storage, thus avoiding duplicates) + // Take note of the error for storage (do this here and not in storage, thus avoiding duplicates). + if ( !$result->isValid() ) { self::getSMWData( $parser )->addPropertyObjectValue( SMWPropertyValue::makeProperty( '_ERRP' ), $property->getWikiPageValue() ); } } Modified: trunk/extensions/SemanticMediaWiki/includes/SMW_ParserExtensions.php === --- trunk/extensions/SemanticMediaWiki/includes/SMW_ParserExtensions.php 2010-05-29 19:54:07 UTC (rev 67053) +++ trunk/extensions/SemanticMediaWiki/includes/SMW_ParserExtensions.php 2010-05-29 20:23:22 UTC (rev 67054) @@ -331,11 +331,13 @@ * | area = 396 km² * | sea = Adria * }} +* * This creates annotations with the properties as stated on the left side, and the * values on the right side. * -* @param[in] &$parser Parser The current parser -* @return nothing +* @param Parser &$parser The current parser +* +* @return empty string */ static public function doSet( &$parser ) { $params = func_get_args(); Modified: trunk/extensions/SemanticMediaWiki/includes/SMW_SemanticData.php === --- trunk/extensions/SemanticMediaWiki/includes/SMW_SemanticData.php 2010-05-29 19:54:07 UTC (rev 67053) +++ trunk/extensions/SemanticMediaWiki/includes/SMW_SemanticData.php 2010-05-29 20:23:22 UTC (rev 67054) @@ -3,8 +3,10 @@ * The class in this file manages (special) properties that are * associated with a certain subject (article). It is used as a * container for chunks of subject-centred data. + * * @file * @ingroup SMW + * * @author Markus Krötzsch */ @@ -12,6 +14,7 @@ * Class for representing chunks of semantic data for one given * article (subject), similar what is typically displayed in the factbox. * This is a light-weight data container. + * * @ingroup SMW */ class SMWSemanticData { @@ -79,21 +82,28 @@ /** * Get the array of all stored values for some property. +* +* @param SMWPropertyValue $property */ public function getPropertyValues( SMWPropertyValue $property ) { - if ( array_key_exists( $property->getDBkey(), $this->stubpropvals ) ) { // unstub those entries completely + if ( array_key_exists( $property->getDBkey(), $this->stubpropvals ) ) { + // Unstub those entries completely. $this->unstubProperty( $property->getDBkey(), $property ); + foreach ( $this->stubpropvals[$property->getDBkey()] as $dbkeys ) { $dv = SMWDataValueFactory::newPropertyObjectValue( $property ); $dv->setDBkeys( $dbkeys ); + if ( $this->m_noduplicates ) { $this->propvals[$property->getDBkey()][$dv->getHash()] = $dv; } else { $this->propvals[$property->getDBkey()][] = $dv;
[MediaWiki-CVS] SVN: [67053] trunk/phase3/maintenance/generateSitemap.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67053 Revision: 67053 Author: ialex Date: 2010-05-29 19:54:07 + (Sat, 29 May 2010) Log Message: --- Fixed some doxygen warnings Modified Paths: -- trunk/phase3/maintenance/generateSitemap.php Modified: trunk/phase3/maintenance/generateSitemap.php === --- trunk/phase3/maintenance/generateSitemap.php2010-05-29 19:47:28 UTC (rev 67052) +++ trunk/phase3/maintenance/generateSitemap.php2010-05-29 19:54:07 UTC (rev 67053) @@ -221,11 +221,9 @@ /** * Get the priority of a given namespace * -* @param int $namespace The namespace to get the priority for -+ -* @return string +* @param $namespace Integer: the namespace to get the priority for +* @return String */ - function priority( $namespace ) { return isset( $this->priorities[$namespace] ) ? $this->priorities[$namespace] : $this->guessPriority( $namespace ); } @@ -235,9 +233,8 @@ * default priority for the namespace, varies depending on whether it's * a talkpage or not. * -* @param int $namespace The namespace to get the priority for -* -* @return string +* @param $namespace Integer: the namespace to get the priority for +* @return String */ function guessPriority( $namespace ) { return MWNamespace::isMain( $namespace ) ? $this->priorities[GS_MAIN] : $this->priorities[GS_TALK]; @@ -246,9 +243,8 @@ /** * Return a database resolution of all the pages in a given namespace * -* @param int $namespace Limit the query to this namespace -* -* @return resource +* @param $namespace Integer: limit the query to this namespace +* @return Resource */ function getPageRes( $namespace ) { return $this->dbr->select( 'page', @@ -264,10 +260,8 @@ /** * Main loop -* -* @access public */ - function main() { + public function main() { global $wgContLang; fwrite( $this->findex, $this->openIndex() ); @@ -323,7 +317,7 @@ /** * gzopen() / fopen() wrapper * -* @return resource +* @return Resource */ function open( $file, $flags ) { return $this->compress ? gzopen( $file, $flags ) : fopen( $file, $flags ); @@ -352,12 +346,9 @@ /** * Get a sitemap filename * -* @static -* -* @param int $namespace The namespace -* @param int $count The count -* -* @return string +* @param $namespace Integer: the namespace +* @param $count Integer: the count +* @return String */ function sitemapFilename( $namespace, $count ) { $ext = $this->compress ? '.gz' : ''; @@ -367,8 +358,6 @@ /** * Return the XML required to open an XML file * -* @static -* * @return string */ function xmlHead() { @@ -378,9 +367,7 @@ /** * Return the XML schema being used * -* @static -* -* @returns string +* @return String */ function xmlSchema() { return 'http://www.sitemaps.org/schemas/sitemap/0.9'; @@ -389,7 +376,7 @@ /** * Return the XML required to open a sitemap index file * -* @return string +* @return String */ function openIndex() { return $this->xmlHead() . '' . "\n"; @@ -398,11 +385,8 @@ /** * Return the XML for a single sitemap indexfile entry * -* @static -* -* @param string $filename The filename of the sitemap file -* -* @return string +* @param $filename String: the filename of the sitemap file +* @return String */ function indexEntry( $filename ) { return @@ -415,9 +399,7 @@ /** * Return the XML required to close a sitemap index file * -* @static -* -* @return string +* @return String */ function closeIndex() { return "\n"; @@ -426,7 +408,7 @@ /** * Return the XML required to open a sitemap file * -* @return string +* @return String */ function openFile() { return $this->xmlHead() . '' . "\n"; @@ -435,13 +417,10 @@ /** * Return the XML for a single sitemap entry * -* @static -* -* @param string $url An RFC 2396 compliant URL -* @param string $date A ISO 8601 date -* @param string $priority
[MediaWiki-CVS] SVN: [67052] trunk/extensions/Storyboard/tags/Storyboard/storyboard.js
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67052 Revision: 67052 Author: jeroendedauw Date: 2010-05-29 19:47:28 + (Sat, 29 May 2010) Log Message: --- Fixed .attr( 'onclick' vs .click( issue Modified Paths: -- trunk/extensions/Storyboard/tags/Storyboard/storyboard.js Modified: trunk/extensions/Storyboard/tags/Storyboard/storyboard.js === --- trunk/extensions/Storyboard/tags/Storyboard/storyboard.js 2010-05-29 19:17:19 UTC (rev 67051) +++ trunk/extensions/Storyboard/tags/Storyboard/storyboard.js 2010-05-29 19:47:28 UTC (rev 67052) @@ -63,9 +63,12 @@ $( "" ).attr( { "target": "_blank", "rel": "nofollow", - "href": deliciousUrl, - "onclick": "window.open( '" + deliciousUrl + "', 'delicious-sharer', 'toolbar=0, status=0, width=850, height=650' ); return false;" + "href": deliciousUrl } ) + .click( function() { + window.open( jQuery( this ).attr( 'href' ), 'delicious-sharer', 'toolbar=0, status=0, width=850, height=650' ); + return false; + } ) .append( $( "" ).attr( "src", wgScriptPath + "/extensions/Storyboard/images/storyboard-delicious.png" ) ) @@ -76,9 +79,12 @@ $( "" ).attr( { "target": "_blank", "rel": "nofollow", - "href": facebookUrl, - "onclick": "window.open( '" + facebookUrl + "', 'facebook-sharer', 'toolbar=0, status=0, width=626, height=436' ); return false;" + "href": facebookUrl } ) + .click( function() { + window.open( jQuery( this ).attr( 'href' ), 'facebook-sharer', 'toolbar=0, status=0, width=626, height=436' ); + return false; + } ) .append( $( "" ).attr( "src", wgScriptPath + "/extensions/Storyboard/images/storyboard-facebook.png" ) ) ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [67050] trunk/extensions/UploadWizard/js/mw.UploadWizard.js
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67050 Revision: 67050 Author: dale Date: 2010-05-29 19:12:56 + (Sat, 29 May 2010) Log Message: --- if using images from mwEmbed you should use mw.getMwEmbedPath() ( its probably better to let css transforms handle the relative path mappings ) Modified Paths: -- trunk/extensions/UploadWizard/js/mw.UploadWizard.js Modified: trunk/extensions/UploadWizard/js/mw.UploadWizard.js === --- trunk/extensions/UploadWizard/js/mw.UploadWizard.js 2010-05-29 18:58:29 UTC (rev 67049) +++ trunk/extensions/UploadWizard/js/mw.UploadWizard.js 2010-05-29 19:12:56 UTC (rev 67050) @@ -1057,7 +1057,7 @@ // content area, it works. Vector is fine $j( _this.dateInput ).datepicker( { dateFormat: 'yy-mm-dd', // oddly, this means -mm-dd - buttonImage: '/js/mwEmbed/skins/common/images/calendar.gif', + buttonImage: mw.getMwEmbedPath() + 'skins/common/images/calendar.gif', buttonImageOnly: false // XXX determine what this does, docs are confusing } ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [67049] trunk/phase3/languages/classes/LanguagePt_br.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67049 Revision: 67049 Author: platonides Date: 2010-05-29 18:58:29 + (Sat, 29 May 2010) Log Message: --- Bug 23707: Zero items is plural in brazilian portuguese, bug 7309 was wrong. Removed Paths: - trunk/phase3/languages/classes/LanguagePt_br.php Deleted: trunk/phase3/languages/classes/LanguagePt_br.php === --- trunk/phase3/languages/classes/LanguagePt_br.php2010-05-29 18:51:31 UTC (rev 67048) +++ trunk/phase3/languages/classes/LanguagePt_br.php2010-05-29 18:58:29 UTC (rev 67049) @@ -1,17 +0,0 @@ -preConvertPlural( $forms, 2 ); - - return ($count <= 1) ? $forms[0] : $forms[1]; - } -} ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [67048] trunk/extensions/Configure
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67048 Revision: 67048 Author: ialex Date: 2010-05-29 18:51:31 + (Sat, 29 May 2010) Log Message: --- Updated SematicMediaWiki extension Modified Paths: -- trunk/extensions/Configure/CHANGELOG trunk/extensions/Configure/Configure.php trunk/extensions/Configure/settings/Settings-ext.txt Modified: trunk/extensions/Configure/CHANGELOG === --- trunk/extensions/Configure/CHANGELOG2010-05-29 18:19:32 UTC (rev 67047) +++ trunk/extensions/Configure/CHANGELOG2010-05-29 18:51:31 UTC (rev 67048) @@ -1,6 +1,9 @@ This file lists changes on this extension. Localisation updates are done through translatewiki.net and are not listed here. +0.15.28 - 29 May 2010 + Updated SematicMediaWiki extension. + 0.15.27 - 26 May 2010 Updated SemanticMediaWiki and Translate extensions. Modified: trunk/extensions/Configure/Configure.php === --- trunk/extensions/Configure/Configure.php2010-05-29 18:19:32 UTC (rev 67047) +++ trunk/extensions/Configure/Configure.php2010-05-29 18:51:31 UTC (rev 67048) @@ -17,7 +17,7 @@ 'author' => array( 'Alexandre Emsenhuber', 'Andrew Garrett' ), 'url' => 'http://www.mediawiki.org/wiki/Extension:Configure', 'descriptionmsg' => 'configure-desc', - 'version' => '0.15.27', + 'version' => '0.15.28', ); # Configuration part Modified: trunk/extensions/Configure/settings/Settings-ext.txt === --- trunk/extensions/Configure/settings/Settings-ext.txt2010-05-29 18:19:32 UTC (rev 67047) +++ trunk/extensions/Configure/settings/Settings-ext.txt2010-05-29 18:51:31 UTC (rev 67048) @@ -743,7 +743,6 @@ settings[] = smwgRSSWithPages: bool settings[] = smwgAllowRecursiveExport: bool settings[] = smwgExportBacklinks: bool -settings[] = smwgOWLFullExport: bool settings[] = smwgNamespace: text settings[] = smwgMaxNonExpNumber: int settings[] = smwgEnableUpdateJobs: bool ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [67047] trunk/phase3/languages/messages/MessagesEn.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67047 Revision: 67047 Author: raymond Date: 2010-05-29 18:19:32 + (Sat, 29 May 2010) Log Message: --- Follow-up r67045. Delete it from the English message file too. Deletion from all other languages will be processed by translatewiki scripts Modified Paths: -- trunk/phase3/languages/messages/MessagesEn.php Modified: trunk/phase3/languages/messages/MessagesEn.php === --- trunk/phase3/languages/messages/MessagesEn.php 2010-05-29 18:06:40 UTC (rev 67046) +++ trunk/phase3/languages/messages/MessagesEn.php 2010-05-29 18:19:32 UTC (rev 67047) @@ -1912,7 +1912,6 @@ 'right-siteadmin' => 'Lock and unlock the database', 'right-reset-passwords' => "Reset other users' passwords", 'right-override-export-depth' => 'Export pages including linked pages up to a depth of 5', -'right-versiondetail' => 'Show the extended software version information', 'right-sendemail' => 'Send e-mail to other users', # User rights log ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [67046] trunk/extensions
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67046 Revision: 67046 Author: raymond Date: 2010-05-29 18:06:40 + (Sat, 29 May 2010) Log Message: --- SlippyMap is not obsolete because Maps does not support OSM in trunk Modified Paths: -- trunk/extensions/Translate/groups/mediawiki-defines.txt Removed Paths: - trunk/extensions/SlippyMap/OBSOLETE Deleted: trunk/extensions/SlippyMap/OBSOLETE === --- trunk/extensions/SlippyMap/OBSOLETE 2010-05-29 17:58:10 UTC (rev 67045) +++ trunk/extensions/SlippyMap/OBSOLETE 2010-05-29 18:06:40 UTC (rev 67046) @@ -1,5 +0,0 @@ -This extensions is unmaintained and obsolete. - -Use extension Maps (http://www.mediawiki.org/wiki/Extension:Maps). - -This extension will be removed after MediaWiki 1.17 has been branched. Modified: trunk/extensions/Translate/groups/mediawiki-defines.txt === --- trunk/extensions/Translate/groups/mediawiki-defines.txt 2010-05-29 17:58:10 UTC (rev 67045) +++ trunk/extensions/Translate/groups/mediawiki-defines.txt 2010-05-29 18:06:40 UTC (rev 67046) @@ -1011,11 +1011,11 @@ Skin Per Page -# OBSOLETE: use Maps -#Slippy Map -#ignored = slippymap_license, slippymap_osmlink -#descmsg = slippymap_desc -#optional = slippymap_tagname, slippymap_extname +# NOT OBSOLETE: Maps does not support OSM in trunk +Slippy Map +ignored = slippymap_license, slippymap_osmlink +descmsg = slippymap_desc +optional = slippymap_tagname, slippymap_extname Smooth Gallery magicfile = SmoothGallery/SmoothGallery.i18n.magic.php ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [67045] trunk/phase3
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67045 Revision: 67045 Author: reedy Date: 2010-05-29 17:58:10 + (Sat, 29 May 2010) Log Message: --- Remove versiondetail from sysop rights as per IRC, being identified as not used Modified Paths: -- trunk/phase3/includes/DefaultSettings.php trunk/phase3/maintenance/language/messages.inc Modified: trunk/phase3/includes/DefaultSettings.php === --- trunk/phase3/includes/DefaultSettings.php 2010-05-29 16:12:41 UTC (rev 67044) +++ trunk/phase3/includes/DefaultSettings.php 2010-05-29 17:58:10 UTC (rev 67045) @@ -1453,7 +1453,6 @@ $wgGroupPermissions['sysop']['apihighlimits']= true; $wgGroupPermissions['sysop']['browsearchive']= true; $wgGroupPermissions['sysop']['noratelimit'] = true; -$wgGroupPermissions['sysop']['versiondetail']= true; $wgGroupPermissions['sysop']['movefile'] = true; $wgGroupPermissions['sysop']['unblockself'] = true; #$wgGroupPermissions['sysop']['mergehistory'] = true; Modified: trunk/phase3/maintenance/language/messages.inc === --- trunk/phase3/maintenance/language/messages.inc 2010-05-29 16:12:41 UTC (rev 67044) +++ trunk/phase3/maintenance/language/messages.inc 2010-05-29 17:58:10 UTC (rev 67045) @@ -1081,7 +1081,6 @@ 'right-siteadmin', 'right-reset-passwords', 'right-override-export-depth', - 'right-versiondetail', 'right-sendemail', ), 'rightslog' => array( ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [67044] trunk/extensions/ParserFunctions
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67044 Revision: 67044 Author: maxsem Date: 2010-05-29 16:12:41 + (Sat, 29 May 2010) Log Message: --- (bug 19940) urldecode dropped during StringFunctions-ParserFunctions merger Modified Paths: -- trunk/extensions/ParserFunctions/ParserFunctions.i18n.magic.php trunk/extensions/ParserFunctions/ParserFunctions.php trunk/extensions/ParserFunctions/ParserFunctions_body.php trunk/extensions/ParserFunctions/funcsParserTests.txt Modified: trunk/extensions/ParserFunctions/ParserFunctions.i18n.magic.php === --- trunk/extensions/ParserFunctions/ParserFunctions.i18n.magic.php 2010-05-29 14:35:46 UTC (rev 67043) +++ trunk/extensions/ParserFunctions/ParserFunctions.i18n.magic.php 2010-05-29 16:12:41 UTC (rev 67044) @@ -25,6 +25,7 @@ 'count' => array( 0, 'count' ), 'replace'=> array( 0, 'replace' ), 'explode'=> array( 0, 'explode' ), + 'urldecode' => array( 0, 'urldecode' ), ); $magicWords['ar'] = array( Modified: trunk/extensions/ParserFunctions/ParserFunctions.php === --- trunk/extensions/ParserFunctions/ParserFunctions.php2010-05-29 14:35:46 UTC (rev 67043) +++ trunk/extensions/ParserFunctions/ParserFunctions.php2010-05-29 16:12:41 UTC (rev 67044) @@ -92,13 +92,14 @@ //String Functions if ( $wgPFEnableStringFunctions ) { - $parser->setFunctionHook( 'len', array(&$this, 'runLen' )); - $parser->setFunctionHook( 'pos', array(&$this, 'runPos' )); - $parser->setFunctionHook( 'rpos', array(&$this, 'runRPos' )); - $parser->setFunctionHook( 'sub', array(&$this, 'runSub' )); - $parser->setFunctionHook( 'count',array(&$this, 'runCount')); - $parser->setFunctionHook( 'replace', array(&$this, 'runReplace' )); - $parser->setFunctionHook( 'explode', array(&$this, 'runExplode' )); + $parser->setFunctionHook( 'len', array( &$this, 'runLen' ) ); + $parser->setFunctionHook( 'pos', array( &$this, 'runPos' ) ); + $parser->setFunctionHook( 'rpos', array( &$this, 'runRPos' ) ); + $parser->setFunctionHook( 'sub', array( &$this, 'runSub' ) ); + $parser->setFunctionHook( 'count', array( &$this, 'runCount' ) ); + $parser->setFunctionHook( 'replace', array( &$this, 'runReplace' ) ); + $parser->setFunctionHook( 'explode', array( &$this, 'runExplode' ) ); + $parser->setFunctionHook( 'urldecode', array( &$this, 'runUrlDecode' ) ); } return true; Modified: trunk/extensions/ParserFunctions/ParserFunctions_body.php === --- trunk/extensions/ParserFunctions/ParserFunctions_body.php 2010-05-29 14:35:46 UTC (rev 67043) +++ trunk/extensions/ParserFunctions/ParserFunctions_body.php 2010-05-29 16:12:41 UTC (rev 67044) @@ -767,4 +767,24 @@ wfProfileOut( __METHOD__ ); return $result; } + + /** +* {{#urldecode:string}} +* +* Decodes URL-encoded (like%20that) strings. +*/ + function runUrlDecode( $parser, $inStr = '' ) { + wfProfileIn( __METHOD__ ); + + $inStr = $this->killMarkers( $parser, (string)$inStr ); + if ( !$this->checkLength( $inStr ) ) { + wfProfileOut( __METHOD__ ); + return $this->tooLongError(); + } + + $result = urldecode( $inStr ); + + wfProfileOut( __METHOD__ ); + return $result; + } } Modified: trunk/extensions/ParserFunctions/funcsParserTests.txt === --- trunk/extensions/ParserFunctions/funcsParserTests.txt 2010-05-29 14:35:46 UTC (rev 67043) +++ trunk/extensions/ParserFunctions/funcsParserTests.txt 2010-05-29 16:12:41 UTC (rev 67044) @@ -175,3 +175,17 @@ false !! end + +!! test +#urldecode +!! input +{{#urldecode:}} +{{#urldecode:foo%20bar}} +{{#urldecode:%D0%9C%D0%B5%D0%B4%D0%B8%D0%B0%D0%92%D0%B8%D0%BA%D0%B8}} +{{#urldecode: some unescaped string}} +!! result +foo bar +МедиаВики +some unescaped string + +!! end ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [67043] trunk/extensions/PureWikiDeletion/PureWikiDeletion.i18n.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67043 Revision: 67043 Author: siebrand Date: 2010-05-29 14:35:46 + (Sat, 29 May 2010) Log Message: --- article -> page Modified Paths: -- trunk/extensions/PureWikiDeletion/PureWikiDeletion.i18n.php Modified: trunk/extensions/PureWikiDeletion/PureWikiDeletion.i18n.php === --- trunk/extensions/PureWikiDeletion/PureWikiDeletion.i18n.php 2010-05-29 14:28:46 UTC (rev 67042) +++ trunk/extensions/PureWikiDeletion/PureWikiDeletion.i18n.php 2010-05-29 14:35:46 UTC (rev 67043) @@ -18,7 +18,7 @@ The reason given for blanking was: ''$3''. -You may [{{fullurl:{{FULLPAGENAMEE}}|action=history}} view the article's history], [{{fullurl:{{FULLPAGENAMEE}}|oldid=$4&action=edit}} edit the last version], or type new page into the white space below.", +You may [{{fullurl:{{FULLPAGENAMEE}}|action=history}} view the page's history], [{{fullurl:{{FULLPAGENAMEE}}|oldid=$4&action=edit}} edit the last version], or type new page into the white space below.", 'blank-log' => 'blank', 'blank-log-name' => 'Blank log', 'blank-log-header' => 'Below is a list of page blankings and unblankings.', ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [67042] trunk/extensions/PureWikiDeletion
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67042 Revision: 67042 Author: siebrand Date: 2010-05-29 14:28:46 + (Sat, 29 May 2010) Log Message: --- Tweak messages 'purewikideletion-blanked' and 'blank-log-link' Modified Paths: -- trunk/extensions/PureWikiDeletion/PureWikiDeletion.hooks.php trunk/extensions/PureWikiDeletion/PureWikiDeletion.i18n.php Modified: trunk/extensions/PureWikiDeletion/PureWikiDeletion.hooks.php === --- trunk/extensions/PureWikiDeletion/PureWikiDeletion.hooks.php 2010-05-29 14:02:50 UTC (rev 67041) +++ trunk/extensions/PureWikiDeletion/PureWikiDeletion.hooks.php 2010-05-29 14:28:46 UTC (rev 67042) @@ -8,7 +8,7 @@ } class PureWikiDeletionHooks { - + public static function PureWikiDeletionOutputPageParserOutputHook( &$out, $parseroutput ) { $dbr = wfGetDB( DB_SLAVE ); $target = $out->getTitle(); @@ -28,11 +28,11 @@ if ( $out->getPageTitle() == $target->getPrefixedText() ) { $out->redirect( $target->getEditURL() ); } - + $out->setPageTitle( $out->getPageTitle() ); return true; } - + public static function PureWikiDeletionSaveCompleteHook( &$article, &$user, $text, $summary, $minoredit, &$watchthis, $sectionanchor, &$flags, $revision, &$status, $baseRevId, &$redirect ) { @@ -106,8 +106,8 @@ } return true; } - - + + public static function PureWikiDeletionLink( $skin, $target, &$text, &$customAttribs, &$query, &$options , &$ret ) { global $wgPureWikiDeletionBlankLinkStyle; @@ -135,7 +135,7 @@ } return true; } - + public static function PureWikiDeletionEditHook( &$editPage ) { global $wgLang, $wgUser; wfLoadExtensionMessages( 'PureWikiDeletion' ); @@ -148,13 +148,13 @@ 'blank_summary', 'blank_parent_id' ); - + $result = $dbr->selectRow( 'blanked_page', $blank_row, array ( 'blank_page_id' => $blank_page_id ) ); if ( !$result ) { return true; } - + $blank_user_id = $result->blank_user_id; if ( $blank_user_id == 0 ) { $blank_user_name = $result->blank_user_name; @@ -162,21 +162,23 @@ $blanking_user = User::newFromId( $blank_user_id ); $blank_user_name = $blanking_user->getName(); } - $html = wfMsgExt( 'purewikideletion-blanked', 'parse', array -( $blank_user_name -, $wgLang->timeanddate( wfTimestamp( TS_MW -, $result->blank_timestamp ), true ) -, $result->blank_summary -, $result->blank_parent_id ) ); - $editPage->editFormPageTop .= $html; - + $html = wfMsgExt( 'purewikideletion-blanked', 'parse', array( + $blank_user_name, + $wgLang->timeanddate( wfTimestamp( TS_MW, $result->blank_timestamp ), true ), + $result->blank_summary, + $result->blank_parent_id, + $wgLang->date( wfTimestamp( TS_MW, $result->blank_timestamp ), true ), + $wgLang->time( wfTimestamp( TS_MW, $result->blank_timestamp ), true ) + ) ); + $editPage->editFormPageTop .= $html; + if ($wgUser->getOption( 'watchunblank' )){ $editPage->watchthis = true; } - + return true; } - + public static function PureWikiDeletionDeleteHook( &$article, &$user, $reason, $id ) { $dbr = wfGetDB( DB_SLAVE ); @@ -190,7 +192,7 @@ } return true; } - + public static function PureWikiDeletionUndeleteHook( $title, $create ) { $dbr = wfGetDB( DB_SLAVE ); $myRevision = Revision::loadFromTitle( $dbr, $title ); @@ -208,14 +210,14 @@ } return true; } - + public static function efPureWikiDeletionParserFunction_Setup( $parser ) { # Set a function hook associating the "example" magic word with our function $parser->setFunctionHook( 'ifnotblank', 'PureWikiDeletionHooks::efPureWikiDeletionParserFunction_RenderNotBlank' ); $parser->setFunctionHook( 'ifblank', 'PureWikiDeletionHooks::efPureWikiDeletionParserFunction_RenderBlank' ); return true; } - + public stat
[MediaWiki-CVS] SVN: [67041] trunk/extensions/Validator
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67041 Revision: 67041 Author: raymond Date: 2010-05-29 14:02:50 + (Sat, 29 May 2010) Log Message: --- Do not translate the extension name itself. It's proper noun as all other extensions have it No need for function efValidatorSetup() Tweak 'validator-desc' a bit for consistency with other desc messages Modified Paths: -- trunk/extensions/Validator/Validator.i18n.php trunk/extensions/Validator/Validator.php Modified: trunk/extensions/Validator/Validator.i18n.php === --- trunk/extensions/Validator/Validator.i18n.php 2010-05-29 03:20:13 UTC (rev 67040) +++ trunk/extensions/Validator/Validator.i18n.php 2010-05-29 14:02:50 UTC (rev 67041) @@ -15,8 +15,7 @@ * @author Jeroen De Dauw */ $messages['en'] = array( - 'validator_name' => 'Validator', - 'validator-desc' => 'Validator is a MediaWiki extension that provides generic parameter handling support to other extensions', + 'validator-desc' => 'Provides generic parameter handling support to other extensions', 'validator_error_parameters' => 'The following {{PLURAL:$1|error has|errors have}} been detected in your syntax:', 'validator_warning_parameters' => 'There {{PLURAL:$1|is an error|are errors}} in your syntax.', @@ -41,7 +40,7 @@ 'validator_list_omitted' => 'The {{PLURAL:$2|value|values}} $1 {{PLURAL:$2|has|have}} been omitted.', - // Crtiteria errors for single values & lists + // Criteria errors for single values & lists 'validator_error_accepts_only' => 'Parameter $1 only accepts {{PLURAL:$3|this value|these values}}: $2.', ); Modified: trunk/extensions/Validator/Validator.php === --- trunk/extensions/Validator/Validator.php2010-05-29 03:20:13 UTC (rev 67040) +++ trunk/extensions/Validator/Validator.php2010-05-29 14:02:50 UTC (rev 67041) @@ -37,33 +37,21 @@ // Include the settings file. require_once( $egValidatorDir . 'Validator_Settings.php' ); -// Put the initalization function into the MW extension hook. -$wgExtensionFunctions[] = 'efValidatorSetup'; - // Register the internationalization file. $wgExtensionMessagesFiles['Validator'] = $egValidatorDir . 'Validator.i18n.php'; +$wgExtensionCredits['other'][] = array( + 'path' => __FILE__, + 'name' => 'Validator', + 'version' => Validator_VERSION, + 'author' => array( '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]' ), + 'url' => 'http://www.mediawiki.org/wiki/Extension:Validator', + 'descriptionmsg' => 'validator-desc', +); + // Autoload the general classes. -$wgAutoloadClasses['Validator']= $egValidatorDir . 'Validator.class.php'; +$wgAutoloadClasses['Validator']= $egValidatorDir . 'Validator.class.php'; $wgAutoloadClasses['ValidatorFunctions'] = $egValidatorDir . 'Validator_Functions.php'; $wgAutoloadClasses['ValidatorFormats'] = $egValidatorDir . 'Validator_Formats.php'; $wgAutoloadClasses['ValidatorManager'] = $egValidatorDir . 'Validator_Manager.php'; $wgAutoloadClasses['TopologicalSort'] = $egValidatorDir . 'TopologicalSort.php'; - -/** - * Initialization function for the Validator extension. - */ -function efValidatorSetup() { - global $wgExtensionCredits; - - wfLoadExtensionMessages( 'Validator' ); - - $wgExtensionCredits['other'][] = array( - 'path' => __FILE__, - 'name' => wfMsg( 'validator_name' ), - 'version' => Validator_VERSION, - 'author' => array( '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]' ), - 'url' => 'http://www.mediawiki.org/wiki/Extension:Validator', - 'descriptionmsg' => 'validator-desc', - ); -} ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs