Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php |
— | — | @@ -4,8 +4,8 @@ |
5 | 5 | * |
6 | 6 | * @file |
7 | 7 | * @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'. |
10 | 10 | * |
11 | 11 | * 'forminput' is called as: |
12 | 12 | * |
— | — | @@ -104,11 +104,25 @@ |
105 | 105 | * |
106 | 106 | * {{#arraymaptemplate:blue;red;yellow|Beautify|;|;}} |
107 | 107 | * |
| 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 | + * |
108 | 121 | * @author Yaron Koren |
109 | 122 | * @author Sergey Chernyshev |
110 | 123 | * @author Daniel Friesen |
111 | 124 | * @author Barry Welch |
112 | 125 | * @author Christoph Burgmer |
| 126 | + * @author Stephan Gambke |
113 | 127 | */ |
114 | 128 | |
115 | 129 | class SFParserFunctions { |
— | — | @@ -557,17 +571,14 @@ |
558 | 572 | } |
559 | 573 | |
560 | 574 | |
561 | | - static function renderAutoEdit ( &$parser ) { |
562 | | - |
| 575 | + static function renderAutoEdit( &$parser ) { |
563 | 576 | global $wgTitle; |
564 | 577 | |
565 | 578 | // set defaults |
566 | 579 | $formcontent = ''; |
567 | | - |
568 | 580 | $linkString = null; |
569 | 581 | $linkType = 'span'; |
570 | 582 | $summary = null; |
571 | | - |
572 | 583 | $classString = 'autoedit-trigger'; |
573 | 584 | |
574 | 585 | // parse parameters |
— | — | @@ -636,9 +647,7 @@ |
637 | 648 | return $parser->insertStripItem( $output, $parser->mStripState ); |
638 | 649 | } |
639 | 650 | |
640 | | - |
641 | | - static function loadScriptsForPopupForm ( &$parser ) { |
642 | | - |
| 651 | + static function loadScriptsForPopupForm( &$parser ) { |
643 | 652 | global $sfgScriptPath; |
644 | 653 | |
645 | 654 | if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) { |
— | — | @@ -650,7 +659,6 @@ |
651 | 660 | } else { |
652 | 661 | |
653 | 662 | // on MW pre1.17 insert the necessary headers into the page head |
654 | | - |
655 | 663 | static $loaded = false; |
656 | 664 | |
657 | 665 | // load JavaScript and CSS files only once |
— | — | @@ -678,9 +686,10 @@ |
679 | 687 | return true; |
680 | 688 | } |
681 | 689 | |
682 | | - // load scripts and style files for AutoEdit |
| 690 | + /** |
| 691 | + * Load scripts and style files for AutoEdit |
| 692 | + */ |
683 | 693 | private static function loadScriptsForAutoEdit ( &$parser ) { |
684 | | - |
685 | 694 | global $sfgScriptPath; |
686 | 695 | |
687 | 696 | if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) { |