PluginProbe ʕ •ᴥ•ʔ
Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager / 3.0.9
Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager v3.0.9
3.1.9 3.1.8 3.1.7 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 trunk 1.3.7 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.6.9 2.7 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9 2.9.1 2.9.2
folders / templates / admin / settings-tabs / notification-settings.php
folders / templates / admin / settings-tabs Last commit date
customize-folders.php 1 year ago folder-settings.php 1 year ago folder-user-settings.php 1 year ago folders-by-user.php 1 year ago folders-import.php 1 year ago notification-settings.php 1 year ago
notification-settings.php
197 lines
1 <?php
2 if($setting_page == "notification-settings") {
3 $notification_setting = get_option('folders_notification_settings');
4 $notification_setting = apply_filters('check_for_folders_notification_settings', $notification_setting);
5 ?>
6 <script>
7 (function (factory) {
8 "use strict";
9 if(typeof define === 'function' && define.amd) {
10 define(['jquery'], factory);
11 }
12 else if(typeof module !== 'undefined' && module.exports) {
13 module.exports = factory(require('jquery'));
14 }
15 else {
16 factory(jQuery);
17 }
18 }(function ($, undefined) {
19 <?php if ($setting_page == "notification-settings") { ?>
20 $(document).ready(function(){
21 $(".notification-select:not(#remove_users-options)").select2();
22 $("#remove_users-options").select2({
23 tags: false,
24 multiple: true,
25 minimumInputLength: 2,
26 minimumResultsForSearch: 10,
27 placeholder: "Search User",
28 ajax: {
29 url: "<?php echo esc_url(admin_url("admin-ajax.php")) ?>",
30 dataType: "json",
31 type: "POST",
32 quietMillis: 50,
33 data: function (params) {
34 var queryParameters = {
35 action: 'folders_search_for_users',
36 search: params.term,
37 nonce: "<?php echo esc_attr(wp_create_nonce("search_folder_user")) ?>",
38 paged: 0
39 }
40 return queryParameters;
41 },
42 processResults: function (result) {
43 console.log(result);
44 if(result.status) {
45 return {
46 results: jQuery.map(result.data, function (item) {
47 return {
48 text: item.display_name,
49 id: item.id
50 }
51 })
52 };
53 } else {
54 return {
55 results: jQuery.map(data, function (item) {
56 return {
57 text: "No results are found",
58 id: 0,
59 disabled: true
60 }
61 })
62 };
63 }
64 }
65 }
66 });
67 });
68 <?php } ?>
69 }));
70 </script>
71 <div class="tab-content <?php echo esc_attr(($setting_page == "notification-settings") ? "active" : "") ?>" id="notification-settings">
72 <div class="accordion-content no-bp">
73 <?php $allow_notification = "on" ?>
74 <div class="notification-setting folder-user-settings <?php echo esc_attr(($allow_notification == "on")?"active":"") ?>">
75 <div class="note-settings">
76 <div class="notification-emails">
77 <label>
78 <?php esc_html_e("Notification Email", "folders"); ?> <span class="folder-tooltip" data-title="Notification Will be sent to this email"><span class="dashicons dashicons-editor-help"></span></span>
79 </label>
80 <?php
81 $default_emails = [""];
82 $notification_emails = (isset($notification_setting['notification_email']) && is_array($notification_setting['notification_email'])) ? $notification_setting['notification_email'] : $default_emails ?>
83 <?php
84 foreach ($notification_emails as $email) { ?>
85 <div class="notification-email">
86 <div class="email-info">
87 <input type="email" required name="notification_setting[notification_email][]" value="<?php echo esc_attr($email) ?>" />
88 </div>
89 <div class="email-test-button">
90 <a href="javascript:;" class="send-test-email"><?php esc_html_e("Test", "folders"); ?></a>
91 </div>
92 <div class="email-remove-button">
93 <a href="javascript:;" class="remove-email"><?php esc_html_e("Remove", "folders"); ?></a>
94 </div>
95 </div>
96 <?php } ?>
97 <div class="notification-email add-email-button">
98 <a href="javascript:;" class="add-email-notification" ><?php esc_html_e("+ Add another email", "folders"); ?></a>
99 </div>
100 </div>
101 <div class="mail-settings">
102 <?php if(isset($notification_setting['mail_setting']) && !empty($notification_setting['mail_setting'])) {
103 foreach($notification_setting['mail_setting'] as $key => $setting) {
104 $setting['status'] = "on";
105 ?>
106 <div class="mail-setting">
107 <div class="mail-checkbox">
108 <input type="hidden" name="notification_setting[mail_setting][<?php echo esc_attr($key) ?>][status]" value="off">
109 <label class="custom-checkbox" for="notification_setting_<?php echo esc_attr($key) ?>">
110 <input id="notification_setting_<?php echo esc_attr($key) ?>" class="sr-only mail-options" type="checkbox" name="notification_setting[mail_setting][<?php echo esc_attr($key) ?>][status]" value="on" <?php checked($setting['status'], "on") ?> />
111 <span></span>
112 </label>
113 <label for="notification_setting_<?php echo esc_attr($key) ?>"><?php echo esc_attr($setting['title']) ?></label>
114 </div>
115 <div class="mail-posts <?php echo esc_attr(($setting['status'] == "on")?"active":"") ?>">
116 <?php if($key != "remove_users") { ?>
117 <div class="mail-field">
118 <!--<label><?php /*esc_html_e("Select Post types"); */?></label>-->
119 <div class="mail-field-input">
120 <select id="<?php echo esc_attr($key) ?>-options" multiple class="notification-select" name="notification_setting[mail_setting][<?php echo esc_attr($key) ?>][post_type][]">
121 <?php if(isset($setting['default']) && is_array($setting['default'])) {
122 $setting['post_type'] = isset($setting['post_type']) ? $setting['post_type'] : "";
123 $post_type = !is_array($setting['post_type'])?[]:$setting['post_type'];
124 foreach ($setting['default'] as $key=>$label) {
125 ?>
126 <option selected value="<?php echo esc_attr($key) ?>"><?php echo esc_attr($label) ?></option>
127 <?php } ?>
128 <?php } ?>
129 </select>
130 </div>
131 </div>
132 <?php } else { ?>
133 <select id="<?php echo esc_attr($key) ?>-options" multiple class="notification-select" name="notification_setting[mail_setting][<?php echo esc_attr($key) ?>][users][]">
134 <?php if(isset($setting['users']) && is_array($setting['users'])) {
135 foreach ($setting['users'] as $use_id) {
136 $user_data = get_user_by("id", $use_id);
137 if(!empty($user_data) && isset($user_data->data->ID)) {
138 ?>
139 <option selected="selected" value="<?php echo esc_attr($use_id) ?>"><?php echo esc_attr($user_data->data->display_name) ?></option>
140 <?php }
141 }
142 } ?>
143 </select>
144 <?php } ?>
145
146 <?php if(isset($setting['email']) && 0) { ?>
147 <div class="mail-field">
148 <label><?php esc_html_e("Mail Subject", 'folders'); ?></label>
149 <div class="mail-field-input">
150 <input type="text" name="notification_setting[mail_setting][<?php echo esc_attr($key) ?>][email][subject]" value="<?php echo esc_attr($setting['email']['subject']) ?>">
151 </div>
152 </div>
153 <div class="mail-field">
154 <label><?php esc_html_e("Mail Content", 'folders'); ?></label>
155 <div class="mail-field-input">
156 <textarea name="notification_setting[mail_setting][<?php echo esc_attr($key) ?>][email][content]"><?php echo esc_attr($setting['email']['content']) ?></textarea>
157 </div>
158 </div>
159 <?php } ?>
160 <?php if(isset($setting['help']) && 0) { ?>
161 <div class="mail-field">
162 <?php echo nl2br(esc_attr($setting['help'])) ?>
163 </div>
164 <?php } ?>
165 </div>
166 </div>
167 <?php }
168 } ?>
169 </div>
170 <div class="submit-button sr-only">
171 <p>
172 <input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes">
173 </p>
174 </div>
175 </div>
176 <div class="pro-feature-popup">
177 <div class="pro-feature-content" style="top: 30%">
178 <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
179 <path d="M16.0002 2.66663C12.3335 2.66663 9.3335 5.66663 9.3335 9.33329V12H12.0002V9.33329C12.0002 7.13329 13.8002 5.33329 16.0002 5.33329C18.2002 5.33329 20.0002 7.13329 20.0002 9.33329V12H22.6668V9.33329C22.6668 5.66663 19.6668 2.66663 16.0002 2.66663Z" fill="#424242"></path>
180 <path d="M24.0002 29.3333H8.00016C6.5335 29.3333 5.3335 28.1333 5.3335 26.6667V14.6667C5.3335 13.2 6.5335 12 8.00016 12H24.0002C25.4668 12 26.6668 13.2 26.6668 14.6667V26.6667C26.6668 28.1333 25.4668 29.3333 24.0002 29.3333Z" fill="#FB8C00"></path>
181 <path d="M16 22.6666C17.1046 22.6666 18 21.7712 18 20.6666C18 19.5621 17.1046 18.6666 16 18.6666C14.8954 18.6666 14 19.5621 14 20.6666C14 21.7712 14.8954 22.6666 16 22.6666Z" fill="#C76E00"></path>
182 </svg>
183 <div class="pro-user-title"><?php esc_html_e("Get notified whenever changes are made to Pages, Posts, Plugins, or Media Files", "folders") ?></div>
184 <div class="pro-user-desc"></div>
185 <a href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" target="_blank">
186 <svg width="18" height="15" viewBox="0 0 18 15" fill="none" xmlns="http://www.w3.org/2000/svg">
187 <path d="M17.9998 3.75C17.9998 4.44031 17.4401 5 16.7498 5C16.7421 5 16.7356 4.99603 16.7278 4.99594L15.1491 13.6803C15.0623 14.1531 14.6498 14.5 14.1654 14.5H3.83418C3.35105 14.5 2.93668 14.1544 2.85043 13.6791L1.27199 4.99688C1.26418 4.99688 1.25762 5 1.22168 5C0.531367 5 -0.0283203 4.44031 -0.0283203 3.75C-0.0283203 3.05969 0.559492 2.5 1.22168 2.5C1.88387 2.5 2.47168 3.05969 2.47168 3.75C2.47168 4.03119 2.36165 4.27781 2.2049 4.48656L5.00584 6.72719C5.50302 7.125 6.24021 6.96294 6.5249 6.39344L8.3249 2.79344C7.97168 2.57313 7.72168 2.19813 7.72168 1.75C7.72168 1.05969 8.30918 0.5 8.9998 0.5C9.69043 0.5 10.2217 1.05969 10.2217 1.75C10.2217 2.19813 9.97284 2.57313 9.61855 2.79375L11.4186 6.39375C11.7033 6.96313 12.4407 7.125 12.9376 6.7275L15.7386 4.48688C15.6092 4.27813 15.4998 4.00313 15.4998 3.75C15.4998 3.05938 16.0592 2.5 16.7498 2.5C17.4404 2.5 17.9998 3.05938 17.9998 3.75Z" fill="white"></path>
188 </svg>
189 <?php esc_html_e("Upgrade to Pro", "folders") ?>
190 </a>
191 </div>
192 </div>
193 </div>
194 </div>
195 </div>
196 <?php } ?>
197