| 1 |
<?php |
| 2 |
/** |
| 3 |
* Elementor Controls for widget Become a teacher settings. |
| 4 |
* |
| 5 |
* @since 4.2.3 |
| 6 |
* @version 1.0.0 |
| 7 |
*/ |
| 8 |
//Stop this config |
| 9 |
use Elementor\Controls_Manager; |
| 10 |
use LearnPress\ExternalPlugin\Elementor\LPElementorControls; |
| 11 |
|
| 12 |
$content_fields = array_merge( |
| 13 |
LPElementorControls::add_fields_in_section( |
| 14 |
'layouts', |
| 15 |
esc_html__( 'Course/Lesson Materials', 'learnpress' ), |
| 16 |
Controls_Manager::TAB_CONTENT, |
| 17 |
[ |
| 18 |
LPElementorControls::add_control_type( |
| 19 |
'item_layouts', |
| 20 |
esc_html__( 'Add layout and drag to top to set Active', 'learnpress' ), |
| 21 |
[ |
| 22 |
[ |
| 23 |
'layout_name' => 'Layout Default', |
| 24 |
'layout_html' => '', |
| 25 |
], |
| 26 |
], |
| 27 |
Controls_Manager::REPEATER, |
| 28 |
[ |
| 29 |
'fields' => [ |
| 30 |
[ |
| 31 |
'name' => 'column_name', |
| 32 |
'label' => esc_html__( 'Column Name', 'learnpress' ), |
| 33 |
'type' => Controls_Manager::TEXT, |
| 34 |
'label_block' => true, |
| 35 |
], |
| 36 |
[ |
| 37 |
'name' => 'show_column', |
| 38 |
'label' => esc_html__( 'Show Column', 'learnpress' ), |
| 39 |
'type' => Controls_Manager::SWITCHER, |
| 40 |
'label_on' => esc_html__( 'Show', 'learnpress' ), |
| 41 |
'label_off' => esc_html__( 'Hide', 'learnpress' ), |
| 42 |
'return_value' => 'yes', |
| 43 |
'default' => 'yes', |
| 44 |
], |
| 45 |
[ |
| 46 |
'name' => 'has_icon', |
| 47 |
'type' => Controls_Manager::HIDDEN, |
| 48 |
'default' => false, |
| 49 |
'return_value' => true, |
| 50 |
], |
| 51 |
[ |
| 52 |
'name' => 'download_icon', |
| 53 |
'label' => esc_html__( 'Download Icon', 'learnpress' ), |
| 54 |
'type' => Controls_Manager::ICONS, |
| 55 |
'default' => [ |
| 56 |
'value' => 'fas fa-file-download', |
| 57 |
'library' => 'fa-solid', |
| 58 |
], |
| 59 |
'condition' => [ |
| 60 |
'has_icon' => 'yes', |
| 61 |
] |
| 62 |
], |
| 63 |
], |
| 64 |
'default' =>[ |
| 65 |
'file-name' => [ |
| 66 |
'column_name' => esc_html__( 'Name', 'learnpress' ), |
| 67 |
'show_column' => esc_html__( 'yes', 'learnpress' ), |
| 68 |
'has_icon' => false, |
| 69 |
], |
| 70 |
'file-type' =>[ |
| 71 |
'column_name' => esc_html__( 'Type', 'learnpress' ), |
| 72 |
'show_column' => esc_html__( 'yes', 'learnpress' ), |
| 73 |
'has_icon' => false, |
| 74 |
], |
| 75 |
'file-size' => [ |
| 76 |
'column_name' => esc_html__( 'Size', 'learnpress' ), |
| 77 |
'show_column' => esc_html__( 'yes', 'learnpress' ), |
| 78 |
'has_icon' => false, |
| 79 |
], |
| 80 |
'file-link' => [ |
| 81 |
'column_name' => esc_html__( 'Download', 'learnpress' ), |
| 82 |
'show_column' => esc_html__( 'yes', 'learnpress' ), |
| 83 |
'has_icon' => 'yes', |
| 84 |
'download_icon' => [ |
| 85 |
'value' => 'fas fa-file-download', |
| 86 |
], |
| 87 |
], |
| 88 |
], |
| 89 |
'prevent_empty' => false, |
| 90 |
'title_field' => '{{{ column_name }}}', |
| 91 |
'item_actions' => [ |
| 92 |
'add' => false, |
| 93 |
'duplicate' => false, |
| 94 |
'remove' => false, |
| 95 |
'sort' => true, |
| 96 |
], |
| 97 |
] |
| 98 |
), |
| 99 |
] |
| 100 |
), |
| 101 |
[] |
| 102 |
); |
| 103 |
return apply_filters( |
| 104 |
'learn-press/elementor/course/course-material', |
| 105 |
array_merge( |
| 106 |
apply_filters( |
| 107 |
'learn-press/elementor/course/course-material/tab-content', |
| 108 |
$content_fields |
| 109 |
), |
| 110 |
// apply_filters( |
| 111 |
// 'learn-press/elementor/list-instructors/tab-styles', |
| 112 |
// $style_fields |
| 113 |
// ) |
| 114 |
) |
| 115 |
); |