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.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 1 day ago reviews 1 day ago settings 1 day ago withdrawal 1 day ago billing.php 1 day ago profile.php 1 day ago reviews.php 1 day ago settings.php 1 day ago withdrawals.php 1 day ago
settings.php
186 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 tabs = tutorTabs({
83 tabs: <?php echo wp_json_encode( $settings_tab_data ); ?>,
84 orientation: "vertical",
85 defaultTab: window.innerWidth >= 768 ? "account" : "none",
86 urlParams: {
87 enabled: true,
88 paramName: "tab",
89 }
90 });
91
92 return {
93 ...tabs,
94 backUrl: <?php echo wp_json_encode( $back_url ); ?>,
95 selectTab(tabId) {
96 if (tabId === "none") {
97 this.activeTab = "none";
98
99 if (this.urlParamsConfig.enabled) {
100 const url = new URL(window.location.href);
101 url.searchParams.delete(this.urlParamsConfig.paramName);
102 window.history.replaceState({}, "", url.toString());
103 }
104
105 return;
106 }
107
108 return tabs.selectTab.call(this, tabId);
109 },
110 handleClose() {
111 if (window.innerWidth < 768 && this.activeTab !== "none") {
112 this.selectTab("none");
113 return;
114 }
115
116 window.location.href = this.backUrl;
117 },
118 };
119 })()'
120 class="tutor-profile-settings-section"
121 >
122 <?php tutor_load_template( 'dashboard.account.settings.header', array( 'back_url' => $back_url ) ); ?>
123
124 <div class="tutor-account-container">
125 <div
126 x-init="$watch('$store.windowWidth', () => {
127 if (window.innerWidth >= 768 && activeTab === 'none') {
128 selectTab('account');
129 } else if (window.innerWidth < 768 && activeTab !== 'none') {
130 selectTab('none');
131 }
132 })"
133 @resize.window="
134 if (window.innerWidth >= 768 && activeTab === 'none') {
135 selectTab('account');
136 } else if (window.innerWidth < 768 && activeTab !== 'none') {
137 selectTab('none');
138 }
139 "
140 x-cloak
141 class="tutor-gap-8"
142 >
143 <div class="tutor-flex tutor-gap-8 tutor-my-9 tutor-sm-my-6">
144 <div x-ref="tablist" role="tablist" aria-orientation="vertical" class="tutor-tabs-nav tutor-profile-settings-tab tutor-p-5">
145 <template x-for="tab in tabs" :key="tab.id">
146 <button
147 type="button"
148 role="tab"
149 :class='getTabClass(tab)'
150 x-bind:aria-selected="isActive(tab.id)"
151 :disabled="tab.disabled ? true : false"
152 @click="selectTab(tab.id)"
153 >
154 <span x-data="tutorIcon({ name: tab.icon, width: 20, height: 20})"></span>
155 <div class="tutor-flex tutor-flex-column tutor-items-start">
156 <span x-text="tab.label" class="tutor-text-small"></span>
157 <span x-text="tab.text" class="tutor-text-tiny tutor-hidden tutor-md-block tutor-text-subdued"></span>
158 </div>
159 </button>
160 </template>
161 </div>
162
163 <div
164 role="main"
165 :class="activeTab !== null && activeTab !== 'none' ? 'tutor-profile-tab-activated' : ''"
166 class="tutor-profile-settings-tab-content tutor-w-full"
167 >
168 <?php foreach ( $settings_tab_data as $settings_tab ) : ?>
169 <div x-show="activeTab === '<?php echo esc_attr( $settings_tab['id'] ); ?>'" x-cloak class="tutor-tab-panel" role="tabpanel">
170 <?php
171 $form_id = "tutor-{$settings_tab['id']}-form";
172 tutor_load_template(
173 $settings_tab['template'],
174 array( 'form_id' => $form_id ),
175 isset( $settings_tab['is_pro'] ) && $settings_tab['is_pro'] ? true : false
176 );
177 ?>
178 </div>
179 <?php endforeach; ?>
180 </div>
181 </div>
182 </div>
183 </div>
184 </div>
185 </section>
186