Index: trunk/extensions/PageSchemas/specials/PS_EditSchema.php |
— | — | @@ -83,41 +83,45 @@ |
84 | 84 | global $wgRequest, $wgOut, $wgUser; |
85 | 85 | global $wgSkin; |
86 | 86 | $this->setHeaders(); |
87 | | - $text_1 = '<p>This category does not exist yet. Create this category and its page schema: </p>'; |
88 | | - $text_2 = '<p>This category exists, but does not have a page schema. Create schema:" </p>'; |
89 | | - $text_3 = '<p>This category exists,have a page schema. Edit schema:" </p>'; |
| 87 | + $text_1 = '<p>'.wfMsg( 'page-desc-cat-not-exist' ).'</p>'; |
| 88 | + $text_2 = '<p>'.wfMsg( 'page-desc-ps-not-exist' ).'</p>'; |
| 89 | + $text_3 = '<p>'.wfMsg( 'page-desc-edit-schema' ).'</p>'; |
90 | 90 | $text_4 = ''; |
91 | 91 | self::addJavascript(); |
92 | 92 | $pageSchemaObj = null; |
93 | 93 | $text_extensions = array(); //This var. will save the html text returned by the extensions |
94 | | - $js_extensions = array(); |
95 | | - wfRunHooks( 'getHtmlTextForFieldInputs', array( &$js_extensions, &$text_extensions )); |
96 | | - $text = ""; |
97 | | - $text .= '<p>This category does not exist yet. Create this category and its page schema: </p>'; |
| 94 | + $js_extensions = array(); |
| 95 | + wfRunHooks( 'getHtmlTextForFieldInputs', array( &$js_extensions, &$text_extensions )); |
| 96 | + $text = ""; |
98 | 97 | $text .= ' <form id="createPageSchemaForm" action="" method="post">' . "\n"; |
99 | | - $text .= '<p>Name of schema: <input type="text" name="s_name"/> </p> '; |
100 | | - $text .= '<p>Additional XML: |
| 98 | + $text .= '<p>'.$schema_name_label.' <input type="text" name="s_name"/> </p> '; |
| 99 | + $text .= '<p>'.$add_xml_label.' |
101 | 100 | <textarea rows=4 style="width: 100%" name="ps_add_xml"></textarea> |
102 | 101 | </p> '; |
103 | 102 | if($text_extensions['sf_form'] != null){ |
104 | 103 | $text_ex = preg_replace('/starter/', '1', $text_extensions['sf_form']); |
105 | 104 | $text .= $text_ex; |
106 | 105 | } |
| 106 | + $delimeter_label = wfMsg('delimeter-label'); |
| 107 | + $multiple_temp_label = wfMsg('multiple-temp-label'); |
| 108 | + $field_list_label = wfMsg('field-list-label'); |
| 109 | + $add_xml_label = wfMsg('add-xml-label'); |
| 110 | + $schema_name_label = wfMsg('schema-name-label'); |
107 | 111 | $text .= '<div id="templatesList">'; |
108 | 112 | $text .= '<div class="templateBox" >'; |
109 | 113 | $text .= '<fieldset style="background: #ddd;"><legend>Template</legend> '; |
110 | 114 | $text .= '<p>Name: <input type="text" name="t_name_1"/></p> '; |
111 | | - $text .= '<p><input type="checkbox" name="is_multiple_1"/> Allow multiple instances of this template</p> '; |
| 115 | + $text .= '<p><input type="checkbox" name="is_multiple_1"/> '.$multiple_temp_label.'</p> '; |
112 | 116 | $text .= '<div id="fieldsList_1">'; |
113 | 117 | $text .= '<div class="fieldBox" >'; |
114 | 118 | $text .= '<fieldset style="background: #bbb;"><legend>Field</legend> |
115 | 119 | <p>Field name: <input size="15" name="f_name_1"> |
116 | 120 | Display label: <input size="15" name="f_label_1"> |
117 | 121 | </p> |
118 | | - <p><input type="checkbox" name="f_is_list_1" class="isListCheckbox" /> |
119 | | - This field can hold a list of values |
| 122 | + <p><input type="checkbox" name="f_is_list_1" class="isListCheckbox" />'. |
| 123 | + $field_list_label.' |
120 | 124 | </p> |
121 | | - <div class="delimiterInput" style="display: none" ><p>Delimiter for values (default is ","): <input type="text" name="f_delimiter_1" /> </p></div>'; |
| 125 | + <div class="delimiterInput" style="display: none" ><p>'.$delimeter_label.' <input type="text" name="f_delimiter_1" /> </p></div>'; |
122 | 126 | if($text_extensions['smw'] != null){ |
123 | 127 | $text_ex = preg_replace('/starter/', '1', $text_extensions['smw']); |
124 | 128 | $text .= $text_ex; |
— | — | @@ -129,8 +133,9 @@ |
130 | 134 | if($text_extensions['sd'] != null){ |
131 | 135 | $text_ex = preg_replace('/starter/', '1', $text_extensions['sd']); |
132 | 136 | $text .= $text_ex; |
133 | | - } |
134 | | - $text .= '<p>Additional XML: |
| 137 | + } |
| 138 | + |
| 139 | + $text .= '<p>'.$add_xml_label.' |
135 | 140 | <textarea rows=4 style="width: 100%" name="f_add_xml_1"></textarea> |
136 | 141 | </p> |
137 | 142 | <input type="button" value="Remove field" class="deleteField" /></fieldset> |
— | — | @@ -146,7 +151,7 @@ |
147 | 152 | ); |
148 | 153 | $text .= Xml::tags( 'p', null, $add_field_button ) . "\n"; |
149 | 154 | $text .= '<hr /> |
150 | | - <p>Additional XML: |
| 155 | + <p>'.$add_xml_label.' |
151 | 156 | <textarea rows=4 style="width: 100%" name="t_add_xml_1"></textarea> |
152 | 157 | </p> |
153 | 158 | <p><input type="button" value="Remove template" class="deleteTemplate" /></p> |
— | — | @@ -175,7 +180,7 @@ |
176 | 181 | <p><input type="button" value="Add Field" onclick="createTemplateAddField(starter)" /></p> |
177 | 182 | |
178 | 183 | <hr /> |
179 | | - <p>Additional XML: |
| 184 | + <p>'.$add_xml_label.' |
180 | 185 | <textarea rows=4 style="width: 100%" name="t_add_xml_starter"></textarea> |
181 | 186 | </p> |
182 | 187 | <p><input type="button" value="Remove template" class="deleteTemplate" /></p> |
— | — | @@ -200,7 +205,7 @@ |
201 | 206 | if($text_extensions['sd'] != null){ |
202 | 207 | $starter_text .= $text_extensions['sd']; |
203 | 208 | } |
204 | | - $starter_text .= '<p>Additional XML: |
| 209 | + $starter_text .= '<p>'.$add_xml_label.' |
205 | 210 | <textarea rows=4 style="width: 100%" name="f_add_xml_starter"></textarea> |
206 | 211 | </p> |
207 | 212 | <input type="button" value="Remove field" class="deleteField" /> |
— | — | @@ -293,7 +298,7 @@ |
294 | 299 | Job::batchInsert( $jobs ); |
295 | 300 | } |
296 | 301 | } |
297 | | - else{ |
| 302 | + else{ |
298 | 303 | if ( $category != "" ) { |
299 | 304 | $pageSchemaObj = new PSSchema( $category ); |
300 | 305 | $title = Title::newFromText( $category, NS_CATEGORY ); |
— | — | @@ -326,13 +331,13 @@ |
327 | 332 | $pageName = (string)$pageXml->attributes()->name; |
328 | 333 | $text_4 .= ''; |
329 | 334 | $text_4 .= '<form id="editPageSchemaForm" action="" method="post">' . "\n"; |
330 | | - $text_4 .= '<p>Name of schema: <input type="text" name="s_name" value="'.$pageName.'" /> </p> '; |
| 335 | + $text_4 .= '<p>'.$schema_name_label.' <input type="text" name="s_name" value="'.$pageName.'" /> </p> '; |
331 | 336 | foreach ( $pageXml->children() as $template_xml ) { |
332 | 337 | if ( ($template_xml->getName() != 'Template') && ($template_xml->getName() != 'Form') ){ |
333 | 338 | $ps_add_xml .= (string)$template_xml->asXML(); |
334 | 339 | } |
335 | 340 | } |
336 | | - $text_4 .= '<p>Additional XML: |
| 341 | + $text_4 .= '<p>'.$add_xml_label.' |
337 | 342 | <textarea rows=4 style="width: 100%" name="ps_add_xml" >'.$ps_add_xml.'</textarea> |
338 | 343 | </p> '; |
339 | 344 | |
— | — | @@ -417,7 +422,7 @@ |
418 | 423 | } |
419 | 424 | } |
420 | 425 | |
421 | | - $text_4 .= '<p>Additional XML: |
| 426 | + $text_4 .= '<p>'.$add_xml_label.' |
422 | 427 | <textarea rows=4 style="width: 100%" name="f_add_xml_'.$field_count.'"></textarea> |
423 | 428 | </p> |
424 | 429 | <input type="button" value="Remove field" class="deleteField" /></fieldset> |
— | — | @@ -439,7 +444,7 @@ |
440 | 445 | ); |
441 | 446 | $text_4 .= Xml::tags( 'p', null, $add_field_button ) . "\n"; |
442 | 447 | $text_4 .= '<hr /> |
443 | | - <p>Additional XML: |
| 448 | + <p>'.$add_xml_label.' |
444 | 449 | <textarea rows=4 style="width: 100%" name="t_add_xml_'.$template_num.'">'.$template_add_xml.'</textarea> |
445 | 450 | </p> |
446 | 451 | <p><input type="button" value="Remove template" class="deleteTemplate" /></p> |