/** * Allow author to repack revision action. * * @return null */ protected function allow_author_repack() { $topic = $this->queue->get_queue_discussion_topic(); $post = new \titania_post(TITANIA_QUEUE_DISCUSSION, $topic); $post->__set_array(array('post_subject' => 'Re: ' . $post->topic->topic_subject)); // Load the message object $message_object = $this->get_message($post); // Submit check...handles running $post->post_data() if required $submit = $message_object->submit_check(); if ($submit) { $this->queue->allow_author_repack = true; $repack_url = $this->contrib->get_url('revision', array('page' => 'repack', 'id' => $this->queue->revision_id)); $for_edit = $post->generate_text_for_edit(); $post->post_text = $for_edit['message'] . "\n\n\n\t\t\t\t[url=" . $repack_url . ']' . $this->user->lang['AUTHOR_REPACK_LINK'] . '[/url]'; $post->generate_text_for_storage($for_edit['allow_bbcode'], $for_edit['allow_smilies'], $for_edit['allow_urls']); $post->submit(); $this->queue->submit(); $this->queue->topic_reply('QUEUE_REPLY_ALLOW_REPACK'); $this->queue->submit(); redirect($this->queue->get_url()); } $message_object->display(); // Common stuff $this->template->assign_vars(array('S_POST_ACTION' => $this->helper->get_current_url(), 'L_POST_A' => $this->user->lang['DISCUSSION_REPLY_MESSAGE'])); return $this->helper->render('manage/queue_post.html', 'DISCUSSION_REPLY_MESSAGE'); }
/** * Check whether the author is subscribed to the queue discussion topic. * * @return bool */ protected function is_author_subscribed() { if ($this->use_queue) { $this->queue->contrib_id = $this->contrib->contrib_id; // Get queue discussion topic id if it exists $this->queue->get_queue_discussion_topic(true); if (!empty($this->queue->queue_discussion_topic_id)) { // Is the author subscribed already? return $this->subscriptions->is_subscribed(TITANIA_TOPIC, $this->queue->queue_discussion_topic_id); } } return false; }