| 1 |
<?php |
| 2 |
namespace LearnPress\ExternalPlugin\Elementor\Widgets\Course; |
| 3 |
|
| 4 |
use LearnPress\ExternalPlugin\Elementor\LPElementorWidgetBase; |
| 5 |
use LearnPress\Helpers\Config; |
| 6 |
use Throwable; |
| 7 |
class CourseMaterialElementor extends LPElementorWidgetBase { |
| 8 |
public function __construct( $data = [], $args = null ) { |
| 9 |
$this->title = esc_html__( 'Course/Lesson Material', 'learnpress' ); |
| 10 |
$this->name = 'lp_course_material'; |
| 11 |
$this->keywords = [ 'courses', 'lesson', 'material' ]; |
| 12 |
$this->icon = 'eicon-document-file'; |
| 13 |
parent::__construct( $data, $args ); |
| 14 |
} |
| 15 |
|
| 16 |
protected function register_controls() { |
| 17 |
$this->controls = Config::instance()->get( 'materials', 'elementor/course' ); |
| 18 |
parent::register_controls(); |
| 19 |
} |
| 20 |
public function render() { |
| 21 |
try { |
| 22 |
$settings = $this->get_settings_for_display(); |
| 23 |
echo '<pre>'; |
| 24 |
print_r( $settings ); |
| 25 |
echo '</pre>'; |
| 26 |
} catch ( Throwable $e ) { |
| 27 |
error_log( __METHOD__ . ': ' . $e->getMessage() ); |
| 28 |
} |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
|