Version Description
03/29/2022 = * TWEAK: Added Technical Support Tab in Settings Panel.
Download this release
Release Info
Developer | magazine3 |
Plugin | Easy Table of Contents |
Version | 2.0.18 |
Comparing to | |
See all releases |
Code changes from version 2.0.17 to 2.0.18
- README.txt +20 -11
- assets/css/admin.css +78 -0
- assets/css/admin.min.css +1 -1
- assets/js/eztoc-admin.js +77 -0
- easy-table-of-contents.php +8 -8
- includes/class.admin.php +117 -0
- includes/inc.admin-options-page.php +63 -34
README.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
=== Easy Table of Contents ===
|
2 |
-
Contributors:
|
3 |
-
Donate link: https://
|
4 |
Tags: table of contents, toc
|
5 |
Requires at least: 5.3
|
6 |
-
Tested up to: 5.9.
|
7 |
Requires PHP: 5.6.20
|
8 |
-
Stable tag: 2.0.
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -15,7 +15,7 @@ Adds a user friendly and fully automatic way to create and display a table of co
|
|
15 |
|
16 |
A user friendly, featured focused plugin which allows you to insert a table of contents into your posts, pages and custom post types.
|
17 |
|
18 |
-
|
19 |
* Automatically generate a table of contents for your posts, pages and custom post types by parsing its contents for headers.
|
20 |
* Supports the `<!--nextpage-->` tag.
|
21 |
* Supports the Rank Math plugin.
|
@@ -36,31 +36,37 @@ A user friendly, featured focused plugin which allows you to insert a table of c
|
|
36 |
* The widget auto highlights the sections currently visible on the page. The highlight color is configurable.
|
37 |
* Developer friendly with many action hooks and filters available. More can be added by request on [Github](https://github.com/shazahm1/Easy-Table-of-Contents). Pull requests are welcomed.
|
38 |
|
39 |
-
|
40 |
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
* [cMap Template Docs](http://connections-pro.com/documentation/cmap/)
|
44 |
* [Circled Template Docs](http://connections-pro.com/documentation/circled/)
|
45 |
* [Gridder Template Docs](http://connections-pro.com/documentation/gridder/)
|
46 |
|
47 |
-
|
48 |
* Fragment caching for improved performance.
|
49 |
* Improve SEO by adding options to add nofollow to TOC link and wrap TOC nav in noindex tag.
|
50 |
* Improve accessibility.
|
51 |
* Add Bullet and Arrow options for list counter style.
|
52 |
|
53 |
-
|
54 |
|
55 |
Easy Table Contents is a fork of the excellent [Table of Contents Plus](https://wordpress.org/plugins/table-of-contents-plus/) plugin by [Michael Tran](http://dublue.com/plugins/toc/).
|
56 |
|
57 |
-
|
58 |
|
59 |
1. The General section of the settings.
|
60 |
2. The Appearance section of the settings.
|
61 |
3. The Advanced section of the settings.
|
62 |
|
63 |
-
|
64 |
|
65 |
= Using the WordPress Plugin Search =
|
66 |
|
@@ -89,6 +95,9 @@ Easy Table Contents is a fork of the excellent [Table of Contents Plus](https://
|
|
89 |
|
90 |
== Changelog ==
|
91 |
|
|
|
|
|
|
|
92 |
= 2.0.17 03/26/2021 =
|
93 |
* TWEAK: Add additional check to prevent `Uncaught Error: Call to undefined function is_woocommerce()`.
|
94 |
* TWEAK: Ensure an instance of `ezTOC_Post ` is returned before accessing methods/properties.
|
1 |
=== Easy Table of Contents ===
|
2 |
+
Contributors: magazine3
|
3 |
+
Donate link: https://magazine3.company/
|
4 |
Tags: table of contents, toc
|
5 |
Requires at least: 5.3
|
6 |
+
Tested up to: 5.9.2
|
7 |
Requires PHP: 5.6.20
|
8 |
+
Stable tag: 2.0.18
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
15 |
|
16 |
A user friendly, featured focused plugin which allows you to insert a table of contents into your posts, pages and custom post types.
|
17 |
|
18 |
+
### Features
|
19 |
* Automatically generate a table of contents for your posts, pages and custom post types by parsing its contents for headers.
|
20 |
* Supports the `<!--nextpage-->` tag.
|
21 |
* Supports the Rank Math plugin.
|
36 |
* The widget auto highlights the sections currently visible on the page. The highlight color is configurable.
|
37 |
* Developer friendly with many action hooks and filters available. More can be added by request on [Github](https://github.com/shazahm1/Easy-Table-of-Contents). Pull requests are welcomed.
|
38 |
|
39 |
+
### Support
|
40 |
|
41 |
+
We try our best to provide support on WordPress.org forums. However, We have a special [team support](https://magazine3.company/contact/) where you can ask us questions and get help. Delivering a good user experience means a lot to us and so we try our best to reply each and every question that gets asked.
|
42 |
+
|
43 |
+
### Bug Reports
|
44 |
+
|
45 |
+
Bug reports for Easy Table of Contents are [welcomed on GitHub](https://github.com/ahmedkaludi/Easy-Table-of-Contents). Please note GitHub is not a support forum, and issues that aren't properly qualified as bugs will be closed.
|
46 |
+
|
47 |
+
### Live Examples
|
48 |
|
49 |
* [cMap Template Docs](http://connections-pro.com/documentation/cmap/)
|
50 |
* [Circled Template Docs](http://connections-pro.com/documentation/circled/)
|
51 |
* [Gridder Template Docs](http://connections-pro.com/documentation/gridder/)
|
52 |
|
53 |
+
### Roadmap
|
54 |
* Fragment caching for improved performance.
|
55 |
* Improve SEO by adding options to add nofollow to TOC link and wrap TOC nav in noindex tag.
|
56 |
* Improve accessibility.
|
57 |
* Add Bullet and Arrow options for list counter style.
|
58 |
|
59 |
+
### Credit
|
60 |
|
61 |
Easy Table Contents is a fork of the excellent [Table of Contents Plus](https://wordpress.org/plugins/table-of-contents-plus/) plugin by [Michael Tran](http://dublue.com/plugins/toc/).
|
62 |
|
63 |
+
### Screenshots
|
64 |
|
65 |
1. The General section of the settings.
|
66 |
2. The Appearance section of the settings.
|
67 |
3. The Advanced section of the settings.
|
68 |
|
69 |
+
### Installation
|
70 |
|
71 |
= Using the WordPress Plugin Search =
|
72 |
|
95 |
|
96 |
== Changelog ==
|
97 |
|
98 |
+
= 2.0.18 03/29/2022 =
|
99 |
+
* TWEAK: Added Technical Support Tab in Settings Panel.
|
100 |
+
|
101 |
= 2.0.17 03/26/2021 =
|
102 |
* TWEAK: Add additional check to prevent `Uncaught Error: Call to undefined function is_woocommerce()`.
|
103 |
* TWEAK: Ensure an instance of `ezTOC_Post ` is returned before accessing methods/properties.
|
assets/css/admin.css
CHANGED
@@ -142,3 +142,81 @@ div#farbtastic_colour_wheel {
|
|
142 |
font-size: 18px;
|
143 |
font-style: italic;
|
144 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
font-size: 18px;
|
143 |
font-style: italic;
|
144 |
}
|
145 |
+
/* Tab panel styles */
|
146 |
+
.postbox{
|
147 |
+
padding: 10px;
|
148 |
+
}
|
149 |
+
html {
|
150 |
+
scroll-behavior: smooth;
|
151 |
+
}
|
152 |
+
.toc-tab-panel {
|
153 |
+
overflow: hidden;
|
154 |
+
border: 1px solid #ccc;
|
155 |
+
background-color: #fff;
|
156 |
+
margin-top: 15px;}
|
157 |
+
.toc-tab-panel a {
|
158 |
+
background-color: inherit;
|
159 |
+
text-decoration: none;
|
160 |
+
float: left;
|
161 |
+
border: none;
|
162 |
+
outline: none;
|
163 |
+
cursor: pointer;
|
164 |
+
padding: 14px 16px;
|
165 |
+
transition: 0s;
|
166 |
+
font-size: 15px;
|
167 |
+
color: #2271b1;
|
168 |
+
}
|
169 |
+
.toc-tab-panel a:hover {
|
170 |
+
color: #0a4b78;
|
171 |
+
}
|
172 |
+
.toc-tab-panel a.active {
|
173 |
+
box-shadow: none;
|
174 |
+
border-bottom: 4px solid #646970;
|
175 |
+
color: #1d2327;
|
176 |
+
}
|
177 |
+
.toc-tab-panel a:focus {
|
178 |
+
box-shadow: none;
|
179 |
+
outline: none;
|
180 |
+
}
|
181 |
+
.eztoc-tabcontent {
|
182 |
+
display: none;
|
183 |
+
border-top: none;
|
184 |
+
animation: fadeEffect 1s;
|
185 |
+
}
|
186 |
+
.eztoc_support_div {
|
187 |
+
background: #fff;
|
188 |
+
margin-top: 10px;
|
189 |
+
padding: 28px;
|
190 |
+
min-width: 255px;
|
191 |
+
border: 1px solid #c3c4c7;
|
192 |
+
box-shadow: 0 1px 1px rgb(0 0 0 / 4%);
|
193 |
+
}
|
194 |
+
.support-label {
|
195 |
+
float: left;
|
196 |
+
width: 70px;
|
197 |
+
font-size: 14px;
|
198 |
+
}
|
199 |
+
.star-mark{
|
200 |
+
color: red;
|
201 |
+
margin-left: 4px;
|
202 |
+
font-family:bold;
|
203 |
+
}
|
204 |
+
.eztoc_support_div li {
|
205 |
+
margin:25px 0px 20px 0px;
|
206 |
+
}
|
207 |
+
.eztoc-query-success{
|
208 |
+
color: green;
|
209 |
+
}
|
210 |
+
.eztoc-query-error{
|
211 |
+
color: red;
|
212 |
+
}
|
213 |
+
.eztoc_hide{
|
214 |
+
display: none;
|
215 |
+
}
|
216 |
+
.eztoc-result{
|
217 |
+
margin-left: 70px;
|
218 |
+
}
|
219 |
+
.eztoc-send-query{
|
220 |
+
margin-left: 70px !important;;
|
221 |
+
}
|
222 |
+
@keyframes fadeEffect { from {opacity: 0;} to {opacity: 1;} }
|
assets/css/admin.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
div.tab_content table{margin-bottom:1em}table.more_toc_options_table td,table.more_toc_options_table th{padding:0;margin:0}table.more_toc_options_table th{width:auto;padding-right:4px;padding-top:2px}div.tab_content ul li{margin-left:2em;list-style-type:disc}div.tab_content ol li{list-style:inherit}div.tab_content pre{margin-left:2em}ul#tabbed-nav{margin-top:1em}#tabbed-nav{margin:0;padding:0;float:left;list-style:none;height:32px;border-bottom:1px solid #dfdfdf;border-left:1px solid #dfdfdf;width:100%}#tabbed-nav li{float:left;margin:0;padding:0;height:31px;line-height:31px;border:1px solid #dfdfdf;border-left:none;margin-bottom:-1px;overflow:hidden;position:relative;background:#f5f5f5;background-image:linear-gradient(center top,#fff,#f5f5f5)}#tabbed-nav li a{text-decoration:none;color:#000;display:block;font-size:1.2em;padding:0 20px;border:1px solid #fff;outline:0}#tabbed-nav li a:hover{background:#ececec}html #tabbed-nav li.active,html #tabbed-nav li.active a:hover{background:#fff;border-bottom:1px solid #fff}div.tab_container{border:1px solid #dfdfdf;border-top:none;overflow:hidden;clear:both;float:left;width:100%;background:#fff;margin-bottom:2em;padding-bottom:2em}div.tab_content{padding:10px;padding-bottom:0;font-size:1em}h3 span.show_hide{font-size:.85em;font-weight:400}div.more_toc_options{margin-top:4px;margin-left:2em}div.toc_theme_option{width:200px;float:left;margin-right:5px}#wpcontent select optgroup option{padding-left:15px}input#font_size,input#smooth_scroll_offset,input#width_custom{width:50px;text-align:center}input.custom_colour_option{width:75px}div#farbtastic_colour_wheel,table#theme_custom{float:left}table#theme_custom{margin-top:30px}table#theme_custom img{vertical-align:middle;opacity:.4}table#theme_custom img:hover{cursor:pointer;opacity:1}div#farbtastic_colour_wheel{margin-left:20px}#tab3 h3:not(:first-child){margin-top:2em}#toc input.small-text{width:50px;padding:2px;height:28px;line-height:28px;vertical-align:bottom}#toc .form-table tr>th>strong{font-size:18px;font-style:italic}
|
1 |
+
div.tab_content table{margin-bottom:1em}table.more_toc_options_table td,table.more_toc_options_table th{padding:0;margin:0}table.more_toc_options_table th{width:auto;padding-right:4px;padding-top:2px}div.tab_content ul li{margin-left:2em;list-style-type:disc}div.tab_content ol li{list-style:inherit}div.tab_content pre{margin-left:2em}ul#tabbed-nav{margin-top:1em}#tabbed-nav{margin:0;padding:0;float:left;list-style:none;height:32px;border-bottom:1px solid #dfdfdf;border-left:1px solid #dfdfdf;width:100%}#tabbed-nav li{float:left;margin:0;padding:0;height:31px;line-height:31px;border:1px solid #dfdfdf;border-left:none;margin-bottom:-1px;overflow:hidden;position:relative;background:#f5f5f5;background-image:linear-gradient(center top,#fff,#f5f5f5)}#tabbed-nav li a{text-decoration:none;color:#000;display:block;font-size:1.2em;padding:0 20px;border:1px solid #fff;outline:0}#tabbed-nav li a:hover{background:#ececec}html #tabbed-nav li.active,html #tabbed-nav li.active a:hover{background:#fff;border-bottom:1px solid #fff}div.tab_container{border:1px solid #dfdfdf;border-top:none;overflow:hidden;clear:both;float:left;width:100%;background:#fff;margin-bottom:2em;padding-bottom:2em}div.tab_content{padding:10px;padding-bottom:0;font-size:1em}h3 span.show_hide{font-size:.85em;font-weight:400}div.more_toc_options{margin-top:4px;margin-left:2em}div.toc_theme_option{width:200px;float:left;margin-right:5px}#wpcontent select optgroup option{padding-left:15px}input#font_size,input#smooth_scroll_offset,input#width_custom{width:50px;text-align:center}input.custom_colour_option{width:75px}div#farbtastic_colour_wheel,table#theme_custom{float:left}table#theme_custom{margin-top:30px}table#theme_custom img{vertical-align:middle;opacity:.4}table#theme_custom img:hover{cursor:pointer;opacity:1}div#farbtastic_colour_wheel{margin-left:20px}#tab3 h3:not(:first-child){margin-top:2em}#toc input.small-text{width:50px;padding:2px;height:28px;line-height:28px;vertical-align:bottom}#toc .form-table tr>th>strong{font-size:18px;font-style:italic}.postbox{padding: 10px;}html {scroll-behavior: smooth;}.toc-tab-panel {overflow: hidden;border: 1px solid #ccc;background-color: #fff;margin-top: 15px;}.toc-tab-panel a {background-color: inherit;text-decoration: none;float: left;border: none;outline: none;cursor: pointer;padding: 14px 16px;transition: 0s;font-size: 15px;color: #2271b1;}.toc-tab-panel a:hover {color: #0a4b78;}.toc-tab-panel a.active {box-shadow: none;border-bottom: 4px solid #646970;color: #1d2327;}.toc-tab-panel a:focus {box-shadow: none;outline: none;}.eztoc-tabcontent {display: none;border-top: none; animation: fadeEffect 1s; }.eztoc_support_div {background: #fff;margin-top: 10px;padding: 28px;min-width: 255px; border: 1px solid #c3c4c7;box-shadow: 0 1px 1px rgb(0 0 0 / 4%);}.support-label {float: left;width: 70px;font-size: 14px;}.star-mark{color: red;margin-left: 4px;font-family:bold;}.eztoc_support_div li {margin:25px 0px 20px 0px; }.eztoc-query-success{color: green;}.eztoc-query-error{color: red;}.eztoc_hide{display: none;}.eztoc-result{margin-left: 70px;}.eztoc-send-query{margin-left: 70px !important;}@keyframes fadeEffect { from {opacity: 0;} to {opacity: 1;} }
|
assets/js/eztoc-admin.js
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function tabToggle(evt, idname) {
|
2 |
+
var i, tabcontent, tablinks;tabcontent = document.getElementsByClassName("eztoc-tabcontent");
|
3 |
+
for (i = 0; i < tabcontent.length; i++) {
|
4 |
+
tabcontent[i].style.display = "none";
|
5 |
+
}
|
6 |
+
tablinks = document.getElementsByClassName("eztoc-tablinks");
|
7 |
+
for (i = 0; i < tablinks.length; i++) {
|
8 |
+
tablinks[i].className = tablinks[i].className.replace(" active", "");
|
9 |
+
}
|
10 |
+
document.getElementById(idname).style.display = "block";
|
11 |
+
|
12 |
+
evt.target.className += " active";
|
13 |
+
}
|
14 |
+
|
15 |
+
function eztocIsEmail(email) {
|
16 |
+
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
17 |
+
return regex.test(email);
|
18 |
+
}
|
19 |
+
|
20 |
+
|
21 |
+
//query form send starts here
|
22 |
+
jQuery(document).ready(function($) {
|
23 |
+
|
24 |
+
var url = window.location.href;
|
25 |
+
if(url.indexOf('#technical-support') > -1){
|
26 |
+
$("#eztoc-technical").click();
|
27 |
+
}else{
|
28 |
+
$("#eztoc-default").click();
|
29 |
+
}
|
30 |
+
|
31 |
+
$(".eztoc-send-query").on("click", function(e){
|
32 |
+
e.preventDefault();
|
33 |
+
var message = $("#eztoc_query_message").val();
|
34 |
+
var email = $("#eztoc_query_email").val();
|
35 |
+
var premium_cus = $("#saswp_query_premium_cus").val();
|
36 |
+
|
37 |
+
if($.trim(message) !='' && $.trim(email) !='' && eztocIsEmail(email) == true){
|
38 |
+
$.ajax({
|
39 |
+
type: "POST",
|
40 |
+
url:ajaxurl,
|
41 |
+
dataType: "json",
|
42 |
+
data:{action:"eztoc_send_query_message",message:message,email:email, eztoc_security_nonce:eztoc_admin_data.eztoc_security_nonce},
|
43 |
+
success:function(response){
|
44 |
+
if(response['status'] =='t'){
|
45 |
+
$(".eztoc-query-success").show();
|
46 |
+
$(".eztoc-query-error").hide();
|
47 |
+
}else{
|
48 |
+
$(".eztoc-query-success").hide();
|
49 |
+
$(".eztoc-query-error").show();
|
50 |
+
}
|
51 |
+
},
|
52 |
+
error: function(response){
|
53 |
+
console.log(response);
|
54 |
+
}
|
55 |
+
});
|
56 |
+
}else{
|
57 |
+
|
58 |
+
if($.trim(message) =='' && $.trim(email) ==''){
|
59 |
+
alert('Please enter the message, email and select customer type');
|
60 |
+
}else{
|
61 |
+
|
62 |
+
if($.trim(message) == ''){
|
63 |
+
alert('Please enter the message');
|
64 |
+
}
|
65 |
+
if($.trim(email) == ''){
|
66 |
+
alert('Please enter the email');
|
67 |
+
}
|
68 |
+
if(eztocIsEmail(email) == false){
|
69 |
+
alert('Please enter a valid email');
|
70 |
+
}
|
71 |
+
|
72 |
+
}
|
73 |
+
|
74 |
+
}
|
75 |
+
|
76 |
+
});
|
77 |
+
});
|
easy-table-of-contents.php
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Easy Table of Contents
|
4 |
-
* Plugin URI:
|
5 |
* Description: Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content.
|
6 |
-
* Version: 2.0.
|
7 |
-
* Author:
|
8 |
-
* Author URI:
|
9 |
* Text Domain: easy-table-of-contents
|
10 |
* Domain Path: /languages
|
11 |
*
|
12 |
-
* Copyright
|
13 |
*
|
14 |
* Easy Table of Contents is free software; you can redistribute it and/or modify
|
15 |
* it under the terms of the GNU General Public License, version 2, as
|
@@ -25,8 +25,8 @@
|
|
25 |
*
|
26 |
* @package Easy Table of Contents
|
27 |
* @category Plugin
|
28 |
-
* @author
|
29 |
-
* @version 2.0.
|
30 |
*/
|
31 |
|
32 |
use Easy_Plugins\Table_Of_Contents\Debug;
|
@@ -48,7 +48,7 @@ if ( ! class_exists( 'ezTOC' ) ) {
|
|
48 |
* @since 1.0
|
49 |
* @var string
|
50 |
*/
|
51 |
-
const VERSION = '2.0.
|
52 |
|
53 |
/**
|
54 |
* Stores the instance of this class.
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Easy Table of Contents
|
4 |
+
* Plugin URI: https://magazine3.company/
|
5 |
* Description: Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content.
|
6 |
+
* Version: 2.0.18
|
7 |
+
* Author: Magazine3
|
8 |
+
* Author URI: https://magazine3.company/
|
9 |
* Text Domain: easy-table-of-contents
|
10 |
* Domain Path: /languages
|
11 |
*
|
12 |
+
* Copyright 2022 Magazine3 ( email : support@magazine3.in )
|
13 |
*
|
14 |
* Easy Table of Contents is free software; you can redistribute it and/or modify
|
15 |
* it under the terms of the GNU General Public License, version 2, as
|
25 |
*
|
26 |
* @package Easy Table of Contents
|
27 |
* @category Plugin
|
28 |
+
* @author Magazine3
|
29 |
+
* @version 2.0.18
|
30 |
*/
|
31 |
|
32 |
use Easy_Plugins\Table_Of_Contents\Debug;
|
48 |
* @since 1.0
|
49 |
* @var string
|
50 |
*/
|
51 |
+
const VERSION = '2.0.18';
|
52 |
|
53 |
/**
|
54 |
* Stores the instance of this class.
|
includes/class.admin.php
CHANGED
@@ -36,6 +36,8 @@ if ( ! class_exists( 'ezTOC_Admin' ) ) {
|
|
36 |
add_action( 'admin_menu', array( $this, 'menu' ) );
|
37 |
add_action( 'init', array( $this, 'registerMetaboxes' ), 99 );
|
38 |
add_filter( 'plugin_action_links_' . EZ_TOC_BASE_NAME, array( $this, 'pluginActionLinks' ), 10, 2 );
|
|
|
|
|
39 |
}
|
40 |
|
41 |
/**
|
@@ -434,6 +436,121 @@ if ( ! class_exists( 'ezTOC_Admin' ) ) {
|
|
434 |
|
435 |
}
|
436 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
/**
|
438 |
* Callback used to render the admin options page.
|
439 |
*
|
36 |
add_action( 'admin_menu', array( $this, 'menu' ) );
|
37 |
add_action( 'init', array( $this, 'registerMetaboxes' ), 99 );
|
38 |
add_filter( 'plugin_action_links_' . EZ_TOC_BASE_NAME, array( $this, 'pluginActionLinks' ), 10, 2 );
|
39 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'load_scripts' ) );
|
40 |
+
add_action('wp_ajax_eztoc_send_query_message', array( $this, 'eztoc_send_query_message'));
|
41 |
}
|
42 |
|
43 |
/**
|
436 |
|
437 |
}
|
438 |
|
439 |
+
|
440 |
+
/**
|
441 |
+
* Enqueue Admin js scripts
|
442 |
+
*
|
443 |
+
*/
|
444 |
+
public function load_scripts($pagenow){
|
445 |
+
|
446 |
+
if (isset($pagenow) && $pagenow != 'settings_page_table-of-contents' && strpos($pagenow, 'table-of-contents') == false) {
|
447 |
+
|
448 |
+
return false;
|
449 |
+
}
|
450 |
+
|
451 |
+
wp_enqueue_script( 'eztoc-admin-js', EZ_TOC_URL . 'assets/js/eztoc-admin.js',array('jquery'), ezTOC::VERSION,true );
|
452 |
+
|
453 |
+
$data = array(
|
454 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
455 |
+
'eztoc_security_nonce' => wp_create_nonce('eztoc_ajax_check_nonce'),
|
456 |
+
);
|
457 |
+
|
458 |
+
$data = apply_filters('eztoc_localize_filter',$data,'eztoc_admin_data');
|
459 |
+
|
460 |
+
wp_localize_script( 'eztoc-admin-js', 'eztoc_admin_data', $data );
|
461 |
+
}
|
462 |
+
|
463 |
+
/**
|
464 |
+
* This is a ajax handler function for sending email from user admin panel to us.
|
465 |
+
* @return type json string
|
466 |
+
*/
|
467 |
+
|
468 |
+
public function eztoc_send_query_message(){
|
469 |
+
|
470 |
+
if ( ! isset( $_POST['eztoc_security_nonce'] ) ){
|
471 |
+
return;
|
472 |
+
}
|
473 |
+
if ( !wp_verify_nonce( $_POST['eztoc_security_nonce'], 'eztoc_ajax_check_nonce' ) ){
|
474 |
+
return;
|
475 |
+
}
|
476 |
+
$message = $this->eztoc_sanitize_textarea_field($_POST['message']);
|
477 |
+
$email = $this->eztoc_sanitize_textarea_field($_POST['email']);
|
478 |
+
|
479 |
+
if(function_exists('wp_get_current_user')){
|
480 |
+
|
481 |
+
$user = wp_get_current_user();
|
482 |
+
|
483 |
+
|
484 |
+
$message = '<p>'.$message.'</p><br><br>'.'Query from Easy Table of Content plugin support tab';
|
485 |
+
|
486 |
+
$user_data = $user->data;
|
487 |
+
$user_email = $user_data->user_email;
|
488 |
+
|
489 |
+
if($email){
|
490 |
+
$user_email = $email;
|
491 |
+
}
|
492 |
+
//php mailer variables
|
493 |
+
$sendto = 'support@magazine3.in';
|
494 |
+
$subject = "Easy Table of Content Query";
|
495 |
+
|
496 |
+
$headers[] = 'Content-Type: text/html; charset=UTF-8';
|
497 |
+
$headers[] = 'From: '. esc_attr($user_email);
|
498 |
+
$headers[] = 'Reply-To: ' . esc_attr($user_email);
|
499 |
+
// Load WP components, no themes.
|
500 |
+
|
501 |
+
$sent = wp_mail($sendto, $subject, $message, $headers);
|
502 |
+
|
503 |
+
if($sent){
|
504 |
+
|
505 |
+
echo json_encode(array('status'=>'t'));
|
506 |
+
|
507 |
+
}else{
|
508 |
+
|
509 |
+
echo json_encode(array('status'=>'f'));
|
510 |
+
|
511 |
+
}
|
512 |
+
|
513 |
+
}
|
514 |
+
|
515 |
+
wp_die();
|
516 |
+
}
|
517 |
+
|
518 |
+
public function eztoc_sanitize_textarea_field( $str ) {
|
519 |
+
|
520 |
+
if ( is_object( $str ) || is_array( $str ) ) {
|
521 |
+
return '';
|
522 |
+
}
|
523 |
+
|
524 |
+
$str = (string) $str;
|
525 |
+
|
526 |
+
$filtered = wp_check_invalid_utf8( $str );
|
527 |
+
|
528 |
+
if ( strpos( $filtered, '<' ) !== false ) {
|
529 |
+
$filtered = wp_pre_kses_less_than( $filtered );
|
530 |
+
// This will strip extra whitespace for us.
|
531 |
+
$filtered = wp_strip_all_tags( $filtered, false );
|
532 |
+
|
533 |
+
// Use HTML entities in a special case to make sure no later
|
534 |
+
// newline stripping stage could lead to a functional tag.
|
535 |
+
$filtered = str_replace( "<\n", "<\n", $filtered );
|
536 |
+
}
|
537 |
+
|
538 |
+
$filtered = trim( $filtered );
|
539 |
+
|
540 |
+
$found = false;
|
541 |
+
while ( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) {
|
542 |
+
$filtered = str_replace( $match[0], '', $filtered );
|
543 |
+
$found = true;
|
544 |
+
}
|
545 |
+
|
546 |
+
if ( $found ) {
|
547 |
+
// Strip out the whitespace that may now exist after removing the octets.
|
548 |
+
$filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );
|
549 |
+
}
|
550 |
+
|
551 |
+
return $filtered;
|
552 |
+
}
|
553 |
+
|
554 |
/**
|
555 |
* Callback used to render the admin options page.
|
556 |
*
|
includes/inc.admin-options-page.php
CHANGED
@@ -1,63 +1,92 @@
|
|
1 |
<div id='toc' class='wrap'>
|
2 |
<h1><?php _e( 'Table of Contents', 'easy-table-of-contents' ); ?></h1>
|
|
|
|
|
|
|
|
|
3 |
|
4 |
-
|
|
|
5 |
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
|
10 |
|
11 |
-
|
12 |
|
13 |
-
|
14 |
|
15 |
-
|
16 |
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
|
24 |
-
|
25 |
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
|
30 |
|
31 |
-
|
32 |
|
33 |
-
|
34 |
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
45 |
-
|
46 |
|
47 |
-
|
48 |
|
49 |
-
|
50 |
|
51 |
-
|
52 |
|
53 |
-
|
54 |
|
55 |
-
|
56 |
-
|
57 |
|
58 |
-
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
</div>
|
1 |
<div id='toc' class='wrap'>
|
2 |
<h1><?php _e( 'Table of Contents', 'easy-table-of-contents' ); ?></h1>
|
3 |
+
<div class="toc-tab-panel">
|
4 |
+
<a id="eztoc-default" class="eztoc-tablinks" data-href="no" href="#general-settings" onclick="tabToggle(event, 'general')">General</a>
|
5 |
+
<a class="eztoc-tablinks" id="eztoc-technical" href="#technical-support" onclick="tabToggle(event, 'technical')" data-href="no">Technical Support</a>
|
6 |
+
</div><!-- /.Tab panel -->
|
7 |
|
8 |
+
<div class="eztoc-tabcontent" id="general">
|
9 |
+
<form method="post" action="<?php echo esc_url( self_admin_url( 'options.php' ) ); ?>">
|
10 |
|
11 |
+
<div class="metabox-holder">
|
12 |
|
13 |
+
<div class="postbox" id="eztoc-general">
|
14 |
+
<h3><span><?php _e( 'General', 'easy-table-of-contents' ); ?></span></h3>
|
15 |
|
16 |
+
<div class="inside">
|
17 |
|
18 |
+
<table class="form-table">
|
19 |
|
20 |
+
<?php do_settings_fields( 'ez_toc_settings_general', 'ez_toc_settings_general' ); ?>
|
21 |
|
22 |
+
</table>
|
23 |
|
24 |
+
</div><!-- /.inside -->
|
25 |
+
</div><!-- /.postbox -->
|
26 |
|
27 |
+
</div><!-- /.metabox-holder -->
|
28 |
|
29 |
+
<div class="metabox-holder">
|
30 |
|
31 |
+
<div class="postbox" id="eztoc-appearance">
|
32 |
+
<h3><span><?php _e( 'Appearance', 'easy-table-of-contents' ); ?></span></h3>
|
33 |
|
34 |
+
<div class="inside">
|
35 |
|
36 |
+
<table class="form-table">
|
37 |
|
38 |
+
<?php do_settings_fields( 'ez_toc_settings_appearance', 'ez_toc_settings_appearance' ); ?>
|
39 |
|
40 |
+
</table>
|
41 |
|
42 |
+
</div><!-- /.inside -->
|
43 |
+
</div><!-- /.postbox -->
|
44 |
|
45 |
+
</div><!-- /.metabox-holder -->
|
46 |
|
47 |
+
<div class="metabox-holder">
|
48 |
|
49 |
+
<div class="postbox" id="eztoc-advanced">
|
50 |
+
<h3><span><?php _e( 'Advanced', 'easy-table-of-contents' ); ?></span></h3>
|
51 |
|
52 |
+
<div class="inside">
|
53 |
|
54 |
+
<table class="form-table">
|
55 |
|
56 |
+
<?php do_settings_fields( 'ez_toc_settings_advanced', 'ez_toc_settings_advanced' ); ?>
|
57 |
|
58 |
+
</table>
|
59 |
|
60 |
+
</div><!-- /.inside -->
|
61 |
+
</div><!-- /.postbox -->
|
62 |
|
63 |
+
</div><!-- /.metabox-holder -->
|
64 |
|
65 |
+
<?php settings_fields( 'ez-toc-settings' ); ?>
|
66 |
+
<?php submit_button( __( 'Save Changes', 'easy-table-of-contents' ) ); ?>
|
67 |
+
</form>
|
68 |
+
</div><!-- /.General Settings ended -->
|
69 |
+
|
70 |
+
<div class="eztoc_support_div eztoc-tabcontent" id="technical">
|
71 |
+
<strong><?php echo esc_html__('If you have any query, please write the query in below box or email us at','easy-table-of-contents') ?> <a href="mailto:support@magazine3.in">support@magazine3.in</a> <?php echo esc_html__('we will reply to your email address shortly.','easy-table-of-contents') ?></strong>
|
72 |
+
|
73 |
+
<ul>
|
74 |
+
<li>
|
75 |
+
<label class="support-label">Email<span class="star-mark">*</span></label>
|
76 |
+
<div class="support-input">
|
77 |
+
<input type="text" id="eztoc_query_email" name="eztoc_query_email" placeholder="email" required>
|
78 |
+
</div>
|
79 |
+
</li>
|
80 |
+
<li>
|
81 |
+
<label class="support-label">Query<span class="star-mark">*</span></label>
|
82 |
+
<div class="support-input"><textarea rows="5" cols="60" id="eztoc_query_message" name="eztoc_query_message" placeholder="Write your query"></textarea>
|
83 |
+
</div>
|
84 |
+
<div class="clear"> </div>
|
85 |
+
<span class="eztoc-query-success eztoc-result eztoc_hide"><?php echo esc_html__('Message sent successfully, Please wait we will get back to you shortly','easy-table-of-contents'); ?></span>
|
86 |
+
<span class="eztoc-query-error eztoc-result eztoc_hide"><?php echo esc_html__('Message not sent. please check your network connection','easy-table-of-contents'); ?></span>
|
87 |
+
</li>
|
88 |
+
<li><button class="button eztoc-send-query"><?php echo esc_html__('Send Message','easy-table-of-contents'); ?></button></li>
|
89 |
+
</ul>
|
90 |
+
|
91 |
+
</div><!-- /.Technical support div ended -->
|
92 |
</div>
|