Index: trunk/extensions/SemanticForms/includes/SF_Form.php |
— | — | @@ -12,11 +12,13 @@ |
13 | 13 | private $mPageNameFormula; |
14 | 14 | private $mCreateTitle; |
15 | 15 | private $mEditTitle; |
| 16 | + private $mAssociatedCategory; |
16 | 17 | |
17 | 18 | static function create( $formName, $templates ) { |
18 | 19 | $form = new SFForm(); |
19 | 20 | $form->mFormName = ucfirst( str_replace( '_', ' ', $formName ) ); |
20 | 21 | $form->mTemplates = $templates; |
| 22 | + $form->mAssociatedCategory = null; |
21 | 23 | return $form; |
22 | 24 | } |
23 | 25 | |
— | — | @@ -36,6 +38,10 @@ |
37 | 39 | $this->mEditTitle = $editTitle; |
38 | 40 | } |
39 | 41 | |
| 42 | + function setAssociatedCategory( $associatedCategory ) { |
| 43 | + $this->mAssociatedCategory = $associatedCategory; |
| 44 | + } |
| 45 | + |
40 | 46 | function creationHTML() { |
41 | 47 | $text = ""; |
42 | 48 | foreach ( $this->mTemplates as $i => $ft ) { |
— | — | @@ -49,7 +55,11 @@ |
50 | 56 | $fs = SpecialPage::getPage( 'FormStart' ); |
51 | 57 | $form_start_url = SFUtils::titleURLString( $fs->getTitle() ) . "/" . $title->getPartialURL(); |
52 | 58 | $form_description = wfMsgForContent( 'sf_form_docu', $this->mFormName, $form_start_url ); |
53 | | - $form_input = "{{#forminput:form=" . $this->mFormName . "}}\n"; |
| 59 | + $form_input = "{{#forminput:form=" . $this->mFormName; |
| 60 | + if ( !is_null( $this->mAssociatedCategory ) ) { |
| 61 | + $form_input .= "|autocomplete on category=" . $this->mAssociatedCategory; |
| 62 | + } |
| 63 | + $form_input .= "}}\n"; |
54 | 64 | $text = <<<END |
55 | 65 | <noinclude> |
56 | 66 | $form_description |