attachment upload
[openafs-wiki.git] / TWiki / TWikiPrefsParserDotPm.mdwn
1 # <a name="Package &lt;code&gt;TWiki::Prefs::Parser="></a> Package =TWiki::Prefs::Parser
2
3 This Prefs-internal class is used to parse \* Set and \* Local statements from arbitrary text, and extract settings from meta objects. It is used by [[TopicPrefs]] to parse preference settings from topics.
4
5 This class does no validation or duplicate-checking on the settings; it simply returns the recognized settings in the order it sees them in.
6
7 <div>
8   <ul>
9     <li><a href="#Package =TWiki::Prefs::Parser="> Package TWiki::Prefs::Parser</a><ul>
10         <li><a href="#ClassMethod <strong>new</strong> () -> topicpar"> ClassMethod new <tt>() -&gt; topicparserobject</tt></a></li>
11         <li><a href="#ObjectMethod <strong>parseText</strong> ($text,"> ObjectMethod parseText <tt>($text,$prefs)</tt></a></li>
12         <li><a href="#ObjectMethod <strong>parseMeta</strong> ($metaO"> ObjectMethod parseMeta <tt>($metaObject,$prefs)</tt></a></li>
13       </ul>
14     </li>
15   </ul>
16 </div>
17
18 ## <a name="ClassMethod &lt;strong&gt;new&lt;/strong&gt; () - topicpars"></a> [[ClassMethod]] **new** `() -> topicparserobject`
19
20 Construct a new parser object.
21
22 ## <a name="ObjectMethod &lt;strong&gt;parseText&lt;/strong&gt; ($text,"></a> [[ObjectMethod]] **parseText** `($text,$prefs)`
23
24 Parse settings from text and add them to the preferences in $prefs
25
26 ## <a name="ObjectMethod &lt;strong&gt;parseMeta&lt;/strong&gt; ($metaO"></a> [[ObjectMethod]] **parseMeta** `($metaObject,$prefs)`
27
28 Traverses through all PREFERENCE attributes of the meta object, creating one setting named with $settingPrefPrefix . 'title' for each. It also creates an entry named with the field 'name', which is a cleaned-up, space-removed version of the title.
29
30 Settings are added to the $prefs passed.