type = sanitize_key( wp_unslash($_GET['type'] ?? '') ); if (isset($_GET['backgroundColor'])) { $this->backgroundColor = acadlix()->helper()->acadlix_css_color( wp_unslash($_GET['backgroundColor']), '#fff' ); } if (isset($_GET['color'])) { $this->color = acadlix()->helper()->acadlix_css_color( wp_unslash($_GET['color']), '#000' ); } else { $this->color = '#000'; } if (isset($_GET['fontSizeScale'])) { $this->fontSizeScale = esc_attr(wp_unslash($_GET['fontSizeScale'])); } $this->boot(); } protected function boot() { $method = "boot_{$this->type}"; if (method_exists($this, $method)) { $this->{$method}(); } } protected function render_content() { $method = "render_{$this->type}"; if (!is_user_logged_in()) { wp_die( esc_html__('You must be logged in to view this content.', 'acadlix') ); } if (method_exists($this, $method)) { $this->{$method}(); return; } wp_die( esc_html__('Invalid iframe type.', 'acadlix') ); } public function render() { $this->render_header(); $this->render_content(); $this->render_footer(); } protected function boot_lesson() { $lesson_id = absint( wp_unslash($_GET['id'] ?? 0) ); if (!$lesson_id) { wp_die( esc_html__('Content ID is required.', 'acadlix') ); } $lesson = acadlix()->model()->lesson()->find($lesson_id); if (!$lesson) { wp_die( esc_html__('Lesson not found.', 'acadlix') ); } $this->data['lesson'] = $lesson; } protected function render_lesson() { // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Content is pre-rendered via 'the_content' filter which handles block/shortcode escaping echo $this->data['lesson']->rendered_post_content ?? ''; } protected function render_header() { ?> > <?php wp_title('|', true, 'right'); ?> > '; echo ''; } }