Index: trunk/extensions/SemanticForms/specials/SF_CreateClass.php |
— | — | @@ -61,8 +61,6 @@ |
62 | 62 | $numStartingRows = 10; |
63 | 63 | self::addJavascript( $numStartingRows ); |
64 | 64 | |
65 | | - $create_button_text = wfMsg( 'create' ); |
66 | | - |
67 | 65 | $property_name_error_str = ''; |
68 | 66 | $save_page = $wgRequest->getCheck( 'save' ); |
69 | 67 | if ( $save_page ) { |
— | — | @@ -70,8 +68,7 @@ |
71 | 69 | $form_name = trim( $wgRequest->getVal( "form_name" ) ); |
72 | 70 | $category_name = trim( $wgRequest->getVal( "category_name" ) ); |
73 | 71 | if ( $template_name == '' | $form_name == '' || $category_name == '' ) { |
74 | | - $text = Xml::element( 'p', null, wfMsg( 'sf_createclass_missingvalues' ) ); |
75 | | - $wgOut->addHTML( $text ); |
| 72 | + $wgOut->addWikiMsg( 'sf_createclass_missingvalues' ); |
76 | 73 | return; |
77 | 74 | } |
78 | 75 | $fields = array(); |
— | — | @@ -106,7 +103,7 @@ |
107 | 104 | // create the template, and save it |
108 | 105 | $full_text = SFTemplateField::createTemplateText( $template_name, $fields, null, $category_name, null, null, null ); |
109 | 106 | $template_title = Title::makeTitleSafe( NS_TEMPLATE, $template_name ); |
110 | | - $template_article = new Article( $template_title ); |
| 107 | + $template_article = new Article( $template_title, 0 ); |
111 | 108 | $edit_summary = ''; |
112 | 109 | $template_article->doEdit( $full_text, $edit_summary ); |
113 | 110 | |
— | — | @@ -130,8 +127,7 @@ |
131 | 128 | $jobs[] = new SFCreatePageJob( $category_title, $params ); |
132 | 129 | Job::batchInsert( $jobs ); |
133 | 130 | |
134 | | - $text = Xml::element( 'p', null, wfMsg( 'sf_createclass_success' ) ); |
135 | | - $wgOut->addHTML( $text ); |
| 131 | + $wgOut->addWikiMsg( 'sf_createclass_success' ); |
136 | 132 | return; |
137 | 133 | } |
138 | 134 | |
— | — | @@ -147,21 +143,21 @@ |
148 | 144 | $creation_links[] = SFUtils::linkForSpecialPage( $sk, 'CreateCategory' ); |
149 | 145 | $create_class_docu = wfMsg( 'sf_createclass_docu', $wgLang->listToText( $creation_links ) ); |
150 | 146 | $leave_field_blank = wfMsg( 'sf_createclass_leavefieldblank' ); |
151 | | - $form_name_label = wfMsg( 'sf_createform_nameinput' ); |
| 147 | + $form_name_label = wfMsg( 'sf_createclass_nameinput' ); |
152 | 148 | $template_name_label = wfMsg( 'sf_createtemplate_namelabel' ); |
153 | 149 | $category_name_label = wfMsg( 'sf_createcategory_name' ); |
154 | 150 | $property_name_label = wfMsg( 'sf_createproperty_propname' ); |
155 | 151 | $field_name_label = wfMsg( 'sf_createtemplate_fieldname' ); |
156 | 152 | $type_label = wfMsg( 'sf_createproperty_proptype' ); |
157 | | - $allowed_values_label = wfMsg( 'sf_createclass_allowedvalues' ) . wfMsg( 'colon-separator' ); |
158 | | - $list_of_values_label = wfMsg( 'sf_createclass_listofvalues' ) . '?'; |
| 153 | + $allowed_values_label = wfMsg( 'sf_createclass_allowedvalues' ); |
| 154 | + $list_of_values_label = wfMsg( 'sf_createclass_listofvalues' ); |
159 | 155 | |
160 | 156 | $text = <<<END |
161 | 157 | <form action="" method="post"> |
162 | 158 | <p>$create_class_docu</p> |
163 | 159 | <p>$leave_field_blank</p> |
164 | 160 | <p>$template_name_label <input type="text" size="30" name="template_name"></p> |
165 | | - <p>$form_name_label: <input type="text" size="30" name="form_name"></p> |
| 161 | + <p>$form_name_label <input type="text" size="30" name="form_name"></p> |
166 | 162 | <p>$category_name_label <input type="text" size="30" name="category_name"></p> |
167 | 163 | <div> |
168 | 164 | <table id="mainTable"> |
— | — | @@ -222,13 +218,13 @@ |
223 | 219 | ); |
224 | 220 | $text .= Xml::tags( 'p', null, $add_another_button ) . "\n"; |
225 | 221 | // Set 'title' as hidden field, in case there's no URL niceness |
226 | | - $cc = Title::makeTitleSafe( NS_SPECIAL, 'CreateClass' ); |
| 222 | + $cc = $this->getTitle(); |
227 | 223 | $text .= Html::Hidden( 'title', SFUtils::titleURLString( $cc ) ) . "\n"; |
228 | 224 | $text .= Xml::element( 'input', |
229 | 225 | array( |
230 | 226 | 'type' => 'submit', |
231 | 227 | 'name' => 'save', |
232 | | - 'value' => $create_button_text |
| 228 | + 'value' => wfMsg( 'sf_createclass_create' ); |
233 | 229 | ) |
234 | 230 | ); |
235 | 231 | $text .= "</form>\n"; |
Index: trunk/extensions/SemanticForms/languages/SF_Messages.php |
— | — | @@ -103,11 +103,13 @@ |
104 | 104 | 'sf_createcategory_makesubcategory' => 'Make this a subcategory of another category (optional):', |
105 | 105 | 'createclass' => 'Create a class', |
106 | 106 | 'sf_createclass_docu' => 'Enter all the data here to create the properties, template, form and category for a single class. For more options, use the pages $1 instead.', |
107 | | - 'sf_createclass_allowedvalues' => 'Allowed values', |
108 | | - 'sf_createclass_listofvalues' => 'List of values', |
| 107 | + 'sf_createclass_allowedvalues' => 'Allowed values:', |
| 108 | + 'sf_createclass_listofvalues' => 'List of values?', |
109 | 109 | 'sf_createclass_leavefieldblank' => 'If the field name is the same as the property name, you can leave it blank.', |
| 110 | + 'sf_createclass_nameinput' => 'Form name:', |
110 | 111 | 'sf_createclass_missingvalues' => 'Not all required fields were filled out.', |
111 | 112 | 'sf_createclass_success' => 'Properties, template, form and category will be created.', |
| 113 | + 'sf_createclass_create' => 'Create', |
112 | 114 | 'formstart' => 'Start of form', |
113 | 115 | 'sf_formstart_badform' => 'Error: no form page was found at $1.', |
114 | 116 | 'sf_formstart_badtitle' => 'Error: "$1" is an invalid title for a page.', |
— | — | @@ -128,7 +130,7 @@ |
129 | 131 | 'sf_formcreate' => 'Create with form', |
130 | 132 | 'sf_viewform' => 'View form', |
131 | 133 | 'sf_editsource' => 'Edit source', |
132 | | - 'sf_formedit_edittitle' => 'Edit $1: $2', |
| 134 | + 'sf_formedit_edittitle' => 'Edit $1: $2', |
133 | 135 | 'sf_formedit_morethanoneform' => "'''Warning:''' More than one default form is defined for this page.", |
134 | 136 | 'sf_formedit_formwarning' => 'Warning: This page <a href="$1">already exists</a>, but it does not use this form.', |
135 | 137 | 'sf_formedit_remove' => 'Remove', |