none
[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>render_MetaData</strong> ("> ObjectMethod renderMetaData <tt>($web,$topic,$meta,$args) -&gt; $text</tt></a></li>
10         <li><a href="#ObjectMethod <strong>formatVersions</strong> ($"> ObjectMethod formatVersions <tt>($web,$topic,$attrs) -&gt; $text</tt></a></li>
11         <li><a href="#ObjectMethod *get_AttachmentLink"> ObjectMethod getAttachmentLink <tt>($user,$web,$topic,$name,$meta) -&gt; $html</tt></a></li>
12         <li><a href="#ObjectMethod *migrate_ToFileAtta"> ObjectMethod migrateToFileAttachmentMacro <tt>($meta,$text) -&gt; $text</tt></a></li>
13         <li><a href="#ObjectMethod *upgradeFrom1v0beta"> ObjectMethod upgradeFrom1v0beta <tt>($meta) -&gt; $text</tt></a></li>
14       </ul>
15     </li>
16   </ul>
17 </div>
18
19 ## <a name="ClassMethod &lt;strong&gt;new&lt;/strong&gt; ($session)"></a> [[ClassMethod]] **new** `($session)`
20
21 Constructor
22
23 ## <a name="ObjectMethod &lt;strong&gt;render_MetaData&lt;/strong&gt; ("></a> [[ObjectMethod]] **renderMetaData** `($web,$topic,$meta,$args) -> $text`
24
25 Generate a table of attachments suitable for the bottom of a topic view, using templates for the header, footer and each row.
26
27 - `$web` the web
28 - `$topic` the topic
29 - `$meta` meta-data hash for the topic
30 - `$args` hash of attachment arguments
31
32 ## <a name="ObjectMethod &lt;strong&gt;formatVersions&lt;/strong&gt; ($"></a> [[ObjectMethod]] **formatVersions** `($web,$topic,$attrs) -> $text`
33
34 Generate a version history table for a single attachment
35
36 - `$web` - the web
37 - `$topic` - the topic
38 - `$attrs` - Hash of meta-data attributes
39
40 ## <a name="ObjectMethod &lt;strong&gt;get_AttachmentLink"></a> [[ObjectMethod]] \*getAttachmentLink `($user,$web,$topic,$name,$meta) -> $html`
41
42 - `$user` - User doing the reading
43 - `$web` - Name of the web
44 - `$topic` - Name of the topic
45 - `$name` - Name of the attachment
46 - `$meta` - Meta object that contains the meta info
47
48 Build a link to the attachment, suitable for insertion in the topic.
49
50 ## <a name="ObjectMethod &lt;strong&gt;migrate_ToFileAtta"></a> [[ObjectMethod]] \*migrateToFileAttachmentMacro `($meta,$text) -> $text`
51
52 Migrate old HTML format
53
54 ## <a name="ObjectMethod &lt;strong&gt;upgradeFrom1v0beta"></a> [[ObjectMethod]] \*upgradeFrom1v0beta `($meta) -> $text`
55
56 CODE\_SMELL: Is this really necessary? upgradeFrom1v0beta?