r100081 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100080‎ | r100081 | r100082 >
Date:20:40, 17 October 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
summary for autoedit
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php (modified) (history)
  • /trunk/extensions/SemanticForms/languages/SF_Messages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
@@ -553,12 +553,15 @@
554554
555555
556556 static function renderAutoEdit ( &$parser ) {
 557+
 558+ global $wgTitle;
557559
558560 // set defaults
559561 $formcontent = '';
560562
561563 $linkString = null;
562564 $linkType = 'span';
 565+ $summary = null;
563566
564567 $classString = 'autoedit-trigger';
565568
@@ -583,13 +586,16 @@
584587 case 'reload':
585588 $classString .= ' reload';
586589 break;
 590+ case 'summary':
 591+ $summary = $parser->recursiveTagParse( $value );
 592+ break;
587593 default :
588594 $formcontent .=
589595 Xml::input( $key, false, urldecode( $value ) , array( 'type' => 'hidden') );
590596 }
591597 }
592598
593 - if ( !$linkString ) return null;
 599+ if ( $linkString == null ) return null;
594600
595601 if ( $linkType == 'button' ) {
596602 $linkElement = Xml::tags( "button", array( 'class' => $classString ), $linkString );
@@ -599,6 +605,13 @@
600606 $linkElement = Xml::tags( "span", array( 'class' => $classString ), $linkString );
601607 }
602608
 609+ if ( $summary == null ) {
 610+ $summary = wfMsg('sf_autoedit_summary', $wgTitle );
 611+ }
 612+
 613+ $formcontent .=
 614+ Xml::input( 'wpSummary', false, urldecode( $summary ), array('type' => 'hidden') );
 615+
603616 $form = Xml::tags( 'form', array( 'class' => 'autoedit-data' ), $formcontent );
604617
605618 // ensure loading of jQuery and style sheets
Index: trunk/extensions/SemanticForms/languages/SF_Messages.php
@@ -149,6 +149,7 @@
150150 'sf_autoedit_toomanyformsfound' => "More than one form available for page.",
151151 'sf_autoedit_readonly' => "The database is currently locked to modifications. Reason: $1",
152152 'sf_autoedit_nosemanticform' => "Could not get form $2 for page $1. See [[{{#special:FormEdit}}/$2/$1]] for details.",
 153+ 'sf_autoedit_summary' => "Edited automatically from page [[$1]].",
153154 'runquery' => 'Run query',
154155 'sf_runquery_badurl' => 'You must specify a form name in the URL;
155156 the URL should look like \'Special:RunQuery/<form name>\'.',

Follow-up revisions

RevisionCommit summaryAuthorDate
r100084followup r100081: Taking [[]] out of i18n filefoxtrott20:51, 17 October 2011
r100156followup r100090, followup r100081: Message doc for new messagesfoxtrott20:37, 18 October 2011