mFormName = ucfirst( str_replace( '_', ' ', $formName ) ); $form->mAssociatedCategory = null; $form->mItems = $items; return $form; } function getFormName() { return $this->mFormName; } function getItems() { return $this->mItems; } function setPageNameFormula( $pageNameFormula ) { $this->mPageNameFormula = $pageNameFormula; } function setCreateTitle( $createTitle ) { $this->mCreateTitle = $createTitle; } function setEditTitle( $editTitle ) { $this->mEditTitle = $editTitle; } function setAssociatedCategory( $associatedCategory ) { $this->mAssociatedCategory = $associatedCategory; } function createMarkup( $standardInputs = array(), $freeTextLabel = null ) { $title = Title::makeTitle( PF_NS_FORM, $this->mFormName ); $fs = SpecialPageFactory::getPage( 'FormStart' ); $form_start_url = PFUtils::titleURLString( $fs->getTitle() ) . "/" . $title->getPartialURL(); $form_description = wfMessage( 'pf_form_docu', $this->mFormName, $form_start_url )->inContentLanguage()->text(); $form_input = "{{#forminput:form=" . str_replace( ',', '\,', $this->mFormName ); if ( !is_null( $this->mAssociatedCategory ) ) { $form_input .= "|autocomplete on category=" . $this->mAssociatedCategory; } $form_input .= "}}\n"; $text = << $form_description $form_input END; if ( !empty( $this->mPageNameFormula ) || !empty( $this->mCreateTitle ) || !empty( $this->mEditTitle ) ) { $text .= "{{{info"; if ( !empty( $this->mPageNameFormula ) ) { $text .= "|page name=" . $this->mPageNameFormula; } if ( !empty( $this->mCreateTitle ) ) { $text .= "|create title=" . $this->mCreateTitle; } if ( !empty( $this->mEditTitle ) ) { $text .= "|edit title=" . $this->mEditTitle; } $text .= "}}}\n"; } $text .= <<