r109048 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109047‎ | r109048 | r109049 >
Date:17:54, 16 January 2012
Author:yaron
Status:deferred
Tags:
Comment:
Added documentation for #autoedit, and made some minor formatting improvements
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
@@ -4,8 +4,8 @@
55 *
66 * @file
77 * @ingroup SF
8 - * Four parser functions are defined: 'forminput', 'formlink', 'arraymap'
9 - * and 'arraymaptemplate'.
 8+ * Five parser functions are defined: 'forminput', 'formlink', 'arraymap',
 9+ * 'arraymaptemplate' and 'autoedit'.
1010 *
1111 * 'forminput' is called as:
1212 *
@@ -104,11 +104,25 @@
105105 *
106106 * {{#arraymaptemplate:blue;red;yellow|Beautify|;|;}}
107107 *
 108+ *
 109+ * 'autoedit' is called as:
 110+ *
 111+ * {{#autoedit:form=|target=|link text=|link type=|query string=|reload}}
 112+ *
 113+ * This function creates a link or button that, when clicked on,
 114+ * automatically modifies the specified page according to the values in the
 115+ * 'query string' variable.
 116+ *
 117+ * The parameters of #autoedit are called in the same format as those
 118+ * of #formlink. The one addition, 'reload', will, if added, cause the page
 119+ * to reload after the user clicks the button or link.
 120+ *
108121 * @author Yaron Koren
109122 * @author Sergey Chernyshev
110123 * @author Daniel Friesen
111124 * @author Barry Welch
112125 * @author Christoph Burgmer
 126+ * @author Stephan Gambke
113127 */
114128
115129 class SFParserFunctions {
@@ -557,17 +571,14 @@
558572 }
559573
560574
561 - static function renderAutoEdit ( &$parser ) {
562 -
 575+ static function renderAutoEdit( &$parser ) {
563576 global $wgTitle;
564577
565578 // set defaults
566579 $formcontent = '';
567 -
568580 $linkString = null;
569581 $linkType = 'span';
570582 $summary = null;
571 -
572583 $classString = 'autoedit-trigger';
573584
574585 // parse parameters
@@ -636,9 +647,7 @@
637648 return $parser->insertStripItem( $output, $parser->mStripState );
638649 }
639650
640 -
641 - static function loadScriptsForPopupForm ( &$parser ) {
642 -
 651+ static function loadScriptsForPopupForm( &$parser ) {
643652 global $sfgScriptPath;
644653
645654 if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) {
@@ -650,7 +659,6 @@
651660 } else {
652661
653662 // on MW pre1.17 insert the necessary headers into the page head
654 -
655663 static $loaded = false;
656664
657665 // load JavaScript and CSS files only once
@@ -678,9 +686,10 @@
679687 return true;
680688 }
681689
682 - // load scripts and style files for AutoEdit
 690+ /**
 691+ * Load scripts and style files for AutoEdit
 692+ */
683693 private static function loadScriptsForAutoEdit ( &$parser ) {
684 -
685694 global $sfgScriptPath;
686695
687696 if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) {