diff options
Diffstat (limited to 'phpBB/phpbb/message/topic_form.php')
-rw-r--r-- | phpBB/phpbb/message/topic_form.php | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/phpBB/phpbb/message/topic_form.php b/phpBB/phpbb/message/topic_form.php index 5a5d090017..988028c301 100644 --- a/phpBB/phpbb/message/topic_form.php +++ b/phpBB/phpbb/message/topic_form.php @@ -9,15 +9,31 @@ namespace phpbb\message; +/** +* Class topic_form +* Form used to send topics as notification emails +* +* @package phpbb\message +*/ class topic_form extends form { + /** @var int */ protected $topic_id; - + /** @var array */ protected $topic_row; + /** @var string */ protected $recipient_address; + /** @var string */ protected $recipient_name; + /** @var string */ protected $recipient_lang; + /** + * Get the data of the topic + * + * @param int $topic_id + * @return false|array false if the topic does not exist, array otherwise + */ protected function get_topic_row($topic_id) { $sql = 'SELECT forum_id, topic_title @@ -30,6 +46,9 @@ class topic_form extends form return $row; } + /** + * {inheritDoc} + */ public function check_allow() { $error = parent::check_allow(); @@ -61,6 +80,9 @@ class topic_form extends form return false; } + /** + * {inheritDoc} + */ public function bind(\phpbb\request\request_interface $request) { parent::bind($request); @@ -73,6 +95,9 @@ class topic_form extends form $this->topic_row = $this->get_topic_row($this->topic_id); } + /** + * {inheritDoc} + */ public function submit(\messenger $messenger) { if (!$this->recipient_address || !preg_match('/^' . get_preg_expression('email') . '$/i', $this->recipient_address)) @@ -102,11 +127,17 @@ class topic_form extends form parent::submit($messenger); } + /** + * {inheritDoc} + */ public function get_return_message() { return sprintf($this->user->lang['RETURN_TOPIC'], '<a href="' . append_sid($this->phpbb_root_path . 'viewtopic.' . $this->phpEx, 'f=' . $this->topic_row['forum_id'] . '&t=' . $this->topic_id) . '">', '</a>'); } + /** + * {inheritDoc} + */ public function render(\phpbb\template\template $template) { parent::render($template); |