]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/noticeform.php
Fix help text for getvaliddaemons.php
[quix0rs-gnu-social.git] / lib / noticeform.php
index 707768cd5948afc1a003a4534254151b7a525461..4e2a2edd61ff78c085d46e5c7419228e7a83a57a 100644 (file)
@@ -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');
         }