Index: trunk/extensions/SemanticForms/specials/SF_EditData.php |
— | — | @@ -139,6 +139,6 @@ |
140 | 140 | $wgOut->addScript('<script type="text/javascript" src="' . $sfgScriptPath . '/libs/SF_yui_autocompletion.js"></script>' . "\n"); |
141 | 141 | $wgOut->addScript('<script type="text/javascript" src="' . $sfgScriptPath . '/libs/floatbox.js"></script>' . "\n"); |
142 | 142 | $wgOut->addScript(' <script type="text/javascript">' . "\n" . $javascript_text . '</script>' . "\n"); |
143 | | - $wgOut->addMeta('robots','noindex,nofollow'); |
| 143 | + $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
144 | 144 | $wgOut->addHTML($text); |
145 | 145 | } |
Index: trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php |
— | — | @@ -63,6 +63,7 @@ |
64 | 64 | $wgSpecialPages['UploadWindow'] = 'SFUploadWindow'; |
65 | 65 | $wgAutoloadClasses['SFUploadWindow'] = $sfgIP . '/specials/SF_UploadWindow.php'; |
66 | 66 | |
| 67 | +$wgAutoloadClasses['FormEditPage'] = $sfgIP . '/includes/SF_FormEditPage.php'; |
67 | 68 | $wgAutoloadClasses['SFTemplateField'] = $sfgIP . '/includes/SF_TemplateField.inc'; |
68 | 69 | $wgAutoloadClasses['SFForm'] = $sfgIP . '/includes/SF_FormClasses.inc'; |
69 | 70 | $wgAutoloadClasses['SFTemplateInForm'] = $sfgIP . '/includes/SF_FormClasses.inc'; |
— | — | @@ -418,7 +419,7 @@ |
419 | 420 | * pages) |
420 | 421 | */ |
421 | 422 | function sffEmbeddedEditForm($action, $article) { |
422 | | - global $sfgIP; |
| 423 | + global $sfgIP, $sfgUseFormEditPage; |
423 | 424 | |
424 | 425 | // return "true" if the call failed (meaning, pass on handling of |
425 | 426 | // the hook to others), and "false" otherwise |
— | — | @@ -426,11 +427,21 @@ |
427 | 428 | return true; |
428 | 429 | } |
429 | 430 | |
| 431 | + // @todo: This looks like bad code. If we can't find a form, we should be |
| 432 | + // showing an informative error page rather than making it look like an |
| 433 | + // edit form page does not exist. |
430 | 434 | $form_name = sffGetFormForArticle($article); |
431 | 435 | if ($form_name == '') { |
432 | 436 | return true; |
433 | 437 | } |
434 | 438 | |
| 439 | + if( $sfgUseFormEditPage ) { |
| 440 | + # Experimental new feature extending from the internal EditPage class |
| 441 | + $editor = new FormEditPage( $article, $form_name ); |
| 442 | + $editor->submit(); |
| 443 | + return false; |
| 444 | + } |
| 445 | + |
435 | 446 | $target_title = $article->getTitle(); |
436 | 447 | $target_name = sffTitleString($target_title); |
437 | 448 | if ($target_title->exists()) { |
Index: trunk/extensions/SemanticForms/includes/SF_Settings.php |
— | — | @@ -74,3 +74,13 @@ |
75 | 75 | ### |
76 | 76 | $sfgYUIBase = "http://yui.yahooapis.com/2.5.1/build/"; |
77 | 77 | |
| 78 | +### |
| 79 | +# Extend the edit form from the internal EditPage class rather than using a |
| 80 | +# special page and hacking things up. |
| 81 | +# |
| 82 | +# @note This is experimental and requires updates to EditPage which I have only |
| 83 | +# added into MediaWiki 1.14a |
| 84 | +### |
| 85 | +$sfgUseFormEditPage = false;//version_compare( $wgVersion, '1.14alpha', '>=' ); |
| 86 | + |
| 87 | + |