Advertisement
Guest User

road-map

a guest
May 22nd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.26 KB | None | 0 0
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3.     exit; // Exit if accessed directly.
  4. }
  5.  
  6. class Tutorlms_Schedule{
  7.  
  8.     public function get_name(){
  9.         return 'tutorlms_schedule';
  10.     }
  11.     public function get_icon() {
  12.         return 'wppb-font-write';
  13.     }
  14.     public function get_category_name(){
  15.         return __( 'Eventco Widgets', 'wp-pagebuilder' );
  16.     }
  17.     public function get_title(){
  18.         return __( 'LMS Schedule ', 'wp-pagebuilder' );
  19.     }
  20.  
  21.     // LMS Schedule Settings Fields
  22.     public function get_settings() {
  23.  
  24.         $settings = array(
  25.  
  26.             'lms_schedule_list' => array(
  27.                 'title'     => __('LMS Schedule','wp-pagebuilder'),
  28.                 'type'      => 'repeatable',
  29.                 'label'     => 'title',
  30.                 'std'       => array(
  31.                     array(
  32.                         'title'         => 'Initial Release of Tutor LMS',
  33.                         'icon_list'     => 'fa fa-star-o',
  34.                         'content_type'  => 'released',
  35.                         'content'       => 'The alpha version of Tutor LMS is released in WordPress.org complete with user and developer documentation.',
  36.                     ),
  37.                 ),
  38.  
  39.                 'attr' => array(
  40.                     'content_type' => array(
  41.                         'type'      => 'select',
  42.                         'title'     => __('Content Type','wp-pagebuilder'),
  43.                         'values'    => array(
  44.                             'released'      => __('Released','wp-pagebuilder'),
  45.                             'working'       => __('Working','wp-pagebuilder'),
  46.                             'pending'       => __('Pending','wp-pagebuilder'),
  47.                             'completed'     => __('Completed','wp-pagebuilder'),
  48.                         ),
  49.                         'std' => 'left',
  50.                     ),
  51.                     'title' => array(
  52.                         'type' => 'text',
  53.                         'title' => __('Item title','wp-pagebuilder'),
  54.                         'std' => '1 year customer support',
  55.                     ),
  56.                     'content' => array(
  57.                         'type' => 'textarea',
  58.                         'title' => __('Contents','wp-pagebuilder'),
  59.                         'std' => '1 year customer support',
  60.                     ),
  61.                 ),
  62.             ),
  63.  
  64.             # Title.
  65.             'title_txt' => array(
  66.                 'type'  => 'text',
  67.                 'title' => __('Schedule Text 1','eventco-core'),
  68.                 'std'   => 'Quarter 1',
  69.             ),
  70.             'title_txt2' => array(
  71.                 'type'  => 'text',
  72.                 'title' => __('Schedule Text 2','eventco-core'),
  73.                 'std'   => '2019',
  74.             ),
  75.         );
  76.  
  77.         return $settings;
  78.     }
  79.  
  80.     # LMS Schedule Render HTML
  81.     public function render($data = null){
  82.         $settings           = $data['settings'];
  83.         $lms_schedule_list  = isset($settings["lms_schedule_list"]) ? $settings["lms_schedule_list"] : array();
  84.         $title_txt          = $settings["title_txt"];
  85.         $title_txt2         = $settings["title_txt2"];
  86.  
  87.         $output = '';
  88.         $output  .= '<div class="tutorlms_schedule">';
  89.  
  90.             $output  .= '<div class="time-line">';
  91.             $output  .= '<h3>'.$title_txt.'<span class="year">'.$title_txt2.'</span></h3>';
  92.             $output  .= '<span><i class="fa fa-star"></i></span>';
  93.             $output  .= '</div>';
  94.  
  95.             if (is_array($lms_schedule_list) && count($lms_schedule_list)){
  96.                 foreach ( $lms_schedule_list as $key => $value ) {
  97.                     $output  .= '<div class="schedule_list col-sm-12 repeater-'.$key.'">';
  98.                     $output  .= '<div class="row">';
  99.                     $output  .= '<div class="col-sm-6">';
  100.                     $output  .= '<div class="content-wrap">';
  101.  
  102.                         if(get_wppb_array_value_by_key($value, 'content_type') == "released" ) {
  103.                             $output  .= '<span class="type color1"><i class="fa fa-check"></i> '. get_wppb_array_value_by_key($value, 'content_type').'</span>';
  104.                         }elseif (get_wppb_array_value_by_key($value, 'content_type') == "working") {
  105.                             $output  .= '<span class="type color2"><i class="fa fa-cog"></i> '. get_wppb_array_value_by_key($value, 'content_type').'</span>';
  106.                         }elseif (get_wppb_array_value_by_key($value, 'content_type') == "pending") {
  107.                             $output  .= '<span class="type color3"><i class="fa fa-refresh"></i> '. get_wppb_array_value_by_key($value, 'content_type').'</span>';
  108.                         }elseif (get_wppb_array_value_by_key($value, 'content_type') == "completed") {
  109.                             $output  .= '<span class="type color4"><i class="fa fa-thumbs-up"></i> ' .get_wppb_array_value_by_key($value, 'content_type').'</span>';
  110.                         }
  111.                         if( get_wppb_array_value_by_key($value, 'title') ){
  112.                             $output  .= '<h2 class="lms-title">'.$value['title'].'</h2>';
  113.                         }
  114.                         if (get_wppb_array_value_by_key($value, 'content')) {
  115.                             $output  .= '<span class="lms-content">'.$value['content'].'</span>';
  116.                         }
  117.  
  118.                     $output  .= '</div>';
  119.                     $output  .= '</div>';
  120.                     $output  .= '</div>';
  121.                     $output  .= '</div>';
  122.                 }
  123.             }
  124.         $output  .= '</div>';
  125.         return $output;
  126.     }
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement