9 date 2008.01.22.03.21.31; author TWikiContributor; state Exp;
14 date 2007.01.16.04.11.57; author TWikiContributor; state Exp;
19 date 2006.02.01.12.01.24; author TWikiContributor; state Exp;
34 @---+ Package =TWiki::Attach=
36 A singleton object of this class is used to deal with attachments to topics.
41 ---++ ClassMethod *new* <tt>($session)</tt>
47 ---++ ObjectMethod *finish* <tt>()</tt>
48 Break circular references.
52 ---++ ObjectMethod *renderMetaData* <tt>($web,$topic,$meta,$args) -> $text</tt>
54 Generate a table of attachments suitable for the bottom of a topic
55 view, using templates for the header, footer and each row.
58 * =$meta= meta-data hash for the topic
59 * =$args= hash of attachment arguments
63 ---++ ObjectMethod *formatVersions* <tt>($web,$topic,$attrs) -> $text</tt>
65 Generate a version history table for a single attachment
67 * =$topic= - the topic
68 * =$attrs= - Hash of meta-data attributes
72 ---++ ObjectMethod *getAttachmentLink* <tt>($user,$web,$topic,$name,$meta) -> $html</tt>
74 * =$user= - User doing the reading
75 * =$web= - Name of the web
76 * =$topic= - Name of the topic
77 * =$name= - Name of the attachment
78 * =$meta= - Meta object that contains the meta info
80 Build a link to the attachment, suitable for insertion in the topic.
96 ---++ ObjectMethod *migrateToFileAttachmentMacro* <tt>($meta,$text) -> $text</tt>
98 Migrate old HTML format
102 ---++ ObjectMethod *upgradeFrom1v0beta* <tt>($meta) -> $text</tt>
104 CODE_SMELL: Is this really necessary? upgradeFrom1v0beta?