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.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / templates / dashboard / account / settings.php
tutor / templates / dashboard / account Last commit date
billing 2 weeks ago reviews 1 month ago settings 1 month ago withdrawal 1 month ago billing.php 3 weeks ago profile.php 1 month ago reviews.php 1 month ago settings.php 3 days ago withdrawals.php 1 month ago
settings.php
192 lines
1 <?php
2 /**
3 * Settings Template for Account
4 *
5 * @package Tutor\Templates
6 * @subpackage Dashboard
7 * @author Themeum <support@themeum.com>
8 * @link https://themeum.com
9 * @since 4.0.0
10 *
11 * These variables are inherited from parent templates:
12 * template: templates/account.php
13 *
14 * @var string $back_url
15 */
16
17 defined( 'ABSPATH' ) || exit;
18
19 use TUTOR\Icon;
20 use TUTOR\User;
21
22 $settings_tab_data = array(
23 'account' => array(
24 'id' => 'account',
25 'label' => __( 'Account', 'tutor' ),
26 'icon' => Icon::USER_CIRCLE,
27 'text' => __( 'Name, email, phone number, profiles', 'tutor' ),
28 'template' => 'dashboard.account.settings.account',
29 'role' => false,
30 ),
31 'security' => array(
32 'id' => 'security',
33 'label' => __( 'Security', 'tutor' ),
34 'icon' => Icon::SECURITY,
35 'text' => __( 'Password, 2FA', 'tutor' ),
36 'template' => 'dashboard.account.settings.security',
37 'role' => false,
38 ),
39 'social-accounts' => array(
40 'id' => 'social-accounts',
41 'label' => __( 'Social Accounts', 'tutor' ),
42 'icon' => Icon::GLOBE,
43 'text' => __( 'Linked social media profiles', 'tutor' ),
44 'template' => 'dashboard.account.settings.social-accounts',
45 'role' => false,
46 ),
47 'withdraw' => array(
48 'id' => 'withdraw',
49 'label' => __( 'Withdraw', 'tutor' ),
50 'icon' => Icon::WITHDRAW,
51 'text' => __( 'Withdrawal and refund', 'tutor' ),
52 'template' => 'dashboard.account.settings.withdraw',
53 'role' => User::INSTRUCTOR,
54 ),
55 'preferences' => array(
56 'id' => 'preferences',
57 'label' => __( 'Preferences', 'tutor' ),
58 'icon' => Icon::FILTER_2,
59 'text' => __( 'Sound effects, animations, theme', 'tutor' ),
60 'template' => 'dashboard.account.settings.preferences',
61 'role' => false,
62 ),
63 );
64
65 // phpcs:ignore WordPress.NamingConventions.ValidHookName
66 $settings_tab_data = apply_filters( 'tutor_dashboard/nav_items/settings/nav_items', $settings_tab_data );
67
68 $settings_tab_data = array_values(
69 array_filter(
70 $settings_tab_data,
71 function ( $tab ) {
72 return 'account' === $tab['id'] || ! $tab['role'] || ( User::INSTRUCTOR === $tab['role'] && current_user_can( tutor()->instructor_role ) && User::is_instructor_view() );
73 }
74 )
75 );
76
77 ?>
78
79 <section x-data="tutorSettings()">
80 <div
81 x-data='(() => {
82 const initialTab = new URL(window.location.href).searchParams.get("tab");
83 const tabs = tutorTabs({
84 tabs: <?php echo wp_json_encode( $settings_tab_data ); ?>,
85 orientation: "vertical",
86 defaultTab: window.innerWidth >= 768 ? "account" : "none",
87 urlParams: {
88 enabled: true,
89 paramName: "tab",
90 }
91 });
92
93 return {
94 ...tabs,
95 backUrl: <?php echo wp_json_encode( $back_url ); ?>,
96 viewportWidth: window.innerWidth,
97 hasInitialUrlTab: tabs.tabs.some((tab) => tab.id === initialTab),
98 handleViewportResize() {
99 const wasDesktop = this.viewportWidth >= 768;
100 const isDesktop = window.innerWidth >= 768;
101
102 this.viewportWidth = window.innerWidth;
103
104 if (wasDesktop === isDesktop || this.hasInitialUrlTab) {
105 return;
106 }
107
108 if (isDesktop && this.activeTab === "none") {
109 this.selectTab("account");
110 } else if (!isDesktop && this.activeTab !== "none") {
111 this.selectTab("none");
112 }
113 },
114 selectTab(tabId) {
115 if (tabId === "none") {
116 this.activeTab = "none";
117
118 if (this.urlParamsConfig.enabled) {
119 const url = new URL(window.location.href);
120 url.searchParams.delete(this.urlParamsConfig.paramName);
121 window.history.replaceState({}, "", url.toString());
122 }
123
124 return;
125 }
126
127 return tabs.selectTab.call(this, tabId);
128 },
129 handleClose() {
130 if (window.innerWidth < 768 && this.activeTab !== "none") {
131 this.selectTab("none");
132 return;
133 }
134
135 window.location.href = this.backUrl;
136 },
137 };
138 })()'
139 class="tutor-profile-settings-section"
140 >
141 <?php tutor_load_template( 'dashboard.account.settings.header', array( 'back_url' => $back_url ) ); ?>
142
143 <div class="tutor-account-container">
144 <div
145 @resize.window="handleViewportResize()"
146 x-cloak
147 class="tutor-gap-8"
148 >
149 <div class="tutor-flex tutor-gap-8 tutor-my-9 tutor-sm-my-6">
150 <div x-ref="tablist" role="tablist" aria-orientation="vertical" class="tutor-tabs-nav tutor-profile-settings-tab tutor-p-5">
151 <template x-for="tab in tabs" :key="tab.id">
152 <button
153 type="button"
154 role="tab"
155 :class='getTabClass(tab)'
156 x-bind:aria-selected="isActive(tab.id)"
157 :disabled="tab.disabled ? true : false"
158 @click="selectTab(tab.id)"
159 >
160 <span x-data="tutorIcon({ name: tab.icon, width: 20, height: 20})"></span>
161 <div class="tutor-flex tutor-flex-column tutor-items-start">
162 <span x-text="tab.label" class="tutor-text-small"></span>
163 <span x-text="tab.text" class="tutor-text-tiny tutor-hidden tutor-md-block tutor-text-subdued"></span>
164 </div>
165 </button>
166 </template>
167 </div>
168
169 <div
170 role="main"
171 :class="activeTab !== null && activeTab !== 'none' ? 'tutor-profile-tab-activated' : ''"
172 class="tutor-profile-settings-tab-content tutor-w-full"
173 >
174 <?php foreach ( $settings_tab_data as $settings_tab ) : ?>
175 <div x-show="activeTab === '<?php echo esc_attr( $settings_tab['id'] ); ?>'" x-cloak class="tutor-tab-panel" role="tabpanel">
176 <?php
177 $form_id = "tutor-{$settings_tab['id']}-form";
178 tutor_load_template(
179 $settings_tab['template'],
180 array( 'form_id' => $form_id ),
181 isset( $settings_tab['is_pro'] ) && $settings_tab['is_pro'] ? true : false
182 );
183 ?>
184 </div>
185 <?php endforeach; ?>
186 </div>
187 </div>
188 </div>
189 </div>
190 </div>
191 </section>
192