1 # <a name="Package <code>TWiki::Attach="></a> Package =TWiki::Attach
3 A singleton object of this class is used to deal with attachments to topics.
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) -> $text</tt></a></li>
11 <li><a href="#ObjectMethod <strong>formatVersions</strong> ($"> ObjectMethod formatVersions <tt>($web,$topic,$attrs) -> $text</tt></a></li>
12 <li><a href="#ObjectMethod *get_AttachmentLink"> ObjectMethod getAttachmentLink <tt>($user,$web,$topic,$name,$meta) -> $html</tt></a></li>
18 ## <a name="ClassMethod <strong>new</strong> ($session)"></a> [[ClassMethod]] **new** `($session)`
22 ## <a name="ObjectMethod <strong>finish</strong> ()"></a> [[ObjectMethod]] **finish** `()`
24 Break circular references.
26 ## <a name="ObjectMethod <strong>render_MetaData</strong> ("></a> [[ObjectMethod]] **renderMetaData** `($web,$topic,$meta,$args) -> $text`
28 Generate a table of attachments suitable for the bottom of a topic view, using templates for the header, footer and each row.
32 - `$meta` meta-data hash for the topic
33 - `$args` hash of attachment arguments
35 ## <a name="ObjectMethod <strong>formatVersions</strong> ($"></a> [[ObjectMethod]] **formatVersions** `($web,$topic,$attrs) -> $text`
37 Generate a version history table for a single attachment
40 - `$topic` - the topic
41 - `$attrs` - Hash of meta-data attributes
43 ## <a name="ObjectMethod <strong>get_AttachmentLink"></a> [[ObjectMethod]] \*getAttachmentLink `($user,$web,$topic,$name,$meta) -> $html`
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
51 Build a link to the attachment, suitable for insertion in the topic.