attachment upload
[openafs-wiki.git] / TWiki / TWikiAttachDotPm.mdwn
1 # <a name="Package &lt;code&gt;TWiki::Attach="></a> Package =TWiki::Attach
2
3 A singleton object of this class is used to deal with attachments to topics.
4
5 <div>
6   <ul>
7     <li><a href="#Package =TWiki::Attach="> Package TWiki::Attach</a><ul>
8         <li><a href="#ClassMethod <strong>new</strong> ($session)"> ClassMethod new <tt>($session)</tt></a></li>
9         <li><a href="#ObjectMethod <strong>finish</strong> ()"> ObjectMethod finish <tt>()</tt></a></li>
10         <li><a href="#ObjectMethod <strong>render_MetaData</strong> ("> ObjectMethod renderMetaData <tt>($web,$topic,$meta,$args) -&gt; $text</tt></a></li>
11         <li><a href="#ObjectMethod <strong>formatVersions</strong> ($"> ObjectMethod formatVersions <tt>($web,$topic,$attrs) -&gt; $text</tt></a></li>
12         <li><a href="#ObjectMethod *get_AttachmentLink"> ObjectMethod getAttachmentLink <tt>($user,$web,$topic,$name,$meta) -&gt; $html</tt></a></li>
13       </ul>
14     </li>
15   </ul>
16 </div>
17
18 ## <a name="ClassMethod &lt;strong&gt;new&lt;/strong&gt; ($session)"></a> [[ClassMethod]] **new** `($session)`
19
20 Constructor.
21
22 ## <a name="ObjectMethod &lt;strong&gt;finish&lt;/strong&gt; ()"></a> [[ObjectMethod]] **finish** `()`
23
24 Break circular references.
25
26 ## <a name="ObjectMethod &lt;strong&gt;render_MetaData&lt;/strong&gt; ("></a> [[ObjectMethod]] **renderMetaData** `($web,$topic,$meta,$args) -> $text`
27
28 Generate a table of attachments suitable for the bottom of a topic view, using templates for the header, footer and each row.
29
30 - `$web` the web
31 - `$topic` the topic
32 - `$meta` meta-data hash for the topic
33 - `$args` hash of attachment arguments
34
35 ## <a name="ObjectMethod &lt;strong&gt;formatVersions&lt;/strong&gt; ($"></a> [[ObjectMethod]] **formatVersions** `($web,$topic,$attrs) -> $text`
36
37 Generate a version history table for a single attachment
38
39 - `$web` - the web
40 - `$topic` - the topic
41 - `$attrs` - Hash of meta-data attributes
42
43 ## <a name="ObjectMethod &lt;strong&gt;get_AttachmentLink"></a> [[ObjectMethod]] \*getAttachmentLink `($user,$web,$topic,$name,$meta) -> $html`
44
45 - `$user` - User doing the reading
46 - `$web` - Name of the web
47 - `$topic` - Name of the topic
48 - `$name` - Name of the attachment
49 - `$meta` - Meta object that contains the meta info
50
51 Build a link to the attachment, suitable for insertion in the topic.