Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( ! defined( 'ABSPATH' ) ) {
- exit; // Exit if accessed directly.
- }
- class Tutorlms_Schedule{
- public function get_name(){
- return 'tutorlms_schedule';
- }
- public function get_icon() {
- return 'wppb-font-write';
- }
- public function get_category_name(){
- return __( 'Eventco Widgets', 'wp-pagebuilder' );
- }
- public function get_title(){
- return __( 'LMS Schedule ', 'wp-pagebuilder' );
- }
- // LMS Schedule Settings Fields
- public function get_settings() {
- $settings = array(
- 'lms_schedule_list' => array(
- 'title' => __('LMS Schedule','wp-pagebuilder'),
- 'type' => 'repeatable',
- 'label' => 'title',
- 'std' => array(
- array(
- 'title' => 'Initial Release of Tutor LMS',
- 'icon_list' => 'fa fa-star-o',
- 'content_type' => 'released',
- 'content' => 'The alpha version of Tutor LMS is released in WordPress.org complete with user and developer documentation.',
- ),
- ),
- 'attr' => array(
- 'content_type' => array(
- 'type' => 'select',
- 'title' => __('Content Type','wp-pagebuilder'),
- 'values' => array(
- 'released' => __('Released','wp-pagebuilder'),
- 'working' => __('Working','wp-pagebuilder'),
- 'pending' => __('Pending','wp-pagebuilder'),
- 'completed' => __('Completed','wp-pagebuilder'),
- ),
- 'std' => 'left',
- ),
- 'title' => array(
- 'type' => 'text',
- 'title' => __('Item title','wp-pagebuilder'),
- 'std' => '1 year customer support',
- ),
- 'content' => array(
- 'type' => 'textarea',
- 'title' => __('Contents','wp-pagebuilder'),
- 'std' => '1 year customer support',
- ),
- ),
- ),
- # Title.
- 'title_txt' => array(
- 'type' => 'text',
- 'title' => __('Schedule Text 1','eventco-core'),
- 'std' => 'Quarter 1',
- ),
- 'title_txt2' => array(
- 'type' => 'text',
- 'title' => __('Schedule Text 2','eventco-core'),
- 'std' => '2019',
- ),
- );
- return $settings;
- }
- # LMS Schedule Render HTML
- public function render($data = null){
- $settings = $data['settings'];
- $lms_schedule_list = isset($settings["lms_schedule_list"]) ? $settings["lms_schedule_list"] : array();
- $title_txt = $settings["title_txt"];
- $title_txt2 = $settings["title_txt2"];
- $output = '';
- $output .= '<div class="tutorlms_schedule">';
- $output .= '<div class="time-line">';
- $output .= '<h3>'.$title_txt.'<span class="year">'.$title_txt2.'</span></h3>';
- $output .= '<span><i class="fa fa-star"></i></span>';
- $output .= '</div>';
- if (is_array($lms_schedule_list) && count($lms_schedule_list)){
- foreach ( $lms_schedule_list as $key => $value ) {
- $output .= '<div class="schedule_list col-sm-12 repeater-'.$key.'">';
- $output .= '<div class="row">';
- $output .= '<div class="col-sm-6">';
- $output .= '<div class="content-wrap">';
- if(get_wppb_array_value_by_key($value, 'content_type') == "released" ) {
- $output .= '<span class="type color1"><i class="fa fa-check"></i> '. get_wppb_array_value_by_key($value, 'content_type').'</span>';
- }elseif (get_wppb_array_value_by_key($value, 'content_type') == "working") {
- $output .= '<span class="type color2"><i class="fa fa-cog"></i> '. get_wppb_array_value_by_key($value, 'content_type').'</span>';
- }elseif (get_wppb_array_value_by_key($value, 'content_type') == "pending") {
- $output .= '<span class="type color3"><i class="fa fa-refresh"></i> '. get_wppb_array_value_by_key($value, 'content_type').'</span>';
- }elseif (get_wppb_array_value_by_key($value, 'content_type') == "completed") {
- $output .= '<span class="type color4"><i class="fa fa-thumbs-up"></i> ' .get_wppb_array_value_by_key($value, 'content_type').'</span>';
- }
- if( get_wppb_array_value_by_key($value, 'title') ){
- $output .= '<h2 class="lms-title">'.$value['title'].'</h2>';
- }
- if (get_wppb_array_value_by_key($value, 'content')) {
- $output .= '<span class="lms-content">'.$value['content'].'</span>';
- }
- $output .= '</div>';
- $output .= '</div>';
- $output .= '</div>';
- $output .= '</div>';
- }
- }
- $output .= '</div>';
- return $output;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement