/** * Shows a form for editing a reply to the given message. */ function show_compose_reply(&$_parent_msg) { $message = new Posting(); // Prepend 'Re: ' if necessary if (strpos($_parent_msg->get_subject(), _('Re: ')) !== 0) { $subject = _('Re: ') . $_parent_msg->get_subject(); $message->set_subject(substr($subject, 0, cfg('max_subjectlength'))); } else { $message->set_subject($_parent_msg->get_subject()); } $this->show_compose($message, $_parent_msg->get_id(), TRUE); }
function &message_init_posting_from_post_data(&$_posting = NULL) { if (!$_posting) { $_posting = new Posting(); } $_posting->set_id($_POST['msg_id']); $_posting->set_username($_POST['username']); $_posting->set_subject($_POST['subject']); $_posting->set_body($_POST['body']); return $_posting; }
function _posting_read() { $posting = $this->forumdb->get_posting_from_id($_GET['msg_id']); $this->_add_posting_breadcrumbs($posting); /* Plugin hook: on_message_read_print * Called before the HTML for the posting is produced. * Args: posting: The posting that is about to be shown. */ $this->eventbus->emit('on_message_read_print', $this->api, $posting); // Hide subject and body if the message is locked. if ($posting) { // bypassed in threadview or listview, if permitted if (!$this->current_group->permissions['bypass']) { $posting->apply_block(); } } else { $posting = new Posting(); $posting->set_subject(_('No Such Message')); $posting->set_body(_('A message with the given ID does not exist.')); } $view = $this->_get_current_view(); $view->show_posting($posting); }