ActionBoxGenerator.php
1 year ago
AnnouncementsGenerator.php
1 year ago
CourseMetaGenerator.php
1 year ago
CourseThumbnailGenerator.php
1 year ago
ElementGenerator.php
1 year ago
GradebookGenerator.php
1 year ago
InstructorGenerator.php
1 year ago
LessonGenerator.php
1 year ago
Preview.php
1 year ago
QnAGenerator.php
1 year ago
RatingGenerator.php
1 year ago
ResourcesGenerator.php
1 year ago
ShareGenerator.php
1 year ago
TopicsGenerator.php
1 year ago
WishListGenerator.php
1 year ago
ShareGenerator.php
35 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Preview script for html markup generator |
| 4 | * |
| 5 | * @package tutor-droip-elements |
| 6 | */ |
| 7 | |
| 8 | namespace TutorLMSDroip\ElementGenerator; |
| 9 | |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; // Exit if accessed directly. |
| 12 | } |
| 13 | trait ShareGenerator { |
| 14 | |
| 15 | /** |
| 16 | * Generate Course Share elements |
| 17 | */ |
| 18 | private function generate_course_share_markup() { |
| 19 | switch ( $this->element['name'] ) { |
| 20 | |
| 21 | case TDE_APP_PREFIX . '-share-course': |
| 22 | $course_share = tutor_utils()->get_option( 'enable_course_share', false, true, true ); |
| 23 | if ( ! $course_share ) { |
| 24 | return ''; |
| 25 | } |
| 26 | |
| 27 | tutor_load_template_from_custom_path( tutor()->path . '/views/course-share.php', array( 'show_share_button' => false ), false ); |
| 28 | |
| 29 | $children_html = $this->generate_child_elements(); |
| 30 | return "<div $this->attributes>$children_html</div>"; |
| 31 | |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 |