/** * Displays survey data in posting.php * * @param unknown $event */ public function posting_display_template($event) { if (!$this->survey->can_create_survey($event['forum_id'])) { return; } // Check for first post if (isset($event['post_data']['topic_first_post_id']) && (!isset($event['post_data']['post_id']) || $event['post_data']['topic_first_post_id'] != $event['post_data']['post_id'])) { return; } $this->user->add_lang_ext('kilianr/survey', 'survey'); if (isset($event['topic_id']) && $event['topic_id']) { $this->survey->load_survey($event['topic_id']); } $this->template->assign_vars(array('S_SURVEY_ALLOWED' => true, 'S_TOPIC_HAS_SURVEY' => $this->survey->enabled, 'S_TOPIC_HAS_INACTIVE_SURVEY' => ($this->survey->entries || $this->survey->questions) && !$this->survey->enabled)); }