/** * Display the message box */ public function display() { $for_edit = $this->post_object->generate_text_for_edit(); // Initialize our post options class $post_options = new post_options(); $post_options->set_auth($this->auth['bbcode'], $this->auth['smilies'], true, true, true); $post_options->set_status($for_edit['allow_bbcode'], $for_edit['allow_smilies'], $for_edit['allow_urls']); // Setup the attachments! $this->setup_attachments(); if ($this->auth['polls']) { $this->posting_panels['poll-panel'] = 'POLL'; } // Add the forum key add_form_key($this->settings['form_name']); // Generate smiley listing if ($post_options->get_status('smilies')) { phpbb::_include('functions_posting', 'generate_smilies'); generate_smilies('inline', false); } // Build custom bbcodes array if ($post_options->get_status('bbcode')) { phpbb::_include('functions_display', 'display_custom_bbcodes'); display_custom_bbcodes(); } // Display the Captcha if required if ($this->settings['display_captcha']) { phpbb::_include('captcha/captcha_factory', false, 'phpbb_captcha_factory'); $captcha =& phpbb_captcha_factory::get_instance(phpbb::$config['captcha_plugin']); $captcha->init(CONFIRM_POST); if ($captcha->validate($this->request_data()) !== false) { phpbb::reset_template(); // Parse the captcha template phpbb::$template->set_filenames(array('captcha' => $captcha->get_template())); // Correct confirm image link phpbb::$template->assign_var('CONFIRM_IMAGE_LINK', phpbb::append_sid('ucp', 'mode=confirm&confirm_id=' . $captcha->confirm_id . '&type=' . $captcha->type)); phpbb::$template->assign_display('captcha', 'CAPTCHA', false); titania::set_custom_template(); } $this->s_hidden_fields = array_merge($this->s_hidden_fields, $captcha->get_hidden_fields()); } $post_options->set_in_template(); // Save the opened panel to show again $default_panel = request_var('open_panel', 'options-panel'); $default_panel = isset($this->posting_panels[$default_panel]) ? $default_panel : 'options-panel'; phpbb::$template->assign_vars(array('ACCESS_OPTIONS' => titania_access_select(isset($for_edit['access']) ? $for_edit['access'] : TITANIA_ACCESS_PUBLIC), 'EDIT_REASON' => isset($for_edit['edit_reason']) ? $for_edit['edit_reason'] : '', 'POSTING_FORM_NAME' => $this->settings['form_name'], 'POSTING_TEXT_NAME' => $this->settings['text_name'], 'POSTING_SUBJECT_NAME' => $this->settings['subject_name'], 'POSTING_PANELS_DEFAULT' => $default_panel, 'POSTING_TEXT' => $this->settings['text_default_override'] !== false ? $this->settings['text_default_override'] : $for_edit['text'], 'SUBJECT' => $this->settings['subject_default_override'] !== false ? $this->settings['subject_default_override'] : (isset($for_edit['subject']) ? $for_edit['subject'] : ''), 'S_ENHANCED_EDITOR' => phpbb::$user->data['titania_enhanced_editor'], 'S_DISPLAY_ERROR' => $this->settings['display_error'], 'S_DISPLAY_SUBJECT' => $this->settings['display_subject'], 'S_STICKY_TOPIC_ALLOWED' => $this->auth['sticky_topic'], 'S_STICKY_TOPIC_CHECKED' => isset($for_edit['topic_sticky']) ? $for_edit['topic_sticky'] : false, 'S_LOCK_TOPIC_ALLOWED' => $this->auth['lock_topic'], 'S_LOCK_TOPIC_CHECKED' => isset($for_edit['topic_locked']) ? $for_edit['topic_locked'] : false, 'S_LOCK_POST_ALLOWED' => $this->auth['lock'], 'S_LOCK_POST_CHECKED' => isset($for_edit['locked']) ? $for_edit['locked'] : false, 'S_EDIT_REASON' => $this->settings['display_edit_reason'], 'S_HIDDEN_FIELDS' => build_hidden_fields($this->s_hidden_fields))); if ($this->attachments) { phpbb::$template->assign_vars(array('UPLOADER' => $this->attachments->parse_uploader($this->settings['attachment_tpl']), 'S_FORM_ENCTYPE' => ' enctype="multipart/form-data"')); } $this->display_panels(); }