r24183 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24182‎ | r24183 | r24184 >
Date:22:59, 16 July 2007
Author:yaron
Status:old
Tags:
Comment:
Version 0.3.9 - fix for URL encoding, added 'hidden' property for 'free text'
Modified paths:
  • /trunk/extensions/SemanticForms/INSTALL (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/INSTALL
@@ -1,4 +1,4 @@
2 -[[Semantic Forms 0.3.8]]
 2+[[Semantic Forms 0.3.9]]
33
44 Contents:
55 * Disclaimer
Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc
@@ -310,12 +310,16 @@
311311 // add placeholders for the free text in both the form and
312312 // the page, using <free_text> tags - once all the free text
313313 // is known (at the end), it will get substituted in
314 - if ($num_rows == null) $num_rows = 5;
315 - if ($num_cols == null) $num_cols = 30;
316 - $new_text = SFFormPrinter::textAreaHTML($num_rows, $num_cols, null, 'free_text', '<free_text>', null);
 314+ if ($is_hidden) {
 315+ $new_text = SFFormPrinter::hiddenFieldHTML(null, 'free_text', '<free_text>');
 316+ } else {
 317+ if ($num_rows == null) $num_rows = 5;
 318+ if ($num_cols == null) $num_cols = 30;
 319+ $new_text = SFFormPrinter::textAreaHTML($num_rows, $num_cols, null, 'free_text', '<free_text>', null);
 320+ }
 321+ $section = substr_replace($section, $new_text, $brackets_loc, $brackets_end_loc + 3 - $brackets_loc);
317322 $free_text_was_included = true;
318 - $section = substr_replace($section, $new_text, $brackets_loc, $brackets_end_loc + 3 - $brackets_loc);
319 - // add a similar placeholder to the data text
 323+ // add a similar placeholder to the data text
320324 $data_text .= "<free_text>\n\n";
321325 }
322326 } else { // this field is part of a template
@@ -788,8 +792,9 @@
789793 $page_action = "wpDiff";
790794
791795 global $wgScript;
 796+ $encoded_page_name = urlencode($page_name);
792797 $text = <<<END
793 - <form id="editform" name="editform" method="post" action="$wgScript?title=$page_name&amp;action=submit">
 798+ <form id="editform" name="editform" method="post" action="$wgScript?title=$encoded_page_name&amp;action=submit">
794799 <input type="hidden" name="wpTextbox1" id="wpTextbox1" value="$data_text" />
795800 <input type="hidden" name="wpStarttime" value="$starttime" />
796801 <input type="hidden" name="wpEdittime" value="$edittime" />
Index: trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php
@@ -3,7 +3,7 @@
44 * Global functions and constants for Semantic Forms.
55 */
66
7 -define('SF_VERSION','0.3.8');
 7+define('SF_VERSION','0.3.9');
88
99 $wgExtensionFunctions[] = 'sfgSetupExtension';
1010

Status & tagging log