function gdlr_lms_create_quiz_meta_box() { global $post; // Add an nonce field so we can check for it later. wp_nonce_field('quiz_meta_box', 'quiz_meta_box_nonce'); //////////////////////////////// //// quiz setting section //// //////////////////////////////// $quiz_settings = array('retake-quiz' => array('title' => __('Allow to retake this quiz', 'gdlr-lms'), 'type' => 'checkbox', 'default' => 'enable'), 'retake-times' => array('title' => __('Number of quiz retakes', 'gdlr-lms'), 'type' => 'text', 'class' => 'small', 'description' => __('times', 'gdlr-lms'))); $quiz_val = gdlr_lms_decode_preventslashes(get_post_meta($post->ID, 'gdlr-lms-quiz-settings', true)); $quiz_settings_val = empty($quiz_val) ? array() : json_decode($quiz_val, true); echo '<div class="gdlr-lms-meta-wrapper">'; echo '<h3>' . __('Quiz Settings', 'gdlr-lms') . '</h3>'; foreach ($quiz_settings as $slug => $quiz_setting) { $quiz_setting['slug'] = $slug; $quiz_setting['value'] = empty($quiz_settings_val[$slug]) ? '' : $quiz_settings_val[$slug]; gdlr_lms_print_meta_box($quiz_setting); } echo '<textarea name="gdlr-lms-quiz-settings">' . esc_textarea($quiz_val) . '</textarea>'; echo '</div>'; ///////////////////// //// tab section //// ///////////////////// $course_content_options = array('section-name' => array('title' => __('Section Name', 'gdlr-lms'), 'type' => 'text'), 'question-type' => array('title' => __('Question Type', 'gdlr-lms'), 'type' => 'combobox', 'options' => array('single' => __('Single Choice', 'gdlr-lms'), 'multiple' => __('Multiple Choice', 'gdlr-lms'), 'small' => __('Small Fill', 'gdlr-lms'), 'large' => __('Large Fill', 'gdlr-lms')), 'description' => __('( Manual marking the score for small and large fill )', 'gdlr-lms')), 'section-timer' => array('title' => __('Section Timer', 'gdlr-lms'), 'type' => 'checkbox'), 'time-period' => array('title' => __('Time Period', 'gdlr-lms'), 'type' => 'text', 'class' => 'small', 'description' => __('Minutes', 'gdlr-lms')), 'question' => array('type' => 'question')); $course_content_val = gdlr_lms_decode_preventslashes(get_post_meta($post->ID, 'gdlr-lms-content-settings', true)); $course_content_options_val = empty($course_content_val) ? array() : json_decode($course_content_val, true); echo '<div class="gdlr-lms-meta-wrapper gdlr-tabs">'; echo '<h3>' . __('Course Content', 'gdlr-lms') . '</h3>'; echo '<div class="course-tab-add-new">'; echo '<span class="head">+</span>'; echo '<span class="tail">' . __('Add Section', 'gdlr-lms') . '</span>'; echo '</div>'; // course-tab-add-new echo '<div class="course-tab-title">'; echo '<span class="active">1</span>'; for ($i = 2; $i <= sizeof($course_content_options_val); $i++) { echo '<span>' . $i . '</span>'; } echo '</div>'; // course-tab-title echo '<div class="course-tab-content">'; echo '<div class="course-tab-remove">' . __('Delete', 'gdlr-lms') . '</div>'; foreach ($course_content_options as $slug => $course_content_option) { $course_content_option['slug'] = $slug; $course_content_option['value'] = empty($course_content_options_val[0][$slug]) ? '' : $course_content_options_val[0][$slug]; gdlr_lms_print_meta_box($course_content_option); } echo '</div>'; // course-tab-content echo '<textarea name="gdlr-lms-content-settings">' . esc_textarea($course_content_val) . '</textarea>'; echo '</div>'; }
function gdlr_soccer_create_player_meta_box() { global $post; // Add an nonce field so we can check for it later. wp_nonce_field('player_meta_box', 'player_meta_box_nonce'); ///////////////// //// setting //// ///////////////// $player_settings = array('player-info' => array('title' => __('Player Info', 'gdlr-soccer'), 'options' => array('general-info' => array('title' => __('General Info', 'gdlr-soccer'), 'type' => 'title'), 'first-name' => array('title' => __('First Name', 'gdlr-soccer'), 'type' => 'text'), 'last-name' => array('title' => __('Last Name', 'gdlr-soccer'), 'type' => 'text'), 'squad' => array('title' => __('Squad', 'gdlr-soccer'), 'type' => 'text'), 'position' => array('title' => __('Position', 'gdlr-soccer'), 'type' => 'text'), 'position-ab' => array('title' => __('Position (abbreviation)', 'gdlr-soccer'), 'type' => 'text'), 'nationality' => array('title' => __('Nationality', 'gdlr-soccer'), 'type' => 'text'), 'date-of-birth' => array('title' => __('Date Of Birth', 'gdlr-soccer'), 'type' => 'text'), 'height' => array('title' => __('Hieght', 'gdlr-soccer'), 'type' => 'text'), 'weight' => array('title' => __('Weight', 'gdlr-soccer'), 'type' => 'text'), 'games-played' => array('title' => __('Games Played', 'gdlr-soccer'), 'type' => 'text'), 'minutes-played' => array('title' => __('Minutes Played', 'gdlr-soccer'), 'type' => 'text'), 'starts' => array('title' => __('Starts', 'gdlr-soccer'), 'type' => 'text'), 'substitution-on' => array('title' => __('Substitution On', 'gdlr-soccer'), 'type' => 'text'), 'substitution-off' => array('title' => __('Substitution Off', 'gdlr-soccer'), 'type' => 'text'), 'social-media' => array('title' => __('Social Media', 'gdlr-soccer'), 'type' => 'title', 'class' => 'with-space'), 'facebook' => array('title' => __('Facebook', 'gdlr-soccer'), 'type' => 'text'), 'twitter' => array('title' => __('Twitter', 'gdlr-soccer'), 'type' => 'text'), 'youtube' => array('title' => __('Youtube', 'gdlr-soccer'), 'type' => 'text'), 'instagram' => array('title' => __('Instagram', 'gdlr-soccer'), 'type' => 'text'))), 'player-stats' => array('title' => __('Player Stats', 'gdlr-soccer'), 'options' => array('general' => array('title' => __('General', 'gdlr-soccer'), 'type' => 'title'), 'passes' => array('title' => __('Passes', 'gdlr-soccer'), 'type' => 'text'), 'passing-accuracy' => array('title' => __('Passing Accuracy', 'gdlr-soccer'), 'type' => 'text'), 'passing-accuracy-opp' => array('title' => __('Passing Accuracy opp. Half', 'gdlr-soccer'), 'type' => 'text'), 'duels-won' => array('title' => __('Duels Won', 'gdlr-soccer'), 'type' => 'text'), 'duels-lost' => array('title' => __('Duels Lost', 'gdlr-soccer'), 'type' => 'text'), 'duels-won-percent' => array('title' => __('Duels Won (%)', 'gdlr-soccer'), 'type' => 'text'), 'aerial-duels-won' => array('title' => __('Aerial Duels Won', 'gdlr-soccer'), 'type' => 'text'), 'aerial-duels-lost' => array('title' => __('Aerial Duels Lost', 'gdlr-soccer'), 'type' => 'text'), 'aerial-duels-won-percent' => array('title' => __('Aerial Duels Won (%)', 'gdlr-soccer'), 'type' => 'text'), 'recoveries' => array('title' => __('Recoveries', 'gdlr-soccer'), 'type' => 'text'), 'defence-descipline' => array('title' => __('Defence & Descipline', 'gdlr-soccer'), 'type' => 'title', 'class' => 'with-space'), 'tackles-won' => array('title' => __('Tackles Won', 'gdlr-soccer'), 'type' => 'text'), 'tackles-lost' => array('title' => __('Tackles Lost', 'gdlr-soccer'), 'type' => 'text'), 'tackles-won-percent' => array('title' => __('Tackles Won (%)', 'gdlr-soccer'), 'type' => 'text'), 'clearances' => array('title' => __('Clearances', 'gdlr-soccer'), 'type' => 'text'), 'blocks' => array('title' => __('Blocks', 'gdlr-soccer'), 'type' => 'text'), 'interceptions' => array('title' => __('Interceptions', 'gdlr-soccer'), 'type' => 'text'), 'penalties-conceded' => array('title' => __('Penalties Conceded', 'gdlr-soccer'), 'type' => 'text'), 'fouls-won' => array('title' => __('Fouls Won', 'gdlr-soccer'), 'type' => 'text'), 'fouls-conceded' => array('title' => __('Fouls Conceded', 'gdlr-soccer'), 'type' => 'text'), 'yellow-cards' => array('title' => __('Yellow Cards', 'gdlr-soccer'), 'type' => 'text'), 'red-cards' => array('title' => __('Red Cards', 'gdlr-soccer'), 'type' => 'text'), 'attack' => array('title' => __('Attack', 'gdlr-soccer'), 'type' => 'title', 'class' => 'with-space'), 'goals' => array('title' => __('Goals', 'gdlr-soccer'), 'type' => 'text'), 'penalty-goals' => array('title' => __('Penalty Goals', 'gdlr-soccer'), 'type' => 'text'), 'minutes-per-goal' => array('title' => __('Minutes Per Goal', 'gdlr-soccer'), 'type' => 'text'), 'total-shots-on-target' => array('title' => __('Total Shots On Target', 'gdlr-soccer'), 'type' => 'text'), 'total-shots-off-target' => array('title' => __('Total Shots Off Target', 'gdlr-soccer'), 'type' => 'text'), 'shooting-accuracy' => array('title' => __('Shooting Accuracy', 'gdlr-soccer'), 'type' => 'text'), 'successful-crosses' => array('title' => __('Successful Crosses', 'gdlr-soccer'), 'type' => 'text'), 'unsuccessful-crosses' => array('title' => __('Unsuccessful Crosses', 'gdlr-soccer'), 'type' => 'text'), 'successful-crosses-percent' => array('title' => __('Successful Crosses (%)', 'gdlr-soccer'), 'type' => 'text'), 'assists' => array('title' => __('Assists', 'gdlr-soccer'), 'type' => 'text'), 'chances-created' => array('title' => __('Chances Created', 'gdlr-soccer'), 'type' => 'text'), 'penalties-won' => array('title' => __('Penalties Won', 'gdlr-soccer'), 'type' => 'text'), 'offsides' => array('title' => __('Offsides', 'gdlr-soccer'), 'type' => 'text'))), 'biography' => array('title' => __('Biography', 'gdlr-soccer'), 'options' => array('biography' => array('type' => 'wysiwyg'))), 'gallery' => array('title' => __('Gallery', 'gdlr-soccer'), 'options' => array('player-gallery' => array('type' => 'wysiwyg')))); $player_val = gdlr_lms_decode_preventslashes(get_post_meta($post->ID, 'gdlr-soccer-player-settings', true)); $player_settings_val = empty($player_val) ? array() : json_decode($player_val, true); echo '<div class="gdlr-lms-meta-wrapper gdlr-tabs">'; // tab title $count = 0; echo '<div class="soccer-tab-title">'; foreach ($player_settings as $section_slug => $player_setting) { echo '<span data-tab="' . $section_slug . '" '; echo $count == 0 ? 'class="active" ' : ''; echo '>' . $player_setting['title'] . '</span>'; $count++; } echo '</div>'; // soccer-tab-title // tab content $count = 0; echo '<div class="soccer-tab-content-wrapper">'; foreach ($player_settings as $section_slug => $player_setting) { echo '<div class="soccer-tab-content '; echo $count == 0 ? 'active' : ''; echo '" data-tab="' . $section_slug . '" >'; foreach ($player_setting['options'] as $option_slug => $option_val) { $option_val['slug'] = $option_slug; if (!empty($player_settings_val[$section_slug][$option_slug])) { $option_val['value'] = $player_settings_val[$section_slug][$option_slug]; } else { $option_val['value'] = ''; } gdlr_lms_print_meta_box($option_val); } echo '</div>'; $count++; } echo '</div>'; // soccer-tab-content-wrapper echo '<textarea name="gdlr-soccer-player-settings">' . esc_textarea($player_val) . '</textarea>'; echo '</div>'; }
function gdlr_soccer_create_league_table_meta_box() { global $post; ?> <style type="text/css"> #edit-slug-box{display: none !important;} </style> <?php // Add an nonce field so we can check for it later. wp_nonce_field('league_table_meta_box', 'league_table_meta_box_nonce'); ///////////////// //// setting //// ///////////////// $league_table_val = gdlr_lms_decode_preventslashes(get_post_meta($post->ID, 'gdlr-soccer-league-table-settings', true)); $league_table_settings_val = empty($league_table_val) ? array() : json_decode($league_table_val, true); // flag echo '<div class="gdlr-lms-meta-wrapper">'; $flag = array('title' => __('Team Flag', 'gdlr-soccer'), 'type' => 'upload', 'slug' => 'flag', 'wrapper-class' => 'team-flag-wrapper', 'value' => empty($league_table_settings_val['flag']) ? '' : $league_table_settings_val['flag']); gdlr_lms_print_meta_box($flag); $league_table_settings = array('win' => array('title' => __('Wins', 'gdlr-soccer'), 'type' => 'text', 'class' => 'medium'), 'draw' => array('title' => __('Draws', 'gdlr-soccer'), 'type' => 'text', 'class' => 'medium'), 'lose' => array('title' => __('Loses', 'gdlr-soccer'), 'type' => 'text', 'class' => 'medium'), 'goal-score' => array('title' => __('Goals Scored', 'gdlr-soccer'), 'type' => 'text', 'class' => 'medium'), 'goal-concede' => array('title' => __('Goals Conceded', 'gdlr-soccer'), 'type' => 'text', 'class' => 'medium')); echo '<div class="gdlr-lms-meta-inner gdlr-left">'; echo '<h3>' . __('Home', 'gdlr-soccer') . '</h3>'; foreach ($league_table_settings as $slug => $league_table_setting) { $league_table_setting['slug'] = 'home-' . $slug; $league_table_setting['value'] = isset($league_table_settings_val['home-' . $slug]) ? $league_table_settings_val['home-' . $slug] : ''; gdlr_lms_print_meta_box($league_table_setting); } $league_table_settings_val['sticky'] = empty($league_table_settings_val['sticky']) ? '' : $league_table_settings_val['sticky']; gdlr_lms_print_meta_box(array('title' => __('Always show in League Table (summary)', 'gdlr-soccer'), 'type' => 'checkbox', 'default' => 'disable', 'slug' => 'sticky', 'value' => $league_table_settings_val['sticky'])); echo '</div>'; echo '<div class="gdlr-lms-meta-inner gdlr-right">'; echo '<h3>' . __('Away', 'gdlr-soccer') . '</h3>'; foreach ($league_table_settings as $slug => $league_table_setting) { $league_table_setting['slug'] = 'away-' . $slug; $league_table_setting['value'] = isset($league_table_settings_val['away-' . $slug]) ? $league_table_settings_val['away-' . $slug] : ''; gdlr_lms_print_meta_box($league_table_setting); } echo '</div>'; echo '<div class="clear"></div>'; echo '<textarea name="gdlr-soccer-league-table-settings">' . esc_textarea($league_table_val) . '</textarea>'; echo '</div>'; // gdlr-lms-meta-wrapper }
function gdlr_lms_create_certificate_meta_box() { global $post; // Add an nonce field so we can check for it later. wp_nonce_field('certificate_meta_box', 'certificate_meta_box_nonce'); ///////////////////////////////////// //// certificate setting section //// ///////////////////////////////////// $certificate_settings = array('enable-printer' => array('title' => __('Online Course', 'gdlr-lms'), 'type' => 'checkbox', 'default' => 'enable'), 'custom-css' => array('title' => __('Custom Certificate Css', 'gdlr-lms'), 'type' => 'textarea'), 'fill-default' => array('title' => __('Fill Default Shortcode Text', 'gdlr-lms'), 'type' => 'button', 'default' => __('Fill Shortcode', 'gdlr-lms')), 'shortcode-description' => array('title' => __('Shortcode Description', 'gdlr-lms'), 'type' => 'description', 'default' => '<br><span class="head">Wrapper - </span>[gdlr_cer_wrapper border="yes" background="XXX" class="XXX" student_code="true" ][/gdlr_cer_wrapper]' . '<br><span class="head">Caption - </span>[gdlr_cer_caption font_size="19px" class="XXX"]This is to certify that[/gdlr_cer_caption]' . '<br><span class="head">Student name - </span>[gdlr_cer_student_name font_size="34px" class="XXX"]' . '<br><span class="head">Course name - </span>[gdlr_cer_course_name font_size="25px" class="XXX"]' . '<br><span class="head">Marks - </span>[gdlr_cer_mark font_size="19px" class="XXX"]With Marks[/gdlr_cer_mark]' . '<br><span class="head">Date - </span>[gdlr_cer_date font_size="15px" margin_top="20px" class="XXX" format="j/n/Y"]Date[/gdlr_cer_date]' . '<br><span class="head">Signature - </span>[gdlr_cer_signature image="XXX" font_size="15px" margin_top="0px" class="XXX"]Sam White, Course Instructor[/gdlr_cer_signature]')); $certificate_val = gdlr_lms_decode_preventslashes(get_post_meta($post->ID, 'gdlr-lms-certificate-settings', true)); $certificate_settings_val = empty($certificate_val) ? array() : json_decode($certificate_val, true); echo '<div class="gdlr-lms-meta-wrapper">'; echo '<h3>' . __('Certificate Settings', 'gdlr-lms') . '</h3>'; foreach ($certificate_settings as $slug => $certificate_setting) { $certificate_setting['slug'] = $slug; $certificate_setting['value'] = empty($certificate_settings_val[$slug]) ? '' : $certificate_settings_val[$slug]; gdlr_lms_print_meta_box($certificate_setting); } echo '<textarea name="gdlr-lms-certificate-settings">' . esc_textarea($certificate_val) . '</textarea>'; echo '</div>'; }
function gdlr_soccer_create_fixture_result_meta_box() { global $post; // Add an nonce field so we can check for it later. wp_nonce_field('fixture_result_meta_box', 'fixture_result_meta_box_nonce'); ///////////////// //// setting //// ///////////////// $fixture_result_settings = array('home-flag' => array('title' => __('Home Team Flag', 'gdlr-soccer'), 'type' => 'upload', 'slug' => 'flag'), 'away-flag' => array('title' => __('Away Team Flag', 'gdlr-soccer'), 'type' => 'upload', 'slug' => 'flag', 'wrapper-class' => 'team-flag-wrapper'), 'home' => array('title' => __('Home Team', 'gdlr-soccer'), 'type' => 'text', 'wrapper-class' => 'gdlr-lms-left'), 'home-goal' => array('title' => __('Goal', 'gdlr-soccer'), 'type' => 'text', 'class' => 'small', 'wrapper-class' => 'gdlr-lms-right', 'description' => __('* Leave this field blank if the match hasn\'t start yet.', 'gdlr-soccer')), 'away' => array('title' => __('Away Team', 'gdlr-soccer'), 'type' => 'text', 'wrapper-class' => 'gdlr-lms-left'), 'away-goal' => array('title' => __('Goal', 'gdlr-soccer'), 'type' => 'text', 'class' => 'small', 'wrapper-class' => 'gdlr-lms-right', 'description' => __('* Leave this field blank if the match hasn\'t start yet.', 'gdlr-soccer')), 'date-of-match' => array('title' => __('Date Of Match', 'gdlr-soccer'), 'type' => 'datepicker'), 'match-time' => array('title' => __('Match Time', 'gdlr-soccer'), 'type' => 'text', 'description' => __('* have to be in HH:MM format', 'gdlr-soccer')), 'location' => array('title' => __('Location', 'gdlr-soccer'), 'type' => 'textarea'), 'show-match-detail' => array('title' => __('Show Match Detail Before Date Of Match', 'gdlr-soccer'), 'type' => 'checkbox', 'default' => 'disable')); $fixture_result_val = gdlr_lms_decode_preventslashes(get_post_meta($post->ID, 'gdlr-soccer-fixture-result-settings', true)); $fixture_result_settings_val = empty($fixture_result_val) ? array() : json_decode($fixture_result_val, true); echo '<div class="gdlr-lms-meta-wrapper">'; echo '<h3>' . __('Fixtures & Result', 'gdlr-soccer') . '</h3>'; foreach ($fixture_result_settings as $slug => $fixture_result_setting) { $fixture_result_setting['slug'] = $slug; $fixture_result_setting['value'] = !isset($fixture_result_settings_val[$slug]) ? '' : $fixture_result_settings_val[$slug]; gdlr_lms_print_meta_box($fixture_result_setting); } echo '<div class="clear" style="height: 40px;"></div>'; echo '<h3>' . __('Match Report', 'gdlr-soccer') . '</h3>'; gdlr_lms_print_meta_box(array('slug' => 'match-report', 'value' => empty($fixture_result_settings_val['match-report']) ? '' : $fixture_result_settings_val['match-report'], 'type' => 'wysiwyg')); echo '<textarea name="gdlr-soccer-fixture-result-settings">' . esc_textarea($fixture_result_val) . '</textarea>'; echo '</div>'; }
function gdlr_lms_create_course_meta_box() { global $post; // Add an nonce field so we can check for it later. wp_nonce_field('course_meta_box', 'course_meta_box_nonce'); //////////////////////////////// //// course setting section //// //////////////////////////////// $course_settings = array('prerequisite-course' => array('title' => __('Prerequisite Course', 'gdlr-lms'), 'type' => 'combobox', 'options' => gdlr_lms_get_post_list('course')), 'online-course' => array('title' => __('Online Course', 'gdlr-lms'), 'type' => 'checkbox', 'default' => 'enable', 'description' => __('Course content section will be ignored when this option is disabled.', 'gdlr-lms')), 'allow-non-member' => array('title' => __('Allow non member to read course', 'gdlr-lms'), 'type' => 'checkbox', 'default' => 'disable', 'wrapper-class' => 'online-course-enable', 'description' => __('The price, quiz, seat and wait time field will be omitted.', 'gdlr-lms')), 'course-code' => array('title' => __('Course Code', 'gdlr-lms'), 'type' => 'text', 'description' => __('Use to generate code after submit payment evidence.', 'gdlr-lms')), 'quiz' => array('title' => __('Course Quiz', 'gdlr-lms'), 'type' => 'combobox', 'options' => gdlr_lms_get_post_list('quiz'), 'wrapper-class' => 'online-course-enable'), 'location' => array('title' => __('Location', 'gdlr-lms'), 'type' => 'text', 'class' => 'long', 'wrapper-class' => 'online-course-disable'), 'start-date' => array('title' => __('Start Date', 'gdlr-lms'), 'type' => 'datepicker'), 'end-date' => array('title' => __('End Date', 'gdlr-lms'), 'type' => 'datepicker'), 'course-time' => array('title' => __('Course Time', 'gdlr-lms'), 'type' => 'text', 'wrapper-class' => 'online-course-disable'), 'expired-date' => array('title' => __('Expired Date', 'gdlr-lms'), 'type' => 'datepicker', 'description' => __('(If any)', 'gdlr-lms')), 'max-seat' => array('title' => __('Max Seat', 'gdlr-lms'), 'type' => 'text', 'wrapper-class' => 'online-course-disable'), 'booked-seat' => array('title' => __('Booked Seat', 'gdlr-lms'), 'type' => 'text', 'wrapper-class' => 'online-course-disable'), 'price' => array('title' => __('Price', 'gdlr-lms'), 'type' => 'text', 'class' => 'small', 'description' => __('Leaving this field blankfor free course (Only number is allowed here)', 'gdlr-lms')), 'discount-price' => array('title' => __('Discount Price', 'gdlr-lms'), 'type' => 'text', 'class' => 'small', 'description' => __('(Only number is allowed here)', 'gdlr-lms')), 'enable-badge' => array('title' => __('Enable Badge', 'gdlr-lms'), 'type' => 'checkbox', 'default' => 'disable', 'wrapper-class' => 'online-course-enable'), 'badge-percent' => array('title' => __('% Of Score To Get Badge', 'gdlr-lms'), 'type' => 'text', 'wrapper-class' => 'online-course-enable'), 'badge-title' => array('title' => __('Badge Title', 'gdlr-lms'), 'type' => 'text', 'wrapper-class' => 'online-course-enable'), 'badge-file' => array('title' => __('Badge File', 'gdlr-lms'), 'type' => 'upload', 'wrapper-class' => 'online-course-enable'), 'enable-certificate' => array('title' => __('Enable Certificate', 'gdlr-lms'), 'type' => 'checkbox', 'default' => 'disable', 'wrapper-class' => 'online-course-enable'), 'certificate-percent' => array('title' => __('% Of Score To Get Certificate', 'gdlr-lms'), 'type' => 'text', 'wrapper-class' => 'online-course-enable'), 'certificate-template' => array('title' => __('Certificate Template', 'gdlr-lms'), 'type' => 'combobox', 'options' => gdlr_lms_get_post_list('certificate'), 'wrapper-class' => 'online-course-enable')); $course_val = gdlr_lms_decode_preventslashes(get_post_meta($post->ID, 'gdlr-lms-course-settings', true)); $course_settings_val = empty($course_val) ? array() : json_decode($course_val, true); echo '<div class="gdlr-lms-meta-wrapper">'; echo '<h3>' . __('Course Settings', 'gdlr-lms') . '</h3>'; foreach ($course_settings as $slug => $course_setting) { $course_setting['slug'] = $slug; $course_setting['value'] = empty($course_settings_val[$slug]) ? '' : $course_settings_val[$slug]; gdlr_lms_print_meta_box($course_setting); } echo '<textarea name="gdlr-lms-course-settings">' . esc_textarea($course_val) . '</textarea>'; echo '</div>'; ///////////////////// //// tab section //// ///////////////////// $course_content_options = array('section-name' => array('title' => __('Section Name', 'gdlr-lms'), 'type' => 'text'), 'pdf-download-link' => array('title' => __('PDF Download Link', 'gdlr-lms'), 'type' => 'upload'), 'wait-time' => array('title' => __('Student have to wait', 'gdlr-lms'), 'type' => 'text', 'class' => 'small', 'description' => __('days before continuing to next section.', 'gdlr-lms')), 'wait-date' => array('title' => __('Next section will be available at', 'gdlr-lms'), 'type' => 'datepicker', 'description' => __('( Wait time has to be blank for this field to take effects )', 'gdlr-lms')), 'course-content' => array('type' => 'wysiwyg')); $course_content_val = gdlr_lms_decode_preventslashes(get_post_meta($post->ID, 'gdlr-lms-content-settings', true)); $course_content_options_val = empty($course_content_val) ? array() : json_decode($course_content_val, true); echo '<div class="gdlr-lms-meta-wrapper gdlr-tabs">'; echo '<h3>' . __('Course Content', 'gdlr-lms') . '</h3>'; echo '<div class="course-tab-add-new">'; echo '<span class="head">+</span>'; echo '<span class="tail">' . __('Add Section', 'gdlr-lms') . '</span>'; echo '</div>'; // course-tab-add-new echo '<div class="course-tab-title">'; echo '<span class="active">1</span>'; for ($i = 2; $i <= sizeof($course_content_options_val); $i++) { echo '<span>' . $i . '</span>'; } echo '</div>'; // course-tab-title echo '<div class="course-tab-content">'; echo '<div class="course-tab-remove">Delete</div>'; foreach ($course_content_options as $slug => $course_content_option) { $course_content_option['slug'] = $slug; $course_content_option['value'] = empty($course_content_options_val[0][$slug]) ? '' : $course_content_options_val[0][$slug]; gdlr_lms_print_meta_box($course_content_option); } echo '</div>'; // course-tab-content echo '<textarea name="gdlr-lms-content-settings">' . esc_textarea($course_content_val) . '</textarea>'; echo '</div>'; }