| @@ -7,9 +7,26 @@ | ||
| 7 | 7 | '%s<br>%s', |
| 8 | 8 | esc_html__( 'The site will be redirected to the URL added after clicking the finish course button.', 'learnpress' ), |
| 9 | 9 | esc_html__( 'Set blank, the site will be redirected to the single course page', 'learnpress' ) |
| 10 | 10 | ); |
| 11 | +$layout_single_course_default = LP_Settings::get_option( 'layout_single_course', '' ); | |
| 12 | +if ( empty( $layout_single_course_default ) ) { | |
| 13 | + $layout_single_course_default = 'classic'; | |
| 14 | +} | |
| 11 | 15 | |
| 16 | +// Temporary hide fields for the Modern layout. | |
| 17 | +add_filter( | |
| 18 | + 'learn-press/course-settings-fields/curriculum', | |
| 19 | + function ( $fields ) use ( $layout_single_course_default ) { | |
| 20 | + if ( $layout_single_course_default === 'modern' ) { | |
| 21 | + unset( $fields[2] ); | |
| 22 | + unset( $fields[3] ); | |
| 23 | + } | |
| 24 | + | |
| 25 | + return $fields; | |
| 26 | + } | |
| 27 | +); | |
| 28 | + | |
| 12 | 29 | return apply_filters( |
| 13 | 30 | 'learn-press/courses-settings-fields', |
| 14 | 31 | array_merge( |
| 15 | 32 | apply_filters( |
| @@ -19,8 +36,19 @@ | ||
| 19 | 36 | 'title' => esc_html__( 'General', 'learnpress' ), |
| 20 | 37 | 'type' => 'title', |
| 21 | 38 | ), |
| 22 | 39 | array( |
| 40 | + 'title' => esc_html__( 'Layout single course', 'learnpress' ), | |
| 41 | + 'desc' => esc_html__( 'Layout default display for single course. (Not apply for theme Gutenberg)', 'learnpress' ), | |
| 42 | + 'id' => 'layout_single_course', | |
| 43 | + 'default' => $layout_single_course_default, | |
| 44 | + 'type' => 'select', | |
| 45 | + 'options' => array( | |
| 46 | + 'modern' => esc_html__( 'Modern', 'learnpress' ), | |
| 47 | + 'classic' => esc_html__( 'Classic', 'learnpress' ), | |
| 48 | + ), | |
| 49 | + ), | |
| 50 | + array( | |
| 23 | 51 | 'title' => esc_html__( 'Review courses', 'learnpress' ), |
| 24 | 52 | 'desc' => esc_html__( 'Courses created by instructors will be pending review first.', 'learnpress' ), |
| 25 | 53 | 'id' => 'required_review', |
| 26 | 54 | 'default' => 'yes', |
| @@ -56,11 +84,19 @@ | ||
| 56 | 84 | 'type' => 'number', |
| 57 | 85 | 'custom_attributes' => array( |
| 58 | 86 | 'min' => '1', |
| 59 | 87 | ), |
| 60 | - 'css' => 'min-width: 50px; width: 50px;', | |
| 88 | + 'css' => 'min-width: 70px; width: 70px;', | |
| 61 | 89 | ), |
| 62 | 90 | array( |
| 91 | + 'title' => esc_html__( 'Include courses in subcategory', 'learnpress' ), | |
| 92 | + 'desc' => esc_html__( 'Show all courses within the subcategory that have not been chosen in the parent category.', 'learnpress' ), | |
| 93 | + 'id' => 'get_courses_of_subcategory', | |
| 94 | + 'default' => 'no', | |
| 95 | + 'type' => 'checkbox', | |
| 96 | + 'css' => 'min-width: 50px; width: 50px;', | |
| 97 | + ), | |
| 98 | + array( | |
| 63 | 99 | 'title' => esc_html__( 'Loading ajax Courses', 'learnpress' ), |
| 64 | 100 | 'desc' => __( 'On/Off <i>loading ajax courses on the Course Archive page </i>.', 'learnpress' ), |
| 65 | 101 | 'id' => 'courses_load_ajax', |
| 66 | 102 | 'default' => 'yes', |
| @@ -74,8 +110,21 @@ | ||
| 74 | 110 | 'type' => 'checkbox', |
| 75 | 111 | 'show_if_checked' => 'courses_load_ajax', |
| 76 | 112 | ), |
| 77 | 113 | array( |
| 114 | + 'title' => esc_html__( 'Pagination Type', 'learnpress' ), | |
| 115 | + 'desc' => esc_html__( 'Display the pagination type on the Course Archive page.', 'learnpress' ), | |
| 116 | + 'id' => 'course_pagination_type', | |
| 117 | + 'default' => 'standard', | |
| 118 | + 'type' => 'select', | |
| 119 | + 'options' => array( | |
| 120 | + 'number' => esc_html__( 'Number', 'learnpress' ), | |
| 121 | + 'load-more' => esc_html__( 'Load More', 'learnpress' ), | |
| 122 | + 'infinite' => esc_html__( 'Infinite Scroll', 'learnpress' ), | |
| 123 | + ), | |
| 124 | + 'show_if_checked' => 'courses_load_ajax', | |
| 125 | + ), | |
| 126 | + array( | |
| 78 | 127 | 'title' => esc_html__( 'Thumbnail dimensions', 'learnpress' ), |
| 79 | 128 | 'id' => 'course_thumbnail_dimensions', |
| 80 | 129 | 'default' => array( 500, 300, 'yes' ), |
| 81 | 130 | 'type' => 'image-dimensions', |
| @@ -84,9 +133,9 @@ | ||
| 84 | 133 | 'title' => esc_html__( 'Redirect when finishing the course', 'learnpress' ), |
| 85 | 134 | 'id' => 'course_finish_redirect', |
| 86 | 135 | 'default' => '', |
| 87 | 136 | 'type' => 'url', |
| 88 | - 'placeholder' => 'https://learnpress.com/', | |
| 137 | + 'placeholder' => 'https://learnpresslms.com/', | |
| 89 | 138 | 'desc' => $des_option_redirect_finish_course, |
| 90 | 139 | ), |
| 91 | 140 | array( |
| 92 | 141 | 'type' => 'sectionend', |
| @@ -101,24 +150,184 @@ | ||
| 101 | 150 | 'title' => esc_html__( 'Curriculum Settings', 'learnpress' ), |
| 102 | 151 | 'id' => 'lp_metabox_curriculum_setting', |
| 103 | 152 | ), |
| 104 | 153 | array( |
| 154 | + 'title' => esc_html__( 'Curriculum display', 'learnpress' ), | |
| 155 | + 'id' => 'curriculum_display', | |
| 156 | + 'default' => 'expand_first_section', | |
| 157 | + 'type' => 'select', | |
| 158 | + 'options' => array( | |
| 159 | + 'expand_first_section' => esc_html__( 'Expand first section', 'learnpress' ), | |
| 160 | + 'expand_all' => esc_html__( 'Expand all sections', 'learnpress' ), | |
| 161 | + 'collapse_all' => esc_html__( 'Collapse all sections', 'learnpress' ), | |
| 162 | + ), | |
| 163 | + 'desc' => esc_html__( 'Currently, apply for the Modern single course layout only.', 'learnpress' ), | |
| 164 | + ), | |
| 165 | + array( | |
| 105 | 166 | 'title' => esc_html__( 'Section Per Page', 'learnpress' ), |
| 106 | 167 | 'id' => 'section_per_page', |
| 107 | - 'default' => 1, | |
| 168 | + 'default' => -1, | |
| 108 | 169 | 'type' => 'number', |
| 170 | + 'min' => '-1', | |
| 109 | 171 | 'desc' => esc_html__( 'The number of displayed sections per page (Enter -1 to display all sections).', 'learnpress' ), |
| 110 | 172 | ), |
| 111 | 173 | array( |
| 112 | 174 | 'title' => esc_html__( 'Course Item Per Page', 'learnpress' ), |
| 113 | 175 | 'id' => 'course_item_per_page', |
| 114 | - 'default' => 10, | |
| 176 | + 'default' => -1, | |
| 115 | 177 | 'type' => 'number', |
| 178 | + 'min' => '-1', | |
| 116 | 179 | 'desc' => esc_html__( 'The number of displayed course items per page in a section (Enter -1 to display all course items).', 'learnpress' ), |
| 117 | 180 | ), |
| 118 | 181 | array( |
| 119 | 182 | 'type' => 'sectionend', |
| 120 | 183 | 'id' => 'lp_metabox_curriculum_setting', |
| 184 | + ), | |
| 185 | + ) | |
| 186 | + ), | |
| 187 | + apply_filters( | |
| 188 | + 'learn-press/course-settings-fields/quiz', | |
| 189 | + array( | |
| 190 | + array( | |
| 191 | + 'type' => 'title', | |
| 192 | + 'title' => esc_html__( 'Quiz Settings', 'learnpress' ), | |
| 193 | + 'id' => 'lp_metabox_setting_quiz', | |
| 194 | + ), | |
| 195 | + array( | |
| 196 | + 'title' => esc_html__( 'Sticky Quiz Paging', 'learnpress' ), | |
| 197 | + 'id' => 'navigation_position', | |
| 198 | + 'default' => 'yes', | |
| 199 | + 'type' => 'checkbox', | |
| 200 | + 'desc' => esc_html__( 'The question\'s navigation position is sticky. If this option is disabled, the question navigation position will be below the quiz content', 'learnpress' ), | |
| 201 | + ), | |
| 202 | + array( | |
| 203 | + 'type' => 'sectionend', | |
| 204 | + 'id' => 'lp_metabox_setting_quiz', | |
| 205 | + ), | |
| 206 | + ) | |
| 207 | + ), | |
| 208 | + apply_filters( | |
| 209 | + 'learn-press/course-settings-fields/material', | |
| 210 | + array( | |
| 211 | + array( | |
| 212 | + 'type' => 'title', | |
| 213 | + 'title' => esc_html__( 'Material Settings', 'learnpress' ), | |
| 214 | + 'id' => 'lp_course_material_setting', | |
| 215 | + ), | |
| 216 | + array( | |
| 217 | + 'title' => esc_html__( 'File Type', 'learnpress' ), | |
| 218 | + 'id' => 'material_allow_file_type', | |
| 219 | + 'type' => 'multiselect', | |
| 220 | + 'is_optgroup' => '1', | |
| 221 | + 'class' => 'lp-tom-select', | |
| 222 | + 'default' => array( 'pdf', 'txt' ), | |
| 223 | + 'desc' => esc_html__( 'Which types of file will be allowed uploading?', 'learnpress' ), | |
| 224 | + 'options' => array( | |
| 225 | + 'document' => array( | |
| 226 | + 'txt' => '.txt(text/plain)', | |
| 227 | + 'doc,docx' => '.doc, .docx (Microsoft Word)', | |
| 228 | + 'pdf' => '.pdf (Portable Document Format)', | |
| 229 | + ), | |
| 230 | + 'image' => array( | |
| 231 | + 'jpg,jpeg' => '.jpg, .jpeg (Joint Photographic Experts Group)', | |
| 232 | + 'png' => '.png (Portable Network Graphics)', | |
| 233 | + 'gif' => '.gif (Graphics Interchange Format)', | |
| 234 | + 'bmp' => '.bmp (Bitmap)', | |
| 235 | + ), | |
| 236 | + 'audio' => array( | |
| 237 | + 'mp3' => '.mp3 (MPEG Audio Layer 3)', | |
| 238 | + 'wav' => '.wav (Waveform Audio File Format)', | |
| 239 | + 'wma' => '.wma (Windows Media Audio)', | |
| 240 | + ), | |
| 241 | + 'video' => array( | |
| 242 | + 'mp4' => '.mp4 (MPEG-4 Part 14)', | |
| 243 | + 'avi' => '.avi (Audio Video Interleave)', | |
| 244 | + 'mov' => '.mov (QuickTime Movie)', | |
| 245 | + 'wmv' => '.wmv (Windows Media Video)', | |
| 246 | + ), | |
| 247 | + 'spreadsheet' => array( | |
| 248 | + 'xls,xlsx' => '.xls, .xlsx (Microsoft Excel)', | |
| 249 | + 'ods' => '.ods (OpenDocument Spreadsheet)', | |
| 250 | + 'csv' => '.csv (Comma-Separated Values)', | |
| 251 | + 'numbers' => '.numbers (Apple Numbers)', | |
| 252 | + 'tsv' => '.tsv (Tab-Separated Values)', | |
| 253 | + ), | |
| 254 | + 'compressed archive' => array( | |
| 255 | + 'zip' => 'ZIP archive', | |
| 256 | + ), | |
| 257 | + ), | |
| 258 | + 'custom_attributes' => array( | |
| 259 | + 'required' => '1', | |
| 260 | + ), | |
| 261 | + ), | |
| 262 | + array( | |
| 263 | + 'title' => esc_html__( 'Upload Files', 'learnpress' ), | |
| 264 | + 'id' => 'material_upload_files', | |
| 265 | + 'default' => 2, | |
| 266 | + 'type' => 'number', | |
| 267 | + 'desc' => esc_html__( 'Number files the user can upload. Set to 0 to disable', 'learnpress' ), | |
| 268 | + 'custom_attributes' => array( | |
| 269 | + 'min' => '0', | |
| 270 | + ), | |
| 271 | + ), | |
| 272 | + array( | |
| 273 | + 'title' => esc_html__( 'File Size Limit', 'learnpress' ), | |
| 274 | + 'id' => 'material_max_file_size', | |
| 275 | + 'default' => 2, | |
| 276 | + 'type' => 'number', | |
| 277 | + 'desc' => esc_html__( 'Set Maximum Attachment size for upload (MB)', 'learnpress' ), | |
| 278 | + 'custom_attributes' => array( | |
| 279 | + 'min' => '1', | |
| 280 | + ), | |
| 281 | + ), | |
| 282 | + array( | |
| 283 | + 'title' => esc_html__( 'File Per Page', 'learnpress' ), | |
| 284 | + 'id' => 'material_file_per_page', | |
| 285 | + 'default' => -1, | |
| 286 | + 'type' => 'number', | |
| 287 | + 'desc' => esc_html__( 'The number of displayed files per page (Enter -1 to display all files, set to 0 to disable).', 'learnpress' ), | |
| 288 | + 'custom_attributes' => array( | |
| 289 | + 'min' => '-1', | |
| 290 | + ), | |
| 291 | + ), | |
| 292 | + array( | |
| 293 | + 'title' => esc_html__( 'Url nofollow', 'learnpress' ), | |
| 294 | + 'desc' => esc_html__( 'Add rel="nofollow" to material external link.', 'learnpress' ), | |
| 295 | + 'id' => 'material_url_nofollow', | |
| 296 | + 'default' => 'yes', | |
| 297 | + 'type' => 'checkbox', | |
| 298 | + ), | |
| 299 | + array( | |
| 300 | + 'type' => 'sectionend', | |
| 301 | + 'id' => 'lp_course_material_setting', | |
| 302 | + ), | |
| 303 | + ) | |
| 304 | + ), | |
| 305 | + apply_filters( | |
| 306 | + 'learn-press/course-settings-fields/instructor', | |
| 307 | + array( | |
| 308 | + array( | |
| 309 | + 'type' => 'title', | |
| 310 | + 'title' => esc_html__( 'Instructor Settings', 'learnpress' ), | |
| 311 | + 'id' => 'lp_metabox_instructor_setting', | |
| 312 | + ), | |
| 313 | + array( | |
| 314 | + 'title' => esc_html__( 'Instructor Per Page', 'learnpress' ), | |
| 315 | + 'id' => 'instructor_per_page', | |
| 316 | + 'default' => 12, | |
| 317 | + 'type' => 'number', | |
| 318 | + 'desc' => esc_html__( 'The number of displayed instructors per page (Enter -1 to display all sections).', 'learnpress' ), | |
| 319 | + ), | |
| 320 | + array( | |
| 321 | + 'title' => esc_html__( 'Show Admin on list', 'learnpress' ), | |
| 322 | + 'id' => 'show_admin_on_list_instructors', | |
| 323 | + 'default' => 'yes', | |
| 324 | + 'type' => 'checkbox', | |
| 325 | + 'desc' => esc_html__( 'Show author Admin on list instructors.', 'learnpress' ), | |
| 326 | + ), | |
| 327 | + array( | |
| 328 | + 'type' => 'sectionend', | |
| 329 | + 'id' => 'lp_metabox_instructor_setting', | |
| 121 | 330 | ), |
| 122 | 331 | ) |
| 123 | 332 | ) |
| 124 | 333 | ) |