X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fnoticeform.php;h=4e2a2edd61ff78c085d46e5c7419228e7a83a57a;hb=db4ffca5350a11835c2c990f8d77d7cabb365a43;hp=707768cd5948afc1a003a4534254151b7a525461;hpb=af700ea27703bbec5aa1078a84f9fd44c0260322;p=quix0rs-gnu-social.git diff --git a/lib/noticeform.php b/lib/noticeform.php index 707768cd59..4e2a2edd61 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'; + } } /** @@ -137,9 +139,6 @@ class NoticeForm extends Form { $this->out->element('label', array('for' => 'notice_data-text'), sprintf(_('What\'s up, %s?'), $this->user->nickname)); - $this->out->elementStart('span', array('style' => 'float: right; margin-top: 2em;')); -// $this->out->element('a', array('href' => '#attach'), ' [ATTACH]'); - $this->out->elementEnd('span'); // XXX: vary by defined max size $this->out->element('textarea', array('id' => 'notice_data-text', 'cols' => 35, @@ -151,12 +150,14 @@ class NoticeForm extends Form $this->out->element('dd', array('id' => 'notice_text-count'), '140'); $this->out->elementEnd('dl'); - $this->out->element('br', array('style' => 'clear:both')); -// $this->out->elementStart('a', array('href' => '#')); - $this->out->element('label', array('for' => 'notice_data-attach'), _('Upload: ')); -// $this->out->elementEnd('a'); - $this->out->element('input', array('id' => 'notice_data-attach', 'type' => 'file', 'name' => 'attach')); - + if (common_config('attachments', 'uploads')) { + $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 ($this->action) { $this->out->hidden('notice_return-to', $this->action, 'returnto'); }