Index: trunk/extensions/SemanticForms/includes/SF_FormClasses.php |
— | — | @@ -13,11 +13,11 @@ |
14 | 14 | * @ingroup SF |
15 | 15 | */ |
16 | 16 | class SFForm { |
17 | | - var $mFormName = null; |
18 | | - var $mTemplates = null; |
19 | | - var $mPageNameFormula = null; |
20 | | - var $mCreateTitle = null; |
21 | | - var $mEditTitle = null; |
| 17 | + private $mFormName; |
| 18 | + private $mTemplates; |
| 19 | + private $mPageNameFormula; |
| 20 | + private $mCreateTitle; |
| 21 | + private $mEditTitle; |
22 | 22 | |
23 | 23 | static function create( $formName, $templates ) { |
24 | 24 | $form = new SFForm(); |
— | — | @@ -26,6 +26,10 @@ |
27 | 27 | return $form; |
28 | 28 | } |
29 | 29 | |
| 30 | + function getFormName() { |
| 31 | + return $this->mFormName; |
| 32 | + } |
| 33 | + |
30 | 34 | function setPageNameFormula( $pageNameFormula ) { |
31 | 35 | $this->mPageNameFormula = $pageNameFormula; |
32 | 36 | } |
— | — | @@ -107,11 +111,11 @@ |
108 | 112 | * @ingroup SF |
109 | 113 | */ |
110 | 114 | class SFTemplateInForm { |
111 | | - var $template_name; |
112 | | - var $label; |
113 | | - var $allow_multiple; |
114 | | - var $max_allowed; |
115 | | - var $fields; |
| 115 | + private $template_name; |
| 116 | + private $label; |
| 117 | + private $allow_multiple; |
| 118 | + private $max_allowed; |
| 119 | + private $fields; |
116 | 120 | |
117 | 121 | /** |
118 | 122 | * For a field name and its attached property name located in the |
— | — | @@ -120,9 +124,7 @@ |
121 | 125 | */ |
122 | 126 | function handlePropertySettingInTemplate( $fieldName, $propertyName, $isList, &$templateFields, $templateText ) { |
123 | 127 | global $wgContLang; |
124 | | - $templateField = SFTemplateField::create( $fieldName, $wgContLang->ucfirst( $fieldName ) ); |
125 | | - $templateField->setSemanticProperty( $propertyName ); |
126 | | - $templateField->is_list = $isList; |
| 128 | + $templateField = SFTemplateField::create( $fieldName, $wgContLang->ucfirst( $fieldName ), $propertyName, $isList ); |
127 | 129 | $cur_pos = stripos( $templateText, $fieldName ); |
128 | 130 | $templateFields[$cur_pos] = $templateField; |
129 | 131 | } |
— | — | @@ -233,7 +235,7 @@ |
234 | 236 | return $templateFields; |
235 | 237 | } |
236 | 238 | |
237 | | - static function create( $name, $label, $allow_multiple, $max_allowed = null ) { |
| 239 | + static function create( $name, $label = null, $allow_multiple = null, $max_allowed = null ) { |
238 | 240 | $tif = new SFTemplateInForm(); |
239 | 241 | $tif->template_name = str_replace( '_', ' ', $name ); |
240 | 242 | $tif->fields = array(); |
— | — | @@ -248,6 +250,14 @@ |
249 | 251 | return $tif; |
250 | 252 | } |
251 | 253 | |
| 254 | + function getTemplateName() { |
| 255 | + return $this->template_name; |
| 256 | + } |
| 257 | + |
| 258 | + function getFields() { |
| 259 | + return $this->fields; |
| 260 | + } |
| 261 | + |
252 | 262 | function creationHTML( $template_num ) { |
253 | 263 | $checked_str = ( $this->allow_multiple ) ? "checked" : ""; |
254 | 264 | $template_str = wfMsg( 'sf_createform_template' ); |