public function process() { /* setup defaults */ $this->setPlaceholders($this->board->toArray()); /* setup class_key - defaults to disThreadDiscussion */ $class_key = 'disThreadDiscussion'; if (isset($_POST['class_key'])) { switch ($_POST['class_key']) { case 'disThreadQuestion': $class_key = $_POST['class_key']; break; case 'disThreadDiscussion': default: $class_key = 'disThreadDiscussion'; } } $this->setPlaceholders(array('is_root' => 1, 'board' => $this->board->get('id'), 'class_key' => $class_key)); $this->getButtons(); $this->checkThreadPermissions(); $this->handleAttachments(); // show subscribe checkbox $notify = !empty($_POST['notify']) ? ' checked="checked"' : ''; $this->setPlaceholders(array('notify_cb' => $this->discuss->getChunk('form/disCheckbox', array('name' => 'notify', 'value' => 1, 'text' => $this->getOption('textCheckboxNotify'), 'attributes' => $notify)))); $this->modx->setPlaceholder('discuss.error_panel', $this->discuss->getChunk('Error')); /* set placeholders for FormIt inputs */ $this->modx->setPlaceholders($this->getPlaceholders(), 'fi.'); }
public function process(array $scriptProperties = array()) { if ($this->board) { $arr = $this->board->toArray(); $arr = $this->modx->toJSON($arr); $this->addHtml('<script type="text/javascript"> Dis.record = ' . $arr . '; </script>'); } }
/** * {@inheritdoc} * @return array */ public function process() { $this->setPlaceholders($this->board->toArray()); /* grab all subboards */ if (!empty($this->options['showSubBoards'])) { $this->getSubBoards(); } $this->getThreads(); $this->buildPagination(); if (!empty($this->options['showReaders'])) { $this->getViewing(); } if (!empty($this->options['showModerators'])) { $this->getModerators(); } $this->getActionButtons(); $this->onRenderBoard(); $this->setPlaceholder('discuss.board', $this->board->get('name')); }