Пример #1
0
 /**
  * Handle the rendering and options of attachments being sent to the form
  * @return void
  */
 public function handleAttachments()
 {
     $this->setPlaceholder('max_attachments', $this->modx->getOption('discuss.attachments_max_per_post', null, 5));
     $this->modx->regClientHTMLBlock('<script type="text/javascript">
     DIS.config.attachments_max_per_post = ' . $this->getPlaceholder('max_attachments') . ';
     </script>');
     if ($this->board->canPostAttachments()) {
         $this->setPlaceholders(array('attachments' => '', 'attachmentCurIdx' => 1));
         $this->setPlaceholder('attachment_fields', $this->discuss->getChunk($this->getOption('tplAttachmentFields'), $this->getPlaceholders()));
     } else {
         $this->setPlaceholders(array('attachment_fields' => '', 'attachments' => '', 'attachmentCurIdx' => 1));
     }
 }