| @@ -6,8 +6,10 @@ | ||
| 6 | 6 | * @package LearnPress/Classes |
| 7 | 7 | * @version 4.0.0 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | +use LearnPress\TemplateHooks\Admin\AdminSettingsPage; | |
| 11 | + | |
| 10 | 12 | defined( 'ABSPATH' ) || exit; |
| 11 | 13 | |
| 12 | 14 | require_once 'email-groups/class-lp-settings-emails-group.php'; |
| 13 | 15 | |
| @@ -54,11 +56,10 @@ | ||
| 54 | 56 | * |
| 55 | 57 | * @return mixed |
| 56 | 58 | */ |
| 57 | 59 | public function get_sections() { |
| 58 | - static $sections = false; | |
| 59 | - | |
| 60 | - if ( ! $sections ) { | |
| 60 | + static $sections; | |
| 61 | + if ( is_null( $sections ) ) { | |
| 61 | 62 | $emails = LP_Emails::instance()->emails; |
| 62 | 63 | |
| 63 | 64 | $sections = array( |
| 64 | 65 | 'general' => esc_html__( 'General', 'learnpress' ), |
| @@ -69,8 +70,10 @@ | ||
| 69 | 70 | include 'email-groups/class-lp-settings-new-order-emails.php', |
| 70 | 71 | include 'email-groups/class-lp-settings-processing-order-emails.php', |
| 71 | 72 | include 'email-groups/class-lp-settings-completed-order-emails.php', |
| 72 | 73 | include 'email-groups/class-lp-settings-cancelled-order-emails.php', |
| 74 | + include 'email-groups/class-lp-settings-refunded-order-emails.php', | |
| 75 | + include 'email-groups/class-lp-settings-refund-request-order-emails.php', | |
| 73 | 76 | include 'email-groups/class-lp-settings-enrolled-course-emails.php', |
| 74 | 77 | include 'email-groups/class-lp-settings-finished-course-emails.php', |
| 75 | 78 | include 'email-groups/class-lp-settings-become-teacher-emails.php', |
| 76 | 79 | include 'email-groups/class-lp-settings-reset-password-emails.php', |
| @@ -131,9 +134,9 @@ | ||
| 131 | 134 | 'title' => esc_html__( 'Email template', 'learnpress' ), |
| 132 | 135 | 'type' => 'title', |
| 133 | 136 | 'desc' => esc_html__( 'This section lets you customize the LearnPress emails', 'learnpress' ), |
| 134 | 137 | ), |
| 135 | - array( | |
| 138 | + /*array( | |
| 136 | 139 | 'title' => esc_html__( 'Content type', 'learnpress' ), |
| 137 | 140 | 'id' => 'emails_general[default_email_content]', |
| 138 | 141 | 'default' => 'html', |
| 139 | 142 | 'type' => 'select', |
| @@ -140,9 +143,9 @@ | ||
| 140 | 143 | 'options' => array( |
| 141 | 144 | 'plain' => esc_html__( 'Plain Text', 'learnpress' ), |
| 142 | 145 | 'html' => esc_html__( 'HTML', 'learnpress' ), |
| 143 | 146 | ), |
| 144 | - ), | |
| 147 | + ),*/ | |
| 145 | 148 | array( |
| 146 | 149 | 'title' => esc_html__( 'Header image', 'learnpress' ), |
| 147 | 150 | 'id' => 'emails_general[header_image]', |
| 148 | 151 | 'default' => '', |
| @@ -174,16 +177,11 @@ | ||
| 174 | 177 | * @param string $tab |
| 175 | 178 | * @version 4.0.0 |
| 176 | 179 | */ |
| 177 | 180 | public function admin_page_settings( $section = null, $tab = null ) { |
| 178 | - $sections = array(); | |
| 179 | - $items = LP_Admin_Menu::instance()->get_menu_items(); | |
| 180 | - | |
| 181 | - if ( ! empty( $items['settings'] ) ) { | |
| 182 | - $tab = $items['settings']->get_active_tab(); | |
| 183 | - $section = $items['settings']->get_active_section(); | |
| 184 | - $sections = $items['settings']->get_sections(); | |
| 185 | - } | |
| 181 | + $tab = AdminSettingsPage::instance()->get_active_tab(); | |
| 182 | + $section = AdminSettingsPage::instance()->get_active_section(); | |
| 183 | + $sections = AdminSettingsPage::instance()->get_sections(); | |
| 186 | 184 | $section_data = ! empty( $sections[ $section ] ) ? $sections[ $section ] : false; |
| 187 | 185 | |
| 188 | 186 | if ( $section_data instanceof LP_Email ) { |
| 189 | 187 | $section_data->admin_option_settings(); |