protected function authoriseUpload($user) { // Check if attachments are allowed if (KunenaForumMessageAttachmentHelper::getExtensions($this, $user) === false) { return JText::_ ( 'COM_KUNENA_LIB_CATEGORY_AUTHORISE_FAILED_UPLOAD_NOT_ALLOWED' ); } }
protected function displayEdit($tpl = null) { $this->catid = $this->state->get('item.catid'); $this->my = JFactory::getUser(); $this->me = KunenaUserHelper::getMyself(); $this->config = KunenaFactory::getConfig(); $mesid = $this->state->get('item.mesid'); $document = JFactory::getDocument(); $saved = $this->app->getUserState('com_kunena.postfields'); $this->message = KunenaForumMessageHelper::get($mesid); if (!$this->message->authorise('edit')) { $app = JFactory::getApplication(); $app->enqueueMessage ( $this->message->getError(), 'notice' ); return false; } $this->topic = $this->message->getTopic(); $this->category = $this->topic->getCategory(); if ($this->config->topicicons && $this->topic->authorise('edit', null, false)) { $this->topicIcons = $this->template->getTopicIcons(false, $saved ? $saved['icon_id'] : $this->topic->icon_id); } $this->title = JText::_ ( 'COM_KUNENA_POST_EDIT' ) . ' ' . $this->topic->subject; $this->action = 'edit'; // Get attachments $this->attachments = $this->message->getAttachments(); // Get poll if ($this->message->parent == 0 && ($this->topic->authorise('poll.create', null, false) || $this->topic->authorise('poll.edit', null, false))) { $this->poll = $this->topic->getPoll(); } $this->allowedExtensions = KunenaForumMessageAttachmentHelper::getExtensions($this->category); if ($saved) { // Update message contents $this->message->edit ( $saved ); } $this->post_anonymous = $saved ? $saved['anonymous'] : ! empty ( $this->category->post_anonymous ); $this->subscriptionschecked = $saved ? $saved['subscribe'] : $this->config->subscriptionschecked == 1; $this->modified_reason = $saved ? $saved['modified_reason'] : ''; $this->app->setUserState('com_kunena.postfields', null); $this->display($tpl); }
protected function displayEdit($tpl = null) { $this->catid = $this->state->get('item.catid'); $mesid = $this->state->get('item.mesid'); $document = JFactory::getDocument(); $saved = $this->app->getUserState('com_kunena.postfields'); $this->message = KunenaForumMessageHelper::get($mesid); if (!$this->message->authorise('edit')) { $this->app->enqueueMessage($this->message->getError(), 'notice'); return false; } $this->topic = $this->message->getTopic(); $this->category = $this->topic->getCategory(); if ($this->config->topicicons && $this->topic->authorise('edit', null, false)) { $this->topicIcons = $this->ktemplate->getTopicIcons(false, $saved ? $saved['icon_id'] : $this->topic->icon_id); } // Run events if (version_compare(JVERSION, '1.6', '>')) { // Joomla 1.6+ $params = new JRegistry(); } else { // Joomla 1.5 $params = new JParameter(''); } $params->set('ksource', 'kunena'); $params->set('kunena_view', 'topic'); $params->set('kunena_layout', 'reply'); $dispatcher = JDispatcher::getInstance(); JPluginHelper::importPlugin('kunena'); $dispatcher->trigger('onKunenaPrepare', array('kunena.topic', &$this->topic, &$params, 0)); $this->_prepareDocument('edit'); $this->action = 'edit'; // Get attachments $this->attachments = $this->message->getAttachments(); // Get poll if ($this->message->parent == 0 && ($this->topic->authorise('poll.create', null, false) || $this->topic->authorise('poll.edit', null, false))) { $this->poll = $this->topic->getPoll(); } $this->allowedExtensions = KunenaForumMessageAttachmentHelper::getExtensions($this->category); if ($saved) { // Update message contents $this->message->edit($saved); } $this->post_anonymous = $saved ? $saved['anonymous'] : !empty($this->category->post_anonymous); $this->subscriptionschecked = $saved ? $saved['subscribe'] : $this->config->subscriptionschecked == 1; $this->modified_reason = $saved ? $saved['modified_reason'] : ''; $this->app->setUserState('com_kunena.postfields', null); $this->display($tpl); }
protected function displayEdit($tpl = null) { $this->catid = $this->state->get('item.catid'); $this->my = JFactory::getUser(); $this->me = KunenaFactory::getUser(); $this->config = KunenaFactory::getConfig(); $mesid = $this->state->get('item.mesid'); $document = JFactory::getDocument(); $this->message = KunenaForumMessageHelper::get($mesid); if (!$this->message->authorise('edit')) { $app = JFactory::getApplication(); $app->enqueueMessage ( $this->message->getError(), 'notice' ); return false; } $this->topic = $this->message->getTopic(); $this->category = $this->topic->getCategory(); if ($this->config->topicicons && $this->topic->authorise('edit', null, false)) { $this->topicIcons = $this->template->getTopicIcons(); if (isset($this->topicIcons[$this->topic->icon_id])) { $this->topicIcons[$this->topic->icon_id]->checked = 1; } else { $this->topicIcons[0]->checked = 1; } } $this->title = JText::_ ( 'COM_KUNENA_POST_EDIT' ) . ' ' . $this->topic->subject; $this->action = 'edit'; // Get attachments $this->attachments = $this->message->getAttachments(); // Get poll if ($this->message->parent == 0 && ($this->topic->authorise('poll.create', null, false) || $this->topic->authorise('poll.edit', null, false))) { $this->poll = $this->topic->getPoll(); } $this->allowedExtensions = KunenaForumMessageAttachmentHelper::getExtensions($this->category); $this->display($tpl); }