Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php |
— | — | @@ -9,6 +9,8 @@ |
10 | 10 | */ |
11 | 11 | abstract class SMWDataValue { |
12 | 12 | |
| 13 | + protected $m_attribute = false; |
| 14 | + |
13 | 15 | /*********************************************************************/ |
14 | 16 | /* Static methods for initialisation */ |
15 | 17 | /*********************************************************************/ |
— | — | @@ -96,10 +98,13 @@ |
97 | 99 | abstract public function setXSDValue($value, $unit); |
98 | 100 | |
99 | 101 | /** |
100 | | - * Set the attribute to which this value refers. Used to generate search links. |
101 | | - * The atriubte is given as a simple wiki text title, without namespace prefix. |
| 102 | + * Set the attribute to which this value refers. Used to generate search links and |
| 103 | + * to find custom settings that relate to the attribute. |
| 104 | + * The attribute is given as a simple wiki text title, without namespace prefix. |
102 | 105 | */ |
103 | | - abstract public function setAttribute($attribute); |
| 106 | + public function setAttribute($attstring) { |
| 107 | + $this->m_attribute = $attstring; |
| 108 | + } |
104 | 109 | |
105 | 110 | /** |
106 | 111 | * Define a particular output format. Output formats are user-supplied strings |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Error.php |
— | — | @@ -7,7 +7,6 @@ |
8 | 8 | */ |
9 | 9 | class SMWErrorValue extends SMWDataValue { |
10 | 10 | |
11 | | - private $m_attribute = null; |
12 | 11 | private $m_error; |
13 | 12 | private $m_value; |
14 | 13 | private $m_infolinks = Array(); |
— | — | @@ -17,10 +16,6 @@ |
18 | 17 | $this->m_value = $uservalue; |
19 | 18 | } |
20 | 19 | |
21 | | - /*********************************************************************/ |
22 | | - /* Set methods */ |
23 | | - /*********************************************************************/ |
24 | | - |
25 | 20 | public function setUserValue($value) { |
26 | 21 | $this->m_value = $value; |
27 | 22 | return true; |
— | — | @@ -30,20 +25,12 @@ |
31 | 26 | $this->setUserValue($value); // no units, compatible syntax |
32 | 27 | } |
33 | 28 | |
34 | | - public function setAttribute($attribute) { |
35 | | - $this->m_attribute = $attribute; |
36 | | - } |
37 | | - |
38 | 29 | public function setOutputFormat($formatstring){ |
39 | 30 | //do nothing |
40 | 31 | } |
41 | 32 | public function setError($errormsg){ |
42 | 33 | $this->m_error = $errormsg; |
43 | 34 | } |
44 | | - |
45 | | - /*********************************************************************/ |
46 | | - /* Get methods */ |
47 | | - /*********************************************************************/ |
48 | 35 | |
49 | 36 | public function getShortWikiText($linked = NULL) { |
50 | 37 | //TODO: support linking |
— | — | @@ -104,5 +91,3 @@ |
105 | 92 | return false; |
106 | 93 | } |
107 | 94 | } |
108 | | - |
109 | | -?> |
\ No newline at end of file |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_URI.php |
— | — | @@ -14,17 +14,12 @@ |
15 | 15 | |
16 | 16 | class SMWURIValue extends SMWDataValue { |
17 | 17 | |
18 | | - private $m_attribute = null; |
19 | 18 | private $m_error = ''; |
20 | 19 | private $m_value = ''; |
21 | 20 | private $m_xsdvalue = ''; |
22 | 21 | private $m_infolinks = Array(); |
23 | 22 | private $m_mode = ''; |
24 | 23 | |
25 | | - /*********************************************************************/ |
26 | | - /* Set methods */ |
27 | | - /*********************************************************************/ |
28 | | - |
29 | 24 | function SMWURIValue($mode) { |
30 | 25 | switch ($mode) { |
31 | 26 | default: case 'url': |
— | — | @@ -71,17 +66,10 @@ |
72 | 67 | $this-> setUserValue($value); |
73 | 68 | } |
74 | 69 | |
75 | | - public function setAttribute($attribute) { |
76 | | - $this->m_attribute = $attribute; |
| 70 | + public function setOutputFormat($formatstring){ |
| 71 | + //TODO |
77 | 72 | } |
78 | 73 | |
79 | | - public function setOutputFormat($formatstring){ |
80 | | - //TODO |
81 | | - } |
82 | | - /*********************************************************************/ |
83 | | - /* Get methods */ |
84 | | - /*********************************************************************/ |
85 | | - |
86 | 74 | public function getShortWikiText($linked = NULL) { |
87 | 75 | //TODO: Support linking |
88 | 76 | wfDebug("\r\n getShortWikiText: ".$this->m_value); |
— | — | @@ -150,4 +138,3 @@ |
151 | 139 | } |
152 | 140 | } |
153 | 141 | |
154 | | -?> |
\ No newline at end of file |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Types.php |
— | — | @@ -33,9 +33,6 @@ |
34 | 34 | $this->m_xsdvalue = $value; // lazy parsing |
35 | 35 | } |
36 | 36 | |
37 | | - public function setAttribute($attribute) { // ignore |
38 | | - } |
39 | | - |
40 | 37 | public function setOutputFormat($formatstring) { |
41 | 38 | // no output formats supported, ignore |
42 | 39 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_String.php |
— | — | @@ -8,16 +8,11 @@ |
9 | 9 | */ |
10 | 10 | class SMWStringValue extends SMWDataValue { |
11 | 11 | |
12 | | - private $m_attribute = null; |
13 | 12 | private $m_error = ''; |
14 | 13 | private $m_value = ''; |
15 | 14 | private $m_xsdvalue = ''; |
16 | 15 | private $m_infolinks = Array(); |
17 | 16 | |
18 | | - /*********************************************************************/ |
19 | | - /* Set methods */ |
20 | | - /*********************************************************************/ |
21 | | - |
22 | 17 | public function setUserValue($value) { |
23 | 18 | if ($value!='') { |
24 | 19 | $this->m_xsdvalue = smwfXMLContentEncode($value); |
— | — | @@ -39,18 +34,10 @@ |
40 | 35 | $this->setUserValue($value); // no units, XML compatible syntax |
41 | 36 | } |
42 | 37 | |
43 | | - public function setAttribute($attribute) { |
44 | | - $this->m_attribute = $attribute; |
45 | | - } |
46 | | - |
47 | 38 | public function setOutputFormat($formatstring){ |
48 | 39 | //ToDo |
49 | 40 | } |
50 | 41 | |
51 | | - /*********************************************************************/ |
52 | | - /* Get methods */ |
53 | | - /*********************************************************************/ |
54 | | - |
55 | 42 | public function getShortWikiText($linked = NULL) { |
56 | 43 | //TODO: Support linking |
57 | 44 | return $this->m_value; |
— | — | @@ -114,5 +101,3 @@ |
115 | 102 | |
116 | 103 | |
117 | 104 | } |
118 | | - |
119 | | -?> |
\ No newline at end of file |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_NAry.php |
— | — | @@ -85,10 +85,6 @@ |
86 | 86 | } |
87 | 87 | } |
88 | 88 | |
89 | | - public function setAttribute($attribute) { |
90 | | - /// TODO |
91 | | - } |
92 | | - |
93 | 89 | public function setOutputFormat($formatstring) { |
94 | 90 | /// TODO |
95 | 91 | } |
— | — | @@ -218,9 +214,5 @@ |
219 | 215 | return $this->isValid() ? $this->m_values : null; |
220 | 216 | } |
221 | 217 | |
222 | | - |
223 | | - |
224 | | - |
225 | | - |
226 | 218 | } |
227 | 219 | |