diff options
author | Robin Millette <millette@controlyourself.ca> | 2009-06-17 16:55:01 -0400 |
---|---|---|
committer | Robin Millette <millette@controlyourself.ca> | 2009-06-17 16:55:01 -0400 |
commit | b58dc5e96117bdb4de899d37c6eb94ebf1c3dfe6 (patch) | |
tree | 283b83c3c487036444595375d50f506e81f21974 /lib/noticeform.php | |
parent | 28d02ec8cdd0278c802c8fee30acddecca9ca01f (diff) |
Added config option to enable or disable file uploads with notices.
Diffstat (limited to 'lib/noticeform.php')
-rw-r--r-- | lib/noticeform.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/noticeform.php b/lib/noticeform.php index 0ad365856..a36b7f31f 100644 --- a/lib/noticeform.php +++ b/lib/noticeform.php @@ -90,7 +90,9 @@ class NoticeForm extends Form $this->user = common_current_user(); } - $this->enctype = 'multipart/form-data'; + if (common_config('attachments', 'uploads')) { + $this->enctype = 'multipart/form-data'; + } } /** @@ -148,12 +150,14 @@ class NoticeForm extends Form $this->out->element('dd', array('id' => 'notice_text-count'), '140'); $this->out->elementEnd('dl'); - $this->out->element('label', array('for' => 'notice_data-attach'),_('Attach')); - $this->out->element('input', array('id' => 'notice_data-attach', - 'type' => 'file', - 'name' => 'attach', - 'title' => _('Attach a file'))); - $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota')); + if (common_config('attachments', 'uploads')) { + $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota')); + $this->out->element('label', array('for' => 'notice_data-attach'),_('Attach')); + $this->out->element('input', array('id' => 'notice_data-attach', + 'type' => 'file', + 'name' => 'attach', + 'title' => _('Attach a file'))); + } if ($this->action) { $this->out->hidden('notice_return-to', $this->action, 'returnto'); } |