Index: trunk/extensions/SemanticForms/includes/SF_Utils.inc |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | * Accepts an optional Parser instance, or uses $wgOut if omitted. |
109 | 109 | */ |
110 | 110 | static function addJavascriptAndCSS($parser = NULL) { |
111 | | - global $wgOut, $sfgScriptPath, $sfgYUIBase, $smwgScriptPath, $wgScriptPath, $wgFCKEditorDir, $wgJsMimeType; |
| 111 | + global $wgOut, $sfgScriptPath, $sfgYUIBase, $smwgScriptPath, $wgScriptPath, $wgFCKEditorDir, $wgJsMimeType, $sfgUseFormEditPage; |
112 | 112 | |
113 | 113 | $links = array( |
114 | 114 | array( |
— | — | @@ -149,21 +149,21 @@ |
150 | 150 | } |
151 | 151 | |
152 | 152 | |
153 | | - $scripts = array( |
154 | | - "{$sfgYUIBase}yahoo/yahoo-min.js", |
155 | | - "{$sfgYUIBase}dom/dom-min.js", |
156 | | - "{$sfgYUIBase}event/event-min.js", |
157 | | - "{$sfgYUIBase}get/get-min.js", |
158 | | - "{$sfgYUIBase}connection/connection-min.js", |
159 | | - "{$sfgYUIBase}json/json-min.js", |
160 | | - "{$sfgYUIBase}datasource/datasource-min.js", |
161 | | - "{$sfgYUIBase}autocomplete/autocomplete-min.js", |
162 | | - "$sfgScriptPath/libs/SF_yui_autocompletion.js", |
163 | | - "$sfgScriptPath/libs/SF_ajax_form_preview.js", |
164 | | - "$sfgScriptPath/libs/floatbox.js", |
165 | | - "$smwgScriptPath/skins/SMW_tooltip.js", |
166 | | - "$smwgScriptPath/skins/SMW_sorttable.js", |
167 | | - ); |
| 153 | + $scripts = array(); |
| 154 | + $scripts[] = "{$sfgYUIBase}yahoo/yahoo-min.js"; |
| 155 | + $scripts[] = "{$sfgYUIBase}dom/dom-min.js"; |
| 156 | + $scripts[] = "{$sfgYUIBase}event/event-min.js"; |
| 157 | + $scripts[] = "{$sfgYUIBase}get/get-min.js"; |
| 158 | + $scripts[] = "{$sfgYUIBase}connection/connection-min.js"; |
| 159 | + $scripts[] = "{$sfgYUIBase}json/json-min.js"; |
| 160 | + $scripts[] = "{$sfgYUIBase}datasource/datasource-min.js"; |
| 161 | + $scripts[] = "{$sfgYUIBase}autocomplete/autocomplete-min.js"; |
| 162 | + $scripts[] = "$sfgScriptPath/libs/SF_yui_autocompletion.js"; |
| 163 | + if ( !$sfgUseFormEditPage ) |
| 164 | + $scripts[] = "$sfgScriptPath/libs/SF_ajax_form_preview.js"; |
| 165 | + $scripts[] = "$sfgScriptPath/libs/floatbox.js"; |
| 166 | + $scripts[] = "$smwgScriptPath/skins/SMW_tooltip.js"; |
| 167 | + $scripts[] = "$smwgScriptPath/skins/SMW_sorttable.js"; |
168 | 168 | if ($wgFCKEditorDir) |
169 | 169 | $scripts[] = "$wgScriptPath/$wgFCKEditorDir/fckeditor.js"; |
170 | 170 | foreach( $scripts as $js ) { |
Index: trunk/extensions/SemanticForms/includes/SF_FormEditPage.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | * @author Yaron Koren |
8 | 8 | */ |
9 | 9 | |
10 | | -class FormEditPage extends EditPage { |
| 10 | +class SFFormEditPage extends EditPage { |
11 | 11 | |
12 | 12 | protected $form, $form_name; |
13 | 13 | |
— | — | @@ -19,6 +19,10 @@ |
20 | 20 | $this->form = Title::makeTitleSafe(SF_NS_FORM, $form_name); |
21 | 21 | $this->form_name = $form_name; |
22 | 22 | } |
| 23 | + |
| 24 | + protected function isSectionEditSupported() { |
| 25 | + return false; // sections and forms don't mix |
| 26 | + } |
23 | 27 | |
24 | 28 | function setHeaders() { |
25 | 29 | parent::setHeaders(); |
— | — | @@ -33,13 +37,12 @@ |
34 | 38 | if ($this->textbox1 != null) |
35 | 39 | parent::displayPreviewArea($previewOutput); |
36 | 40 | } |
37 | | - |
38 | | - protected function showTextbox1( $classes ) { |
39 | | - if( $this->isConflict ) { |
40 | | - // Fallback to normal mode when showing an editconflict |
41 | | - parent::showTextbox1(); |
42 | | - return; |
43 | | - } |
| 41 | + |
| 42 | + protected function importContentFormData( &$request ) { |
| 43 | + // @todo This is where $request to save&preview page text should go |
| 44 | + } |
| 45 | + |
| 46 | + protected function showContentForm() { |
44 | 47 | global $sfgIP; |
45 | 48 | $target_title = $this->mArticle->getTitle(); |
46 | 49 | $target_name = SFLinkUtils::titleString($target_title); |
— | — | @@ -48,7 +51,7 @@ |
49 | 52 | } else { |
50 | 53 | SFAddData::printAddForm($this->form_name, $target_name, array(), $this->textbox1); |
51 | 54 | } |
52 | | - |
| 55 | + // @todo This needs a proper form builder |
53 | 56 | } |
54 | 57 | |
55 | 58 | function showFooter() { |
Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.inc |
— | — | @@ -529,7 +529,7 @@ |
530 | 530 | $disabled_text = ($is_disabled) ? "disabled" : ""; |
531 | 531 | if ($label == null) |
532 | 532 | $label = wfMsg('savearticle'); |
533 | | - $temp = array( |
| 533 | + $temp = $attr + array( |
534 | 534 | 'id' => 'wpSave', |
535 | 535 | 'name' => 'wpSave', |
536 | 536 | 'type' => 'submit', |
— | — | @@ -538,7 +538,7 @@ |
539 | 539 | 'accesskey' => wfMsg('accesskey-save'), |
540 | 540 | 'title' => wfMsg('tooltip-save'), |
541 | 541 | $disabled_text => '', |
542 | | - ) + $attr; |
| 542 | + ); |
543 | 543 | return self::buttonHTML($temp); |
544 | 544 | } |
545 | 545 | |
— | — | @@ -549,7 +549,7 @@ |
550 | 550 | $disabled_text = ($is_disabled) ? "disabled" : ""; |
551 | 551 | if ($label == null) |
552 | 552 | $label = wfMsg('showpreview'); |
553 | | - $temp = array( |
| 553 | + $temp = $attr + array( |
554 | 554 | 'id' => 'wpPreview', |
555 | 555 | 'name' => 'wpPreview', |
556 | 556 | 'type' => 'submit', |
— | — | @@ -558,7 +558,7 @@ |
559 | 559 | 'accesskey' => wfMsg('accesskey-preview'), |
560 | 560 | 'title' => wfMsg('tooltip-preview'), |
561 | 561 | $disabled_text => '', |
562 | | - ) + $attr; |
| 562 | + ); |
563 | 563 | return self::buttonHTML($temp); |
564 | 564 | } |
565 | 565 | |
— | — | @@ -569,7 +569,7 @@ |
570 | 570 | $disabled_text = ($is_disabled) ? "disabled" : ""; |
571 | 571 | if ($label == null) |
572 | 572 | $label = wfMsg('showdiff'); |
573 | | - $temp = array( |
| 573 | + $temp = $attr + array( |
574 | 574 | 'id' => 'wpDiff', |
575 | 575 | 'name' => 'wpDiff', |
576 | 576 | 'type' => 'submit', |
— | — | @@ -578,7 +578,7 @@ |
579 | 579 | 'accesskey' => wfMsg('accesskey-diff'), |
580 | 580 | 'title' => wfMsg('tooltip-diff'), |
581 | 581 | $disabled_text => '', |
582 | | - ) + $attr; |
| 582 | + ); |
583 | 583 | return self::buttonHTML($temp); |
584 | 584 | } |
585 | 585 | |
— | — | @@ -616,14 +616,14 @@ |
617 | 617 | $disabled_text = ($is_disabled) ? "disabled" : ""; |
618 | 618 | if ($label == null) |
619 | 619 | $label = wfMsg('runquery'); |
620 | | - return self::buttonHTML(array( |
| 620 | + return self::buttonHTML($attr + array( |
621 | 621 | 'id' => 'wpRunQuery', |
622 | 622 | 'name' => 'wpRunQuery', |
623 | 623 | 'type' => 'submit', |
624 | 624 | 'tabindex' => $sfgTabIndex, |
625 | 625 | 'value' => $label, |
626 | 626 | 'title' => $label, |
627 | | - ) + $attr); |
| 627 | + )); |
628 | 628 | } |
629 | 629 | |
630 | 630 | // Much of this function is based on MediaWiki's EditPage::showEditForm() |
Index: trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php |
— | — | @@ -88,6 +88,7 @@ |
89 | 89 | $wgAutoloadClasses['SFFormInputs'] = $sfgIP . '/includes/SF_FormInputs.inc'; |
90 | 90 | $wgAutoloadClasses['SFFormUtils'] = $sfgIP . '/includes/SF_FormUtils.inc'; |
91 | 91 | $wgAutoloadClasses['SFFormEditTab'] = $sfgIP . '/includes/SF_FormEditTab.php'; |
| 92 | +$wgAutoloadClasses['SFFormEditPage'] = $sfgIP . '/includes/SF_FormEditPage.php'; |
92 | 93 | $wgAutoloadClasses['SFUtils'] = $sfgIP . '/includes/SF_Utils.inc'; |
93 | 94 | $wgAutoloadClasses['SFLinkUtils'] = $sfgIP . '/includes/SF_LinkUtils.inc'; |
94 | 95 | $wgAutoloadClasses['SFParserFunctions'] = $sfgIP . '/includes/SF_ParserFunctions.php'; |
Index: trunk/extensions/SemanticForms/includes/SF_FormEditTab.php |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | if( $sfgUseFormEditPage ) { |
144 | 144 | # Experimental new feature extending from the internal |
145 | 145 | # EditPage class |
146 | | - $editor = new FormEditPage( $article, $form_name ); |
| 146 | + $editor = new SFFormEditPage( $article, $form_name ); |
147 | 147 | $editor->submit(); |
148 | 148 | return false; |
149 | 149 | } |