Ultimate FAQ - Version 2.0.0

Version Description

(2021-04-06) - This update includes quite a big change to the construction of the plugin, so please take caution and test before updating on a live site (or wait a few days before updating in case some minor corrective updates need to be released). - Rebuilt the plugin, from the ground up, to be object oriented. - Updated the structure of the settings pages. - Fixed an issue with the WooCommerce integration causing other tabs to not display. - Fixed an issue with reveal effects not working. - Fixed issues with custom field importing. - If there's only a single FAQ being displayed, it will automatically display opened - CSS/styling updates, including for columns and WP Forms integration. - Updates to several styling options. - Updates to several option descriptions, to clarify them. - Updated the conditional loading of CSS and JS assets. - Added labelling option. - Cleaning up/removing unnecessary code and files. - Eliminating notices. - JS localization. - Updated .pot file. (If you have created a translation based on the old version, you might need to just update your .po file for this new version.)

Download this release

Release Info

Developer Rustaurius
Plugin Icon 128x128 Ultimate FAQ
Version 2.0.0
Comparing to
See all releases

Code changes from version 1.9.12 to 2.0.0

Files changed (184) hide show
  1. Functions/EWD_UFAQ_Add_Social_Media_Buttons.php +0 -109
  2. Functions/EWD_UFAQ_Add_Views_Column.php +0 -141
  3. Functions/EWD_UFAQ_Admin_Image_Upload.php +0 -20
  4. Functions/EWD_UFAQ_Captcha.php +0 -25
  5. Functions/EWD_UFAQ_Create_Captcha_Image.php +0 -20
  6. Functions/EWD_UFAQ_Deactivation_Survey.php +0 -69
  7. Functions/EWD_UFAQ_Export.php +0 -176
  8. Functions/EWD_UFAQ_Export_To_PDF.php +0 -160
  9. Functions/EWD_UFAQ_Help_Pointers.php +0 -75
  10. Functions/EWD_UFAQ_Import.php +0 -227
  11. Functions/EWD_UFAQ_Initial_Data.php +0 -45
  12. Functions/EWD_UFAQ_Meta_Boxes.php +0 -276
  13. Functions/EWD_UFAQ_Output_Export_Page.php +0 -11
  14. Functions/EWD_UFAQ_Output_Import_Page.php +0 -11
  15. Functions/EWD_UFAQ_Output_Options_Page.php +0 -11
  16. Functions/EWD_UFAQ_Output_Pages.php +0 -16
  17. Functions/EWD_UFAQ_Output_Statistics_Page.php +0 -11
  18. Functions/EWD_UFAQ_Pointers_Manager_Class.php +0 -46
  19. Functions/EWD_UFAQ_Pointers_Manager_Interface.php +0 -20
  20. Functions/EWD_UFAQ_Rewrite_Rules.php +0 -33
  21. Functions/EWD_UFAQ_Styling.php +0 -83
  22. Functions/EWD_UFAQ_Submit_Question.php +0 -147
  23. Functions/EWD_UFAQ_Upgrade_Box.php +0 -46
  24. Functions/EWD_UFAQ_Version_Update.php +0 -129
  25. Functions/EWD_UFAQ_WPForms_Integration.php +0 -99
  26. Functions/EWD_UFAQ_Widgets.php +0 -323
  27. Functions/EWD_UFAQ_WooCommerce_Tab.php +0 -155
  28. Functions/Error_Notices.php +0 -59
  29. Functions/FrontEndAjaxUrl.php +0 -10
  30. Functions/Process_Ajax.php +0 -315
  31. Functions/Register_EWD_UFAQ_Posts_Taxonomies.php +0 -86
  32. Functions/Update_Admin_Databases.php +0 -214
  33. Functions/Update_EWD_UFAQ_Content.php +0 -33
  34. Main.php +0 -414
  35. PHPSpreadsheet/vendor/phpoffice/phpspreadsheet/.gitattributes +0 -2
  36. PHPSpreadsheet/vendor/phpoffice/phpspreadsheet/.gitignore +0 -11
  37. Shortcodes/DisplayFAQs.php +0 -700
  38. Shortcodes/Display_FAQ_Search.php +0 -100
  39. Shortcodes/Display_Popular_FAQs.php +0 -33
  40. Shortcodes/Display_Recent_FAQs.php +0 -33
  41. Shortcodes/Display_Top_Rated_FAQs.php +0 -17
  42. Shortcodes/SelectFAQ.php +0 -44
  43. Shortcodes/SubmitFAQ.php +0 -171
  44. assets/css/dashboard-review-ask.css +61 -0
  45. assets/css/ewd-ufaq-admin.css +1118 -0
  46. {blocks → assets/css}/ewd-ufaq-blocks.css +0 -0
  47. assets/css/ewd-ufaq-wc-admin.css +53 -0
  48. {css → assets/css}/ewd-ufaq-welcome-screen.css +17 -138
  49. assets/css/ewd-ufaq-wpforms.css +614 -0
  50. css/ewd-ufaq-styles.css → assets/css/ewd-ufaq.css +616 -617
  51. assets/css/jquery-ui.min.css +7 -0
  52. css/ewd-ufaq-plugin-deactivation.css → assets/css/plugin-deactivation.css +0 -0
  53. {css → assets/css}/rrssb-min.css +0 -0
  54. {css → assets}/fonts/ewd-toggle-icon.eot +0 -0
  55. {css → assets}/fonts/ewd-toggle-icon.svg +0 -0
  56. {css → assets}/fonts/ewd-toggle-icon.ttf +0 -0
  57. {css → assets}/fonts/ewd-toggle-icon.woff +0 -0
  58. {css → assets}/fonts/ewd-toggle-icon.woff2 +0 -0
  59. {images → assets/img}/Icon_Documentation_Grey.png +0 -0
  60. {images → assets/img}/Icon_PluginForum_Grey.png +0 -0
  61. {images → assets/img}/Icon_WP_Grey.png +0 -0
  62. {images → assets/img}/Icon_Youtube_Grey.png +0 -0
  63. {images → assets/img}/Thumbs-down-icon.png +0 -0
  64. {images → assets/img}/Thumbs-up-icon.png +0 -0
  65. {images → assets/img}/UPCP_Icons-07-300x300.png +0 -0
  66. {images → assets/img}/URP_Icons-03.png +0 -0
  67. {images → assets/img}/US_Related_Sales_Icon.png +0 -0
  68. {images → assets/img}/dash-asset-badge-old.png +0 -0
  69. {images → assets/img}/dash-asset-badge.png +0 -0
  70. {images → assets/img}/dash-asset-checkmark.png +0 -0
  71. {images → assets/img}/dash-asset-key.png +0 -0
  72. {images → assets/img}/dash-asset-stars.png +0 -0
  73. {images → assets/img}/ewd-dashboard-icon-ufaq-01.png +0 -0
  74. {images → assets/img}/ewd-dashboard-icon-ufaq-02.png +0 -0
  75. {images → assets/img}/ewd-dashboard-icon-ufaq-03.png +0 -0
  76. {images → assets/img}/ewd-logo-white.png +0 -0
  77. {images → assets/img}/ewd-support-icon-documentation.png +0 -0
  78. {images → assets/img}/ewd-support-icon-faqs.png +0 -0
  79. {images → assets/img}/ewd-support-icon-forum.png +0 -0
  80. {images → assets/img}/ewd-support-icon-youtube.png +0 -0
  81. {images → assets/img}/ewd-ufaq-dashboard-banner.png +0 -0
  82. {images → assets/img}/ewd-ufaq-icon.png +0 -0
  83. {images → assets/img}/ewd-upcp-icon.png +0 -0
  84. {images → assets/img}/ewd-urp-icon.png +0 -0
  85. {images → assets/img}/insert_link.png +0 -0
  86. {images → assets/img}/options-asset-info.png +0 -0
  87. {images → assets/img}/options-asset-lock.png +0 -0
  88. {images → assets/img}/options-asset-star.png +0 -0
  89. {images → assets/img}/support_icons_ufaq-01.png +0 -0
  90. {images → assets/img}/support_icons_ufaq-02.png +0 -0
  91. {images → assets/img}/support_icons_ufaq-03.png +0 -0
  92. {images → assets/img}/ufaq-buttonsicons-04.png +0 -0
  93. assets/js/dashboard-review-ask.js +62 -0
  94. assets/js/ewd-ufaq-admin.js +71 -0
  95. {blocks → assets/js}/ewd-ufaq-blocks.js +161 -161
  96. {js → assets/js}/ewd-ufaq-wc-admin.js +57 -57
  97. js/ewd-ufaq-getting-started.js → assets/js/ewd-ufaq-welcome-screen.js +10 -10
  98. assets/js/ewd-ufaq.js +440 -0
  99. js/ewd-ufaq-plugin-deactivation.js → assets/js/plugin-deactivation.js +0 -0
  100. blocks/ewd-ufaq-blocks.php +0 -10
  101. css/Admin.css +0 -3025
  102. css/CSSTidy/class.csstidy.php +0 -1001
  103. css/CSSTidy/class.csstidy_optimise.php +0 -811
  104. css/CSSTidy/class.csstidy_print.php +0 -350
  105. css/CSSTidy/cssparse.css +0 -137
  106. css/CSSTidy/data.inc.php +0 -473
  107. css/CSSTidy/lang.inc.php +0 -238
  108. css/ewd-ufaq-post-edit-styles.css +0 -30
  109. ewd-ufaq-templates/faq-answer.php +3 -0
  110. ewd-ufaq-templates/faq-author-date.php +9 -0
  111. ewd-ufaq-templates/faq-author.php +5 -0
  112. ewd-ufaq-templates/faq-back-to-top.php +7 -0
  113. ewd-ufaq-templates/faq-categories.php +11 -0
  114. ewd-ufaq-templates/faq-custom-fields.php +21 -0
  115. ewd-ufaq-templates/faq-date.php +5 -0
  116. ewd-ufaq-templates/faq-permalink.php +10 -0
  117. ewd-ufaq-templates/faq-preview.php +3 -0
  118. ewd-ufaq-templates/faq-ratings.php +18 -0
  119. ewd-ufaq-templates/faq-social-media-email.php +17 -0
  120. ewd-ufaq-templates/faq-social-media-facebook.php +17 -0
  121. ewd-ufaq-templates/faq-social-media-linkedin.php +17 -0
  122. ewd-ufaq-templates/faq-social-media-pinterest.php +17 -0
  123. ewd-ufaq-templates/faq-social-media-twitter.php +17 -0
  124. ewd-ufaq-templates/faq-social-media.php +11 -0
  125. ewd-ufaq-templates/faq-tags.php +11 -0
  126. ewd-ufaq-templates/faq-title.php +21 -0
  127. ewd-ufaq-templates/faq.php +17 -0
  128. ewd-ufaq-templates/faqs-category-footer.php +3 -0
  129. ewd-ufaq-templates/faqs-category-header.php +12 -0
  130. ewd-ufaq-templates/faqs-category-list-header.php +37 -0
  131. ewd-ufaq-templates/faqs-expand-collapse-all.php +13 -0
  132. ewd-ufaq-templates/faqs-list-header.php +20 -0
  133. ewd-ufaq-templates/faqs-pagination.php +21 -0
  134. ewd-ufaq-templates/faqs-search-submit.php +3 -0
  135. ewd-ufaq-templates/faqs-search.php +13 -0
  136. ewd-ufaq-templates/faqs-shortcode-args.php +6 -0
  137. ewd-ufaq-templates/faqs.php +17 -0
  138. ewd-ufaq-templates/submit-faq-captcha.php +11 -0
  139. ewd-ufaq-templates/submit-faq-custom-field-checkbox.php +21 -0
  140. ewd-ufaq-templates/submit-faq-custom-field-date.php +11 -0
  141. ewd-ufaq-templates/submit-faq-custom-field-datetime.php +11 -0
  142. ewd-ufaq-templates/submit-faq-custom-field-radio.php +21 -0
  143. ewd-ufaq-templates/submit-faq-custom-field-select.php +16 -0
  144. ewd-ufaq-templates/submit-faq-custom-field-text.php +11 -0
  145. ewd-ufaq-templates/submit-faq-custom-field-textarea.php +11 -0
  146. ewd-ufaq-templates/submit-faq-field-author-email.php +19 -0
  147. ewd-ufaq-templates/submit-faq-field-author.php +19 -0
  148. ewd-ufaq-templates/submit-faq-field-faq-answer.php +21 -0
  149. ewd-ufaq-templates/submit-faq-field-faq-question.php +19 -0
  150. ewd-ufaq-templates/submit-faq-submitted-faq-message.php +3 -0
  151. ewd-ufaq-templates/submit-faq.php +31 -0
  152. html/AdminFooter.php +0 -1
  153. html/AdminHeader.php +0 -23
  154. html/DashboardPage.php +0 -269
  155. html/ExportPage.php +0 -34
  156. html/ImportPage.php +0 -29
  157. html/MainScreen.php +0 -32
  158. html/OptionsPage.php +0 -1793
  159. html/StatisticsPage.php +0 -62
  160. html/WelcomeScreen.php +0 -166
  161. includes/Ajax.class.php +153 -0
  162. includes/BackwardsCompatibility.class.php +197 -0
  163. includes/Blocks.class.php +127 -0
  164. includes/CustomPostTypes.class.php +577 -0
  165. includes/Dashboard.class.php +320 -0
  166. includes/DeactivationSurvey.class.php +84 -0
  167. includes/Export.class.php +242 -0
  168. includes/FAQ.class.php +373 -0
  169. includes/Import.class.php +301 -0
  170. includes/InstallationWalkthrough.class.php +384 -0
  171. includes/Notifications.class.php +72 -0
  172. includes/OrderingTable.class.php +94 -0
  173. includes/Permissions.class.php +61 -0
  174. includes/Query.class.php +310 -0
  175. includes/ReviewAsk.class.php +101 -0
  176. includes/Settings.class.php +1964 -0
  177. includes/UltimateWPMail.class.php +76 -0
  178. includes/WPForms.class.php +158 -0
  179. includes/Widgets.class.php +382 -0
  180. includes/WooCommerce.class.php +307 -0
  181. includes/template-functions.php +401 -0
  182. js/Admin.js +0 -332
  183. js/ewd-ufaq-dashboard-review-ask.js +0 -62
  184. js/ewd-ufaq-js.js +0 -84
Functions/EWD_UFAQ_Add_Social_Media_Buttons.php DELETED
@@ -1,109 +0,0 @@
1
- <?php
2
-
3
- function EWD_UFAQ_Add_Social_Media_Buttons($Social_Media, $Permalink, $Title) {
4
- $Text = __("Check out this helpful FAQ", 'ultimate-faqs');
5
-
6
- $URL_Encoded_Text = urlencode($Text);
7
- $URL_Encoded_Permalink = urlencode($Permalink);
8
- $URL_Encoded_Title = urlencode($Title);
9
- $URL_Encoded_Text_Concat = urlencode(": ");
10
- $URL_Encoded_Permalink_Concat = urlencode(" | ");
11
-
12
- switch ($Social_Media) {
13
- case 'Email':
14
- $ReturnString = "<li class='rrssb-email'>";
15
- $ReturnString .= "<a href='mailto:?subject=" . $URL_Encoded_Text . "&amp;body=" . $URL_Encoded_Title . $URL_Encoded_Permalink_Concat . $URL_Encoded_Permalink . "'>";
16
- $ReturnString .= "<span class='rrssb-icon'>";
17
- $ReturnString .= "<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'>";
18
- $ReturnString .= "<path d='M20.11 26.147c-2.335 1.05-4.36 1.4-7.124 1.4C6.524 27.548.84 22.916.84 15.284.84 7.343 6.602.45 15.4.45c6.854 0 11.8 4.7 11.8 11.252 0 5.684-3.193 9.265-7.398 9.3-1.83 0-3.153-.934-3.347-2.997h-.077c-1.208 1.986-2.96 2.997-5.023 2.997-2.532 0-4.36-1.868-4.36-5.062 0-4.75 3.503-9.07 9.11-9.07 1.713 0 3.7.4 4.6.972l-1.17 7.203c-.387 2.298-.115 3.3 1 3.4 1.674 0 3.774-2.102 3.774-6.58 0-5.06-3.27-8.994-9.304-8.994C9.05 2.87 3.83 7.545 3.83 14.97c0 6.5 4.2 10.2 10 10.202 1.987 0 4.09-.43 5.647-1.245l.634 2.22zM16.647 10.1c-.31-.078-.7-.155-1.207-.155-2.572 0-4.596 2.53-4.596 5.53 0 1.5.7 2.4 1.9 2.4 1.44 0 2.96-1.83 3.31-4.088l.592-3.72z'";
19
- $ReturnString .= "/>";
20
- $ReturnString .= "</svg>";
21
- $ReturnString .= "</span>";
22
- $ReturnString .= "<span class='rrssb-text'>email</span>";
23
- $ReturnString .= "</a>";
24
- $ReturnString .= "</li>";
25
-
26
- break;
27
-
28
- case 'Facebook':
29
- $ReturnString = "<li class='rrssb-facebook'>";
30
- $ReturnString .= "<a href='https://www.facebook.com/sharer/sharer.php?u=" . $Permalink . "' class='popup'>";
31
- $ReturnString .= "<span class='rrssb-icon'>";
32
- $ReturnString .= "<svg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='xMidYMid' width='29' height='29' viewBox='0 0 29 29'>";
33
- $ReturnString .= "<path d='M26.4 0H2.6C1.714 0 0 1.715 0 2.6v23.8c0 .884 1.715 2.6 2.6 2.6h12.393V17.988h-3.996v-3.98h3.997v-3.062c0-3.746 2.835-5.97 6.177-5.97 1.6 0 2.444.173 2.845.226v3.792H21.18c-1.817 0-2.156.9-2.156 2.168v2.847h5.045l-.66 3.978h-4.386V29H26.4c.884 0 2.6-1.716 2.6-2.6V2.6c0-.885-1.716-2.6-2.6-2.6z'";
34
- $ReturnString .= "class='cls-2' fill-rule='evenodd' />";
35
- $ReturnString .= "</svg>";
36
- $ReturnString .= "</span>";
37
- $ReturnString .= "<span class='rrssb-text'>facebook</span>";
38
- $ReturnString .= "</a>";
39
- $ReturnString .= "</li>";
40
-
41
- break;
42
-
43
- case 'Linkedin':
44
- $ReturnString = "<li class='rrssb-linkedin'>";
45
- $ReturnString .= "<a href='http://www.linkedin.com/shareArticle?mini=true&amp;url=" . $Permalink . "&amp;title=" . $URL_Encoded_Text . "&amp;summary=" . $URL_Encoded_Title . "' class='popup'>";
46
- $ReturnString .= "<span class='rrssb-icon'>";
47
- $ReturnString .= "<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'>";
48
- $ReturnString .= "<path d='M25.424 15.887v8.447h-4.896v-7.882c0-1.98-.71-3.33-2.48-3.33-1.354 0-2.158.91-2.514 1.802-.13.315-.162.753-.162 1.194v8.216h-4.9s.067-13.35 0-14.73h4.9v2.087c-.01.017-.023.033-.033.05h.032v-.05c.65-1.002 1.812-2.435 4.414-2.435 3.222 0 5.638 2.106 5.638 6.632zM5.348 2.5c-1.676 0-2.772 1.093-2.772 2.54 0 1.42 1.066 2.538 2.717 2.546h.032c1.71 0 2.77-1.132 2.77-2.546C8.056 3.593 7.02 2.5 5.344 2.5h.005zm-2.48 21.834h4.896V9.604H2.867v14.73z'";
49
- $ReturnString .= "/>";
50
- $ReturnString .= "</svg>";
51
- $ReturnString .= "</span>";
52
- $ReturnString .= "<span class='rrssb-text'>linkedin</span>";
53
- $ReturnString .= "</a>";
54
- $ReturnString .= "</li>";
55
-
56
- break;
57
-
58
- case 'Twitter':
59
- $ReturnString = "<li class='rrssb-twitter'>";
60
- $ReturnString .= "<a href='https://twitter.com/intent/tweet?text=" . $URL_Encoded_Text . $URL_Encoded_Text_Concat . $URL_Encoded_Title . $URL_Encoded_Permalink_Concat . $URL_Encoded_Permalink . "'";
61
- $ReturnString .= "class='popup'>";
62
- $ReturnString .= "<span class='rrssb-icon'>";
63
- $ReturnString .= "<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'>";
64
- $ReturnString .= "<path d='M24.253 8.756C24.69 17.08 18.297 24.182 9.97 24.62c-3.122.162-6.22-.646-8.86-2.32 2.702.18 5.375-.648 7.507-2.32-2.072-.248-3.818-1.662-4.49-3.64.802.13 1.62.077 2.4-.154-2.482-.466-4.312-2.586-4.412-5.11.688.276 1.426.408 2.168.387-2.135-1.65-2.73-4.62-1.394-6.965C5.574 7.816 9.54 9.84 13.802 10.07c-.842-2.738.694-5.64 3.434-6.48 2.018-.624 4.212.043 5.546 1.682 1.186-.213 2.318-.662 3.33-1.317-.386 1.256-1.248 2.312-2.4 2.942 1.048-.106 2.07-.394 3.02-.85-.458 1.182-1.343 2.15-2.48 2.71z'";
65
- $ReturnString .= "/>";
66
- $ReturnString .= "</svg>";
67
- $ReturnString .= "</span>";
68
- $ReturnString .= "<span class='rrssb-text'>twitter</span>";
69
- $ReturnString .= "</a>";
70
- $ReturnString .= "</li>";
71
-
72
- break;
73
-
74
- case 'Google':
75
- $ReturnString = "<li class='rrssb-googleplus'>";
76
- $ReturnString .= "<a href='https://plus.google.com/share?url=" . $URL_Encoded_Text . $URL_Encoded_Text_Concat . $URL_Encoded_Title . $URL_Encoded_Permalink_Concat . $URL_Encoded_Permalink . "' class='popup'>";
77
- $ReturnString .= "<span class='rrssb-icon'>";
78
- $ReturnString .= "<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'>";
79
- $ReturnString .= "<path d='M14.703 15.854l-1.22-.948c-.37-.308-.88-.715-.88-1.46 0-.747.51-1.222.95-1.662 1.42-1.12 2.84-2.31 2.84-4.817 0-2.58-1.62-3.937-2.4-4.58h2.098l2.203-1.384h-6.67c-1.83 0-4.467.433-6.398 2.027C3.768 4.287 3.06 6.018 3.06 7.576c0 2.634 2.02 5.328 5.603 5.328.34 0 .71-.033 1.083-.068-.167.408-.336.748-.336 1.324 0 1.04.55 1.685 1.01 2.297-1.523.104-4.37.273-6.466 1.562-1.998 1.187-2.605 2.915-2.605 4.136 0 2.512 2.357 4.84 7.288 4.84 5.822 0 8.904-3.223 8.904-6.41.008-2.327-1.36-3.49-2.83-4.73h-.01zM10.27 11.95c-2.913 0-4.232-3.764-4.232-6.036 0-.884.168-1.797.744-2.51.543-.68 1.49-1.12 2.372-1.12 2.807 0 4.256 3.797 4.256 6.24 0 .613-.067 1.695-.845 2.48-.537.55-1.438.947-2.295.95v-.003zm.032 13.66c-3.62 0-5.957-1.733-5.957-4.143 0-2.408 2.165-3.223 2.91-3.492 1.422-.48 3.25-.545 3.556-.545.34 0 .52 0 .767.034 2.574 1.838 3.706 2.757 3.706 4.48-.002 2.072-1.736 3.664-4.982 3.648l.002.017zM23.254 11.89V8.52H21.57v3.37H18.2v1.714h3.367v3.4h1.684v-3.4h3.4V11.89'";
80
- $ReturnString .= "/>";
81
- $ReturnString .= "</svg>";
82
- $ReturnString .= "</span>";
83
- $ReturnString .= "<span class='rrssb-text'>google+</span>";
84
- $ReturnString .= "</a>";
85
- $ReturnString .= "</li>";
86
-
87
- break;
88
-
89
- case 'Pinterest':
90
- $ReturnString = "<li class='rrssb-pinterest'>";
91
- $ReturnString .= "<a href='http://pinterest.com/pin/create/button/?url=" . $Permalink . "&amp;description=" . $URL_Encoded_Text . $URL_Encoded_Text_Concat . $URL_Encoded_Title . "'>";
92
- $ReturnString .= "<span class='rrssb-icon'>";
93
- $ReturnString .= "<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'>";
94
- $ReturnString .= "<path d='M14.02 1.57c-7.06 0-12.784 5.723-12.784 12.785S6.96 27.14 14.02 27.14c7.062 0 12.786-5.725 12.786-12.785 0-7.06-5.724-12.785-12.785-12.785zm1.24 17.085c-1.16-.09-1.648-.666-2.558-1.22-.5 2.627-1.113 5.146-2.925 6.46-.56-3.972.822-6.952 1.462-10.117-1.094-1.84.13-5.545 2.437-4.632 2.837 1.123-2.458 6.842 1.1 7.557 3.71.744 5.226-6.44 2.924-8.775-3.324-3.374-9.677-.077-8.896 4.754.19 1.178 1.408 1.538.49 3.168-2.13-.472-2.764-2.15-2.683-4.388.132-3.662 3.292-6.227 6.46-6.582 4.008-.448 7.772 1.474 8.29 5.24.58 4.254-1.815 8.864-6.1 8.532v.003z'";
95
- $ReturnString .= "/>";
96
- $ReturnString .= "</svg>";
97
- $ReturnString .= "</span>";
98
- $ReturnString .= "<span class='rrssb-text'>pinterest</span>";
99
- $ReturnString .= "</a>";
100
- $ReturnString .= "</li>";
101
-
102
- break;
103
-
104
- }
105
-
106
-
107
- return $ReturnString;
108
-
109
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Add_Views_Column.php DELETED
@@ -1,141 +0,0 @@
1
- <?php
2
- // Add in a new column option for the UFAQ post type
3
- function EWD_UFAQ_Columns_Head($defaults) {
4
- $defaults['number_of_views'] = __('# of Views', 'ultimate-faqs');
5
- $defaults['ufaq_categories'] = __('Categories', 'ultimate-faqs');
6
- $defaults['ufaq_ID'] = __('Post ID', 'ultimate-faqs');
7
-
8
- return $defaults;
9
- }
10
-
11
- // Show the number of times the FAQ post has been clicked
12
- function EWD_UFAQ_Columns_Content($column_name, $post_ID) {
13
- if ($column_name == 'number_of_views') {
14
- $num_views = EWD_UFAQ_Get_Views($post_ID);
15
- echo $num_views;
16
- }
17
-
18
- if ($column_name == 'ufaq_categories') {
19
- $categories = EWD_UFAQ_Get_Categories($post_ID);
20
- echo $categories;
21
- }
22
-
23
- if ($column_name == 'ufaq_ID') {
24
- echo $post_ID;
25
- }
26
- }
27
-
28
- function EWD_UFAQ_Register_Post_Column_Sortables( $column ) {
29
- $column['number_of_views'] = 'number_of_views';
30
- $column['ufaq_categories'] = 'ufaq_categories';
31
- return $column;
32
- }
33
-
34
- function EWD_UFAQ_Sort_Views_Column( $vars )
35
- {
36
- if ( isset( $vars['orderby'] ) && 'number_of_views' == $vars['orderby'] ) {
37
- $vars = array_merge( $vars, array(
38
- 'meta_key' => 'ufaq_view_count', //Custom field key
39
- 'orderby' => 'meta_value_num') //Custom field value (number)
40
- );
41
- }
42
-
43
- return $vars;
44
- }
45
-
46
- function mbe_sort_custom_column($clauses, $wp_query){
47
- global $wpdb;
48
- if(isset($wp_query->query['orderby']) && $wp_query->query['orderby'] == 'ufaq_categories'){
49
- $clauses['join'] .= <<<SQL
50
- LEFT OUTER JOIN {$wpdb->term_relationships} ON {$wpdb->posts}.ID={$wpdb->term_relationships}.object_id
51
- LEFT OUTER JOIN {$wpdb->term_taxonomy} USING (term_taxonomy_id)
52
- LEFT OUTER JOIN {$wpdb->terms} USING (term_id)
53
- SQL;
54
- $clauses['where'] .= "AND (taxonomy = 'ufaq-category' OR taxonomy IS NULL)";
55
- $clauses['groupby'] = "object_id";
56
- $clauses['orderby'] = "GROUP_CONCAT({$wpdb->terms}.name ORDER BY name ASC)";
57
- if(strtoupper($wp_query->get('order')) == 'ASC'){
58
- $clauses['orderby'] .= 'ASC';
59
- } else{
60
- $clauses['orderby'] .= 'DESC';
61
- }
62
- }
63
- return $clauses;
64
- }
65
-
66
- // Get the number of times the FAQ post has been clicked
67
- function EWD_UFAQ_Get_Views($post_ID) {
68
- $UFAQ_View_Count = get_post_meta($post_ID, 'ufaq_view_count', true);
69
- if ($UFAQ_View_Count != "") {
70
- return $UFAQ_View_Count;
71
- }
72
- else {
73
- return 0;
74
- }
75
- }
76
-
77
- function EWD_UFAQ_Add_Reset_View_Count_Bulk_Action($Actions) {
78
- $Actions['reset_view_count'] = __('Reset View Count', 'ultimate-faqs');
79
-
80
- return $Actions;
81
- }
82
- add_filter('bulk_actions-edit-ufaq', 'EWD_UFAQ_Add_Reset_View_Count_Bulk_Action', 99);
83
-
84
- function EWD_UFAQ_Reset_View_Count($redirect_to, $doaction, $post_ids) {
85
-
86
- if ($doaction != 'reset_view_count') {return $redirect_to;}
87
-
88
- foreach ($post_ids as $post_id) {
89
- update_post_meta( $post_id, 'ufaq_view_count', 0 );
90
- }
91
-
92
- return $redirect_to;
93
- }
94
- add_filter('handle_bulk_actions-edit-ufaq', 'EWD_UFAQ_Reset_View_Count', 10, 3);
95
-
96
- function EWD_UFAQ_Get_Categories($post_id) {
97
- echo get_the_term_list($post_id, 'ufaq-category', '', ', ', '').PHP_EOL;
98
- }
99
-
100
- add_action('restrict_manage_posts','EWD_UFAQ_Restrict_By_Category');
101
- function EWD_UFAQ_Restrict_By_Category() {
102
- global $typenow;
103
- global $wp_query;
104
- if ($typenow=='ufaq') {
105
- $taxonomy = 'ufaq-category';
106
- $faq_taxonomy = get_taxonomy($taxonomy);
107
- if (!isset($wp_query->query['term'])) {$wp_query->query['term'] = '';}
108
- wp_dropdown_categories(array(
109
- 'show_option_all' => __("Show All {$faq_taxonomy->label}"),
110
- 'taxonomy' => $taxonomy,
111
- 'name' => 'ufaq-category',
112
- 'orderby' => 'name',
113
- 'selected' => $wp_query->query['term'],
114
- 'hierarchical' => true,
115
- 'depth' => 3,
116
- 'show_count' => true, // Show # listings in parens
117
- 'hide_empty' => true,
118
- ));
119
- }
120
- }
121
-
122
- add_filter('parse_query','Convert_UFAQ_Category_To_Taxonomy_Term_In_Query');
123
- function Convert_UFAQ_Category_To_Taxonomy_Term_In_Query($query) {
124
- global $pagenow;
125
- $post_type = 'ufaq'; // change HERE
126
- $taxonomy = 'ufaq-category'; // change HERE
127
- $q_vars = &$query->query_vars;
128
- if ($pagenow == 'edit.php' && isset($q_vars['post_type']) && $q_vars['post_type'] == $post_type && isset($q_vars[$taxonomy]) && is_numeric($q_vars[$taxonomy]) && $q_vars[$taxonomy] != 0) {
129
- $term = get_term_by('id', $q_vars[$taxonomy], $taxonomy);
130
- $q_vars[$taxonomy] = $term->slug;
131
- }
132
- }
133
-
134
- add_filter('manage_ufaq_posts_columns', 'EWD_UFAQ_Columns_Head');
135
- add_action('manage_ufaq_posts_custom_column', 'EWD_UFAQ_Columns_Content', 10, 2);
136
-
137
- add_filter( 'manage_edit-ufaq_sortable_columns', 'EWD_UFAQ_Register_Post_Column_Sortables' );
138
- add_filter('posts_clauses', 'mbe_sort_custom_column', 10, 2);
139
- add_filter( 'request', 'EWD_UFAQ_Sort_Views_Column' );
140
-
141
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Admin_Image_Upload.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- function Prepare_Thumbs_Up_Image() {
3
- /* Double check that everything worked correctly in moving the file, return blank to erase the custom image or return the link */
4
- if (isset($_POST['Thumbs_Up_Image']) and ($_POST['Thumbs_Up_Image'] == "http://" or $_POST['Thumbs_Up_Image'] == "")) {
5
- return;
6
- }
7
- else {
8
- return isset($_POST['Thumbs_Up_Image']) ? $_POST['Thumbs_Up_Image'] : '';
9
- }
10
- }
11
- function Prepare_Thumbs_Down_Image() {
12
- /* Double check that everything worked correctly in moving the file, return blank to erase the custom image or return the link */
13
- if (isset($_POST['Thumbs_Down_Image']) and ($_POST['Thumbs_Down_Image'] == "http://" or $_POST['Thumbs_Down_Image'] == "")) {
14
- return;
15
- }
16
- else {
17
- return isset($_POST['Thumbs_Down_Image']) ? $_POST['Thumbs_Down_Image'] : '';
18
- }
19
- }
20
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Captcha.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- function EWD_UFAQ_Validate_Captcha() {
3
- $ModifiedCode = intval( $_POST['ewd_ufaq_modified_captcha'] );
4
- $UserCode = intval( $_POST['ewd_ufaq_captcha'] );
5
-
6
- $Code = EWD_UFAQ_Decrypt_Catpcha_Code($ModifiedCode);
7
-
8
- if ($Code == $UserCode) {$Validate_Captcha = "Yes";}
9
- else {$Validate_Captcha = "No";}
10
-
11
- return $Validate_Captcha;
12
- }
13
-
14
- function EWD_UFAQ_Encrypt_Captcha_Code($Code) {
15
- $ModifiedCode = ($Code + 5) * 3;
16
-
17
- return $ModifiedCode;
18
- }
19
-
20
- function EWD_UFAQ_Decrypt_Catpcha_Code($ModifiedCode) {
21
- $Code = ($ModifiedCode / 3) - 5;
22
-
23
- return $Code;
24
- }
25
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Create_Captcha_Image.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- $ModifiedCode = intval( $_GET['Code'] );
3
- $Code = EWD_UFAQ_Decrypt_Catpcha_Code($ModifiedCode);
4
- $im = imagecreatetruecolor(50, 24);
5
- $bg = imagecolorallocate($im, 22, 86, 165);
6
- $fg = imagecolorallocate($im, 255, 255, 255);
7
- imagefill($im, 0, 0, $bg);
8
- imagestring($im, 5, 5, 5, $Code, $fg);
9
- header("Cache-Control: no-cache, must-revalidate");
10
- header('Content-type: image/png');
11
- imagepng($im);
12
- imagedestroy($im);
13
-
14
-
15
- function EWD_UFAQ_Decrypt_Catpcha_Code($ModifiedCode) {
16
- $Code = ($ModifiedCode / 3) - 5;
17
-
18
- return $Code;
19
- }
20
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Deactivation_Survey.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
- add_action('current_screen', 'EWD_UFAQ_Deactivation_Survey');
3
- function EWD_UFAQ_Deactivation_Survey() {
4
- if (in_array(get_current_screen()->id, array( 'plugins', 'plugins-network' ), true)) {
5
- add_action('admin_enqueue_scripts', 'EWD_UFAQ_Enqueue_Deactivation_Scripts');
6
- add_action( 'admin_footer', 'EWD_UFAQ_Deactivation_Survey_HTML');
7
- }
8
- }
9
-
10
- function EWD_UFAQ_Enqueue_Deactivation_Scripts() {
11
- wp_enqueue_style('ewd-ufaq-deactivation-css', EWD_UFAQ_CD_PLUGIN_URL . 'css/ewd-ufaq-plugin-deactivation.css');
12
- wp_enqueue_script('ewd-ufaq-deactivation-js', EWD_UFAQ_CD_PLUGIN_URL . 'js/ewd-ufaq-plugin-deactivation.js', array('jquery'));
13
-
14
- wp_localize_script('ewd-ufaq-deactivation-js', 'ewd_ufaq_deactivation_data', array('site_url' => site_url()));
15
- }
16
-
17
- function EWD_UFAQ_Deactivation_Survey_HTML() {
18
- $Install_Time = get_option("EWD_UFAQ_Install_Time");
19
-
20
- $options = array(
21
- 1 => array(
22
- 'title' => esc_html__( 'I no longer need the plugin', 'ultimate-faqs' ),
23
- ),
24
- 2 => array(
25
- 'title' => esc_html__( 'I\'m switching to a different plugin', 'ultimate-faqs' ),
26
- 'details' => esc_html__( 'Please share which plugin', 'ultimate-faqs' ),
27
- ),
28
- 3 => array(
29
- 'title' => esc_html__( 'I couldn\'t get the plugin to work', 'ultimate-faqs' ),
30
- 'details' => esc_html__( 'Please share what wasn\'t working', 'ultimate-faqs' ),
31
- ),
32
- 4 => array(
33
- 'title' => esc_html__( 'It\'s a temporary deactivation', 'ultimate-faqs' ),
34
- ),
35
- 5 => array(
36
- 'title' => esc_html__( 'Other', 'ultimate-faqs' ),
37
- 'details' => esc_html__( 'Please share the reason', 'ultimate-faqs' ),
38
- ),
39
- );
40
- ?>
41
- <div class="ewd-ufaq-deactivate-survey-modal" id="ewd-ufaq-deactivate-survey-ultimate-faqs">
42
- <div class="ewd-ufaq-deactivate-survey-wrap">
43
- <form class="ewd-ufaq-deactivate-survey" method="post" data-installtime="<?php echo $Install_Time; ?>">
44
- <span class="ewd-ufaq-deactivate-survey-title"><span class="dashicons dashicons-testimonial"></span><?php echo ' ' . __( 'Quick Feedback', 'ultimate-faqs' ); ?></span>
45
- <span class="ewd-ufaq-deactivate-survey-desc"><?php echo __('If you have a moment, please share why you are deactivating Ultimate FAQs:', 'ultimate-faqs' ); ?></span>
46
- <div class="ewd-ufaq-deactivate-survey-options">
47
- <?php foreach ( $options as $id => $option ) : ?>
48
- <div class="ewd-ufaq-deactivate-survey-option">
49
- <label for="ewd-ufaq-deactivate-survey-option-ultimate-faqs-<?php echo $id; ?>" class="ewd-ufaq-deactivate-survey-option-label">
50
- <input id="ewd-ufaq-deactivate-survey-option-ultimate-faqs-<?php echo $id; ?>" class="ewd-ufaq-deactivate-survey-option-input" type="radio" name="code" value="<?php echo $id; ?>" />
51
- <span class="ewd-ufaq-deactivate-survey-option-reason"><?php echo $option['title']; ?></span>
52
- </label>
53
- <?php if ( ! empty( $option['details'] ) ) : ?>
54
- <input class="ewd-ufaq-deactivate-survey-option-details" type="text" placeholder="<?php echo $option['details']; ?>" />
55
- <?php endif; ?>
56
- </div>
57
- <?php endforeach; ?>
58
- </div>
59
- <div class="ewd-ufaq-deactivate-survey-footer">
60
- <button type="submit" class="ewd-ufaq-deactivate-survey-submit button button-primary button-large"><?php _e('Submit and Deactivate', 'ultimate-faqs' ); ?></button>
61
- <a href="#" class="ewd-ufaq-deactivate-survey-deactivate"><?php _e('Skip and Deactivate', 'ultimate-faqs' ); ?></a>
62
- </div>
63
- </form>
64
- </div>
65
- </div>
66
- <?php
67
- }
68
-
69
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Export.php DELETED
@@ -1,176 +0,0 @@
1
- <?php
2
- function EWD_UFAQ_Export_To_PDF() {
3
-
4
- // make sure that the request is coming from the admin form
5
- if ( ! isset( $_POST['EWD_UFAQ_Export_PDF_Nonce'] ) ) { return; }
6
- if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Export_PDF_Nonce'], 'EWD_UFAQ_Export_PDF' ) ) { return; }
7
-
8
- require_once(EWD_UFAQ_CD_PLUGIN_PATH . '/FPDF/fpdf.php');
9
- global $Category; /*Undefined Category variable at line 5 and 7*/
10
- // if ($Category != "EWD_UFAQ_ALL_CATEGORIES") {$category_array = array( 'taxonomy' => 'ufaq-category',
11
- // 'field' => 'slug',
12
- // 'terms' => $Category->slug
13
- // );
14
- //
15
- // }
16
-
17
- $params = array(
18
- 'posts_per_page' => -1,
19
- 'post_type' => 'ufaq'
20
- );
21
- $faqs = get_posts($params);
22
-
23
- $PDFPasses = array("FirstPageRun", "SecondPageRun", "Final");
24
- foreach ($PDFPasses as $PDFRun) {
25
- $pdf = new FPDF();
26
- $pdf->AddPage();
27
-
28
- if ($PDFRun == "SecondPageRun" or $PDFRun == "Final") {
29
- $pdf->SetFont('Arial','B',14);
30
- $pdf->Cell(20, 10, "Page #");
31
- $pdf->Cell(20, 10, "Article Title");
32
- $pdf->Ln();
33
- $pdf->SetFont('Arial','',12);
34
-
35
- foreach ($ToC as $entry) {
36
- $pdf->Cell(20, 5, " " . $entry['page']);
37
- $pdf->MultiCell(0, 5, $entry['title']);
38
- $pdf->Ln();
39
- }
40
-
41
- unset($ToC);
42
- }
43
-
44
- foreach ($faqs as $faq) {
45
- $PostTitle = utf8_decode(strip_tags(html_entity_decode($faq->post_title)));
46
-
47
- $PostText = utf8_decode(strip_tags(html_entity_decode($faq->post_content)));
48
- $PostText = str_replace("&#91;", "[", $PostText);
49
- $PostText = str_replace("&#93;", "]", $PostText);
50
-
51
- $pdf->AddPage();
52
-
53
- $Entry['page'] = $pdf->GetPage();
54
- $Entry['title'] = $PostTitle;
55
-
56
- $pdf->SetFont('Arial','B',15);
57
- $pdf->MultiCell(0, 10, $PostTitle);
58
- $pdf->Ln();
59
- $pdf->SetFont('Arial','',12);
60
- $pdf->MultiCell(0, 10, $PostText);
61
-
62
- $ToC[] = $Entry;
63
- unset($Entry);
64
- }
65
-
66
- if ($PDFRun == "FirstPageRun" or $PDFRun == "SecondPageRun") {
67
- $pdf->Close();
68
- }
69
-
70
- if ($PDFRun == "Final") {
71
- $pdf->Output('Ultimate-FAQ-Manual.pdf', 'D');
72
- }
73
- }
74
- }
75
-
76
- if (!class_exists('ComposerAutoloaderInit4618f5c41cf5e27cc7908556f031e4d4')) {require_once EWD_UFAQ_CD_PLUGIN_PATH . 'PHPSpreadsheet/vendor/autoload.php';}
77
- use PhpOffice\PhpSpreadsheet\Spreadsheet;
78
- use PhpOffice\PhpSpreadsheet\Writer\Xls;
79
- use PhpOffice\PhpSpreadsheet\Writer\Csv;
80
- function EWD_UFAQ_Export_To_Excel() {
81
-
82
- // make sure that the request is coming from the admin form
83
- if ( ! isset( $_POST['EWD_UFAQ_Export_Nonce'] ) ) { return; }
84
- if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Export_Nonce'], 'EWD_UFAQ_Export' ) ) { return; }
85
-
86
- $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
87
- if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
88
-
89
- // Instantiate a new PHPExcel object
90
- $Spreadsheet = new Spreadsheet();
91
- // Set the active Excel worksheet to sheet 0
92
- $Spreadsheet->setActiveSheetIndex(0);
93
-
94
- // Print out the regular order field labels
95
- $Spreadsheet->getActiveSheet()->setCellValue("A1", "ID");
96
- $Spreadsheet->getActiveSheet()->setCellValue("B1", "Question");
97
- $Spreadsheet->getActiveSheet()->setCellValue("C1", "Answer");
98
- $Spreadsheet->getActiveSheet()->setCellValue("D1", "Categories");
99
- $Spreadsheet->getActiveSheet()->setCellValue("E1", "Tags");
100
- $Spreadsheet->getActiveSheet()->setCellValue("F1", "Post Date");
101
-
102
- $column = 'G';
103
- foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {
104
- $Spreadsheet->getActiveSheet()->setCellValue($column."1", $FAQ_Field_Item['FieldName']);
105
- $column++;
106
- }
107
-
108
- //start while loop to get data
109
- $rowCount = 2;
110
- $params = array(
111
- 'posts_per_page' => -1,
112
- 'post_type' => 'ufaq'
113
- );
114
- $Posts = get_posts($params);
115
- foreach ($Posts as $Post)
116
- {
117
- $Categories = get_the_terms($Post->ID, "ufaq-category");
118
- $Category_String = '';
119
- if (is_array($Categories)) {
120
- foreach ($Categories as $Category) {
121
- $Category_String .= $Category->name . ",";
122
- }
123
- $Category_String = substr($Category_String, 0, -1);
124
- }
125
- else {$Category_String = "";}
126
-
127
- $Tags = get_the_terms($Post->ID, "ufaq-tag");
128
- $Tag_String = '';
129
- if (is_array($Tags)) {
130
- foreach ($Tags as $Tag) {
131
- $Tag_String .= $Tag->name . ",";
132
- }
133
- $Tag_String = substr($Tag_String, 0, -1);
134
- }
135
- else {$Tag_String = "";}
136
-
137
- $Spreadsheet->getActiveSheet()->setCellValue("A" . $rowCount, $Post->ID);
138
- $Spreadsheet->getActiveSheet()->setCellValue("B" . $rowCount, $Post->post_title);
139
- $Spreadsheet->getActiveSheet()->setCellValue("C" . $rowCount, $Post->post_content);
140
- $Spreadsheet->getActiveSheet()->setCellValue("D" . $rowCount, $Category_String);
141
- $Spreadsheet->getActiveSheet()->setCellValue("E" . $rowCount, $Tag_String);
142
- $Spreadsheet->getActiveSheet()->setCellValue("F" . $rowCount, $Post->post_date);
143
-
144
- $column = 'G';
145
- foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {
146
- $Value = get_post_meta($Post->ID, "Custom_Field_" . $FAQ_Field_Item['FieldID'], true);
147
- $Spreadsheet->getActiveSheet()->setCellValue($column . $rowCount, $Value);
148
- $column++;
149
- }
150
-
151
- $rowCount++;
152
-
153
- unset($Category_String);
154
- unset($Tag_String);
155
- }
156
-
157
- // Redirect output to a client’s web browser (Excel5)
158
- if (!isset($Format_Type) == "CSV") {
159
- header('Content-Type: application/vnd.ms-excel');
160
- header('Content-Disposition: attachment;filename="FAQ_Export.csv"');
161
- header('Cache-Control: max-age=0');
162
- $objWriter = new Csv($Spreadsheet);
163
- $objWriter->save('php://output');
164
- die();
165
- }
166
- else {echo 'Printing spreadsheet<br><br><br><br>';
167
- header('Content-Type: application/vnd.ms-excel');
168
- header('Content-Disposition: attachment;filename="FAQ_Export.xls"');
169
- header('Cache-Control: max-age=0');
170
- $objWriter = new Xls($Spreadsheet);
171
- $objWriter->save('php://output');
172
- die();
173
- }
174
-
175
- }
176
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Export_To_PDF.php DELETED
@@ -1,160 +0,0 @@
1
- <?php
2
- function EWD_UFAQ_Export_To_PDF() {
3
- // make sure that the request is coming from the admin form
4
- if ( ! isset( $_POST['EWD_UFAQ_Export_PDF_Nonce'] ) ) { return; }
5
- if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Export_PDF_Nonce'], 'EWD_UFAQ_Export_PDF' ) ) { return; }
6
-
7
- require_once(EWD_UFAQ_CD_PLUGIN_PATH . '/FPDF/fpdf.php');
8
-
9
- if ($Category != "EWD_UFAQ_ALL_CATEGORIES") {
10
- $category_array = array(
11
- 'taxonomy' => 'ufaq-category',
12
- 'field' => 'slug',
13
- 'terms' => $Category->slug
14
- );
15
- }
16
-
17
- $params = array(
18
- 'posts_per_page' => -1,
19
- 'post_type' => 'ufaq'
20
- );
21
- $faqs = get_posts($params);
22
-
23
- $PDFPasses = array("FirstPageRun", "SecondPageRun", "Final");
24
- foreach ($PDFPasses as $PDFRun) {
25
- $pdf = new FPDF();
26
- $pdf->AddPage();
27
-
28
- if ($PDFRun == "SecondPageRun" or $PDFRun == "Final") {
29
- $pdf->SetFont('Arial','B',14);
30
- $pdf->Cell(20, 10, "Page #");
31
- $pdf->Cell(20, 10, "Article Title");
32
- $pdf->Ln();
33
- $pdf->SetFont('Arial','',12);
34
-
35
- foreach ($ToC as $entry) {
36
- $pdf->Cell(20, 5, " " . utf8_decode($entry['page']));
37
- $pdf->MultiCell(0, 5, utf8_decode($entry['title']));
38
- $pdf->Ln();
39
- }
40
-
41
- unset($ToC);
42
- }
43
-
44
- foreach ($faqs as $faq) {
45
- $PostTitle = em(strip_tags(html_entity_decode($faq->post_title)));
46
-
47
- $PostText = em(strip_tags(html_entity_decode($faq->post_content)));
48
- $PostText = str_replace("&#91;", "[", $PostText);
49
- $PostText = str_replace("&#93;", "]", $PostText);
50
-
51
- $pdf->AddPage();
52
-
53
- $Entry['page'] = $pdf->page;
54
- $Entry['title'] = $PostTitle;
55
-
56
- $pdf->SetFont('Arial','B',15);
57
- $pdf->MultiCell(0, 10, $PostTitle);
58
- $pdf->Ln();
59
- $pdf->SetFont('Arial','',12);
60
- $pdf->MultiCell(0, 10, $PostText);
61
-
62
- $ToC[] = $Entry;
63
- unset($Entry);
64
- }
65
-
66
- if ($PDFRun == "FirstPageRun" or $PDFRun == "SecondPageRun") {
67
- $pdf->Close();
68
- }
69
-
70
- if ($PDFRun == "Final") {
71
- $pdf->Output('Ultimate-FAQ-Manual.pdf', 'D');
72
- }
73
- }
74
- }
75
-
76
- function em($word) {
77
-
78
- $word = str_replace("@","%40",$word);
79
- $word = str_replace("`","%60",$word);
80
- $word = str_replace("¢","%A2",$word);
81
- $word = str_replace("£","%A3",$word);
82
- $word = str_replace("¥","%A5",$word);
83
- $word = str_replace("|","%A6",$word);
84
- $word = str_replace("«","%AB",$word);
85
- $word = str_replace("¬","%AC",$word);
86
- $word = str_replace("¯","%AD",$word);
87
- $word = str_replace("º","%B0",$word);
88
- $word = str_replace("±","%B1",$word);
89
- $word = str_replace("ª","%B2",$word);
90
- $word = str_replace("µ","%B5",$word);
91
- $word = str_replace("»","%BB",$word);
92
- $word = str_replace("¼","%BC",$word);
93
- $word = str_replace("½","%BD",$word);
94
- $word = str_replace("¿","%BF",$word);
95
- $word = str_replace("À","%C0",$word);
96
- $word = str_replace("Á","%C1",$word);
97
- $word = str_replace("Â","%C2",$word);
98
- $word = str_replace("Ã","%C3",$word);
99
- $word = str_replace("Ä","%C4",$word);
100
- $word = str_replace("Å","%C5",$word);
101
- $word = str_replace("Æ","%C6",$word);
102
- $word = str_replace("Ç","%C7",$word);
103
- $word = str_replace("È","%C8",$word);
104
- $word = str_replace("É","%C9",$word);
105
- $word = str_replace("Ê","%CA",$word);
106
- $word = str_replace("Ë","%CB",$word);
107
- $word = str_replace("Ì","%CC",$word);
108
- $word = str_replace("Í","%CD",$word);
109
- $word = str_replace("Î","%CE",$word);
110
- $word = str_replace("Ï","%CF",$word);
111
- $word = str_replace("Ð","%D0",$word);
112
- $word = str_replace("Ñ","%D1",$word);
113
- $word = str_replace("Ò","%D2",$word);
114
- $word = str_replace("Ó","%D3",$word);
115
- $word = str_replace("Ô","%D4",$word);
116
- $word = str_replace("Õ","%D5",$word);
117
- $word = str_replace("Ö","%D6",$word);
118
- $word = str_replace("Ø","%D8",$word);
119
- $word = str_replace("Ù","%D9",$word);
120
- $word = str_replace("Ú","%DA",$word);
121
- $word = str_replace("Û","%DB",$word);
122
- $word = str_replace("Ü","%DC",$word);
123
- $word = str_replace("Ý","%DD",$word);
124
- $word = str_replace("Þ","%DE",$word);
125
- $word = str_replace("ß","%DF",$word);
126
- $word = str_replace("à","%E0",$word);
127
- $word = str_replace("á","%E1",$word);
128
- $word = str_replace("â","%E2",$word);
129
- $word = str_replace("ã","%E3",$word);
130
- $word = str_replace("ä","%E4",$word);
131
- $word = str_replace("å","%E5",$word);
132
- $word = str_replace("æ","%E6",$word);
133
- $word = str_replace("ç","%E7",$word);
134
- $word = str_replace("è","%E8",$word);
135
- $word = str_replace("é","%E9",$word);
136
- $word = str_replace("ê","%EA",$word);
137
- $word = str_replace("ë","%EB",$word);
138
- $word = str_replace("ì","%EC",$word);
139
- $word = str_replace("í","%ED",$word);
140
- $word = str_replace("î","%EE",$word);
141
- $word = str_replace("ï","%EF",$word);
142
- $word = str_replace("ð","%F0",$word);
143
- $word = str_replace("ñ","%F1",$word);
144
- $word = str_replace("ò","%F2",$word);
145
- $word = str_replace("ó","%F3",$word);
146
- $word = str_replace("ô","%F4",$word);
147
- $word = str_replace("õ","%F5",$word);
148
- $word = str_replace("ö","%F6",$word);
149
- $word = str_replace("÷","%F7",$word);
150
- $word = str_replace("ø","%F8",$word);
151
- $word = str_replace("ù","%F9",$word);
152
- $word = str_replace("ú","%FA",$word);
153
- $word = str_replace("û","%FB",$word);
154
- $word = str_replace("ü","%FC",$word);
155
- $word = str_replace("ý","%FD",$word);
156
- $word = str_replace("þ","%FE",$word);
157
- $word = str_replace("ÿ","%FF",$word);
158
- return urldecode($word);
159
- }
160
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Help_Pointers.php DELETED
@@ -1,75 +0,0 @@
1
- <?php
2
-
3
- function UFAQ_Return_Pointers() {
4
- $pointers = array();
5
-
6
- $pointers['tutorial-one'] = array(
7
- 'title' => "<h3>" . 'Ultimate FAQ Intro' . "</h3>",
8
- 'content' => "<div><p>Thanks for installing UFAQ! These 6 slides will help get you started using the plugin.</p></div><div class='ufaq-pointer-count'><p>1 of 6 - <span class='ufaq-skip-all-tutorial-pop-ups'>Skip All</span></p></div>",
9
- 'anchor_id' => '.Header',
10
- 'edge' => 'top',
11
- 'align' => 'left',
12
- 'nextTab' => 'Products',
13
- 'width' => '320',
14
- 'where' => array( 'toplevel_page_EWD-UFAQ-Options') // <-- Please note this
15
- );
16
-
17
- $pointers['tutorial-two'] = array(
18
- 'title' => "<h3>" . 'Create FAQs' . "</h3>",
19
- 'content' => "<div><p>Click 'Add New' to create FAQs for your visitors to view. Enter the FAQ question in the title area and the FAQ answer in the main post content area. Set the author name using the 'Author Display Name' field under the main post content area. Select and/or create FAQ categories and FAQ tags in the right-side menu.</p></div><div class='ufaq-pointer-count'><p>2 of 6 - <span class='ufaq-skip-all-tutorial-pop-ups'>Skip All</span></p></div>",
20
- 'anchor_id' => '#FAQs_Menu',
21
- 'edge' => 'top',
22
- 'align' => 'left',
23
- 'nextTab' => 'Categories',
24
- 'width' => '320',
25
- 'where' => array( 'toplevel_page_EWD-UFAQ-Options') // <-- Please note this
26
- );
27
-
28
- $pointers['tutorial-three'] = array(
29
- 'title' => "<h3>" . 'Set Up Categories' . "</h3>",
30
- 'content' => "<div><p>Categories help organize your FAQs. You can assign FAQs to categories and optionally choose to group your FAQ page by category.</p></div><div class='ufaq-pointer-count'><p>3 of 6 - <span class='ufaq-skip-all-tutorial-pop-ups'>Skip All</span></p></div>",
31
- 'anchor_id' => '#FAQ_Categories_Menu',
32
- 'edge' => 'top',
33
- 'align' => 'left',
34
- 'nextTab' => 'Catalogues',
35
- 'width' => '320',
36
- 'where' => array( 'toplevel_page_EWD-UFAQ-Options') // <-- Please note this
37
- );
38
-
39
- $pointers['tutorial-four'] = array(
40
- 'title' => "<h3>" . 'Display FAQs' . "</h3>",
41
- 'content' => "<div><p>Place the [ultimate-faqs] shortcode in the content area of any page you've created and it will display your FAQs</p></div><div class='ufaq-pointer-count'><p>4 of 6 - <span class='ufaq-skip-all-tutorial-pop-ups'>Skip All</span></p></div>",
42
- 'anchor_id' => '#menu-pages',
43
- 'edge' => 'top',
44
- 'align' => 'left',
45
- 'nextTab' => 'Options',
46
- 'width' => '320',
47
- 'where' => array( 'toplevel_page_EWD-UFAQ-Options') // <-- Please note this
48
- );
49
-
50
- $pointers['tutorial-five'] = array(
51
- 'title' => "<h3>" . 'Customize Options' . "</h3>",
52
- 'content' => "<div><p>The FAQ settings area has options to help customize the plugin perfectly for your site, including:</p><ul><li>Toggle and accordion modes</li><li>FAQ comments</li><li>Many styling options and more!</li></ul></div><div class='ufaq-pointer-count'><p>5 of 6 - <span class='ufaq-skip-all-tutorial-pop-ups'>Skip All</span></p></div>",
53
- 'anchor_id' => '#Options_Menu',
54
- 'edge' => 'top',
55
- 'align' => 'left',
56
- 'nextTab' => 'Dashboard',
57
- 'width' => '320',
58
- 'where' => array( 'toplevel_page_EWD-UFAQ-Options') // <-- Please note this
59
- );
60
-
61
- $pointers['tutorial-six'] = array(
62
- 'title' => "<h3>" . 'Need More Help?' . "</h3>",
63
- 'content' => "<div><p><a href='https://wordpress.org/support/plugin/ultimate-faqs/reviews/'>Help us spread the word with a 5 star rating!</a><br><br>We've got a number of videos on how to use the plugin:<br /><iframe width='560' height='315' src='https://www.youtube.com/embed/zf-tYLqHpRs?list=PLEndQUuhlvSrNdfu5FKa1uGHsaKZxgdWt' frameborder='0' allowfullscreen></iframe></p></div><div class='ufaq-pointer-count'><p>6 of 6</p></div>",
64
- 'anchor_id' => '#wp-admin-bar-site-name',
65
- 'edge' => 'top',
66
- 'align' => 'left',
67
- 'nextTab' => 'Dashboard',
68
- 'width' => '600',
69
- 'where' => array( 'toplevel_page_EWD-UFAQ-Options') // <-- Please note this
70
- );
71
-
72
- return $pointers;
73
- }
74
-
75
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Import.php DELETED
@@ -1,227 +0,0 @@
1
- <?php
2
- // This function is used to import FAQ from another plugin
3
-
4
- function EWD_UFAQ_Import(){
5
- global $wpdb;
6
-
7
- $Posts_Table_Name = $wpdb->prefix . "posts";
8
- $Sql = "SELECT ID FROM $Posts_Table_Name WHERE post_type='qa_faqs'";
9
- //$Sql = "SELECT ID FROM $Posts_Table_Name WHERE post_type='ufaq'";
10
- $Results = $wpdb->get_results($Sql);
11
- if (is_array($Results)){
12
-
13
- foreach($Results as $Result){
14
-
15
- $data_array = array('post_type' => 'ufaq');
16
- //$data_array = array('post_type' => 'qa_faqs');
17
- $where = array('ID' => $Result->ID);
18
- $wpdb->update($Posts_Table_Name, $data_array, $where);
19
- }
20
- }
21
-
22
- $Terms_Table_Name = $wpdb->prefix . "term_taxonomy";
23
- $data_array = array('taxonomy' => 'ufaq-category');
24
- $where = array('taxonomy' => 'faq_category');
25
- //$data_array = array('taxonomy' => 'faq_category');
26
- //$where = array('taxonomy' => 'ufaq-category');
27
- $wpdb->update($Terms_Table_Name, $data_array, $where);
28
-
29
- $args = array('post_type' => 'ufaq');
30
- $FAQs_Query = new WP_Query($args);
31
- $FAQs = $FAQs_Query->get_posts();
32
-
33
- foreach ($FAQs as $FAQ) {
34
- if (get_post_meta($FAQ->ID, 'ufaq_view_count', true) == "") {update_post_meta($FAQ->ID, 'ufaq_view_count', 0);}
35
- }
36
-
37
- echo $wpdb->last_query;
38
- }
39
-
40
- if (!class_exists('ComposerAutoloaderInit4618f5c41cf5e27cc7908556f031e4d4')) {require_once EWD_UFAQ_CD_PLUGIN_PATH . 'PHPSpreadsheet/vendor/autoload.php';}
41
- use PhpOffice\PhpSpreadsheet\Spreadsheet;
42
- function Add_EWD_UFAQs_From_Spreadsheet($Excel_File_Name){
43
-
44
- // check that the current user has the correct privileges to create posts
45
- if ( ! current_user_can( 'edit_posts' ) ) { return; }
46
-
47
- // make sure that the request is coming from the admin form
48
- if ( ! isset( $_POST['EWD_UFAQ_Import_Nonce'] ) ) { return; }
49
- if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Import_Nonce'], 'EWD_UFAQ_Import' ) ) { return; }
50
-
51
- $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
52
- if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
53
-
54
- $Excel_URL = EWD_UFAQ_CD_PLUGIN_PATH . 'faq-sheets/' . $Excel_File_Name;
55
-
56
- // Build the workbook object out of the uploaded spreadsheet
57
- $objWorkBook = \PhpOffice\PhpSpreadsheet\IOFactory::load($Excel_URL);
58
-
59
- // Create a worksheet object out of the product sheet in the workbook
60
- $sheet = $objWorkBook->getActiveSheet();
61
-
62
- $Allowable_Custom_Fields = array();
63
- foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {$Allowable_Custom_Fields[] = $FAQ_Field_Item['FieldName'];}
64
- //List of fields that can be accepted via upload
65
- $Allowed_Fields = array("ID", "Question", "Answer", "Categories", "Tags", "Post Date");
66
-
67
-
68
- // Get column names
69
- $highestColumn = $sheet->getHighestColumn();
70
- $highestColumnIndex = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString($highestColumn);
71
- for ($column = 1; $column <= $highestColumnIndex; $column++) {
72
- if (trim($sheet->getCellByColumnAndRow($column, 1)->getValue()) == "ID") {$ID_Column = $column;}
73
- if (trim($sheet->getCellByColumnAndRow($column, 1)->getValue()) == "Question") {$Question_Column = $column;}
74
- if (trim($sheet->getCellByColumnAndRow($column, 1)->getValue()) == "Answer") {$Answer_Column = $column;}
75
- if (trim($sheet->getCellByColumnAndRow($column, 1)->getValue()) == "Categories") {$Categories_Column = $column;}
76
- if (trim($sheet->getCellByColumnAndRow($column, 1)->getValue()) == "Tags") {$Tags_Column = $column;}
77
- if (trim($sheet->getCellByColumnAndRow($column, 1)->getValue()) == "Post Date") {$Date_Column = $column;}
78
-
79
- foreach ($FAQ_Fields_Array as $key => $FAQ_Field_Item) {
80
- if (trim($sheet->getCellByColumnAndRow($column, 1)->getValue()) == $FAQ_Field_Item['FieldName']) {$FAQ_Fields_Array[$key]['FieldColumn'] = $column;}
81
- }
82
- }
83
-
84
-
85
- // Put the spreadsheet data into a multi-dimensional array to facilitate processing
86
- $highestRow = $sheet->getHighestRow();
87
- for ($row = 2; $row <= $highestRow; $row++) {
88
- for ($column = 1; $column <= $highestColumnIndex; $column++) {
89
- $Data[$row][$column] = $sheet->getCellByColumnAndRow($column, $row)->getValue();
90
- }
91
- }
92
-
93
- // Create the query to insert the products one at a time into the database and then run it
94
- foreach ($Data as $FAQ) {
95
-
96
- // Create an array of the values that are being inserted for each order,
97
- // edit if it's a current order, otherwise add it
98
- foreach ($FAQ as $Col_Index => $Value) {
99
- if ( isset( $ID_Column ) and $Col_Index == $ID_Column ) {$Post['ID'] = esc_sql($Value);}
100
- if ( isset( $Question_Column ) and $Col_Index == $Question_Column ) {$Post['post_title'] = esc_sql($Value);}
101
- if ( isset( $Answer_Column ) and $Col_Index == $Answer_Column ) {$Post['post_content'] = esc_sql($Value);}
102
- if ( isset( $Categories_Column ) and $Col_Index == $Categories_Column ) {$Post_Categories = explode(",", esc_sql($Value));}
103
- if ( isset( $Tags_Column ) and $Col_Index == $Tags_Column ) {$Post_Tags = explode(",", esc_sql($Value));}
104
- if ( isset($Date_Column) and $Col_Index == $Date_Column ) {$Post['post_date'] = esc_sql($Value);}
105
- }
106
-
107
- if ( ! isset( $Post_Categories ) or ! is_array( $Post_Categories ) ) {$Post_Categories = array();}
108
- if ( ! isset( $Post_Tags ) or ! is_array( $Post_Tags ) ) {$Post_Tags = array();}
109
-
110
- if ($Post['post_title'] == '') {continue;}
111
-
112
- $Post['post_status'] = 'publish';
113
- $Post['post_type'] = 'ufaq';
114
-
115
- $Post_ID = wp_insert_post($Post);
116
- if ($Post_ID != 0) {
117
- foreach ($Post_Categories as $Category) {
118
- $Term = term_exists($Category, 'ufaq-category');
119
- if ($Term !== 0 && $Term !== null) {$Category_IDs[] = (int) $Term['term_id'];}
120
- }
121
- if (isset($Category_IDs) and is_array($Category_IDs)) {wp_set_object_terms($Post_ID, $Category_IDs, 'ufaq-category');}
122
- foreach ($Post_Tags as $Tag) {
123
- $Term = term_exists($Tag, 'ufaq-tag');
124
- if ($Term !== 0 && $Term !== null) {$Tag_IDs[] = (int) $Term['term_id'];}
125
- }
126
- if (isset($Tag_IDs) and is_array($Tag_IDs)) {wp_set_object_terms($Post_ID, $Tag_IDs, 'ufaq-tag');}
127
-
128
- foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {
129
- if (isset($FAQ_Field_Item['FieldColumn']) and isset($FAQ[$FAQ_Field_Item['FieldColumn']])) {
130
- $Value = esc_sql($FAQ[$FAQ_Field_Item['FieldColumn']]);
131
- update_post_meta($Post_ID, "Custom_Field_" . $FAQ_Field_Item['FieldID'], $Value);
132
- }
133
- }
134
- }
135
-
136
- unset($Post);
137
- unset($Post_Categories);
138
- unset($Post_Tags);
139
- unset($Category_IDs);
140
- unset($Tag_IDs);
141
- }
142
-
143
- return __("FAQs added successfully.", 'ultimate-faqs');
144
- }
145
-
146
- function EWD_UFAQ_Import_From_Spreadsheet() {
147
-
148
- // check that the current user has the correct privileges to create posts
149
- if ( ! current_user_can( 'edit_posts' ) ) { return; }
150
-
151
- // make sure that the request is coming from the admin form
152
- if ( ! isset( $_POST['EWD_UFAQ_Import_Nonce'] ) ) { return; }
153
- if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Import_Nonce'], 'EWD_UFAQ_Import' ) ) { return; }
154
-
155
- /* Test if there is an error with the uploaded spreadsheet and return that error if there is */
156
- if (!empty($_FILES['FAQs_Spreadsheet']['error']))
157
- {
158
- switch($_FILES['FAQs_Spreadsheet']['error'])
159
- {
160
-
161
- case '1':
162
- $error = __('The uploaded file exceeds the upload_max_filesize directive in php.ini', 'ultimate-faqs');
163
- break;
164
- case '2':
165
- $error = __('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form', 'ultimate-faqs');
166
- break;
167
- case '3':
168
- $error = __('The uploaded file was only partially uploaded', 'ultimate-faqs');
169
- break;
170
- case '4':
171
- $error = __('No file was uploaded.', 'ultimate-faqs');
172
- break;
173
-
174
- case '6':
175
- $error = __('Missing a temporary folder', 'ultimate-faqs');
176
- break;
177
- case '7':
178
- $error = __('Failed to write file to disk', 'ultimate-faqs');
179
- break;
180
- case '8':
181
- $error = __('File upload stopped by extension', 'ultimate-faqs');
182
- break;
183
- case '999':
184
- default:
185
- $error = __('No error code avaiable', 'ultimate-faqs');
186
- }
187
- }
188
- /* Make sure that the file exists */
189
- elseif (empty($_FILES['FAQs_Spreadsheet']['tmp_name']) || $_FILES['FAQs_Spreadsheet']['tmp_name'] == 'none') {
190
- $error = __('No file was uploaded here..', 'ultimate-faqs');
191
- }
192
- /* Move the file and store the URL to pass it onwards*/
193
- /* Check that it is a .xls or .xlsx file */
194
- if(!isset($_FILES['FAQs_Spreadsheet']['name']) or (!preg_match("/\.(xls.?)$/", $_FILES['FAQs_Spreadsheet']['name']) and !preg_match("/\.(csv.?)$/", $_FILES['FAQs_Spreadsheet']['name']))) {
195
- $error = __('File must be .csv, .xls or .xlsx', 'ultimate-faqs');
196
- }
197
- else {
198
- $filename = basename( $_FILES['FAQs_Spreadsheet']['name']);
199
- $filename = mb_ereg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $filename);
200
- $filename = mb_ereg_replace("([\.]{2,})", '', $filename);
201
-
202
- //for security reason, we force to remove all uploaded file
203
- $target_path = ABSPATH . "wp-content/plugins/ultimate-faqs/faq-sheets/";
204
- //plugins_url("order-tracking/product-sheets/");
205
-
206
- $target_path = $target_path . $filename;
207
-
208
- if (!move_uploaded_file($_FILES['FAQs_Spreadsheet']['tmp_name'], $target_path)) {
209
- //if (!$upload = wp_upload_bits($_FILES["Item_Image"]["name"], null, file_get_contents($_FILES["Item_Image"]["tmp_name"]))) {
210
- $error .= "There was an error uploading the file, please try again!";
211
- }
212
- else {
213
- $Excel_File_Name = $filename;
214
- }
215
- }
216
-
217
- /* Pass the data to the appropriate function in Update_Admin_Databases.php to create the products */
218
- if (!isset($error)) {
219
- $user_update = Add_EWD_UFAQs_From_Spreadsheet($Excel_File_Name);
220
- return $user_update;
221
- }
222
- else {
223
- $output_error = array("Message_Type" => "Error", "Message" => $error);
224
- return $output_error;
225
- }
226
- }
227
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Initial_Data.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
- /* Adds a small amount of sample data to the UPCP database for demonstration purposes */
3
- function EWD_UFAQ_Output_Welcome_Screen() {
4
- include EWD_UFAQ_CD_PLUGIN_PATH . 'html/WelcomeScreen.php';
5
- }
6
-
7
- function EWD_UFAQ_Initial_Install_Screen() {
8
- add_dashboard_page(
9
- esc_html__( 'Ultimate FAQs - Welcome!', 'ultimate-faqs' ),
10
- esc_html__( 'Ultimate FAQs - Welcome!', 'ultimate-faqs' ),
11
- 'manage_options',
12
- 'ewd-ufaq-getting-started',
13
- 'EWD_UFAQ_Output_Welcome_Screen'
14
- );
15
- }
16
-
17
- function EWD_UFAQ_Remove_Install_Screen_Admin_Menu() {
18
- remove_submenu_page( 'index.php', 'ewd-ufaq-getting-started' );
19
- }
20
-
21
- function EWD_UFAQ_Welcome_Screen_Redirect() {
22
- if ( ! get_transient( 'ewd-ufaq-getting-started' ) ) {
23
- return;
24
- }
25
-
26
- delete_transient( 'ewd-ufaq-getting-started' );
27
-
28
- if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
29
- return;
30
- }
31
-
32
- $FAQs = get_posts(array('post_type' => 'ufaq'));
33
- if (!empty($FAQs)) {
34
- set_transient('ewd-ufaq-admin-install-notice', true, 5);
35
- return;
36
- }
37
-
38
- wp_safe_redirect( admin_url( 'index.php?page=ewd-ufaq-getting-started' ) );
39
- exit;
40
- }
41
-
42
- add_action( 'admin_menu', 'EWD_UFAQ_Initial_Install_Screen' );
43
- add_action( 'admin_head', 'EWD_UFAQ_Remove_Install_Screen_Admin_Menu' );
44
- add_action( 'admin_init', 'EWD_UFAQ_Welcome_Screen_Redirect', 9999 );
45
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Meta_Boxes.php DELETED
@@ -1,276 +0,0 @@
1
- <?php
2
-
3
- add_filter("get_sample_permalink_html", "EWD_UFAQ_Add_FAQ_Shortcode", 10, 5);
4
- function EWD_UFAQ_Add_FAQ_Shortcode($HTML, $post_id, $title, $slug, $post) {
5
- if ($post->post_type == "ufaq") {
6
- $HTML .= "<div class='ewd-ufaq-shortcode-help'>";
7
- $HTML .= __("Use the following shortcode to add this FAQ to a page:", 'ultimate-faqs') . "<br>";
8
- $HTML .= "[select-faq faq_id='" . $post_id . "']";
9
- $HTML .= "</div>";
10
- }
11
-
12
- return $HTML;
13
- }
14
-
15
- add_action("ufaq-category_edit_form_fields", "EWD_UFAQ_Taxonomy_Page", 10, 2);
16
- function EWD_UFAQ_Taxonomy_Page($tag, $taxonomy) {
17
- echo __("FAQ shortcode for this category", 'ultimate-faqs') . ":<br />[ultimate-faqs include_category='" . $tag->slug . "']";
18
- }
19
-
20
- add_action( 'add_meta_boxes', 'EWD_UFAQ_Add_Meta_Boxes' );
21
- function EWD_UFAQ_Add_Meta_Boxes () {
22
- add_meta_box("ufaq-meta", __("FAQ Details", 'ultimate-faqs'), "EWD_UFAQ_Meta_Box", "ufaq", "normal", "high");
23
- add_meta_box("ufaq-meta-need-help", __("Need Help?", 'ultimate-faqs'), "EWD_UFAQ_Need_Help_Meta_Box", "ufaq", "side", "high");
24
- }
25
-
26
- /**
27
- * Prints the box content.
28
- *
29
- * @param WP_Post $post The object for the current post/page.
30
- */
31
-
32
- function EWD_UFAQ_Need_Help_Meta_Box( $post ) {
33
- echo "<div class='ewd-ufaq-need-help-box'>";
34
- echo "<div class='ewd-ufaq-need-help-text'>Visit our Support Center for documentation and tutorials</div>";
35
- echo "<a class='ewd-ufaq-need-help-button' href='https://www.etoilewebdesign.com/support-center/?Plugin=UFAQ' target='_blank'>GET SUPPORT</a>";
36
- echo "</div>";
37
- }
38
-
39
-
40
- function EWD_UFAQ_Meta_Box( $post ) {
41
- $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
42
- if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
43
- $FAQ_Ratings = get_option("EWD_UFAQ_FAQ_Ratings");
44
-
45
- // Add a nonce field so we can check for it later.
46
- wp_nonce_field( 'EWD_UFAQ_Save_Meta_Box_Data', 'EWD_UFAQ_meta_box_nonce' );
47
-
48
- /*
49
- * Use get_post_meta() to retrieve an existing value
50
- * from the database and use the value for the form.
51
- */
52
- $Author = get_post_meta( $post->ID, 'EWD_UFAQ_Post_Author', true );
53
-
54
- if ($Author == "") {
55
- $User = wp_get_current_user();
56
- $Author = $User->display_name;
57
- }
58
-
59
- echo "<div class='ewd-ufaq-meta-field'>";
60
- echo "<label for='Post_Author'>";
61
- echo __( "Author Display Name:", 'EWD_UFAQ' );
62
- echo " </label>";
63
- echo "<input type='text' id='ewd-ufaq-post-author' name='Post_Author' value='" . esc_attr( $Author ) . "' size='25' />";
64
- echo "</div>";
65
-
66
- if ($FAQ_Ratings == "Yes") {
67
- $Up_Votes = get_post_meta($post->ID, "FAQ_Up_Votes", true);
68
- $Down_Votes = get_post_meta($post->ID, "FAQ_Down_Votes", true);
69
-
70
- echo "<div class='ewd-ufaq-meta-field'>";
71
- echo "<label for='Up_Votes'>";
72
- echo __( "Up Votes:", 'EWD_UFAQ' );
73
- echo " </label>";
74
- echo "<input type='text' id='ewd-ufaq-up-votes' name='Up_Votes' value='" . esc_attr( $Up_Votes ) . "' size='25' />";
75
- echo "</div>";
76
- echo "<div class='ewd-ufaq-meta-field'>";
77
- echo "<label for='Down_Votes'>";
78
- echo __( "Down Votes:", 'EWD_UFAQ' );
79
- echo " </label>";
80
- echo "<input type='text' id='ewd-ufaq-down-votes' name='Down_Votes' value='" . esc_attr( $Down_Votes ) . "' size='25' />";
81
- echo "</div>";
82
- }
83
-
84
- foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {
85
- echo "<div class='ewd-ufaq-meta-field'>";
86
- echo "<label for='" . $FAQ_Field_Item['FieldName'] . "'>";
87
- echo $FAQ_Field_Item['FieldName'] . ": ";
88
- echo "</label>";
89
- $Value = get_post_meta($post->ID, "Custom_Field_" . $FAQ_Field_Item['FieldID'], true);
90
- if ($FAQ_Field_Item['FieldType'] == "text") {
91
- echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' id='ewd-ufaq-input-" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-text-input' type='text' value='" . htmlspecialchars($Value, ENT_QUOTES) . "' size='60' />";
92
- }
93
- elseif ($FAQ_Field_Item['FieldType'] == "textarea") {
94
- echo "<textarea name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' id='ewd-ufaq-input-" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-textarea' cols='60' rows='6'>" . $Value . "</textarea>";
95
- }
96
- elseif ($FAQ_Field_Item['FieldType'] == "select") {
97
- $Options = explode(",", $FAQ_Field_Item['FieldValues']);
98
- echo "<select name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' id='ewd-ufaq-input-" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-select'>";
99
- foreach ($Options as $Option) {
100
- echo "<option value='" . $Option . "' ";
101
- if (trim($Option) == trim($Value)) {echo "selected='selected'";}
102
- echo ">" . $Option . "</option>";
103
- }
104
- echo "</select>";
105
- }
106
- elseif ($FAQ_Field_Item['FieldType'] == "radio") {
107
- $Counter = 0;
108
- $Options = explode(",", $FAQ_Field_Item['FieldValues']);
109
- echo "";
110
- foreach ($Options as $Option) {
111
- if ($Counter != 0) {echo "<label class='radio'></label>";}
112
- echo "<input type='radio' name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' value='" . $Option . "' class='ewd-ufaq-radio' ";
113
- if (trim($Option) == trim($Value)) {echo "checked";}
114
- echo ">" . $Option;
115
- $Counter++;
116
- }
117
- echo "";
118
- }
119
- elseif ($FAQ_Field_Item['FieldType'] == "checkbox") {
120
- $Counter = 0;
121
- $Options = explode(",", $FAQ_Field_Item['FieldValues']);
122
- $Values = explode(",", $Value);
123
- echo "";
124
- foreach ($Options as $Option) {
125
- if ($Counter != 0) {echo "<label class='radio'></label>";}
126
- echo "<input type='checkbox' name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "[]' value='" . $Option . "' class='ewd-ufaq-checkbox' ";
127
- if (in_array($Option, $Values)) {echo "checked";}
128
- echo ">" . $Option . "</br>";
129
- $Counter++;
130
- }
131
- echo "";
132
- }
133
- elseif ($FAQ_Field_Item['FieldType'] == "file") {
134
- echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-file-input' type='file' value='" . $Value . "' /><br/><label>Current " . $FAQ_Field_Item['FieldName'] . " File: </label>" . $Value . "";
135
- }
136
- elseif ($FAQ_Field_Item['FieldType'] == "link") {
137
- echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' id='ewd-ufaq-input-" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-text-input' type='text' value='" . $Value . "' size='60' />";
138
- }
139
- elseif ($FAQ_Field_Item['FieldType'] == "date") {
140
- echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-date-input' type='date' value='" . $Value . "' />";
141
- }
142
- elseif ($FAQ_Field_Item['FieldType'] == "datetime") {
143
- echo "<input name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' class='ewd-ufaq-datetime-input' type='datetime-local' value='" . $Value . "' />";
144
- }
145
- unset($Value);
146
- echo "</div>";
147
- }
148
- }
149
-
150
- add_action( 'save_post', 'EWD_UFAQ_Save_Meta_Box_Data' );
151
- function EWD_UFAQ_Save_Meta_Box_Data($post_id) {
152
- $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
153
- if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
154
- $FAQ_Ratings = get_option("EWD_UFAQ_FAQ_Ratings");
155
-
156
- /*
157
- * We need to verify this came from our screen and with proper authorization,
158
- * because the save_post action can be triggered at other times.
159
- */
160
-
161
- // Check if our nonce is set.
162
- if ( ! isset( $_POST['EWD_UFAQ_meta_box_nonce'] ) ) {
163
- return;
164
- }
165
-
166
- // Verify that the nonce is valid.
167
- if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_meta_box_nonce'], 'EWD_UFAQ_Save_Meta_Box_Data' ) ) {
168
- return;
169
- }
170
-
171
- // If this is an autosave, our form has not been submitted, so we don't want to do anything.
172
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
173
- return;
174
- }
175
-
176
- // Check the user's permissions.
177
- if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {
178
-
179
- if ( ! current_user_can( 'edit_page', $post_id ) ) {
180
- return;
181
- }
182
-
183
- } else {
184
-
185
- if ( ! current_user_can( 'edit_post', $post_id ) ) {
186
- return;
187
- }
188
- }
189
-
190
- foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {
191
- $FieldName = "Custom_Field_" . $FAQ_Field_Item['FieldID'];
192
- if (isset($_POST[$FieldName]) or isset($_FILES[$FieldName])) {
193
- // If it's a file, pass back to Prepare_Data_For_Insertion.php to upload the file and get the name
194
- $Value = '';
195
- $NoFile = '';
196
- if ($FAQ_Field_Item['FieldType'] == "file") {
197
- $File_Upload_Return = EWD_UFAQ_Handle_File_Upload($FieldName);
198
- if ($File_Upload_Return['Success'] == "No") {return $File_Upload_Return['Data'];}
199
- elseif ($File_Upload_Return['Success'] == "N/A") {$NoFile = "Yes";}
200
- else {$Value = $File_Upload_Return['Data'];}
201
- }
202
- elseif ($FAQ_Field_Item['FieldType'] == "checkbox") {
203
- foreach ($_POST[$FieldName] as $SingleValue) {$Value .= trim(sanitize_text_field($SingleValue)) . ",";}
204
- $Value = substr($Value, 0, strlen($Value)-1);
205
- }
206
- else {
207
- $Value = stripslashes_deep(trim(sanitize_text_field($_POST[$FieldName])));
208
- $Options = explode(",", $FAQ_Field_Item['FieldValues']);
209
- if (sizeOf($Options) > 0 and $Options[0] != "") {
210
- $Trimmed_Options = array_map('trim', $Options);
211
- $Options = $Trimmed_Options;
212
- $InArray = in_array($Value, $Options);
213
- }
214
- }
215
- if (!isset($InArray) or $InArray) {
216
- if ($NoFile != "Yes") {
217
- update_post_meta($post_id, "Custom_Field_" . $FAQ_Field_Item['FieldID'], $Value);
218
- }
219
- }
220
- elseif ($InArray == false) {$CustomFieldError = __(" One or more custom field values were incorrect.", 'ultimate-faqs');}
221
- unset($Value);
222
- unset($InArray);
223
- unset($NoFile);
224
- unset($CombinedValue);
225
- unset($FieldName);
226
- }
227
- }
228
-
229
- // Sanitize user input.
230
- $Post_Author = sanitize_text_field( $_POST['Post_Author'] );
231
-
232
- // Update the meta field in the database.
233
- update_post_meta( $post_id, 'EWD_UFAQ_Post_Author', $Post_Author );
234
-
235
- if ($FAQ_Ratings == "Yes") {
236
- update_post_meta($post_id, "FAQ_Up_Votes", sanitize_text_field($_POST['Up_Votes']));
237
- update_post_meta($post_id, "FAQ_Down_Votes", sanitize_text_field($_POST['Down_Votes']));
238
- update_post_meta($post_id, "FAQ_Total_Score", sanitize_text_field($_POST['Up_Votes']) - sanitize_text_field($_POST['Down_Votes']));
239
- }
240
- }
241
-
242
- function EWD_UFAQ_Add_Edit_Form_Multipart_Encoding() {
243
- global $post;
244
-
245
- if(!$post) {return;}
246
-
247
- $post_type = get_post_type($post->ID);
248
-
249
- if ($post_type = "ufaq") {echo ' enctype="multipart/form-data"';}
250
- }
251
- add_action('post_edit_form_tag', 'EWD_UFAQ_Add_Edit_Form_Multipart_Encoding');
252
-
253
- function EWD_UFAQ_Handle_File_Upload($Field_Name) {
254
-
255
- if (!is_user_logged_in()) {exit();}
256
-
257
- if (isset($_FILES[$Field_Name]) && ($_FILES[$Field_Name]['size'] > 0)) {
258
- $uploaded_file = wp_handle_upload($_FILES[$Field_Name], array( 'test_form' => false ));
259
- if (isset($uploaded_file['file'])) {
260
- $Return['Success'] = "Yes";
261
- $Return['Data'] = $uploaded_file['url'];
262
- }
263
- else {
264
- $Return['Success'] = "No";
265
- $Return['Data'] = "There was an error with the file upload";
266
- }
267
- }
268
- else {
269
- $Return['Success'] = "N/A";
270
- $Return['Data'] = __('No file was uploaded.', 'UPCP');
271
- }
272
-
273
- return $Return;
274
- }
275
-
276
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Output_Export_Page.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- /* Creates the admin page, and fills it in based on whether the user is looking at
3
- * the overview page or an individual item is being edited */
4
- function EWD_UFAQ_Output_Export_Page() {
5
- global $UFAQ_Full_Version;
6
-
7
- include( plugin_dir_path( __FILE__ ) . '../html/AdminHeader.php');
8
- include( plugin_dir_path( __FILE__ ) . '../html/ExportPage.php');
9
- include( plugin_dir_path( __FILE__ ) . '../html/AdminFooter.php');
10
- }
11
- ?>
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Output_Import_Page.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- /* Creates the admin page, and fills it in based on whether the user is looking at
3
- * the overview page or an individual item is being edited */
4
- function EWD_UFAQ_Output_Import_Page() {
5
- global $UFAQ_Full_Version;
6
-
7
- include( plugin_dir_path( __FILE__ ) . '../html/AdminHeader.php');
8
- include( plugin_dir_path( __FILE__ ) . '../html/ImportPage.php');
9
- include( plugin_dir_path( __FILE__ ) . '../html/AdminFooter.php');
10
- }
11
- ?>
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Output_Options_Page.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- /* Creates the admin page, and fills it in based on whether the user is looking at
3
- * the overview page or an individual item is being edited */
4
- function EWD_UFAQ_Output_Options_Page() {
5
- global $UFAQ_Full_Version;
6
-
7
- include( plugin_dir_path( __FILE__ ) . '../html/AdminHeader.php');
8
- include( plugin_dir_path( __FILE__ ) . '../html/OptionsPage.php');
9
- include( plugin_dir_path( __FILE__ ) . '../html/AdminFooter.php');
10
- }
11
- ?>
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Output_Pages.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
- /* Creates the admin page, and fills it in based on whether the user is looking at
3
- * the overview page or an individual item is being edited */
4
- function EWD_UFAQ_Output_Pages() {
5
- global $UFAQ_Full_Version;
6
-
7
- if (!isset($_GET['DisplayPage'])) {$_GET['DisplayPage'] = "";}
8
-
9
- include( plugin_dir_path( __FILE__ ) . '../html/AdminHeader.php');
10
- if ($_GET['DisplayPage'] == "" or $_GET['DisplayPage'] == "Dashboard") {include( plugin_dir_path( __FILE__ ) . '../html/DashboardPage.php');}
11
- if ($_GET['DisplayPage'] == "Options") {include( plugin_dir_path( __FILE__ ) . '../html/OptionsPage.php');}
12
- if ($_GET['DisplayPage'] == "Export") {include( plugin_dir_path( __FILE__ ) . '../html/ExportPage.php');}
13
- if ($_GET['DisplayPage'] == "ImportPosts") {include( plugin_dir_path( __FILE__ ) . '../html/ImportPage.php');}
14
- include( plugin_dir_path( __FILE__ ) . '../html/AdminFooter.php');
15
- }
16
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Output_Statistics_Page.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- /* Creates the admin page, and fills it in based on whether the user is looking at
3
- * the overview page or an individual item is being edited */
4
- function EWD_UFAQ_Output_Options_Page() {
5
- global $Full_Version;
6
-
7
- include( plugin_dir_path( __FILE__ ) . '../html/AdminHeader.php');
8
- include( plugin_dir_path( __FILE__ ) . '../html/StatisticsPage.php');
9
- include( plugin_dir_path( __FILE__ ) . '../html/AdminFooter.php');
10
- }
11
- ?>
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Pointers_Manager_Class.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
-
3
- class UFAQPointersManager implements UFAQPointersManagerInterface {
4
-
5
- private $pointers_input;
6
- private $version;
7
- private $prefix;
8
- private $pointers = array();
9
-
10
- public function __construct( $pointers_input, $version, $prefix ) {
11
- $this->pointers_input = $pointers_input;
12
- $this->version = str_replace( '.', '_', $version );
13
- $this->prefix = $prefix;
14
- }
15
-
16
- public function parse() {
17
- if ( empty($this->pointers_input) ) return;
18
- foreach ( $this->pointers_input as $i => $pointer ) {
19
- $pointer['id'] = "{$this->prefix}_{$i}";
20
- $this->pointers[$pointer['id']] = (object) $pointer;
21
- }
22
- }
23
-
24
- public function filter( $page ) {
25
- if ( empty( $this->pointers ) ) return array();
26
- $uid = get_current_user_id();
27
- $no = explode( ',', (string) get_user_meta( $uid, 'dismissed_wp_pointers', TRUE ) );
28
- $active_ids = array_diff( array_keys( $this->pointers ), $no );
29
- $good = array();
30
- foreach( $this->pointers as $i => $pointer ) {
31
- if (
32
- in_array( $i, $active_ids, TRUE ) // is active
33
- && isset( $pointer->where ) // has where
34
- && in_array( $page, (array) $pointer->where, TRUE ) // current page is in where
35
- ) {
36
- $good[] = $pointer;
37
- }
38
- }
39
- $count = count( $good );
40
- if ( $good === 0 ) return array();
41
- foreach( array_values( $good ) as $i => $pointer ) {
42
- $good[$i]->next = $i+1 < $count ? $good[$i+1]->id : '';
43
- }
44
- return $good;
45
- }
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Pointers_Manager_Interface.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- interface UFAQPointersManagerInterface {
3
-
4
- /**
5
- * Load pointers from file and setup id with prefix and version.
6
- * Cast pointers to objects.
7
- */
8
- public function parse();
9
-
10
- /**
11
- * Remove from parse pointers dismissed ones and pointers
12
- * that should not be shown on given page
13
- *
14
- * @param string $page Current admin page file
15
- */
16
- public function filter( $page );
17
-
18
- }
19
-
20
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Rewrite_Rules.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- function EWD_UFAQ_Rewrite_Rules() {
3
- global $wp_rewrite;
4
-
5
- $UFAQ_Rules = get_option('rewrite_rules');
6
-
7
- $frontpage_id = get_option('page_on_front');
8
-
9
- add_rewrite_tag('%single_faq%','([^&]+)');
10
- add_rewrite_tag('%ufaq_category_slug%','([^+]+)');
11
- add_rewrite_tag('%ufaq_tag_slug%','([^?]+)');
12
-
13
- add_rewrite_rule("single-faq/([^&]*)/?$", "index.php?page_id=". $frontpage_id . "&single_faq=\$matches[1]", 'top');
14
- add_rewrite_rule("(.?.+?)/single-faq/([^&]*)/?$", "index.php?pagename=\$matches[1]&single_faq=\$matches[2]", 'top');
15
- add_rewrite_rule("faq-category/([^+]*)/?$", "index.php?page_id=". $frontpage_id . "&ufaq_category_slug=\$matches[1]", 'top');
16
- add_rewrite_rule("(.?.+?)/faq-category/([^+]*)/?$", "index.php?pagename=\$matches[1]&ufaq_category_slug=\$matches[2]", 'top');
17
- add_rewrite_rule("faq-tag/([^?]*)/?$", "index.php?page_id=". $frontpage_id . "&ufaq_tag_slug=\$matches[1]", 'top');
18
- add_rewrite_rule("(.?.+?)/faq-tag/([^?]*)/?$", "index.php?pagename=\$matches[1]&ufaq_tag_slug=\$matches[2]", 'top');
19
-
20
- if (!isset($UFAQ_Rules['(.?.+?)/single-faq/([^&]*)/?$'])) {
21
- flush_rewrite_rules();
22
- }
23
- }
24
-
25
- function EWD_UFAQ_add_query_vars_filter( $vars ){
26
- $vars[] = "single_faq";
27
- $vars[] = "ufaq_category_slug";
28
- $vars[] = "ufaq_tag_slug";
29
- return $vars;
30
- }
31
-
32
-
33
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Styling.php DELETED
@@ -1,83 +0,0 @@
1
- <?php
2
- function EWD_UFAQ_Add_Modified_Styles() {
3
- $UFAQ_Styling_FAQ_Heading_Type = get_option("EWD_UFAQ_Styling_FAQ_Heading_Type");
4
- $UFAQ_Styling_Category_Heading_Type = get_option("EWD_UFAQ_Styling_Category_Heading_Type");
5
-
6
- $StylesString = "<style>";
7
- $StylesString .=".ewd-ufaq-post-margin-symbol { ";
8
- if (get_option("EWD_UFAQ_Styling_Default_Bg_Color") != "") {$StylesString .= "background-color:" . get_option("EWD_UFAQ_Styling_Default_Bg_Color") . " !important;";}
9
- if (get_option("EWD_UFAQ_Styling_Default_Font_Color") != "") {$StylesString .="color:" . get_option("EWD_UFAQ_Styling_Default_Font_Color") . " !important;";}
10
- if (get_option("EWD_UFAQ_Styling_Default_Border_Size") != "") {$StylesString .= "border-width:" . get_option("EWD_UFAQ_Styling_Default_Border_Size") . " !important; border-style: solid;";}
11
- if (get_option("EWD_UFAQ_Styling_Default_Border_Color") != "") {$StylesString .= "border-color:" . get_option("EWD_UFAQ_Styling_Default_Border_Color") . " !important;";}
12
- if (get_option("EWD_UFAQ_Styling_Default_Border_Radius") != "") {$StylesString .= "border-radius:" . get_option("EWD_UFAQ_Styling_Default_Border_Radius") . " !important;";}
13
- if (get_option("EWD_UFAQ_Styling_Toggle_Symbol_Size") != "") {$StylesString .= "font-size:" . get_option("EWD_UFAQ_Styling_Toggle_Symbol_Size") . " !important;";}
14
- $StylesString .="}\n";
15
- $StylesString .=".ewd-ufaq-post-margin-symbol span { ";
16
- if (get_option("EWD_UFAQ_Styling_Toggle_Symbol_Size") != "") {$StylesString .= "font-size:" . get_option("EWD_UFAQ_Styling_Toggle_Symbol_Size") . " !important;";}
17
- $StylesString .="}\n";
18
- $StylesString .=".ufaq-faq-display-style-Block.ewd-ufaq-post-active, .ufaq-faq-display-style-Block.ewd-ufaq-post-active a,.ufaq-faq-display-style-Block:hover, .ufaq-faq-display-style-Block:hover a, .ufaq-faq-display-style-Block:hover h4 { ";
19
- if (get_option("EWD_UFAQ_Styling_Block_Bg_Color") != "") {$StylesString .= "background-color:" . get_option("EWD_UFAQ_Styling_Block_Bg_Color") . " !important;";}
20
- if (get_option("EWD_UFAQ_Styling_Block_Font_Color") != "") {$StylesString .="color:" . get_option("EWD_UFAQ_Styling_Block_Font_Color") . " !important;";}
21
- $StylesString .="}\n";
22
- $StylesString .=".ufaq-faq-display-style-Border_Block.ewd-ufaq-post-active, .ufaq-faq-display-style-Border_Block:hover, .ufaq-faq-display-style-Border_Block:hover h1, .ufaq-faq-display-style-Border_Block:hover h2, .ufaq-faq-display-style-Border_Block:hover h3, .ufaq-faq-display-style-Border_Block:hover h4, .ufaq-faq-display-style-Border_Block:hover h5, .ufaq-faq-display-style-Border_Block:hover h6 { ";
23
- if (get_option("EWD_UFAQ_Styling_Block_Bg_Color") != "") {$StylesString .= "background-color:" . get_option("EWD_UFAQ_Styling_Block_Bg_Color") . " !important;";}
24
- if (get_option("EWD_UFAQ_Styling_Block_Font_Color") != "") {$StylesString .="color:" . get_option("EWD_UFAQ_Styling_Block_Font_Color") . " !important;";}
25
- $StylesString .="}\n";
26
- $StylesString .=".ufaq-faq-display-style-Border_Block .ufaq-faq-body { ";
27
- if (get_option("EWD_UFAQ_Styling_Block_Bg_Color") != "") {$StylesString .= "border-color:" . get_option("EWD_UFAQ_Styling_Block_Bg_Color") . " !important;";}
28
- $StylesString .="}\n";
29
- $StylesString .=".ufaq-faq-display-style-Border_Block .comment-reply-title, .ufaq-faq-display-style-Border_Block:hover .comment-reply-title { ";
30
- $StylesString .= "background-color: transparent !important;";
31
- $StylesString .="}\n";
32
- $StylesString .="div.ufaq-faq-category-title " . $UFAQ_Styling_Category_Heading_Type . " " . get_option("EWD_UFAQ_Styling_Category_Heading_Type") . " { ";
33
- if (get_option("EWD_UFAQ_Styling_Category_Heading_Font") != "") {$StylesString .= "font-family:" . get_option("EWD_UFAQ_Styling_Category_Heading_Font") . " !important;";}
34
- if (get_option("EWD_UFAQ_Styling_Category_Heading_Font_Size") != "") {$StylesString .= "font-size:" . get_option("EWD_UFAQ_Styling_Category_Heading_Font_Size") . " !important;";}
35
- if (get_option("EWD_UFAQ_Styling_Category_Heading_Font_Color") != "") {$StylesString .= "color:" . get_option("EWD_UFAQ_Styling_Category_Heading_Font_Color") . " !important;";}
36
- $StylesString .="}\n";
37
- $StylesString .=".ufaq-faq-header-title a{ ";
38
- if (get_option("EWD_UFAQ_Styling_List_Font") != "") {$StylesString .= "font-family:" . get_option("EWD_UFAQ_Styling_List_Font") . " !important;";}
39
- if (get_option("EWD_UFAQ_Styling_List_Font_Size") != "") {$StylesString .="font-size:" . get_option("EWD_UFAQ_Styling_List_Font_Size") . " !important;";}
40
- if (get_option("EWD_UFAQ_Styling_List_Font_Color") != "") {$StylesString .= "color:" . get_option("EWD_UFAQ_Styling_List_Font_Color") . " !important;";}
41
- if (get_option("EWD_UFAQ_Styling_List_Margin") != "") {$StylesString .= "margin:" . get_option("EWD_UFAQ_Styling_List_Margin") . " !important;";}
42
- if (get_option("EWD_UFAQ_Styling_List_Padding") != "") {$StylesString .= "padding:" . get_option("EWD_UFAQ_Styling_List_Padding") . " !important;";}
43
- $StylesString .="}\n";
44
- $StylesString .="div.ufaq-faq-title " . $UFAQ_Styling_FAQ_Heading_Type . " { ";
45
- if (get_option("EWD_UFAQ_Styling_Question_Font") != "") {$StylesString .= "font-family:" . get_option("EWD_UFAQ_Styling_Question_Font") . " !important;";}
46
- if (get_option("EWD_UFAQ_Styling_Question_Font_Size") != "") {$StylesString .="font-size:" . get_option("EWD_UFAQ_Styling_Question_Font_Size") . " !important;";}
47
- if (get_option("EWD_UFAQ_Styling_Question_Font_Color") != "") {$StylesString .= "color:" . get_option("EWD_UFAQ_Styling_Question_Font_Color") . " !important;";}
48
- if (get_option("EWD_UFAQ_Styling_Question_Margin") != "") {$StylesString .= "margin:" . get_option("EWD_UFAQ_Styling_Question_Margin") . " !important;";}
49
- if (get_option("EWD_UFAQ_Styling_Question_Padding") != "") {$StylesString .= "padding:" . get_option("EWD_UFAQ_Styling_Question_Padding") . " !important;";}
50
- $StylesString .="}\n";
51
- $StylesString .=".ewd-ufaq-post-margin-symbol { ";
52
- if (get_option("EWD_UFAQ_Styling_Question_Icon_Top_Margin") != "") {$StylesString .= "margin-top:" . get_option("EWD_UFAQ_Styling_Question_Icon_Top_Margin") . " !important;";}
53
- $StylesString .="}\n";
54
- $StylesString .="div.ufaq-faq-post p { ";
55
- if (get_option("EWD_UFAQ_Styling_Answer_Font") != "") {$StylesString .= "font-family:" . get_option("EWD_UFAQ_Styling_Answer_Font") . " !important;";}
56
- if (get_option("EWD_UFAQ_Styling_Answer_Font_Size") != "") {$StylesString .="font-size:" . get_option("EWD_UFAQ_Styling_Answer_Font_Size") . " !important;";}
57
- if (get_option("EWD_UFAQ_Styling_Answer_Font_Color") != "") {$StylesString .= "color:" . get_option("EWD_UFAQ_Styling_Answer_Font_Color") . " !important;";}
58
- if (get_option("EWD_UFAQ_Styling_Answer_Margin") != "") {$StylesString .= "margin:" . get_option("EWD_UFAQ_Styling_Answer_Margin") . " !important;";}
59
- if (get_option("EWD_UFAQ_Styling_Answer_Padding") != "") {$StylesString .= "padding:" . get_option("EWD_UFAQ_Styling_Answer_Padding") . " !important;";}
60
- $StylesString .="}\n";
61
- $StylesString .="div.ufaq-faq-body, .ufaq-faq-display-style-Border_Block .ufaq-faq-body { ";
62
- if (get_option("EWD_UFAQ_Styling_Answer_Font") != "") {$StylesString .= "font-family:" . get_option("EWD_UFAQ_Styling_Answer_Font") . " !important;";}
63
- if (get_option("EWD_UFAQ_Styling_Answer_Font_Size") != "") {$StylesString .="font-size:" . get_option("EWD_UFAQ_Styling_Answer_Font_Size") . " !important;";}
64
- if (get_option("EWD_UFAQ_Styling_Answer_Font_Color") != "") {$StylesString .= "color:" . get_option("EWD_UFAQ_Styling_Answer_Font_Color") . " !important;";}
65
- $StylesString .="}\n";
66
- $StylesString .="div.ewd-ufaq-author-date { ";
67
- if (get_option("EWD_UFAQ_Styling_Postdate_Font") != "") {$StylesString .= "font-family:" . get_option("EWD_UFAQ_Styling_Postdate_Font") . " !important;";}
68
- if (get_option("EWD_UFAQ_Styling_Postdate_Font_Size") != "") {$StylesString .="font-size:" . get_option("EWD_UFAQ_Styling_Postdate_Font_Size") . " !important;";}
69
- if (get_option("EWD_UFAQ_Styling_Postdate_Font_Color") != "") {$StylesString .= "color:" . get_option("EWD_UFAQ_Styling_Postdate_Font_Color") . " !important;";}
70
- if (get_option("EWD_UFAQ_Styling_Postdate_Margin") != "") {$StylesString .= "margin:" . get_option("EWD_UFAQ_Styling_Postdate_Margin") . " !important;";}
71
- if (get_option("EWD_UFAQ_Styling_Postdate_Padding") != "") {$StylesString .= "padding:" . get_option("EWD_UFAQ_Styling_Postdate_Padding") . " !important;";}
72
- $StylesString .="}\n";
73
- $StylesString .="div.ufaq-faq-categories, div.ufaq-faq-tags { ";
74
- if (get_option("EWD_UFAQ_Styling_Category_Font") != "") {$StylesString .= "font-family:" . get_option("EWD_UFAQ_Styling_Category_Font") . " !important;";}
75
- if (get_option("EWD_UFAQ_Styling_Category_Font_Size") != "") {$StylesString .="font-size:" . get_option("EWD_UFAQ_Styling_Category_Font_Size") . " !important;";}
76
- if (get_option("EWD_UFAQ_Styling_Category_Font_Color") != "") {$StylesString .= "color:" . get_option("EWD_UFAQ_Styling_Category_Font_Color") . " !important;";}
77
- if (get_option("EWD_UFAQ_Styling_Category_Margin") != "") {$StylesString .= "margin:" . get_option("EWD_UFAQ_Styling_Category_Margin") . " !important;";}
78
- if (get_option("EWD_UFAQ_Styling_Category_Padding") != "") {$StylesString .= "padding:" . get_option("EWD_UFAQ_Styling_Category_Padding") . " !important;";}
79
- $StylesString .="}\n";
80
- $StylesString .= "</style>";
81
-
82
- return $StylesString;
83
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Submit_Question.php DELETED
@@ -1,147 +0,0 @@
1
- <?php
2
- function EWD_UFAQ_Submit_Question($success_message) {
3
- $Submit_Question_Captcha = get_option("EWD_UFAQ_Submit_Question_Captcha");
4
- $Admin_Question_Notification = get_option("EWD_UFAQ_Admin_Question_Notification");
5
- $Submit_FAQ_Email = get_option("EWD_UFAQ_Submit_FAQ_Email");
6
- $Submitted_Default_Category = get_option("EWD_UFAQ_Submitted_Default_Category");
7
-
8
- $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
9
- if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
10
-
11
- $Post_Title = sanitize_text_field($_POST['Post_Title']);
12
- $Post_Body = (isset($_POST['Post_Body']) ? sanitize_text_field($_POST['Post_Body']) : '');
13
- $Post_Author = sanitize_text_field($_POST['Post_Author']);
14
-
15
- if ($Submit_Question_Captcha == "Yes" and EWD_UFAQ_Validate_Captcha() != "Yes") {
16
- $user_message = __("Captcha number didn't match image.", 'ultimate-faqs');
17
- return $user_message;
18
- }
19
-
20
- $post = array(
21
- 'post_content' => $Post_Body,
22
- 'post_title' => $Post_Title,
23
- 'post_type' => 'ufaq',
24
- 'post_status' => 'draft' //Can create an option for admin approval of reviews here
25
- );
26
- $post_id = wp_insert_post($post);
27
- if ($post_id == 0) {$user_message = __("FAQ was not created succesfully.", 'ultimate-faqs'); return $user_message;}
28
-
29
- update_post_meta($post_id, "EWD_UFAQ_Post_Author", $Post_Author);
30
-
31
- if ($Submitted_Default_Category != '' and $Submitted_Default_Category != 'none') {
32
- $FAQ_Category = get_term_by('slug', $Submitted_Default_Category, 'ufaq-category');
33
- $term_id = (int) $FAQ_Category->term_id;
34
- wp_set_post_terms($post_id, array($term_id), 'ufaq-category');
35
- }
36
-
37
- foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {
38
- if ($FAQ_Field_Item['FieldType'] == "checkbox") {$FieldName = "Custom_Field_" . $FAQ_Field_Item['FieldID'];}
39
- else {$FieldName = "Custom_Field_" . $FAQ_Field_Item['FieldID'];}
40
- if (isset($_POST[$FieldName]) or isset($_FILES[$FieldName])) {
41
- // If it's a file, pass back to Prepare_Data_For_Insertion.php to upload the file and get the name
42
- $Value = '';
43
- if ($FAQ_Field_Item['FieldType'] == "checkbox") {
44
- foreach ($_POST[$FieldName] as $SingleValue) {$Value .= trim(sanitize_text_field($SingleValue)) . ",";}
45
- $Value = substr($Value, 0, strlen($Value)-1);
46
- }
47
- else {
48
- $Value = stripslashes_deep(trim(sanitize_text_field($_POST[$FieldName])));
49
- $Options = explode(",", $FAQ_Field_Item['FieldValues']);
50
- if (sizeOf($Options) > 0 and $Options[0] != "") {
51
- $Trimmed_Options = array_map('trim', $Options);
52
- $Options = $Trimmed_Options;
53
- $InArray = in_array($Value, $Options);
54
- }
55
- }
56
- if (!isset($InArray) or $InArray) {
57
- update_post_meta($post_id, "Custom_Field_" . $FAQ_Field_Item['FieldID'], $Value);
58
- }
59
- unset($Value);
60
- unset($InArray);
61
- unset($FieldName);
62
- }
63
- }
64
-
65
- if ($Submit_FAQ_Email != 0 and isset($_POST['Author_Email'])) {
66
- update_post_meta($post_id, 'EWD_UFAQ_Post_Author_Email', sanitize_text_field($_POST['Author_Email']));
67
- if (function_exists('EWD_URP_Send_Email_To_Non_User')) {
68
- $Params = array(
69
- 'Email_ID' => $Submit_FAQ_Email,
70
- 'Email_Address' => sanitize_email($_POST['Author_Email']),
71
- 'post_id' => $post_id
72
- );
73
-
74
- EWD_URP_Send_Email_To_Non_User($Params);
75
- }
76
- }
77
-
78
- if ($Admin_Question_Notification == "Yes") {
79
- EWD_UFAQ_Send_Admin_Notification_Email($post_id, $Post_Title, $Post_Body);
80
- }
81
-
82
- return $success_message;
83
- }
84
-
85
- function EWD_UFAQ_Send_Admin_Notification_Email($post_id, $Post_Title, $Post_Body) {
86
- if (get_option("EWD_UFAQ_Admin_Notification_Email") != "") {$Admin_Email = get_option("EWD_UFAQ_Admin_Notification_Email");}
87
- else {$Admin_Email = get_option( 'admin_email' );}
88
-
89
- $ReviewLink = site_url() . "/wp-admin/post.php?post=" . $post_id . "&action=edit";
90
-
91
- $Subject_Line = __("New Question Received", 'ultimate-faqs');
92
-
93
- $Message_Body = __("Hello Admin,", 'ultimate-faqs') . "<br/><br/>";
94
- $Message_Body .= __("You've received a new question titled", 'ultimate-faqs') . " '" . $Post_Title . "'.<br/><br/>";
95
- if ($Post_Body != "") {
96
- $Message_Body .= __("The answer reads:<br>", 'ultimate-faqs');
97
- $Message_Body .= $Post_Body . "<br><br><br>";
98
- }
99
- $Message_Body .= __("You can view the question in the admin area by going to the following link:<br>", 'ultimate-faqs');
100
- $Message_Body .= "<a href='" . $ReviewLink . "' />" . __("See the review", 'ultimate-faqs') . "</a><br/><br/>";
101
- $Message_Body .= __("Have a great day,", 'ultimate-faqs') . "<br/><br/>";
102
- $Message_Body .= __("Ultimate FAQs Team");
103
-
104
- $headers = array('Content-Type: text/html; charset=UTF-8');
105
- $Mail_Success = wp_mail($Admin_Email, $Subject_Line, $Message_Body, $headers);
106
- }
107
-
108
- function EWD_UFAQ_Add_UWPM_Element_Sections() {
109
- if (function_exists('uwpm_register_custom_element_section')) {
110
- uwpm_register_custom_element_section('ewd_ufaq_uwpm_elements', array('label' => 'FAQ Tags'));
111
- }
112
- }
113
- add_action('uwpm_register_custom_element_section', 'EWD_UFAQ_Add_UWPM_Element_Sections');
114
-
115
- function EWD_UFAQ_Add_UWPM_Elements() {
116
- if (function_exists('uwpm_register_custom_element')) {
117
-
118
- uwpm_register_custom_element('ewd_ufaq_author',
119
- array(
120
- 'label' => 'FAQ Author',
121
- 'callback_function' => 'EWD_UFAQ_UWPM_FAQ_Author',
122
- 'section' => 'ewd_ufaq_uwpm_elements'
123
- )
124
- );
125
- uwpm_register_custom_element('ewd_ufaq_author_email',
126
- array(
127
- 'label' => 'FAQ Author Email',
128
- 'callback_function' => 'EWD_UFAQ_UWPM_FAQ_Author_Email',
129
- 'section' => 'ewd_ufaq_uwpm_elements'
130
- )
131
- );
132
- }
133
- }
134
- add_action('uwpm_register_custom_element', 'EWD_UFAQ_Add_UWPM_Elements');
135
-
136
- function EWD_UFAQ_UWPM_FAQ_Author($Params, $User) {
137
- if (!isset($Params['post_id'])) {return;}
138
-
139
- return get_post_meta($Params['post_id'], 'EWD_UFAQ_Post_Author', true);
140
- }
141
-
142
- function EWD_UFAQ_UWPM_FAQ_Author_Email($Params, $User) {
143
- if (!isset($Params['post_id'])) {return;}
144
-
145
- return get_post_meta($Params['post_id'], 'EWD_UFAQ_Post_Author_Email', true);
146
- }
147
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Upgrade_Box.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
-
3
- function EWD_UFAQ_Upgrade_Box() {
4
- ?>
5
- <div id="side-sortables" class="metabox-holder ">
6
- <div id="upcp_pro" class="postbox " >
7
- <div class="handlediv" title="Click to toggle"></div><h3 class='hndle'><span><?php _e("Full Version", 'ultimate-faqs') ?></span></h3>
8
- <div class="inside">
9
- <ul><li><a href="http://www.etoilewebdesign.com/plugins/ultimate-faq/"><?php _e("Upgrade to the full version ", 'ultimate-faqs'); ?></a><?php _e("to take advantage of all the available features of the Ultimate FAQs for Wordpress!", 'ultimate-faqs'); ?></li></ul>
10
- <h3 class='hndle'><span><?php _e("What you get by upgrading:", 'EWD_URP') ?></span></h3>
11
- <ul>
12
- <li>Ability to add a unique FAQ tab to each WooCommerce product page.</li>
13
- <li>Premium shortcodes to accept questions from users and insert an AJAX FAQ search.</li>
14
- <li>Additional FAQ style skins, dozens of styling and labeling options and much more!</li>
15
- <li>Access to e-mail support.</li>
16
- </ul>
17
- <div class="full-version-form-div">
18
- <form action="edit.php?post_type=ufaq" method="post">
19
- <div class="form-field form-required">
20
- <label for="Key"><?php _e("Product Key", 'ultimate-faqs') ?></label>
21
- <input name="Key" type="text" value="" size="40" />
22
- </div>
23
- <input type="submit" name="Upgrade_To_Full" value="<?php _e('Upgrade', 'ultimate-faqs') ?>">
24
- </form>
25
- </div>
26
- </div>
27
- </div>
28
- </div>
29
-
30
- <?php
31
- }
32
-
33
- function EWD_UFAQ_Upgrade_Notice() {
34
- ?>
35
- <div id="side-sortables" class="metabox-holder ">
36
- <div id="upcp_pro" class="postbox " >
37
- <div class="handlediv" title="Click to toggle"></div><h3 class='hndle'><span><?php _e("Upgrade Complete!", 'ultimate-faqs') ?></span></h3>
38
- <div class="inside">
39
- <ul><li><?php _E("Thanks for upgrading!", 'ultimate-faqs'); ?></li></ul>
40
- </div>
41
- </div>
42
- </div>
43
-
44
- <?php
45
- }
46
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Version_Update.php DELETED
@@ -1,129 +0,0 @@
1
- <?php
2
- function EWD_UFAQ_Version_Update() {
3
- global $EWD_UFAQ_Version;
4
-
5
- $params = array(
6
- 'post_type' => 'ufaq',
7
- 'posts_per_page' => -1,
8
- );
9
- $FAQs = get_posts($params);
10
-
11
- if (is_array($FAQs)) {
12
- foreach ($FAQs as $FAQ) {
13
- $Current_Order = get_post_meta($FAQ->ID, "ufaq_order", true);
14
- if ($Current_Order == "") {
15
- update_post_meta($FAQ->ID, 'ufaq_order', 999);
16
- }
17
- }
18
- }
19
-
20
- if (is_array($FAQs)) {
21
- foreach ($FAQs as $FAQ) {
22
- $Current_Order = get_post_meta($FAQ->ID, "FAQ_Total_Score", true);
23
- if ($Current_Order == "") {
24
- update_post_meta($FAQ->ID, 'FAQ_Total_Score', 0);
25
- }
26
- }
27
- }
28
-
29
- if (get_option("EWD_UFAQ_FAQ_Elements") == "") {
30
- $FAQ_Elements = array();
31
- $FAQ_Elements[0] = "Author_Date";
32
- $FAQ_Elements[1] = "Body";
33
- $FAQ_Elements[2] = "Custom_Fields";
34
- $FAQ_Elements[3] = "Categories";
35
- $FAQ_Elements[4] = "Tags";
36
- $FAQ_Elements[5] = "Ratings";
37
- $FAQ_Elements[6] = "Social_Media";
38
- $FAQ_Elements[7] = "Permalink";
39
- $FAQ_Elements[8] = "Comments";
40
- $FAQ_Elements[9] = "Back_To_Top";
41
-
42
- update_option("EWD_UFAQ_FAQ_Elements", $FAQ_Elements);
43
- }
44
-
45
- if (get_option("EWD_UFAQ_Display_Style") == "Color_Block") {
46
- update_option("EWD_UFAQ_Display_Style", "Default");
47
-
48
- if (get_option("EWD_UFAQ_Color_Block_Shape") != 'Square') {
49
- if (get_option("EWD_UFAQ_Styling_Default_Border_Radius") == '') {update_option("EWD_UFAQ_Styling_Default_Border_Radius", "100px");}
50
- }
51
-
52
- if (get_option("UFAQ_Styling_Default_Bg_Color") == "") {update_option("UFAQ_Styling_Default_Bg_Color", "#1188cc");}
53
- if (get_option("UFAQ_Styling_Default_Font_Color") == "") {update_option("UFAQ_Styling_Default_Font_Color", "#ffffff");}
54
- if (get_option("UFAQ_Styling_Default_Border_Color") == "") {update_option("UFAQ_Styling_Default_Border_Color", "#1188cc");}
55
- }
56
-
57
- if (get_option("EWD_UFAQ_Toggle") == "") {update_option("EWD_UFAQ_Toggle", "Yes");}
58
- if (get_option("EWD_UFAQ_Display_Back_To_Top") == "") {update_option("EWD_UFAQ_Display_Back_To_Top", "No");}
59
- if (get_option("EWD_UFAQ_Comments_On") == "") {update_option("EWD_UFAQ_Comments_On", "No");}
60
- if (get_option("EWD_UFAQ_Display_Style") == "") {update_option("EWD_UFAQ_Display_Style", "Default");}
61
- if (get_option("EWD_UFAQ_FAQ_Ratings") == "") {update_option("EWD_UFAQ_FAQ_Ratings", "No");}
62
- if (get_option("EWD_UFAQ_WooCommerce_FAQs") == "") {update_option("EWD_UFAQ_WooCommerce_FAQs", "No");}
63
- if (get_option("EWD_UFAQ_Use_Product") == "") {update_option("EWD_UFAQ_Use_Product", "Yes");}
64
- if (get_option("EWD_UFAQ_Color_Block_Shape") == "") {update_option("EWD_UFAQ_Color_Block_Shape", "Square");}
65
- if (get_option("FAQ_Auto_Complete_Titles") == "") {update_option("FAQ_Auto_Complete_Titles", "Yes");}
66
- if (get_option("EWD_UFAQ_Permalink_Type") == "") {update_option("EWD_UFAQ_Permalink_Type", "SamePage");}
67
- if (get_option("EWD_UFAQ_Slug_Base") == "") {update_option("EWD_UFAQ_Slug_Base", "ufaqs");}
68
-
69
- if (get_option("EWD_UFAQ_Hide_Blank_Fields") == "") {update_option("EWD_UFAQ_Hide_Blank_Fields", "Yes");}
70
-
71
- if (get_option("EWD_UFAQ_Styling_Category_Heading_Type") == "") {update_option("EWD_UFAQ_Styling_Category_Heading_Type", "h4");}
72
- if (get_option("EWD_UFAQ_Styling_FAQ_Heading_Type") == "") {update_option("EWD_UFAQ_Styling_FAQ_Heading_Type", "h4");}
73
-
74
- if (get_option("EWD_UFAQ_Install_Time") == "") {update_option("EWD_UFAQ_Install_Time", time() - 3600*24*4);}
75
-
76
- update_option('EWD_UFAQ_Version', $EWD_UFAQ_Version);
77
- }
78
-
79
- add_filter('upgrader_pre_install', 'EWD_UFAQ_SetUpdateOption');
80
- function EWD_UFAQ_SetUpdateOption() {
81
- update_option('EWD_UFAQ_Update_Flag', "Yes");
82
- }
83
-
84
- if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and get_option('EWD_UFAQ_Update_Flag') != "Yes") {add_action("admin_notices", "EWD_UFAQ_Version_Update_Box");}
85
-
86
- function EWD_UFAQ_Version_Update_Box() { /*
87
- ?>
88
- <div id="side-sortables" class="metabox-holder ">
89
- <div id="EWD_UFAQ_pro" class="postbox " >
90
- <div class="handlediv" title="Click to toggle"></div>
91
- <h3 class='hndle'><span><?php _e("Thank You!", 'ultimate-faqs') ?></span></h3>
92
- <div class="inside">
93
- <?php if (get_option("EWD_UFAQ_Install_Flag") == "Yes") { ?><ul><li><?php _e("Thanks for installing the Ultimate FAQs plugin.", 'ultimate-faqs'); ?><br> <a href='https://www.youtube.com/channel/UCZPuaoetCJB1vZOmpnMxJNw'><?php _e("Subscribe to our YouTube channel ", 'ultimate-faqs'); ?></a> <?php _e("for tutorial videos on this and our other plugins!", 'ultimate-faqs');?> </li></ul>
94
- <?php } else { ?><ul><li><?php _e("Thanks for upgrading to version 1.4.1!", 'ultimate-faqs'); ?><br> <a href='https://wordpress.org/support/plugin/ultimate-faqs/reviews/'><?php _e("Please rate our plugin", 'ultimate-faqs'); ?></a> <?php _e("if you find Ultimate FAQs useful!", 'ultimate-faqs');?> </li></ul><?php } ?>
95
-
96
- <?php /* if (get_option("EWD_UFAQ_Install_Flag") == "Yes") { ?><ul><li><?php _e("Thanks for installing the Ultimate Product Catalogue Plugin.", 'ultimate-faqs'); ?><br> <a href='http://www.facebook.com/EtoileWebDesign'><?php _e("Follow us on Facebook", 'ultimate-faqs'); ?></a> <?php _e("to suggest new features or hear about upcoming ones!", 'ultimate-faqs');?> </li></ul>
97
- <?php } else { ?><ul><li><?php _e("Thanks for upgrading to version 2.2.9!", 'ultimate-faqs'); ?><br> <a href='http://www.facebook.com/EtoileWebDesign'><?php _e("Follow us on Facebook", 'ultimate-faqs'); ?></a> <?php _e("to suggest new features or hear about upcoming ones!", 'ultimate-faqs');?> </li></ul><?php } */ ?>
98
-
99
- <?php /* if (get_option("EWD_UFAQ_Install_Flag") == "Yes") { ?><ul><li><?php _e("Thanks for installing the Ultimate Product Catalogue Plugin.", 'ultimate-faqs'); ?><br> <a href='http://www.facebook.com/EtoileWebDesign'><?php _e("Follow us on Facebook", 'ultimate-faqs'); ?></a> <?php _e("to suggest new features or hear about upcoming ones!", 'ultimate-faqs');?> </li></ul>
100
- <?php } else { ?><ul><li><?php _e("Thanks for upgrading to version 3.0.16!", 'ultimate-faqs'); ?><br> <a href='http://wordpress.org/support/view/plugin-reviews/ultimate-product-catalogue'><?php _e("Please rate our plugin", 'ultimate-faqs'); ?></a> <?php _e("if you find the Ultimate Product Catalogue Plugin useful!", 'ultimate-faqs');?> </li></ul><?php } */ ?>
101
-
102
- <?php /* if (get_option("EWD_UFAQ_Install_Flag") == "Yes") { ?><ul><li><?php _e("Thanks for installing the Ultimate Product Catalogue Plugin.", 'ultimate-faqs'); ?><br> <a href='http://www.facebook.com/EtoileWebDesign'><?php _e("Follow us on Facebook", 'ultimate-faqs'); ?></a> <?php _e("to suggest new features or hear about upcoming ones!", 'ultimate-faqs');?> </li></ul>
103
- <?php } else { ?><ul><li><?php _e("Thanks for upgrading to version 3.4.8!", 'ultimate-faqs'); ?><br> <a href='http://wordpress.org/plugins/order-tracking/'><?php _e("Try out order tracking plugin ", 'ultimate-faqs'); ?></a> <?php _e("if you ship orders and find the Ultimate Product Catalogue Plugin useful!", 'ultimate-faqs');?> </li></ul><?php } */ ?>
104
-
105
- <?php /* if (get_option("EWD_UFAQ_Install_Flag") == "Yes") { ?><ul><li><?php _e("Thanks for installing the Ultimate Product Catalogue Plugin.", 'ultimate-faqs'); ?><br> <a href='http://www.facebook.com/EtoileWebDesign'><?php _e("Follow us on Facebook", 'ultimate-faqs'); ?></a> <?php _e("to suggest new features or hear about upcoming ones!", 'ultimate-faqs');?> </li></ul>
106
- <?php } else { ?><ul><li><?php _e("Thanks for upgrading to version 2.3.9!", 'ultimate-faqs'); ?><br> <a href='http://wordpress.org/support/topic/error-hunt'><?php _e("Please let us know about any small display/functionality errors. ", 'ultimate-faqs'); ?></a> <?php _e("We've noticed a couple, and would like to eliminate as many as possible.", 'ultimate-faqs');?> </li></ul><?php } */ ?>
107
-
108
- <?php /* if (get_option("EWD_UFAQ_Install_Flag") == "Yes") { ?><ul><li><?php _e("Thanks for installing the Ultimate Product Catalogue Plugin.", 'ultimate-faqs'); ?><br> <a href='https://www.youtube.com/channel/UCZPuaoetCJB1vZOmpnMxJNw'><?php _e("Check out our YouTube channel ", 'ultimate-faqs'); ?></a> <?php _e("for tutorial videos on this and our other plugins!", 'ultimate-faqs');?> </li></ul>
109
- <?php } elseif ($Full_Version == "Yes") { ?><ul><li><?php _e("Thanks for upgrading to version 3.5.0!", 'ultimate-faqs'); ?><br> <a href='http://www.facebook.com/EtoileWebDesign'><?php _e("Follow us on Facebook", 'ultimate-faqs'); ?></a> <?php _e("to suggest new features or hear about upcoming ones!", 'ultimate-faqs');?> </li></ul>
110
- <?php } else { ?><ul><li><?php _e("Thanks for upgrading to version 3.4!", 'ultimate-faqs'); ?><br> <?php _e("Love the plugin but don't need the premium version? Help us speed up product support and development by donating. Thanks for using the plugin!", 'ultimate-faqs');?>
111
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
112
- <input type="hidden" name="cmd" value="_s-xclick">
113
- <input type="hidden" name="hosted_button_id" value="AQLMJFJ62GEFJ">
114
- <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
115
- <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
116
- </form>
117
- </li></ul>
118
- <?php } ?>
119
-
120
- </div>
121
- </div>
122
- </div>
123
-
124
- <?php
125
- update_option("EWD_UFAQ_Update_Flag", "No");
126
- update_option("EWD_UFAQ_Install_Flag", "No"); */
127
- }
128
-
129
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_WPForms_Integration.php DELETED
@@ -1,99 +0,0 @@
1
- <?php
2
-
3
- if ( get_option( 'EWD_UFAQ_WPForms_Integration' ) == 'Yes' ) {
4
- global $target_field;
5
-
6
- add_filter( 'wpforms_builder_settings_sections', 'EWD_UFAQ_WPForms_Add_Settings_Panel' );
7
- add_action( 'wpforms_form_settings_panel_content', 'EWD_UFAQ_WPForms_Add_Settings' );
8
-
9
- add_action( 'wpforms_frontend_output_before', 'EWD_UFAQ_WPForms_Integration_Localization', 10, 2 );
10
-
11
- if ( get_option( 'EWD_UFAQ_WPForms_FAQ_Location' ) == 'Below' ) { add_action( 'wpforms_display_field_after', 'EWD_UFAQ_WPForms_Integration', 10, 2 ); }
12
- else { add_action( 'wpforms_display_field_before', 'EWD_UFAQ_WPForms_Integration', 10, 2 ); }
13
- }
14
-
15
- function EWD_UFAQ_WPForms_Add_Settings_Panel( $panels ) {
16
- $panels['ufaq'] = esc_html__( 'FAQs', 'wpforms-lite' );
17
-
18
- return $panels;
19
- }
20
-
21
- function EWD_UFAQ_WPForms_Add_Settings( $form ) {
22
- echo '<div class="wpforms-panel-content-section wpforms-panel-content-section-ufaq">';
23
-
24
- echo '<div class="wpforms-panel-content-section-title">';
25
- esc_html_e( 'Ultimate FAQs', 'wpforms-lite' );
26
- echo '</div>';
27
-
28
- wpforms_panel_field(
29
- 'radio',
30
- 'settings',
31
- 'ufaq_enabled',
32
- $form->form_data,
33
- esc_html__( 'Disable FAQ display for this form, or enable it only on specific fields.', 'wpforms-lite' ),
34
- array(
35
- 'options' => array(
36
- 'enabled' => array( 'label' => 'Enable' ),
37
- 'disabled' => array( 'label' => 'Disable' ),
38
- 'specific' => array( 'label' => 'Specific Field' )
39
- )
40
- )
41
- );
42
-
43
- wpforms_panel_field(
44
- 'select',
45
- 'settings',
46
- 'ufaq_selected_field',
47
- $form->form_data,
48
- esc_html__( 'If FAQs are set to a specific field, which field should FAQs be displayed for?', 'wpforms-lite' ),
49
- array(
50
- 'field_map' => array(
51
- 'text',
52
- 'textarea'
53
- )
54
- )
55
- );
56
-
57
- echo '</div>';
58
- }
59
-
60
- function EWD_UFAQ_WPForms_Integration_Localization( $form_data, $form ) {
61
- global $target_field;
62
-
63
- if ( isset ( $form_data['settings']['ufaq_enabled'] ) and $form_data['settings']['ufaq_enabled'] == 'specific' ) {
64
- $target_field = isset( $form_data['settings']['ufaq_selected_field'] ) ? $form_data['settings']['ufaq_selected_field'] : 0;
65
- }
66
- elseif ( ! isset( $form_data['settings']['ufaq_enabled'] ) or ( isset ( $form_data['settings']['ufaq_enabled'] ) and $form_data['settings']['ufaq_enabled'] != 'disabled' ) ) {
67
- foreach ( $form_data['fields'] as $field_id => $field ){
68
- if ( $field['type'] == 'textarea' ) {
69
- $target_field = $field['id'];
70
- break;
71
- }
72
- }
73
- }
74
- else {
75
- $target_field = 0;
76
- }
77
-
78
- wp_localize_script(
79
- 'ewd-ufaq-js',
80
- 'wpforms_integration',
81
- array(
82
- 'ufaq_enabled' => isset ( $form_data['settings']['ufaq_enabled'] ) ? $form_data['settings']['ufaq_enabled'] : 'enabled',
83
- 'ufaq_selected_field' => $target_field,
84
- 'form_id' => $form_data['id']
85
- )
86
- );
87
- }
88
-
89
- function EWD_UFAQ_WPForms_Integration( $field, $form_data ) {
90
- global $target_field;
91
-
92
- if ( isset( $form_data['settings']['ufaq_enabled'] ) and $form_data['settings']['ufaq_enabled'] != 'disabled' and $field['id'] == $target_field ) {
93
- echo '<div class="ewd-ufaq-wpforms-label ewd-ufaq-hidden">Possible FAQs related to your message:</div>';
94
- echo "<input type='hidden' name='current_url' value='" . $_SERVER['REQUEST_URI'] . "' id='ufaq-current-url' />";
95
- echo do_shortcode( '[ultimate-faq-search wp_forms_load="Yes"]' );
96
- }
97
- }
98
-
99
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_Widgets.php DELETED
@@ -1,323 +0,0 @@
1
- <?php
2
- class EWD_UFAQ_Display_FAQ_Post_List extends WP_Widget {
3
-
4
- /**
5
- * Sets up the widgets name etc
6
- */
7
- public function __construct() {
8
- parent::__construct(
9
- 'ewd_ufaq_display_faq_post_list', // Base ID
10
- __('UFAQ FAQ ID List', 'ultimate-faqs'), // Name
11
- array( 'description' => __( 'Insert FAQ posts using a comma-separated list of post IDs', 'EWD_UFAQ' ), ) // Args
12
- );
13
- }
14
-
15
- /**
16
- * Outputs the content of the widget
17
- *
18
- * @param array $args
19
- * @param array $instance
20
- */
21
- public function widget( $args, $instance ) {
22
- echo $args['before_widget'];
23
- if ($instance['faq_title'] != "") {echo ($args['before_title'] != '' ? $args['before_title'] : "<h3>") . $instance['faq_title'] . ($args['after_title'] != '' ? $args['after_title'] : "</h3>");}
24
- echo do_shortcode("[select-faq faq_id='". $instance['faq_id'] . "' no_comments='Yes']");
25
- echo $args['after_widget'];
26
- }
27
-
28
- /**
29
- * Outputs the options form on admin
30
- *
31
- * @param array $instance The widget options
32
- */
33
- public function form( $instance ) {
34
- $faq_id = ! empty( $instance['faq_id'] ) ? $instance['faq_id'] : __( 'FAQ ID List', 'EWD_UFAQ' );
35
- $faq_title = ! empty( $instance['faq_title'] ) ? $instance['faq_title'] : __( 'Widget Title', 'EWD_UFAQ' );
36
- ?>
37
- <p>
38
- <label for="<?php echo $this->get_field_id( 'faq_id' ); ?>"><?php _e( 'FAQ ID List:', 'EWD_UFAQ' ); ?></label>
39
- <input class="widefat" id="<?php echo $this->get_field_id( 'faq_id' ); ?>" name="<?php echo $this->get_field_name( 'faq_id' ); ?>" type="text" value="<?php echo esc_attr( $faq_id ); ?>">
40
- </p>
41
- <p>
42
- <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'EWD_UFAQ' ); ?></label>
43
- <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
44
- </p>
45
- <?php
46
- }
47
-
48
- /**
49
- * Processing widget options on save
50
- *
51
- * @param array $new_instance The new options
52
- * @param array $old_instance The previous options
53
- */
54
- public function update( $new_instance, $old_instance ) {
55
- $instance = array();
56
- $instance['faq_id'] = ( ! empty( $new_instance['faq_id'] ) ) ? strip_tags( $new_instance['faq_id'] ) : '';
57
- $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
58
-
59
- return $instance;
60
- }
61
- }
62
- function EWD_UFAQ_Register_Display_FAQ_Post_List() {
63
- register_widget("EWD_UFAQ_Display_FAQ_Post_List");
64
- }
65
- add_action('widgets_init', 'EWD_UFAQ_Register_Display_FAQ_Post_List');
66
-
67
- class EWD_UFAQ_Display_Recent_FAQS extends WP_Widget {
68
-
69
- /**
70
- * Sets up the widgets name etc
71
- */
72
- public function __construct() {
73
- parent::__construct(
74
- 'ewd_ufaq_display_recent_faqs', // Base ID
75
- __('Recent FAQs', 'ultimate-faqs'), // Name
76
- array( 'description' => __( 'Insert a number of the most recent FAQs', 'EWD_UFAQ' ), ) // Args
77
- );
78
- }
79
-
80
- /**
81
- * Outputs the content of the widget
82
- *
83
- * @param array $args
84
- * @param array $instance
85
- */
86
- public function widget( $args, $instance ) {
87
- echo $args['before_widget'];
88
- if ($instance['faq_title'] != "") {echo ($args['before_title'] != '' ? $args['before_title'] : "<h3>") . $instance['faq_title'] . ($args['after_title'] != '' ? $args['after_title'] : "</h3>");}
89
- echo do_shortcode("[recent-faqs post_count='". $instance['post_count'] . "' no_comments='Yes']");
90
- echo $args['after_widget'];
91
- }
92
-
93
- /**
94
- * Outputs the options form on admin
95
- *
96
- * @param array $instance The widget options
97
- */
98
- public function form( $instance ) {
99
- $post_count = ! empty( $instance['post_count'] ) ? $instance['post_count'] : __( 'Number of FAQs', 'EWD_UFAQ' );
100
- $faq_title = ! empty( $instance['faq_title'] ) ? $instance['faq_title'] : __( 'Widget Title', 'EWD_UFAQ' );
101
- ?>
102
- <p>
103
- <label for="<?php echo $this->get_field_id( 'post_count' ); ?>"><?php _e( 'Number of FAQs:', 'EWD_UFAQ' ); ?></label>
104
- <input class="widefat" id="<?php echo $this->get_field_id( 'post_count' ); ?>" name="<?php echo $this->get_field_name( 'post_count' ); ?>" type="text" value="<?php echo esc_attr( $post_count ); ?>">
105
- </p>
106
- <p>
107
- <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'EWD_UFAQ' ); ?></label>
108
- <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
109
- </p>
110
- <?php
111
- }
112
-
113
- /**
114
- * Processing widget options on save
115
- *
116
- * @param array $new_instance The new options
117
- * @param array $old_instance The previous options
118
- */
119
- public function update( $new_instance, $old_instance ) {
120
- $instance = array();
121
- $instance['post_count'] = ( ! empty( $new_instance['post_count'] ) ) ? strip_tags( $new_instance['post_count'] ) : '';
122
- $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
123
-
124
- return $instance;
125
- }
126
- }
127
- function EWD_UFAQ_Register_Display_Recent_FAQS() {
128
- register_widget("EWD_UFAQ_Display_Recent_FAQS");
129
- }
130
- add_action('widgets_init', 'EWD_UFAQ_Register_Display_Recent_FAQS');
131
-
132
- class EWD_UFAQ_Display_Popular_FAQS extends WP_Widget {
133
-
134
- /**
135
- * Sets up the widgets name etc
136
- */
137
- public function __construct() {
138
- parent::__construct(
139
- 'ewd_ufaq_display_popular_faqs', // Base ID
140
- __('Popular FAQs', 'ultimate-faqs'), // Name
141
- array( 'description' => __( 'Insert a number of the most popular FAQs', 'EWD_UFAQ' ), ) // Args
142
- );
143
- }
144
-
145
- /**
146
- * Outputs the content of the widget
147
- *
148
- * @param array $args
149
- * @param array $instance
150
- */
151
- public function widget( $args, $instance ) {
152
- echo $args['before_widget'];
153
- if ($instance['faq_title'] != "") {echo ($args['before_title'] != '' ? $args['before_title'] : "<h3>") . $instance['faq_title'] . ($args['after_title'] != '' ? $args['after_title'] : "</h3>");}
154
- echo do_shortcode("[popular-faqs post_count='". $instance['post_count'] . "' no_comments='Yes']");
155
- echo $args['after_widget'];
156
- }
157
-
158
- /**
159
- * Outputs the options form on admin
160
- *
161
- * @param array $instance The widget options
162
- */
163
- public function form( $instance ) {
164
- $post_count = ! empty( $instance['post_count'] ) ? $instance['post_count'] : __( 'Number of FAQs', 'EWD_UFAQ' );
165
- $faq_title = ! empty( $instance['faq_title'] ) ? $instance['faq_title'] : __( 'Widget Title', 'EWD_UFAQ' );
166
- ?>
167
- <p>
168
- <label for="<?php echo $this->get_field_id( 'post_count' ); ?>"><?php _e( 'Number of FAQs:', 'EWD_UFAQ' ); ?></label>
169
- <input class="widefat" id="<?php echo $this->get_field_id( 'post_count' ); ?>" name="<?php echo $this->get_field_name( 'post_count' ); ?>" type="text" value="<?php echo esc_attr( $post_count ); ?>">
170
- </p>
171
- <p>
172
- <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'EWD_UFAQ' ); ?></label>
173
- <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
174
- </p>
175
- <?php
176
- }
177
-
178
- /**
179
- * Processing widget options on save
180
- *
181
- * @param array $new_instance The new options
182
- * @param array $old_instance The previous options
183
- */
184
- public function update( $new_instance, $old_instance ) {
185
- $instance = array();
186
- $instance['post_count'] = ( ! empty( $new_instance['post_count'] ) ) ? strip_tags( $new_instance['post_count'] ) : '';
187
- $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
188
-
189
- return $instance;
190
- }
191
- }
192
- function EWD_UFAQ_Register_Display_Popular_FAQS() {
193
- register_widget("EWD_UFAQ_Display_Popular_FAQS");
194
- }
195
- add_action('widgets_init', 'EWD_UFAQ_Register_Display_Popular_FAQS');
196
-
197
- class EWD_UFAQ_Display_Random_FAQ extends WP_Widget {
198
-
199
- /**
200
- * Sets up the widgets name etc
201
- */
202
- public function __construct() {
203
- parent::__construct(
204
- 'ewd_ufaq_display_random_faq', // Base ID
205
- __('Random FAQ', 'ultimate-faqs'), // Name
206
- array( 'description' => __( 'Display a random FAQ', 'EWD_UFAQ' ), ) // Args
207
- );
208
- }
209
-
210
- /**
211
- * Outputs the content of the widget
212
- *
213
- * @param array $args
214
- * @param array $instance
215
- */
216
- public function widget( $args, $instance ) {
217
- $FAQs = get_posts(array('orderby' => 'rand', 'posts_per_page' => '1', 'post_type' => 'ufaq'));
218
-
219
- echo $args['before_widget'];
220
- if ($instance['faq_title'] != "") {echo ($args['before_title'] != '' ? $args['before_title'] : "<h3>") . $instance['faq_title'] . ($args['after_title'] != '' ? $args['after_title'] : "</h3>");}
221
- foreach ($FAQs as $FAQ) {echo do_shortcode("[select-faq faq_id='". $FAQ->ID . "' no_comments='Yes']");}
222
- echo $args['after_widget'];
223
- }
224
-
225
- /**
226
- * Outputs the options form on admin
227
- *
228
- * @param array $instance The widget options
229
- */
230
- public function form( $instance ) {
231
- $faq_title = ! empty( $instance['faq_title'] ) ? $instance['faq_title'] : __( 'Widget Title', 'EWD_UFAQ' );
232
- ?>
233
- <p>
234
- <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'EWD_UFAQ' ); ?></label>
235
- <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
236
- </p>
237
- <?php
238
- }
239
-
240
- /**
241
- * Processing widget options on save
242
- *
243
- * @param array $new_instance The new options
244
- * @param array $old_instance The previous options
245
- */
246
- public function update( $new_instance, $old_instance ) {
247
- $instance = array();
248
- $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
249
-
250
- return $instance;
251
- }
252
- }
253
- function EWD_UFAQ_Register_Display_Random_FAQ() {
254
- register_widget("EWD_UFAQ_Display_Random_FAQ");
255
- }
256
- add_action('widgets_init', 'EWD_UFAQ_Register_Display_Random_FAQ');
257
-
258
- class EWD_UFAQ_Display_FAQ_Categories extends WP_Widget {
259
-
260
- /**
261
- * Sets up the widgets name etc
262
- */
263
- public function __construct() {
264
- parent::__construct(
265
- 'ewd_ufaq_display_faq_categories', // Base ID
266
- __('UFAQ FAQ Category List', 'ultimate-faqs'), // Name
267
- array( 'description' => __( 'Insert FAQ posts using a comma-separated list of categories', 'EWD_UFAQ' ), ) // Args
268
- );
269
- }
270
-
271
- /**
272
- * Outputs the content of the widget
273
- *
274
- * @param array $args
275
- * @param array $instance
276
- */
277
- public function widget( $args, $instance ) {
278
- echo $args['before_widget'];
279
- if ($instance['faq_title'] != "") {echo ($args['before_title'] != '' ? $args['before_title'] : "<h3>") . $instance['faq_title'] . ($args['after_title'] != '' ? $args['after_title'] : "</h3>");}
280
- echo do_shortcode("[ultimate-faqs include_category='". $instance['include_category'] . "' no_comments='Yes']");
281
- echo $args['after_widget'];
282
- }
283
-
284
- /**
285
- * Outputs the options form on admin
286
- *
287
- * @param array $instance The widget options
288
- */
289
- public function form( $instance ) {
290
- $include_category = ! empty( $instance['include_category'] ) ? $instance['include_category'] : __( 'FAQ Category List', 'EWD_UFAQ' );
291
- $faq_title = ! empty( $instance['faq_title'] ) ? $instance['faq_title'] : __( 'Widget Title', 'EWD_UFAQ' );
292
- ?>
293
- <p>
294
- <label for="<?php echo $this->get_field_id( 'include_category' ); ?>"><?php _e( 'FAQ Category List:', 'EWD_UFAQ' ); ?></label>
295
- <input class="widefat" id="<?php echo $this->get_field_id( 'include_category' ); ?>" name="<?php echo $this->get_field_name( 'include_category' ); ?>" type="text" value="<?php echo esc_attr( $include_category ); ?>">
296
- </p>
297
- <p>
298
- <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'EWD_UFAQ' ); ?></label>
299
- <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
300
- </p>
301
- <?php
302
- }
303
-
304
- /**
305
- * Processing widget options on save
306
- *
307
- * @param array $new_instance The new options
308
- * @param array $old_instance The previous options
309
- */
310
- public function update( $new_instance, $old_instance ) {
311
- $instance = array();
312
- $instance['include_category'] = ( ! empty( $new_instance['include_category'] ) ) ? strip_tags( $new_instance['include_category'] ) : '';
313
- $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
314
-
315
- return $instance;
316
- }
317
- }
318
- function EWD_UFAQ_Register_Display_FAQ_Categories() {
319
- register_widget("EWD_UFAQ_Display_FAQ_Categories");
320
- }
321
- add_action('widgets_init', 'EWD_UFAQ_Register_Display_FAQ_Categories');
322
-
323
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/EWD_UFAQ_WooCommerce_Tab.php DELETED
@@ -1,155 +0,0 @@
1
- <?php
2
-
3
- add_filter( 'woocommerce_product_tabs', 'EWD_UFAQ_Woo_FAQ_Tab' );
4
- function EWD_UFAQ_Woo_FAQ_Tab( $tabs ) {
5
- global $product;
6
-
7
- $Use_Product = get_option("EWD_UFAQ_Use_Product");
8
-
9
- $WooCommerce_FAQs = get_option("EWD_UFAQ_WooCommerce_FAQs");
10
-
11
- $WooCommerce_Tab_Label = get_option("EWD_UFAQ_WooCommerce_Tab_Label");
12
- if ($WooCommerce_Tab_Label == "") {$WooCommerce_Tab_Label = __( 'FAQs', 'EWD_UFAQ' );}
13
-
14
- if ($Use_Product == "Yes" and is_object($product)) {$Product_Post = get_post($product->get_id());}
15
- else {$Product_Post = get_post(get_the_id());}
16
-
17
- $UFAQ_Product_Category = get_term_by('name', $Product_Post->post_title, 'ufaq-category');
18
-
19
- $WC_Cats = get_the_terms($Product_Post, 'product_cat');
20
- $UFAQ_WCCat_Category = false;
21
- if ($WC_Cats) {
22
- foreach ($WC_Cats as $WC_Cat) {
23
- if (get_term_by('name', $WC_Cat->name, 'ufaq-category')) {$UFAQ_WCCat_Category = true;}
24
- }
25
- }
26
-
27
- $Current_FAQs = get_post_meta($Product_Post->ID, 'EWD_UFAQ_WC_Selected_FAQs', true );
28
- if (!is_array($Current_FAQs)) {$Current_FAQs = array();}
29
-
30
- if (($UFAQ_Product_Category or $UFAQ_WCCat_Category or !empty($Current_FAQs)) and $WooCommerce_FAQs == "Yes") {
31
- $tabs['faq_tab'] = array(
32
- 'title' => $WooCommerce_Tab_Label,
33
- 'priority' => 50,
34
- 'callback' => 'EWD_UFAQ_Woo_FAQ_Tab_Content'
35
- );
36
- }
37
-
38
- return $tabs;
39
- }
40
-
41
- function EWD_UFAQ_Woo_FAQ_Tab_Content() {
42
- global $product;
43
-
44
- $Use_Product = get_option("EWD_UFAQ_Use_Product");
45
-
46
- $WooCommerce_Tab_Label = get_option("EWD_UFAQ_WooCommerce_Tab_Label");
47
- if ($WooCommerce_Tab_Label == "") {$WooCommerce_Tab_Label = __( 'FAQs', 'EWD_UFAQ' );}
48
-
49
- if ($Use_Product == "Yes") {$Product_Post = get_post($product->get_id());}
50
- else {$Product_Post = get_post(get_the_id());}
51
- $UFAQ_Product_Category = get_term_by('name', $Product_Post->post_title, 'ufaq-category');
52
-
53
- echo '<h2>' . $WooCommerce_Tab_Label . '</h2>';
54
-
55
- $Current_FAQs = get_post_meta($Product_Post->ID, 'EWD_UFAQ_WC_Selected_FAQs', true );
56
- if (!is_array($Current_FAQs)) {$Current_FAQs = array();}
57
-
58
- if (!empty($Current_FAQs)) {
59
- $FAQ_List = implode(",", $Current_FAQs);
60
- echo do_shortcode("[ultimate-faqs post__in_string='". $FAQ_List . "']");
61
- }
62
- else {
63
- $WC_Cats = get_the_terms($Product_Post, 'product_cat');
64
- $UFAQ_WC_Category_List = "";
65
- if ($WC_Cats) {
66
- foreach ($WC_Cats as $WC_Cat) {
67
- $UFAQ_WC_Category = get_term_by('name', $WC_Cat->name, 'ufaq-category');
68
- if ($UFAQ_WC_Category) {$UFAQ_WC_Category_List .= "," . $UFAQ_WC_Category->slug;}
69
- }
70
- }
71
- echo do_shortcode("[ultimate-faqs include_category='". $UFAQ_Product_Category->slug . $UFAQ_WC_Category_List . "']");
72
- }
73
- }
74
-
75
- function EWD_UFAQ_Add_FAQs_Product_Tab($array) {
76
- $Add_Tab = array(
77
- 'label' => __('FAQs', 'ultimate-faqs'),
78
- 'target' => 'ewd_ufaq_faqs',
79
- 'class' => array()
80
- );
81
-
82
- $array['faqs'] = $Add_Tab;
83
-
84
- return $array;
85
- }
86
- add_filter( 'woocommerce_product_data_tabs', 'EWD_UFAQ_Add_FAQs_Product_Tab', 10, 1 );
87
-
88
- function EWD_UFAQ_WooCommerce_Product_Page_FAQs() {
89
- global $thepostid;
90
-
91
- $WooCommerce_FAQs = get_option("EWD_UFAQ_WooCommerce_FAQs");
92
- if ($WooCommerce_FAQs != "Yes") {return;}
93
-
94
- $Current_FAQs = get_post_meta($thepostid, 'EWD_UFAQ_WC_Selected_FAQs', true );
95
- if (!is_array($Current_FAQs)) {$Current_FAQs = array();}
96
-
97
- $All_FAQs = get_posts(array("numberposts" => -1, "post_type" => 'ufaq'));
98
- $Categories = get_terms(array('taxonomy' => 'ufaq-category'));
99
-
100
- echo "<div id='ewd_ufaq_faqs' class='panel woocommerce_options_panel'>";
101
-
102
- echo "<div class='ewd-ufaq-explanation'>";
103
- echo __("You can use the form below to select which FAQs to display for this product, or leave it blank to use the default category naming system.", 'ultimate-faqs');
104
- echo "</div>";
105
-
106
- echo "<div id='ewd-ufaq-add-delete-faq-form-container'>";
107
- echo "<div id='ewd-ufaq-add-faq-form-div'>";
108
- echo "<form id='ewd-ufaq-add-faq-form'>";
109
- echo "<select class='ewd-ufaq-category-filter' name='ewd-ufaq-category-filter'>";
110
- echo "<option value=''>" . __("All Categories", 'ultimate-faqs') . "</option>";
111
- foreach ($Categories as $Category) {echo "<option value='" . $Category->term_id . "'>" . $Category->name . "</option>";}
112
- echo "</select>";
113
- echo "<table class='form-table ewd-ufaq-faq-add-table'>";
114
- echo "<tr>";
115
- echo "<th>" . __("Add?", 'ultimate-faqs') . "</th>";
116
- echo "<th>" . __("FAQ", 'ultimate-faqs') . "</th>";
117
- echo "</tr>";
118
- foreach ($All_FAQs as $FAQ) {
119
- echo "<tr class='ewd-ufaq-faq-row' data-faqid='" . $FAQ->ID . "'>";
120
- echo "<td><input type='checkbox' class='ewd-ufaq-add-faq' name='Add_FAQs[]' value='" . $FAQ->ID . "'/></td>";
121
- echo "<td>" . $FAQ->post_title . "</td>";
122
- echo "</tr>";
123
- }
124
- echo "</table>";
125
- echo "</form>";
126
- echo "<button class='ewd-ufaq-add-faq-button'>" . __('Add FAQs', 'ultimate-faqs') . "</button>";
127
- echo "</div>"; // ewd-ufaq-add-faq-form-div
128
-
129
- echo "<div id='ewd-ufaq-delete-faq-form-div'>";
130
- echo "<form id='ewd-ufaq-delete-faq-form'>";
131
- echo "<input type='hidden' id='ewd-ufaq-post-id' value='" . $thepostid . "' />";
132
- echo "<table class='form-table ewd-ufaq-delete-table'>";
133
- echo "<tr>";
134
- echo "<th>" . __("Delete?", 'ultimate-faqs') . "</th>";
135
- echo "<th>" . __("FAQ", 'ultimate-faqs') . "</th>";
136
- echo "</tr>";
137
- foreach ($Current_FAQs as $FAQ_ID) {
138
- $FAQ = get_post($FAQ_ID);
139
-
140
- echo "<tr class='ewd-ufaq-faq-row ewd-ufaq-delete-faq-row' data-faqid='" . $FAQ_ID . "'>";
141
- echo "<td><input type='checkbox' class='ewd-ufaq-delete-faq' name='Delete_FAQs[]' value='" . $FAQ_ID . "'/></td>";
142
- echo "<td>" . $FAQ->post_title . "</td>";
143
- echo "</tr>";
144
- }
145
- echo "</table>";
146
- echo "</form>";
147
- echo "<button class='ewd-ufaq-delete-faq-button'>" . __('Delete FAQs', 'ultimate-faqs') . "</button>";
148
- echo "</div>"; // ewd-ufaq-delete-faq-form-div
149
- echo "</div>"; // ewd-ufaq-add-delete-faq-form-container
150
- echo "</div>";
151
- }
152
-
153
- add_action('woocommerce_product_data_panels', 'EWD_UFAQ_WooCommerce_Product_Page_FAQs');
154
-
155
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/Error_Notices.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
- /* Add any update or error notices to the top of the admin page */
3
- function EWD_UFAQ_Error_Notices(){
4
- global $ewd_ufaq_message;
5
- if (isset($ewd_ufaq_message)) {
6
- if (isset($ewd_ufaq_message['Message_Type']) and $ewd_ufaq_message['Message_Type'] == "Update") {echo "<div class='updated'><p>" . $ewd_ufaq_message['Message'] . "</p></div>";}
7
- if (isset($ewd_ufaq_message['Message_Type']) and $ewd_ufaq_message['Message_Type'] == "Error") {echo "<div class='error'><p>" . $ewd_ufaq_message['Message'] . "</p></div>";}
8
- }
9
-
10
- if( get_transient( 'ewd-ufaq-admin-install-notice' ) ){ ?>
11
- <div class="updated notice is-dismissible">
12
- <p>Head over to the <a href="admin.php?page=EWD-UFAQ-Options">Ultimate FAQs Dashboard</a> to get started using the plugin!</p>
13
- </div>
14
-
15
- <?php
16
- delete_transient( 'ewd-ufaq-admin-install-notice' );
17
- }
18
-
19
- $Ask_Review_Date = get_option('EWD_UFAQ_Ask_Review_Date');
20
- if ($Ask_Review_Date == "") {$Ask_Review_Date = get_option("EWD_UFAQ_Install_Time") + 3600*24*4;}
21
-
22
- if ($Ask_Review_Date < time() and get_option("EWD_UFAQ_Install_Time") < time() - 3600*24*4) {
23
-
24
- global $pagenow;
25
- if($pagenow != 'post.php' && $pagenow != 'post-new.php'){ ?>
26
-
27
- <div class='notice notice-info is-dismissible ewd-ufaq-main-dashboard-review-ask' style='display:none'>
28
- <div class='ewd-ufaq-review-ask-plugin-icon'></div>
29
- <div class='ewd-ufaq-review-ask-text'>
30
- <p class='ewd-ufaq-review-ask-starting-text'>Enjoying using the Ultimate FAQs plugin?</p>
31
- <p class='ewd-ufaq-review-ask-feedback-text ufaq-hidden'>Help us make the plugin better! Please take a minute to rate the plugin. Thanks!</p>
32
- <p class='ewd-ufaq-review-ask-review-text ufaq-hidden'>Please let us know what we could do to make the plugin better!<br /><span>(If you would like a response, please include your email address.)</span></p>
33
- <p class='ewd-ufaq-review-ask-thank-you-text ufaq-hidden'>Thank you for taking the time to help us!</p>
34
- </div>
35
- <div class='ewd-ufaq-review-ask-actions'>
36
- <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-not-really ewd-ufaq-review-ask-white'>Not Really</div>
37
- <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-yes ewd-ufaq-review-ask-green'>Yes!</div>
38
- <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-no-thanks ewd-ufaq-review-ask-white ufaq-hidden'>No Thanks</div>
39
- <a href='https://wordpress.org/support/plugin/ultimate-faqs/reviews/' target='_blank'>
40
- <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-review ewd-ufaq-review-ask-green ufaq-hidden'>OK, Sure</div>
41
- </a>
42
- </div>
43
- <div class='ewd-ufaq-review-ask-feedback-form ufaq-hidden'>
44
- <div class='ewd-ufaq-review-ask-feedback-explanation'>
45
- <textarea></textarea>
46
- <br>
47
- <input type="email" name="feedback_email_address" placeholder="<?php _e('Email Address', 'ultimate-faqs'); ?>">
48
- </div>
49
- <div class='ewd-ufaq-review-ask-send-feedback ewd-ufaq-review-ask-action ewd-ufaq-review-ask-green'>Send Feedback</div>
50
- </div>
51
- <div class='ewd-ufaq-clear'></div>
52
- </div>
53
-
54
- <?php
55
- }
56
- }
57
- }
58
-
59
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/FrontEndAjaxUrl.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- function ewd_ufaq_frontend_ajaxurl() {
3
- ?>
4
- <script type="text/javascript">
5
- var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
6
- </script>
7
- <?php
8
- }
9
- add_action('wp_head','ewd_ufaq_frontend_ajaxurl');
10
- ?>
 
 
 
 
 
 
 
 
 
 
Functions/Process_Ajax.php DELETED
@@ -1,315 +0,0 @@
1
- <?php
2
- /* Processes the ajax requests being put out in the admin area and the front-end
3
- * of the UPCP plugin */
4
-
5
- // Returns the FAQs that are found for a specific search
6
- function UFAQ_Search() {
7
- $response = do_shortcode("[ultimate-faqs search_string='" . strtolower(sanitize_text_field($_POST['Q'])) . "' include_category='" . sanitize_text_field($_POST['include_category']) . "' exclude_category='" . sanitize_text_field($_POST['exclude_category']) . "' orderby='" . sanitize_text_field($_POST['orderby']) . "' order='" . sanitize_text_field($_POST['order']) . "' post_count='" . sanitize_text_field($_POST['post_count']) . "' current_url='" . sanitize_text_field($_POST['current_url']) . "' faqs_only='" . sanitize_text_field($_POST['faqs_only']) . "' faq_page='" . sanitize_text_field($_POST['faq_page']) . "' ajax='Yes']");
8
-
9
- $ReturnArray['request_count'] = sanitize_text_field($_POST['request_count']);
10
- $ReturnArray['message'] = $response;
11
- echo json_encode($ReturnArray);
12
-
13
- die();
14
- }
15
- add_action('wp_ajax_ufaq_search', 'UFAQ_Search');
16
- add_action( 'wp_ajax_nopriv_ufaq_search', 'UFAQ_Search');
17
-
18
- // Change the up and down votes for a particular FAQ
19
- function EWD_UFAQ_Update_Rating() {
20
- $FAQ_ID = is_numeric($_POST['FAQ_ID']) ? intval($_POST['FAQ_ID']) : 0;
21
- $Vote_Type = sanitize_text_field( $_POST['Vote_Type'] );
22
-
23
- if ($Vote_Type == "Up") {
24
- $Up_Votes = get_post_meta($FAQ_ID, "FAQ_Up_Votes", true);
25
- update_post_meta($FAQ_ID, "FAQ_Up_Votes", $Up_Votes + 1);
26
- $Total_Score = get_post_meta($FAQ_ID, "FAQ_Total_Score", true);
27
- update_post_meta($FAQ_ID, "FAQ_Total_Score", $Total_Score + 1);
28
- }
29
- if ($Vote_Type == "Down") {
30
- $Down_Votes = get_post_meta($FAQ_ID, "FAQ_Down_Votes", true);
31
- update_post_meta($FAQ_ID, "FAQ_Down_Votes", $Down_Votes + 1);
32
- $Total_Score = get_post_meta($FAQ_ID, "FAQ_Total_Score", true);
33
- update_post_meta($FAQ_ID, "FAQ_Total_Score", $Total_Score - 1);
34
- }
35
-
36
- die();
37
- }
38
- add_action('wp_ajax_ufaq_update_rating', 'EWD_UFAQ_Update_Rating');
39
- add_action( 'wp_ajax_nopriv_ufaq_update_rating', 'EWD_UFAQ_Update_Rating');
40
-
41
- // Records the number of time an FAQ post is opened
42
- function UFAQ_Record_View() {
43
- global $wpdb;
44
- $wpdb->show_errors();
45
- $post_id = intval( substr($_POST['post_id'], 4, strrpos(sanitize_text_field($_POST['post_id']), "-") - 4) );
46
-
47
- if (!is_numeric($post_id)) {return;}
48
-
49
- $Meta_ID = $wpdb->get_var($wpdb->prepare("SELECT meta_id FROM $wpdb->postmeta WHERE post_id=%d AND meta_key='ufaq_view_count'", $post_id));
50
- if ($Meta_ID != "" and $Meta_ID != 0) {$wpdb->query($wpdb->prepare("UPDATE $wpdb->postmeta SET meta_value=meta_value+1 WHERE post_id=%d AND meta_key='ufaq_view_count'", $post_id));}
51
- else {$wpdb->query($wpdb->prepare("INSERT INTO $wpdb->postmeta (post_id,meta_key,meta_value) VALUES (%d,'ufaq_view_count','1')", $post_id));}
52
-
53
- die();
54
- }
55
- add_action('wp_ajax_ufaq_record_view', 'UFAQ_Record_View');
56
- add_action( 'wp_ajax_nopriv_ufaq_record_view', 'UFAQ_Record_View');
57
-
58
- function EWD_UFAQ_Save_Order(){
59
- global $UFAQ_Full_Version;
60
-
61
- if (!is_array($_POST['ewd-ufaq-item']) or $UFAQ_Full_Version != "Yes") {return;}
62
-
63
- foreach ($_POST['ewd-ufaq-item'] as $Key=>$ID) {
64
- update_post_meta( intval( $ID ), 'ufaq_order', intval( $Key ) );
65
- }
66
-
67
- die();
68
- }
69
- add_action('wp_ajax_UFAQ_update_order','EWD_UFAQ_Save_Order');
70
-
71
- function EWD_UFAQ_Add_WC_FAQs(){
72
- $Post_ID = intval( $_POST['Post_ID'] );
73
-
74
- if (!is_numeric($Post_ID)) {return;}
75
-
76
- $Current_FAQs = get_post_meta($Post_ID, 'EWD_UFAQ_WC_Selected_FAQs', true );
77
- if (!is_array($Current_FAQs)) {$Current_FAQs = array();}
78
-
79
- $FAQs = json_decode(stripslashes_deep($_POST['FAQs']));
80
- if (!is_array($FAQs)) {$FAQs = array();}
81
-
82
- $Added_FAQs = array();
83
- foreach ($FAQs as $FAQ) {
84
- if (!in_array($FAQ, $Current_FAQs)) {
85
- $Current_FAQs[] = $FAQ;
86
-
87
- $FAQ_Post = get_post($FAQ);
88
- $Added_FAQs[] = array("ID" => $FAQ, "Name" => $FAQ_Post->post_title);
89
- }
90
- }
91
-
92
- update_post_meta($Post_ID, 'EWD_UFAQ_WC_Selected_FAQs', $Current_FAQs);
93
-
94
- echo json_encode($Added_FAQs);
95
-
96
- die();
97
- }
98
- add_action('wp_ajax_ewd_ufaq_add_wc_faqs','EWD_UFAQ_Add_WC_FAQs');
99
-
100
- function EWD_UFAQ_Delete_WC_FAQs(){
101
- $Post_ID = intval( $_POST['Post_ID'] );
102
-
103
- $Current_FAQs = get_post_meta($Post_ID, 'EWD_UFAQ_WC_Selected_FAQs', true );
104
- if (!is_array($Current_FAQs)) {$Current_FAQs = array();}
105
-
106
- $FAQs = json_decode(stripslashes_deep($_POST['FAQs']));
107
- if (!is_array($FAQs)) {$FAQs = array();}
108
-
109
- $Remaining_FAQs = array_diff($Current_FAQs, $FAQs);
110
-
111
- update_post_meta($Post_ID, 'EWD_UFAQ_WC_Selected_FAQs', $Remaining_FAQs);
112
-
113
- die();
114
- }
115
- add_action('wp_ajax_ewd_ufaq_delete_wc_faqs','EWD_UFAQ_Delete_WC_FAQs');
116
-
117
- function EWD_UFAQ_WC_FAQ_Category() {
118
- $Cat_ID = sanitize_text_field($_POST['Cat_ID']);
119
-
120
- $args = array("numberposts" => -1, "post_type" => 'ufaq');
121
- if ($Cat_ID != "") {
122
- $args['tax_query'] = array(array(
123
- 'taxonomy' => 'ufaq-category',
124
- 'terms' => $Cat_ID
125
- ));
126
- }
127
- $All_FAQs = get_posts($args);
128
-
129
- $ReturnString .= "<table class='form-table ewd-ufaq-faq-add-table'>";
130
- $ReturnString .= "<tr>";
131
- $ReturnString .= "<th>" . __("Add?", 'ultimate-faqs') . "</th>";
132
- $ReturnString .= "<th>" . __("FAQ", 'ultimate-faqs') . "</th>";
133
- $ReturnString .= "</tr>";
134
- foreach ($All_FAQs as $FAQ) {
135
- $ReturnString .= "<tr class='ewd-ufaq-faq-row' data-faqid='" . $FAQ->ID . "'>";
136
- $ReturnString .= "<td><input type='checkbox' class='ewd-ufaq-add-faq' name='Add_FAQs[]' value='" . $FAQ->ID . "'/></td>";
137
- $ReturnString .= "<td>" . $FAQ->post_title . "</td>";
138
- $ReturnString .= "</tr>";
139
- }
140
- $ReturnString .= "</table>";
141
-
142
- echo $ReturnString;
143
-
144
- die();
145
- }
146
- add_action('wp_ajax_ewd_ufaq_wc_faq_category','EWD_UFAQ_WC_FAQ_Category');
147
-
148
- function EWD_UFAQ_Hide_Review_Ask() {
149
- $Ask_Review_Date = sanitize_text_field($_POST['Ask_Review_Date']);
150
-
151
- if (get_option('EWD_UFAQ_Ask_Review_Date') < time()+3600*24*$Ask_Review_Date) {
152
- update_option('EWD_UFAQ_Ask_Review_Date', time()+3600*24*$Ask_Review_Date);
153
- }
154
-
155
- die();
156
- }
157
- add_action('wp_ajax_ewd_ufaq_hide_review_ask','EWD_UFAQ_Hide_Review_Ask');
158
-
159
- function EWD_UFAQ_Send_Feedback() {
160
- $headers = 'Content-type: text/html;charset=utf-8' . "\r\n";
161
- $Feedback = sanitize_text_field($_POST['Feedback']);
162
- $Feedback .= '<br /><br />Email Address: ';
163
- $Feedback .= sanitize_text_field($_POST['EmailAddress']);
164
-
165
- wp_mail('contact@etoilewebdesign.com', 'UFAQ Feedback - Dashboard Form', $Feedback, $headers);
166
-
167
- die();
168
- }
169
- add_action('wp_ajax_ewd_ufaq_send_feedback','EWD_UFAQ_Send_Feedback');
170
-
171
- function EWD_UFAQ_Dismiss_Pointers() {
172
- $uid = get_current_user_id();
173
- $pointers = explode( ',', (string) get_user_meta( $uid, 'dismissed_wp_pointers', TRUE ) );
174
-
175
- $pointers[] = 'ufaq_admin_pointers_tutorial-one';
176
- $pointers[] = 'ufaq_admin_pointers_tutorial-two';
177
- $pointers[] = 'ufaq_admin_pointers_tutorial-three';
178
- $pointers[] = 'ufaq_admin_pointers_tutorial-four';
179
- $pointers[] = 'ufaq_admin_pointers_tutorial-five';
180
- $pointers[] = 'ufaq_admin_pointers_tutorial-six';
181
-
182
- $unique_pointers = array_unique($pointers);
183
- update_usermeta($uid, 'dismissed_wp_pointers', implode(",", $unique_pointers));
184
-
185
- die();
186
- }
187
- add_action('wp_ajax_ufaq-dismiss-wp-pointers','EWD_UFAQ_Dismiss_Pointers');
188
-
189
- /* WPForms Search Suggestions */
190
- function EWD_UFAQ_WPForms_Results() {
191
- global $wpdb;
192
-
193
- $post_count = get_option( 'EWD_UFAQ_WPForms_Post_Count' );
194
-
195
- $search_string = sanitize_text_field( $_POST['search_string'] );
196
-
197
- $words = explode( ' ', $search_string );
198
-
199
- foreach ( $words as &$word ) { $word = trim( $word, '.,!?:;()$# '); }
200
-
201
- $unique_words = array_unique( $words );
202
-
203
- usort( $unique_words, 'EWD_UFAQ_Sort_By_String_Length' );
204
-
205
- $str_length = strlen( reset( $unique_words) );
206
- $search_string = '';
207
- $search_values = array();
208
- $matching_posts = array();
209
-
210
- // Go through the words in the message, starting with the longest, and search for FAQs that contain the same word
211
- // Continue by descending word length, until enough posts are found
212
- foreach ( $unique_words as $unique_word ) {
213
- if ( $str_length != strlen( $unique_word ) ) {
214
- $search_string_ready = substr( $search_string, 0, strlen($search_string) - 4 );
215
-
216
- $results = $wpdb->get_results( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='ufaq' AND post_status='publish' AND ( $search_string_ready ) ", $search_values ) );
217
-
218
- foreach ( $results as $result ) {
219
- $matching_posts[] = $result->ID;
220
- }
221
-
222
- $unique_posts = array_unique( $matching_posts );
223
- $matching_posts = $unique_posts;
224
-
225
- if ( sizeof( $matching_posts ) >= $post_count or strlen( $unique_word ) <= 3 ) { break; }
226
-
227
- $search_string = '';
228
- $search_values = array();
229
- $str_length = strlen( $unique_word );
230
- }
231
-
232
- $search_string .= "post_content LIKE '%%%s%%' OR post_title LIKE '%%%s%%' OR ";
233
- $search_values[] = $unique_word;
234
- $search_values[] = $unique_word;
235
- }
236
-
237
- $final_posts = array_slice( $matching_posts, 0, $post_count );
238
- $final_posts_string = implode( ',', $final_posts );
239
-
240
- $ReturnArray['request_count'] = intval( $_POST['request_count'] );
241
-
242
- if ( sizeof( $final_posts ) > 0 ) {
243
- $response = do_shortcode("[ultimate-faqs current_url='" . sanitize_text_field($_POST['current_url']) . "' post__in_string='" . $final_posts_string . "' ajax='Yes']");
244
- $ReturnArray['message'] = $response;
245
- }
246
- else {
247
- $ReturnArray['message'] = false;
248
- }
249
-
250
- echo json_encode($ReturnArray);
251
-
252
- die();
253
- }
254
- add_action( 'wp_ajax_ufaq_wpforms_search', 'EWD_UFAQ_WPForms_Results' );
255
- add_action( 'wp_ajax_nopriv_ufaq_wpforms_search', 'EWD_UFAQ_WPForms_Results' );
256
-
257
- function EWD_UFAQ_Sort_By_String_Length( $a, $b ) {
258
- if ( function_exists( 'mb_strlen' ) ) { return mb_strlen( $b ) - mb_strlen( $a ); }
259
-
260
- return strlen( $b ) - strlen( $a );
261
- }
262
-
263
-
264
- /* WELCOME SCREEN AJAX INSTALL FUNCTIONS */
265
- function EWD_UFAQ_AJAX_Add_Category() {
266
-
267
- $Category_Name = isset($_POST['category_name']) ? sanitize_text_field( $_POST['category_name'] ) : '';
268
- $Category_Description = isset($_POST['category_description']) ? sanitize_text_field($_POST['category_description']) : '';
269
-
270
- $Category_Term_IDs = wp_insert_term( $Category_Name, 'ufaq-category', array('description' => $Category_Description) );
271
-
272
- echo json_encode( array( 'category_name' => $Category_Name, 'category_id' => $Category_Term_IDs['term_id'] ) );
273
-
274
- exit();
275
- }
276
- add_action('wp_ajax_ewd_ufaq_welcome_add_category', 'EWD_UFAQ_AJAX_Add_Category');
277
-
278
- function EWD_UFAQ_AJAX_Add_FAQ_Page() {
279
- wp_insert_post(array(
280
- 'post_title' => (isset($_POST['faq_page_title']) ? sanitize_text_field($_POST['faq_page_title']) : ''),
281
- 'post_content' => '<!-- wp:paragraph --><p> [ultimate-faqs] </p><!-- /wp:paragraph -->',
282
- 'post_status' => 'publish',
283
- 'post_type' => 'page'
284
- ));
285
-
286
- exit();
287
- }
288
- add_action('wp_ajax_ewd_ufaq_welcome_add_faq_page', 'EWD_UFAQ_AJAX_Add_FAQ_Page');
289
-
290
- function EWD_UFAQ_AJAX_Set_Options() {
291
- update_option("EWD_UFAQ_FAQ_Accordion", sanitize_text_field( $_POST['faq_accordion'] ) );
292
- update_option("EWD_UFAQ_Toggle", sanitize_text_field( $_POST['faq_toggle'] ) );
293
- update_option("EWD_UFAQ_Group_By_Category", sanitize_text_field( $_POST['group_by_category'] ) );
294
- update_option("EWD_UFAQ_Order_By", sanitize_text_field( $_POST['order_by_setting'] ) );
295
-
296
- exit();
297
- }
298
- add_action('wp_ajax_ewd_ufaq_welcome_set_options', 'EWD_UFAQ_AJAX_Set_Options');
299
-
300
- function EWD_UFAQ_AJAX_Add_FAQ() {
301
- $FAQ_Post_ID = wp_insert_post(array(
302
- 'post_title' => (isset($_POST['faq_question']) ? sanitize_text_field($_POST['faq_question']) : ''),
303
- 'post_content' => (isset($_POST['faq_answer']) ? sanitize_text_field($_POST['faq_answer']) : ''),
304
- 'post_status' => 'publish',
305
- 'post_type' => 'ufaq'
306
- ));
307
-
308
-
309
- if (isset($_POST['faq_category']) and $_POST['faq_category']) {
310
- wp_set_post_terms($FAQ_Post_ID, sanitize_text_field( $_POST['faq_category'] ), 'ufaq-category');
311
- }
312
-
313
- exit();
314
- }
315
- add_action('wp_ajax_ewd_ufaq_welcome_add_faq', 'EWD_UFAQ_AJAX_Add_FAQ');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/Register_EWD_UFAQ_Posts_Taxonomies.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
- add_action( 'init', 'EWD_UFAQ_Create_Posttype' );
3
- function EWD_UFAQ_Create_Posttype() {
4
- $Slug_Base = get_option("EWD_UFAQ_Slug_Base");
5
- if ($Slug_Base == '') {$Slug_Base = 'ufaqs';}
6
-
7
- $labels = array(
8
- 'name' => __('FAQs', 'ultimate-faqs'),
9
- 'singular_name' => __('FAQ', 'ultimate-faqs'),
10
- 'menu_name' => __('FAQs', 'ultimate-faqs'),
11
- 'add_new' => __('Add New', 'ultimate-faqs'),
12
- 'add_new_item' => __('Add New FAQ', 'ultimate-faqs'),
13
- 'edit_item' => __('Edit FAQ', 'ultimate-faqs'),
14
- 'new_item' => __('New FAQ', 'ultimate-faqs'),
15
- 'view_item' => __('View FAQ', 'ultimate-faqs'),
16
- 'search_items' => __('Search FAQs', 'ultimate-faqs'),
17
- 'not_found' => __('Nothing found', 'ultimate-faqs'),
18
- 'not_found_in_trash' => __('Nothing found in Trash', 'ultimate-faqs'),
19
- 'parent_item_colon' => ''
20
- );
21
-
22
- $args = array(
23
- 'labels' => $labels,
24
- 'public' => true,
25
- 'publicly_queryable' => true,
26
- 'show_ui' => true,
27
- 'query_var' => true,
28
- 'has_archive' => true,
29
- 'menu_icon' => null,
30
- 'rewrite' => array('slug' => $Slug_Base),
31
- 'capability_type' => 'post',
32
- 'menu_position' => null,
33
- 'menu_icon' => 'dashicons-format-status',
34
- 'supports' => array('title','editor','author','excerpt','comments'),
35
- 'show_in_rest' => true
36
- );
37
-
38
- register_post_type( 'ufaq' , $args );
39
- }
40
-
41
- function EWD_UFAQ_Create_Category_Taxonomy() {
42
-
43
- register_taxonomy('ufaq-category', 'ufaq', array(
44
- // Hierarchical taxonomy (like categories)
45
- 'hierarchical' => true,
46
- // This array of options controls the labels displayed in the WordPress Admin UI
47
- 'labels' => array(
48
- 'name' => __('FAQ Categories', 'ultimate-faqs'),
49
- 'singular_name' => __('FAQ Category', 'ultimate-faqs'),
50
- 'search_items' => __('Search FAQ Categories', 'ultimate-faqs'),
51
- 'all_items' => __('All FAQ Categories', 'ultimate-faqs'),
52
- 'parent_item' => __('Parent FAQ Category', 'ultimate-faqs'),
53
- 'parent_item_colon' => __('Parent FAQ Category:', 'ultimate-faqs'),
54
- 'edit_item' => __('Edit FAQ Category', 'ultimate-faqs'),
55
- 'update_item' => __('Update FAQ Category', 'ultimate-faqs'),
56
- 'add_new_item' => __('Add New FAQ Category', 'ultimate-faqs'),
57
- 'new_item_name' => __('New FAQ Category Name', 'ultimate-faqs'),
58
- 'menu_name' => __('FAQ Categories', 'ultimate-faqs'),
59
- ),
60
- 'query_var' => true,
61
- 'show_in_rest' => true
62
- ));
63
-
64
- register_taxonomy('ufaq-tag', 'ufaq', array(
65
- // Hierarchical taxonomy (like categories)
66
- 'hierarchical' => false,
67
- // This array of options controls the labels displayed in the WordPress Admin UI
68
- 'labels' => array(
69
- 'name' => __('FAQ Tags', 'ultimate-faqs'),
70
- 'singular_name' => __('FAQ Tag', 'ultimate-faqs'),
71
- 'search_items' => __('Search FAQ Tags', 'ultimate-faqs'),
72
- 'all_items' => __('All FAQ Tags', 'ultimate-faqs'),
73
- 'parent_item' => __('Parent FAQ Tag', 'ultimate-faqs'),
74
- 'parent_item_colon' => __('Parent FAQ Tag:', 'ultimate-faqs'),
75
- 'edit_item' => __('Edit FAQ Tag', 'ultimate-faqs'),
76
- 'update_item' => __('Update FAQ Tag', 'ultimate-faqs'),
77
- 'add_new_item' => __('Add New FAQ Tag', 'ultimate-faqs'),
78
- 'new_item_name' => __('New FAQ Tag Name', 'ultimate-faqs'),
79
- 'menu_name' => __('FAQ Tags', 'ultimate-faqs'),
80
- ),
81
- 'show_in_rest' => true
82
- ));
83
- }
84
- add_action( 'init', 'EWD_UFAQ_Create_Category_Taxonomy', 0 );
85
-
86
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/Update_Admin_Databases.php DELETED
@@ -1,214 +0,0 @@
1
- <?php
2
- /* The file contains all of the functions which make changes to the WordPress tables */
3
-
4
- function EWD_UFAQ_Add_Post_Order_Meta($post_id) {
5
- $Current_Order = get_post_meta($post_id, "ufaq_order", true);
6
-
7
- if ($Current_Order == "") {
8
- update_post_meta($post_id, "ufaq_order", 1000);
9
- }
10
- }
11
- add_action('save_post_ufaq', 'EWD_UFAQ_Add_Post_Order_Meta');
12
-
13
- function EWD_UFAQ_UpdateOptions() {
14
- global $UFAQ_Full_Version;
15
-
16
- if ( ! isset( $_POST['EWD_UFAQ_Save_Options_Nonce'] ) ) {return;}
17
-
18
- if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Save_Options_Nonce'], 'EWD_UFAQ_Save_Options' ) ) {return;}
19
-
20
- if ( get_option( "EWD_UFAQ_Access_Role" ) != '' and !current_user_can( get_option( "EWD_UFAQ_Access_Role" ) ) ) { return; }
21
-
22
- $Custom_CSS = isset( $_POST['custom_css'] ) ? EWD_UFAQ_Validate_CSS( $_POST['custom_css'] ) : null;
23
- $Social_Media_Array = ( isset( $_POST['Socialmedia'] ) and is_array( $_POST['Socialmedia'] ) ) ? $_POST['Socialmedia'] : array();
24
- array_walk( $Social_Media_Array, 'sanitize_text_field' );
25
- if ( is_array( $Social_Media_Array ) ) { $Social_Media = implode( ",", $Social_Media_Array ); }
26
-
27
- $Custom_CSS = stripslashes_deep($Custom_CSS);
28
-
29
- if (isset($_POST['Options_Submit'])) {update_option('EWD_UFAQ_Custom_CSS', $Custom_CSS);}
30
- if (isset($_POST['faq_toggle'])) {update_option('EWD_UFAQ_Toggle', sanitize_text_field($_POST['faq_toggle']));}
31
- if (isset($_POST['faq_category_toggle'])) {update_option('EWD_UFAQ_Category_Toggle', sanitize_text_field($_POST['faq_category_toggle']));}
32
- if (isset($_POST['faq_category_accordion'])) {update_option('EWD_UFAQ_Category_Accordion', sanitize_text_field($_POST['faq_category_accordion']));}
33
- if (isset($_POST['expand_collapse_all'])) {update_option('EWD_UFAQ_Expand_Collapse_All', sanitize_text_field($_POST['expand_collapse_all']));}
34
- if (isset($_POST['faq_accordion'])) {update_option('EWD_UFAQ_FAQ_Accordion', sanitize_text_field($_POST['faq_accordion']));}
35
- if (isset($_POST['faq_auto_complete_titles'])) {update_option('EWD_UFAQ_Auto_Complete_Titles', sanitize_text_field($_POST['faq_auto_complete_titles']));}
36
- if (isset($_POST['hide_categories'])) {update_option('EWD_UFAQ_Hide_Categories', sanitize_text_field($_POST['hide_categories']));}
37
- if (isset($_POST['hide_tags'])) {update_option('EWD_UFAQ_Hide_Tags', sanitize_text_field($_POST['hide_tags']));}
38
- if (isset($_POST['scroll_to_top'])) {update_option('EWD_UFAQ_Scroll_To_Top', sanitize_text_field($_POST['scroll_to_top']));}
39
- if (isset($_POST['display_all_answers'])) {update_option('EWD_UFAQ_Display_All_Answers', sanitize_text_field($_POST['display_all_answers']));}
40
- if (isset($_POST['display_author'])) {update_option('EWD_UFAQ_Display_Author', sanitize_text_field($_POST['display_author']));}
41
- if (isset($_POST['display_date'])) {update_option('EWD_UFAQ_Display_Date', sanitize_text_field($_POST['display_date']));}
42
- if (isset($_POST['display_back_to_top'])) {update_option('EWD_UFAQ_Display_Back_To_Top', sanitize_text_field($_POST['display_back_to_top']));}
43
- if (isset($_POST['include_permalink'])) {update_option('EWD_UFAQ_Include_Permalink', sanitize_text_field($_POST['include_permalink']));}
44
- if (isset($_POST['permalink_type'])) {update_option('EWD_UFAQ_Permalink_Type', sanitize_text_field($_POST['permalink_type']));}
45
- if (isset($_POST['show_tinymce'])) {update_option('EWD_UFAQ_Show_TinyMCE', sanitize_text_field($_POST['show_tinymce']));}
46
- if (isset($_POST['comments_on'])) {update_option('EWD_UFAQ_Comments_On', sanitize_text_field($_POST['comments_on']));}
47
- if (isset($_POST['disable_microdata'])) {update_option('EWD_UFAQ_Disable_Microdata', sanitize_text_field($_POST['disable_microdata']));}
48
- if (isset($_POST['access_role'])) {update_option('EWD_UFAQ_Access_Role', sanitize_text_field($_POST['access_role']));}
49
-
50
- if (isset($_POST['display_style']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Display_Style', sanitize_text_field($_POST['display_style']));}
51
- if (isset($_POST['faq_number_of_columns']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_FAQ_Number_Of_Columns', sanitize_text_field($_POST['faq_number_of_columns']));}
52
- if (isset($_POST['responsive_columns']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Responsive_Columns', sanitize_text_field($_POST['responsive_columns']));}
53
- if (isset($_POST['color_block_shape']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Color_Block_Shape', sanitize_text_field($_POST['color_block_shape']));}
54
- if (isset($_POST['Options_Submit']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_FAQs_Per_Page', sanitize_text_field($_POST['faqs_per_page']));}
55
- if (isset($_POST['faq_ratings']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_FAQ_Ratings', sanitize_text_field($_POST['faq_ratings']));}
56
- $ThumbsUpImageLink = Prepare_Thumbs_Up_Image();
57
- if (isset($_POST['Thumbs_Up_Image']) and $UFAQ_Full_Version == "Yes") {update_option("EWD_UFAQ_Thumbs_Up_Image", esc_url_raw( $ThumbsUpImageLink ) );}
58
- $ThumbsDownImageLink = Prepare_Thumbs_Down_Image();
59
- if (isset($_POST['Thumbs_Down_Image']) and $UFAQ_Full_Version == "Yes") {update_option("EWD_UFAQ_Thumbs_Down_Image", esc_url_raw( $ThumbsDownImageLink ) );}
60
- if (isset($_POST['page_type']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Page_Type', sanitize_text_field($_POST['page_type']));}
61
- if (isset($_POST['woocommerce_faqs']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_WooCommerce_FAQs', sanitize_text_field($_POST['woocommerce_faqs']));}
62
- if (isset($_POST['use_product']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Use_Product', sanitize_text_field($_POST['use_product']));}
63
- if (isset($_POST['wpforms_integration']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_WPForms_Integration', sanitize_text_field($_POST['wpforms_integration']));}
64
- if (isset($_POST['wpforms_post_count']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_WPForms_Post_Count', sanitize_text_field($_POST['wpforms_post_count']));}
65
- if (isset($_POST['wpforms_faq_location']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_WPForms_FAQ_Location', sanitize_text_field($_POST['wpforms_faq_location']));}
66
- if (isset($_POST['reveal_effect']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Reveal_Effect', sanitize_text_field($_POST['reveal_effect']));}
67
- if (isset($_POST['pretty_permalinks']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Pretty_Permalinks', sanitize_text_field($_POST['pretty_permalinks']));}
68
- if (isset($_POST['allow_proposed_answer']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Allow_Proposed_Answer', sanitize_text_field($_POST['allow_proposed_answer']));}
69
- if (isset($_POST['submit_custom_fields']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Submit_Custom_Fields', sanitize_text_field($_POST['submit_custom_fields']));}
70
- if (isset($_POST['submit_question_captcha']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Submit_Question_Captcha', sanitize_text_field($_POST['submit_question_captcha']));}
71
- if (isset($_POST['submitted_default_category']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Submitted_Default_Category', sanitize_text_field($_POST['submitted_default_category']));}
72
- if (isset($_POST['admin_question_notification']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Admin_Question_Notification', sanitize_text_field($_POST['admin_question_notification']));}
73
- if (isset($_POST['Options_Submit']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Admin_Notification_Email', sanitize_text_field($_POST['admin_notification_email']));}
74
- if (isset($_POST['submit_faq_email']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Submit_FAQ_Email', sanitize_text_field($_POST['submit_faq_email']));}
75
- if (isset($_POST['faq_auto_complete_titles']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Auto_Complete_Titles', sanitize_text_field($_POST['faq_auto_complete_titles']));}
76
- if (isset($_POST['highlight_search_term']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Highlight_Search_Term', sanitize_text_field($_POST['highlight_search_term']));}
77
- if (isset($_POST['slug_base']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Slug_Base', sanitize_text_field( $_POST['slug_base'] ) );}
78
- if (isset($_POST['Socialmedia']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Social_Media', $Social_Media);}
79
-
80
- $FAQ_Elements = array();
81
- for ($i=0; $i<=9; $i++) {
82
- $FAQ_Elements[] = sanitize_text_field( $_POST['Element_' . $i] );
83
- }
84
- if (isset($_POST['Options_Submit'])) {update_option('EWD_UFAQ_FAQ_Elements', $FAQ_Elements);}
85
-
86
- if (isset($_POST['group_by_category'])) {update_option('EWD_UFAQ_Group_By_Category', sanitize_text_field($_POST['group_by_category']));}
87
- if (isset($_POST['group_by_category_count'])) {update_option('EWD_UFAQ_Group_By_Category_Count', sanitize_text_field($_POST['group_by_category_count']));}
88
- if (isset($_POST['group_by_order_by'])) {update_option('EWD_UFAQ_Group_By_Order_By', sanitize_text_field($_POST['group_by_order_by']));}
89
- if (isset($_POST['group_by_order'])) {update_option('EWD_UFAQ_Group_By_Order', sanitize_text_field($_POST['group_by_order']));}
90
- if (isset($_POST['order_by_setting'])) {update_option('EWD_UFAQ_Order_By', sanitize_text_field($_POST['order_by_setting']));}
91
- if (isset($_POST['order_setting'])) {update_option('EWD_UFAQ_Order', sanitize_text_field($_POST['order_setting']));}
92
-
93
- $Counter = 0;
94
- $Custom_Fields = array();
95
- while ($Counter < 30) {
96
- if (isset($_POST['Custom_Field_' . $Counter . '_Name'])) {
97
- $Prefix = 'Custom_Field_' . $Counter;
98
-
99
- $Custom_Field_Item['FieldID'] = sanitize_text_field($_POST[$Prefix . '_ID']);
100
- $Custom_Field_Item['FieldName'] = sanitize_text_field($_POST[$Prefix . '_Name']);
101
- $Custom_Field_Item['FieldType'] = sanitize_text_field($_POST[$Prefix . '_Type']);
102
- $Custom_Field_Item['FieldValues'] = sanitize_text_field($_POST[$Prefix . '_Values']);
103
-
104
- $Custom_Fields[] = $Custom_Field_Item;
105
- unset($Custom_Field_Item);
106
- }
107
- $Counter++;
108
- }
109
-
110
- if (isset($_POST['Options_Submit'])) {update_option('EWD_UFAQ_FAQ_Fields', $Custom_Fields);}
111
- if (isset($_POST['hide_blank_fields'])) {update_option('EWD_UFAQ_Hide_Blank_Fields', sanitize_text_field($_POST['hide_blank_fields']));}
112
-
113
-
114
- if (isset($_POST['posted_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Posted_Label', sanitize_text_field($_POST['posted_label']));}
115
- if (isset($_POST['by_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_By_Label', sanitize_text_field($_POST['by_label']));}
116
- if (isset($_POST['on_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_On_Label', sanitize_text_field($_POST['on_label']));}
117
- if (isset($_POST['category_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Category_Label', sanitize_text_field($_POST['category_label']));}
118
- if (isset($_POST['tag_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Tag_Label', sanitize_text_field($_POST['tag_label']));}
119
- if (isset($_POST['enter_question_label'])) {update_option('EWD_UFAQ_Enter_Question_Label', sanitize_text_field($_POST['enter_question_label']));}
120
- if (isset($_POST['search_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Search_Label', sanitize_text_field($_POST['search_label']));}
121
- if (isset($_POST['permalink_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Permalink_Label', sanitize_text_field($_POST['permalink_label']));}
122
- if (isset($_POST['back_to_top_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Back_To_Top_Label', sanitize_text_field($_POST['back_to_top_label']));}
123
- if (isset($_POST['woocommerce_tab_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_WooCommerce_Tab_Label', sanitize_text_field($_POST['woocommerce_tab_label']));}
124
- if (isset($_POST['share_faq_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Share_FAQ_Label', sanitize_text_field($_POST['share_faq_label']));}
125
- if (isset($_POST['find_faq_helpful_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Find_FAQ_Helpful_Label', sanitize_text_field($_POST['find_faq_helpful_label']));}
126
- if (isset($_POST['search_placeholder_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Search_Placeholder_Label', sanitize_text_field($_POST['search_placeholder_label']));}
127
-
128
- if (isset($_POST['thank_you_submit_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Thank_You_Submit_Label', sanitize_text_field($_POST['thank_you_submit_label']));}
129
- if (isset($_POST['submit_question_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Submit_Question_Label', sanitize_text_field($_POST['submit_question_label']));}
130
- if (isset($_POST['please_fill_form_below_label'])) {update_option('EWD_UFAQ_Please_Fill_Form_Below_Label', sanitize_text_field($_POST['please_fill_form_below_label']));}
131
- if (isset($_POST['send_question_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Send_Question_Label', sanitize_text_field($_POST['send_question_label']));}
132
- if (isset($_POST['question_title_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Question_Title_Label', sanitize_text_field($_POST['question_title_label']));}
133
- if (isset($_POST['what_question_being_answered_label'])) {update_option('EWD_UFAQ_What_Question_Being_Answered_Label', sanitize_text_field($_POST['what_question_being_answered_label']));}
134
- if (isset($_POST['proposed_answer_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Proposed_Answer_Label', sanitize_text_field($_POST['proposed_answer_label']));}
135
- if (isset($_POST['review_author_label']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Review_Author_Label', sanitize_text_field($_POST['review_author_label']));}
136
- if (isset($_POST['what_name_with_review_label'])) {update_option('EWD_UFAQ_What_Name_With_Review_Label', sanitize_text_field($_POST['what_name_with_review_label']));}
137
- if (isset($_POST['captcha_image_number_label'])) {update_option('EWD_UFAQ_Captcha_Image_Number_Label', sanitize_text_field($_POST['captcha_image_number_label']));}
138
- if (isset($_POST['retrieving_results']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Retrieving_Results', sanitize_text_field($_POST['retrieving_results']));}
139
- if (isset($_POST['no_results_found_text']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_No_Results_Found_Text', sanitize_text_field($_POST['no_results_found_text']));}
140
-
141
- if (isset($_POST['ufaq_styling_default_bg_color'])) {update_option('EWD_UFAQ_Styling_Default_Bg_Color', sanitize_hex_color($_POST['ufaq_styling_default_bg_color']));}
142
- if (isset($_POST['ufaq_styling_default_font_color'])) {update_option('EWD_UFAQ_Styling_Default_Font_Color', sanitize_hex_color($_POST['ufaq_styling_default_font_color']));}
143
- if (isset($_POST['ufaq_styling_default_border_size'])) {update_option('EWD_UFAQ_Styling_Default_Border_Size', sanitize_text_field($_POST['ufaq_styling_default_border_size']));}
144
- if (isset($_POST['ufaq_styling_default_border_color'])) {update_option('EWD_UFAQ_Styling_Default_Border_Color', sanitize_hex_color($_POST['ufaq_styling_default_border_color']));}
145
- if (isset($_POST['ufaq_styling_default_border_radius'])) {update_option('EWD_UFAQ_Styling_Default_Border_Radius', sanitize_text_field($_POST['ufaq_styling_default_border_radius']));}
146
- if (isset($_POST['ufaq_styling_toggle_symbol_size'])) {update_option('EWD_UFAQ_Styling_Toggle_Symbol_Size', sanitize_text_field($_POST['ufaq_styling_toggle_symbol_size']));}
147
- if (isset($_POST['ufaq_styling_block_bg_color'])) {update_option('EWD_UFAQ_Styling_Block_Bg_Color', sanitize_hex_color($_POST['ufaq_styling_block_bg_color']));}
148
- if (isset($_POST['ufaq_styling_block_font_color'])) {update_option('EWD_UFAQ_Styling_Block_Font_Color', sanitize_hex_color($_POST['ufaq_styling_block_font_color']));}
149
- if (isset($_POST['ufaq_styling_list_font'])) {update_option('EWD_UFAQ_Styling_List_Font', sanitize_text_field($_POST['ufaq_styling_list_font']));}
150
- if (isset($_POST['ufaq_styling_list_font_size'])) {update_option('EWD_UFAQ_Styling_List_Font_Size', sanitize_text_field($_POST['ufaq_styling_list_font_size']));}
151
- if (isset($_POST['ufaq_styling_list_font_color'])) {update_option('EWD_UFAQ_Styling_List_Font_Color', sanitize_hex_color($_POST['ufaq_styling_list_font_color']));}
152
- if (isset($_POST['ufaq_styling_list_margin'])) {update_option('EWD_UFAQ_Styling_List_Margin', sanitize_text_field($_POST['ufaq_styling_list_margin']));}
153
- if (isset($_POST['ufaq_styling_list_padding'])) {update_option('EWD_UFAQ_Styling_List_Padding', sanitize_text_field($_POST['ufaq_styling_list_padding']));}
154
-
155
- if (isset($_POST['ufaq_styling_question_font'])) {update_option('EWD_UFAQ_Styling_Question_Font', sanitize_text_field($_POST['ufaq_styling_question_font']));}
156
- if (isset($_POST['ufaq_styling_question_font_size'])) {update_option('EWD_UFAQ_Styling_Question_Font_Size', sanitize_text_field($_POST['ufaq_styling_question_font_size']));}
157
- if (isset($_POST['ufaq_styling_question_font_color'])) {update_option('EWD_UFAQ_Styling_Question_Font_Color', sanitize_hex_color($_POST['ufaq_styling_question_font_color']));}
158
- if (isset($_POST['ufaq_styling_question_margin'])) {update_option('EWD_UFAQ_Styling_Question_Margin', sanitize_text_field($_POST['ufaq_styling_question_margin']));}
159
- if (isset($_POST['ufaq_styling_question_padding'])) {update_option('EWD_UFAQ_Styling_Question_Padding', sanitize_text_field($_POST['ufaq_styling_question_padding']));}
160
- if (isset($_POST['ufaq_styling_question_icon_top_margin'])) {update_option('EWD_UFAQ_Styling_Question_Icon_Top_Margin', sanitize_text_field($_POST['ufaq_styling_question_icon_top_margin']));}
161
- if (isset($_POST['ufaq_styling_answer_font'])) {update_option('EWD_UFAQ_Styling_Answer_Font', sanitize_text_field($_POST['ufaq_styling_answer_font']));}
162
- if (isset($_POST['ufaq_styling_answer_font_size'])) {update_option('EWD_UFAQ_Styling_Answer_Font_Size', sanitize_text_field($_POST['ufaq_styling_answer_font_size']));}
163
- if (isset($_POST['ufaq_styling_answer_font_color'])) {update_option('EWD_UFAQ_Styling_Answer_Font_Color', sanitize_hex_color($_POST['ufaq_styling_answer_font_color']));}
164
- if (isset($_POST['ufaq_styling_answer_margin'])) {update_option('EWD_UFAQ_Styling_Answer_Margin', sanitize_text_field($_POST['ufaq_styling_answer_margin']));}
165
- if (isset($_POST['ufaq_styling_answer_padding'])) {update_option('EWD_UFAQ_Styling_Answer_Padding', sanitize_text_field($_POST['ufaq_styling_answer_padding']));}
166
- if (isset($_POST['ufaq_styling_postdate_font'])) {update_option('EWD_UFAQ_Styling_Postdate_Font', sanitize_text_field($_POST['ufaq_styling_postdate_font']));}
167
- if (isset($_POST['ufaq_styling_postdate_font_size'])) {update_option('EWD_UFAQ_Styling_Postdate_Font_Size', sanitize_text_field($_POST['ufaq_styling_postdate_font_size']));}
168
- if (isset($_POST['ufaq_styling_postdate_font_color'])) {update_option('EWD_UFAQ_Styling_Postdate_Font_Color', sanitize_hex_color($_POST['ufaq_styling_postdate_font_color']));}
169
- if (isset($_POST['ufaq_styling_postdate_margin'])) {update_option('EWD_UFAQ_Styling_Postdate_Margin', sanitize_text_field($_POST['ufaq_styling_postdate_margin']));}
170
- if (isset($_POST['ufaq_styling_postdate_padding'])) {update_option('EWD_UFAQ_Styling_Postdate_Padding', sanitize_text_field($_POST['ufaq_styling_postdate_padding']));}
171
- if (isset($_POST['ufaq_styling_category_heading_font'])) {update_option('EWD_UFAQ_Styling_Category_Heading_Font', sanitize_text_field($_POST['ufaq_styling_category_heading_font']));}
172
- if (isset($_POST['ufaq_styling_category_heading_font_size'])) {update_option('EWD_UFAQ_Styling_Category_Heading_Font_Size', sanitize_text_field($_POST['ufaq_styling_category_heading_font_size']));}
173
- if (isset($_POST['ufaq_styling_category_heading_font_color'])) {update_option('EWD_UFAQ_Styling_Category_Heading_Font_Color', sanitize_hex_color($_POST['ufaq_styling_category_heading_font_color']));}
174
- if (isset($_POST['ufaq_styling_category_font'])) {update_option('EWD_UFAQ_Styling_Category_Font', sanitize_text_field($_POST['ufaq_styling_category_font']));}
175
- if (isset($_POST['ufaq_styling_category_font_size'])) {update_option('EWD_UFAQ_Styling_Category_Font_Size', sanitize_text_field($_POST['ufaq_styling_category_font_size']));}
176
- if (isset($_POST['ufaq_styling_category_font_color'])) {update_option('EWD_UFAQ_Styling_Category_Font_Color', sanitize_hex_color($_POST['ufaq_styling_category_font_color']));}
177
- if (isset($_POST['ufaq_styling_category_margin'])) {update_option('EWD_UFAQ_Styling_Category_Margin', sanitize_text_field($_POST['ufaq_styling_category_margin']));}
178
- if (isset($_POST['ufaq_styling_category_padding'])) {update_option('EWD_UFAQ_Styling_Category_Padding', sanitize_text_field($_POST['ufaq_styling_category_padding']));}
179
-
180
- if (isset($_POST['ufaq_styling_category_heading_type'])) {update_option('EWD_UFAQ_Styling_Category_Heading_Type', sanitize_text_field($_POST['ufaq_styling_category_heading_type']));}
181
- if (isset($_POST['ufaq_styling_faq_heading_type'])) {update_option('EWD_UFAQ_Styling_FAQ_Heading_Type', sanitize_text_field($_POST['ufaq_styling_faq_heading_type']));}
182
- if (isset($_POST['toggle_symbol'])) {update_option('EWD_UFAQ_Toggle_Symbol', sanitize_text_field($_POST['toggle_symbol']));}
183
-
184
- if (isset($_POST['Pretty_Permalinks']) and $_POST['Pretty_Permalinks'] == "Yes") {
185
- update_option("EWD_UFAQ_Rewrite_Rules", "Yes");
186
- }
187
- }
188
-
189
- function EWD_UFAQ_Validate_CSS($CSS) {
190
- require_once( EWD_UFAQ_CD_PLUGIN_PATH . 'css/CSSTidy/class.csstidy.php' );
191
-
192
- $CSSTidy = new csstidy();
193
-
194
- $CSSTidy->set_cfg( 'remove_bslash', false );
195
- $CSSTidy->set_cfg( 'compress_colors', false );
196
- $CSSTidy->set_cfg( 'compress_font-weight', false );
197
- $CSSTidy->set_cfg( 'optimise_shorthands', 0 );
198
- $CSSTidy->set_cfg( 'remove_last_;', false );
199
- $CSSTidy->set_cfg( 'case_properties', false );
200
- $CSSTidy->set_cfg( 'discard_invalid_properties', false );
201
- $CSSTidy->set_cfg( 'css_level', 'CSS3.0' );
202
- $CSSTidy->set_cfg( 'preserve_css', true );
203
-
204
- $CSS = preg_replace( '/\\\\([0-9a-fA-F]{4})/', '\\\\\\\\$1', $CSS );
205
-
206
- $CSS = str_replace( '<=', '&lt;=', $CSS );
207
- $CSS = wp_kses_split($CSS, array(), array());
208
- $CSS = str_replace( '&gt;', '>', $CSS );
209
- $CSS = strip_tags( $CSS );
210
-
211
- $CSSTidy->parse( $CSS );
212
- return $CSSTidy->print->plain();
213
- }
214
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/Update_EWD_UFAQ_Content.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- /* This file is the action handler. The appropriate function is then called based
3
- * on the action that's been selected by the user. The functions themselves are all
4
- * stored either in Prepare_Data_For_Insertion.php or Update_Admin_Databases.php */
5
-
6
- function Update_EWD_UFAQ_Content() {
7
- global $ewd_ufaq_message;
8
- global $ews_ufaq_import;
9
- if (isset($_GET['Action'])) {
10
- switch ($_GET['Action']) {
11
- case "EWD_UFAQ_UpdateOptions":
12
- $ewd_ufaq_message = EWD_UFAQ_UpdateOptions();
13
- break;
14
- case "EWD_UFAQ_ImportFaqs":
15
- $ewd_ufaq_message = EWD_UFAQ_Import();
16
- break;
17
- case "EWD_UFAQ_ImportFaqsFromSpreadsheet":
18
- $ewd_ufaq_message = EWD_UFAQ_Import_From_Spreadsheet();
19
- break;
20
- case "EWD_UFAQ_ExportToPDF":
21
- $ewd_ufaq_message = EWD_UFAQ_Export_To_PDF();
22
- break;
23
- case "EWD_UFAQ_ExportToSpreadsheet":
24
- $ewd_ufaq_message = EWD_UFAQ_Export_To_Excel();
25
- break;
26
- default:
27
- $ewd_ufaq_message = __("The form has not worked correctly. Please contact the plugin developer.", 'EWD_UFAQP');
28
- break;
29
- }
30
- }
31
- }
32
-
33
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Main.php DELETED
@@ -1,414 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Ultimate FAQ - WordPress FAQ Plugin
4
- Plugin URI: https://www.etoilewebdesign.com/plugins/ultimate-faq/
5
- Description: Easily create and add FAQs to your WordPress site with a Gutenberg block, shortcode or widget. Includes FAQ schema, search, accordion toggle and more.
6
- Author: Etoile Web Design
7
- Author URI: https://www.etoilewebdesign.com/
8
- Terms and Conditions: https://www.etoilewebdesign.com/plugin-terms-and-conditions/
9
- Text Domain: ultimate-faqs
10
- Version: 1.9.12
11
- */
12
-
13
- global $ewd_ufaq_message;
14
- global $UFAQ_Full_Version;
15
- global $EWD_UFAQ_Version;
16
-
17
- $EWD_UFAQ_Version = '1.9.0';
18
-
19
- define( 'EWD_UFAQ_CD_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
20
- define( 'EWD_UFAQ_CD_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
21
-
22
- //define('WP_DEBUG', true);
23
-
24
- register_activation_hook(__FILE__,'Set_EWD_UFAQ_Options');
25
- register_activation_hook(__FILE__,'Run_UFAQ_Tutorial');
26
- register_activation_hook(__FILE__,'EWD_UFAQ_Show_Dashboard_Link');
27
- add_filter('upgrader_post_install', 'Set_EWD_UFAQ_Options');
28
-
29
- /* Hooks neccessary admin tasks */
30
- if ( is_admin() ){
31
- add_action('widgets_init', 'Update_EWD_UFAQ_Content');
32
- add_action('admin_notices', 'EWD_UFAQ_Error_Notices');
33
- add_action('admin_enqueue_scripts', 'Add_EWD_UFAQ_Scripts', 10, 1);
34
- add_action('admin_head', 'EWD_UFAQ_Admin_Options');
35
- }
36
-
37
- function EWD_UFAQ_Enable_Sub_Menu() {
38
- global $submenu;
39
-
40
- $Admin_Approval = get_option("EWD_UFAQ_Admin_Approval");
41
- $Access_Role = get_option("EWD_UFAQ_Access_Role");
42
-
43
- if ($Access_Role == "") {$Access_Role = "edit_posts";}
44
-
45
- remove_menu_page('edit.php?post_type=ufaq');
46
-
47
- if( current_user_can($Access_Role) ){
48
- add_menu_page( 'Ultimate FAQs', 'FAQs', $Access_Role, 'EWD-UFAQ-Options', 'EWD_UFAQ_Output_Pages', 'dashicons-format-chat', '49.1' );
49
- }
50
- add_submenu_page('EWD-UFAQ-Options', 'FAQ Options', 'FAQ Options', $Access_Role, 'EWD-UFAQ-Options&DisplayPage=Options', 'EWD_UFAQ_Output_Pages');
51
- if ($Admin_Approval == "Yes") {
52
- $submenu['EWD-UFAQ-Options'][6] = $submenu['EWD-UFAQ-Options'][1];
53
- $submenu['EWD-UFAQ-Options'][1] = array( 'Approved FAQs', $Access_Role, "edit.php?post_type=ufaq&post_status=publish", "Approved FAQs" );
54
- $submenu['EWD-UFAQ-Options'][2] = array( 'Awaiting Approval', $Access_Role, "edit.php?post_type=ufaq&post_status=draft", "Awaiting Approval" );
55
- $submenu['EWD-UFAQ-Options'][3] = array( 'Add New', $Access_Role, "post-new.php?post_type=ufaq", "Add New" );
56
- $submenu['EWD-UFAQ-Options'][4] = array( 'FAQ Categories', $Access_Role, "edit-tags.php?taxonomy=ufaq-category&post_type=ufaq", "FAQ Categories" );
57
- $submenu['EWD-UFAQ-Options'][5] = array( 'FAQ Tags', $Access_Role, "edit-tags.php?taxonomy=ufaq-tag&post_type=ufaq", "FAQ Tags" );
58
- }
59
- else {
60
- $submenu['EWD-UFAQ-Options'][5] = $submenu['EWD-UFAQ-Options'][1];
61
- $submenu['EWD-UFAQ-Options'][1] = array( 'FAQs', $Access_Role, "edit.php?post_type=ufaq", "FAQs" );
62
- $submenu['EWD-UFAQ-Options'][2] = array( 'Add New', $Access_Role, "post-new.php?post_type=ufaq", "Add New" );
63
- $submenu['EWD-UFAQ-Options'][3] = array( 'FAQ Categories', $Access_Role, "edit-tags.php?taxonomy=ufaq-category&post_type=ufaq", "FAQ Categories" );
64
- $submenu['EWD-UFAQ-Options'][4] = array( 'FAQ Tags', $Access_Role, "edit-tags.php?taxonomy=ufaq-tag&post_type=ufaq", "FAQ Tags" );
65
- }
66
- add_submenu_page('EWD-UFAQ-Options', 'FAQ Export', 'FAQ Export', $Access_Role, 'EWD-UFAQ-Options&DisplayPage=Export', 'EWD_UFAQ_Output_Pages');
67
- add_submenu_page('EWD-UFAQ-Options', 'FAQ Import', 'FAQ Import', $Access_Role, 'EWD-UFAQ-Options&DisplayPage=ImportPosts', 'EWD_UFAQ_Output_Pages');
68
-
69
- $submenu['EWD-UFAQ-Options'][0][0] = "Dashboard";
70
- ksort($submenu['EWD-UFAQ-Options']);
71
- }
72
- add_action('admin_menu' , 'EWD_UFAQ_Enable_Sub_Menu', 1);
73
-
74
- function EWD_UFAQ_Add_Header_Bar($Called = "No") {
75
- global $pagenow, $post;
76
-
77
- if ($Called != "Yes" and (!isset($_GET['post_type']) or $_GET['post_type'] != "ufaq") and (!is_object($post) or $post->post_type != 'ufaq')) {return;}
78
-
79
- $Admin_Approval = get_option("EWD_UFAQ_Admin_Approval"); ?>
80
-
81
- <div class="EWD_UFAQ_Menu">
82
- <h2 class="nav-tab-wrapper">
83
- <a id="ewd-ufaq-dash-mobile-menu-open" href="#" class="MenuTab nav-tab"><?php _e("MENU", 'ultimate-faqs'); ?><span id="ewd-ufaq-dash-mobile-menu-down-caret">&nbsp;&nbsp;&#9660;</span><span id="ewd-ufaq-dash-mobile-menu-up-caret">&nbsp;&nbsp;&#9650;</span></a>
84
- <a id="Dashboard_Menu" href='admin.php?page=EWD-UFAQ-Options' class="MenuTab nav-tab <?php if (!isset($_GET['post_type']) and (isset($_GET['DisplayPage']) and ($_GET['DisplayPage'] == '' or $_GET['DisplayPage'] == 'Dashboard'))) {echo 'nav-tab-active';}?>"><?php _e("Dashboard", 'ultimate-faqs'); ?></a>
85
- <?php if ($Admin_Approval == "Yes") { ?>
86
- <a id="Approved_FAQs_Menu" href='edit.php?post_type=ufaq&post_status=publish' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit.php' and (!isset($_GET['post_status']) or $_GET['post_status'] == 'publish')) {echo 'nav-tab-active';}?>"><?php _e("Approved FAQs", 'ultimate-faqs'); ?></a>
87
- <a id="FAQs_Awaiting_Approval_Menu" href='edit.php?post_type=ufaq&post_status=draft' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit.php' and $_GET['post_status'] == 'draft') {echo 'nav-tab-active';}?>"><?php _e("Awaiting Approval", 'ultimate-faqs'); ?></a>
88
- <?php } else { ?>
89
- <a id="FAQs_Menu" href='edit.php?post_type=ufaq' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit.php') {echo 'nav-tab-active';}?>"><?php _e("FAQs", 'ultimate-faqs'); ?></a>
90
- <?php } ?>
91
- <a id="Add_New_Menu" href='post-new.php?post_type=ufaq' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'post-new.php') {echo 'nav-tab-active';}?>"><?php _e("Add New", 'ultimate-faqs'); ?></a>
92
- <a id="FAQ_Categories_Menu" href='edit-tags.php?taxonomy=ufaq-category&post_type=ufaq' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit-tags.php' and $_GET['taxonomy'] == "ufaq-category") {echo 'nav-tab-active';}?>"><?php _e("Categories", 'ultimate-faqs'); ?></a>
93
- <a id="FAQ_Categories_Menu" href='edit-tags.php?taxonomy=ufaq-tag&post_type=ufaq' class="MenuTab nav-tab <?php if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and $pagenow == 'edit-tags.php' and $_GET['taxonomy'] == "ufaq-tag") {echo 'nav-tab-active';}?>"><?php _e("Tags", 'ultimate-faqs'); ?></a>
94
- <a id="Options_Menu" href='admin.php?page=EWD-UFAQ-Options&DisplayPage=Options' class="MenuTab nav-tab <?php if (!isset($_GET['post_type']) and isset($_GET['DisplayPage']) and $_GET['DisplayPage'] == 'Options') {echo 'nav-tab-active';}?>"><?php _e("Options", 'ultimate-faqs'); ?></a>
95
- <a id="WooCommerce_Import_Menu" href='admin.php?page=EWD-UFAQ-Options&DisplayPage=Export' class="MenuTab nav-tab <?php if (!isset($_GET['post_type']) and isset($_GET['DisplayPage']) and $_GET['DisplayPage'] == 'Export') {echo 'nav-tab-active';}?>"><?php _e("Export", 'ultimate-faqs'); ?></a>
96
- <a id="WooCommerce_Import_Menu" href='admin.php?page=EWD-UFAQ-Options&DisplayPage=ImportPosts' class="MenuTab nav-tab <?php if (!isset($_GET['post_type']) and isset($_GET['DisplayPage']) and $_GET['DisplayPage'] == 'ImportPosts') {echo 'nav-tab-active';}?>"><?php _e("Import", 'ultimate-faqs'); ?></a>
97
- </h2>
98
- </div>
99
- <?php }
100
- add_action('admin_notices', 'EWD_UFAQ_Add_Header_Bar');
101
-
102
- /* Add localization support */
103
- function EWD_UFAQ_localization_setup() {
104
- load_plugin_textdomain('ultimate-faqs', false, dirname(plugin_basename(__FILE__)) . '/lang/');
105
- }
106
- add_action('after_setup_theme', 'EWD_UFAQ_localization_setup');
107
-
108
- // Add settings link on plugin page
109
- function EWD_UFAQ_plugin_settings_link($links) {
110
- $settings_link = '<a href="admin.php?page=EWD-UFAQ-Options">Settings</a>';
111
- array_unshift($links, $settings_link);
112
- return $links;
113
- }
114
- $plugin = plugin_basename(__FILE__);
115
- add_filter("plugin_action_links_$plugin", 'EWD_UFAQ_plugin_settings_link' );
116
-
117
- function Add_EWD_UFAQ_Scripts($hook) {
118
- global $post, $EWD_UFAQ_Version;
119
-
120
- wp_enqueue_script('ewd-ufaq-review-ask', plugins_url("js/ewd-ufaq-dashboard-review-ask.js", __FILE__), array('jquery'), $EWD_UFAQ_Version);
121
-
122
- if ((isset($_GET['post_type']) && $_GET['post_type'] == 'ufaq') or
123
- (isset($_GET['page']) && $_GET['page'] == 'EWD-UFAQ-Options')) {
124
- $url_one = plugins_url("ultimate-faqs/js/sorttable.js");
125
- $url_two = plugins_url("ultimate-faqs/js/Admin.js");
126
- $url_three = plugins_url("ultimate-faqs/js/spectrum.js");
127
- $url_four = plugins_url("ultimate-faqs/js/wp_ufaq_uploader.js");
128
-
129
- wp_enqueue_script('jquery-ui-sortable');
130
- wp_enqueue_script('sortable', $url_one, array('jquery'));
131
- wp_enqueue_script('UFAQ Admin', $url_two, array('jquery'), $EWD_UFAQ_Version);
132
- wp_enqueue_script('spectrum', $url_three, array('jquery'));
133
- wp_enqueue_script('wp_ufaq_uploader', $url_four, array('jquery'));
134
- }
135
-
136
- if ($hook == 'edit.php' or $hook == 'post-new.php' or $hook == 'post.php') {
137
- if (isset($post->post_type) and $post->post_type == 'product') {
138
- wp_enqueue_script('ewd-ufaq-wc-admin', plugins_url("js/ewd-ufaq-wc-admin.js", __FILE__), array('jquery'), $EWD_UFAQ_Version);
139
- }
140
- }
141
-
142
- if (isset($_GET['page']) && $_GET['page'] == 'ewd-ufaq-getting-started') {
143
- wp_enqueue_script('ewd-ufaq-getting-started', EWD_UFAQ_CD_PLUGIN_URL . 'js/ewd-ufaq-getting-started.js', array('jquery'), $EWD_UFAQ_Version);
144
- wp_enqueue_script('spectrum', EWD_UFAQ_CD_PLUGIN_URL . 'js/spectrum.js', array('jquery'), $EWD_UFAQ_Version);
145
- wp_enqueue_script('UFAQ Admin', EWD_UFAQ_CD_PLUGIN_URL . 'js/Admin.js', array('jquery', 'jquery-ui-sortable', 'spectrum'), $EWD_UFAQ_Version);
146
- }
147
- }
148
-
149
- function EWD_UFAQ_Admin_Options() {
150
- global $EWD_UFAQ_Version;
151
-
152
- wp_enqueue_style( 'ewd-ufaq-admin', plugins_url("ultimate-faqs/css/Admin.css"), array(), $EWD_UFAQ_Version);
153
- wp_enqueue_style( 'ewd-ufaq-spectrum', plugins_url("ultimate-faqs/css/spectrum.css"));
154
- wp_enqueue_style( 'ewd-ufaq-welcome-screen', EWD_UFAQ_CD_PLUGIN_URL . 'css/ewd-ufaq-welcome-screen.css', array(), $EWD_UFAQ_Version);
155
- }
156
-
157
- add_action( 'wp_enqueue_scripts', 'Add_EWD_UFAQ_FrontEnd_Scripts' );
158
- function Add_EWD_UFAQ_FrontEnd_Scripts() {
159
- global $EWD_UFAQ_Version;
160
-
161
- wp_register_script('ewd-ufaq-js', plugins_url( '/js/ewd-ufaq-js.js' , __FILE__ ), array( 'jquery' ), $EWD_UFAQ_Version);
162
-
163
- $Highlight_Search_Term = get_option("EWD_UFAQ_Highlight_Search_Term");
164
-
165
- $Retrieving_Results = get_option("EWD_UFAQ_Retrieving_Results");
166
- if ($Retrieving_Results == "") {$Retrieving_Results = __("Retrieving Results", 'ultimate-faqs') . "...";}
167
-
168
- $ewd_ufaq_php_data = array(
169
- 'retrieving_results' => $Retrieving_Results,
170
- 'highlight_search_term' => $Highlight_Search_Term
171
- );
172
-
173
- wp_localize_script('ewd-ufaq-js', 'ewd_ufaq_php_data', $ewd_ufaq_php_data );
174
- }
175
-
176
-
177
- add_action( 'wp_enqueue_scripts', 'EWD_UFAQ_Add_Stylesheet' );
178
- function EWD_UFAQ_Add_Stylesheet() {
179
- global $EWD_UFAQ_Version;
180
-
181
- wp_register_style( 'ewd-ufaq-style', plugins_url('css/ewd-ufaq-styles.css', __FILE__) );
182
- wp_enqueue_style( 'ewd-ufaq-style', $EWD_UFAQ_Version );
183
-
184
- wp_register_style( 'ewd-ufaq-rrssb', plugins_url('css/rrssb-min.css', __FILE__) );
185
- wp_enqueue_style( 'ewd-ufaq-rrssb' );
186
- }
187
-
188
- //add_action('activated_plugin','save_ufaq_error');
189
- function save_ufaq_error(){
190
- update_option('plugin_error', ob_get_contents());
191
- file_put_contents("Error.txt", ob_get_contents());
192
- }
193
-
194
- function Set_EWD_UFAQ_Options() {
195
- if (get_option("EWD_UFAQ_Toggle") == "") {update_option("EWD_UFAQ_Toggle", "Yes");}
196
- if (get_option("EWD_UFAQ_Category_Toggle") == "") {update_option("EWD_UFAQ_Category_Toggle", "No");}
197
- if (get_option("EWD_UFAQ_Category_Accordion") == "") {update_option("EWD_UFAQ_Category_Accordion", "No");}
198
- if (get_option("EWD_UFAQ_Expand_Collapse_All") == "") {update_option("EWD_UFAQ_Expand_Collapse_All", "No");}
199
- if (get_option("EWD_UFAQ_FAQ_Accordion") == "") {update_option("EWD_UFAQ_FAQ_Accordion", "No");}
200
- if (get_option("EWD_UFAQ_Hide_Categories") == "") {update_option("EWD_UFAQ_Hide_Categories", "No");}
201
- if (get_option("EWD_UFAQ_Hide_Tags") == "") {update_option("EWD_UFAQ_Hide_Tags", "No");}
202
- if (get_option("EWD_UFAQ_Scroll_To_Top") == "") {update_option("EWD_UFAQ_Scroll_To_Top", "Yes");}
203
- if (get_option("EWD_UFAQ_Display_All_Answers") == "") {update_option("EWD_UFAQ_Display_All_Answers", "No");}
204
- if (get_option("EWD_UFAQ_Display_Author") == "") {update_option("EWD_UFAQ_Display_Author", "Yes");}
205
- if (get_option("EWD_UFAQ_Display_Date") == "") {update_option("EWD_UFAQ_Display_Date", "Yes");}
206
- if (get_option("EWD_UFAQ_Display_Back_To_Top") == "") {update_option("EWD_UFAQ_Display_Back_To_Top", "No");}
207
- if (get_option("EWD_UFAQ_Include_Permalink") == "") {update_option("EWD_UFAQ_Include_Permalink", "Yes");}
208
- if (get_option("EWD_UFAQ_Permalink_Type") == "") {update_option("EWD_UFAQ_Permalink_Type", "SamePage");}
209
- if (get_option("EWD_UFAQ_Show_TinyMCE") == "") {update_option("EWD_UFAQ_Show_TinyMCE", "Yes");}
210
- if (get_option("EWD_UFAQ_Comments_On") == "") {update_option("EWD_UFAQ_Comments_On", "Yes");}
211
- if (get_option("EWD_UFAQ_Disable_Microdata") == "") {update_option("EWD_UFAQ_Disable_Microdata", "No");}
212
- if (get_option("EWD_UFAQ_Access_Role") == "") {update_option("EWD_UFAQ_Access_Role", "edit_posts");}
213
-
214
- if (get_option("EWD_UFAQ_Display_Style") == "") {update_option("EWD_UFAQ_Display_Style", "Default");}
215
- if (get_option("EWD_UFAQ_FAQ_Number_Of_Columns") == "") {update_option("EWD_UFAQ_FAQ_Number_Of_Columns", "One");}
216
- if (get_option("EWD_UFAQ_Color_Block_Shape") == "") {update_option("EWD_UFAQ_Color_Block_Shape", "Square");}
217
- if (get_option("EWD_UFAQ_Page_Type") == "") {update_option("EWD_UFAQ_Page_Type", "Load_More");}
218
- if (get_option("EWD_UFAQ_FAQ_Ratings") == "") {update_option("EWD_UFAQ_FAQ_Ratings", "No");}
219
- if (get_option("EWD_UFAQ_WooCommerce_FAQs") == "") {update_option("EWD_UFAQ_WooCommerce_FAQs", "No");}
220
- if (get_option("EWD_UFAQ_Use_Product") == "") {update_option("EWD_UFAQ_Use_Product", "Yes");}
221
- if (get_option("EWD_UFAQ_WPForms_Integration") == "") {update_option("EWD_UFAQ_WPForms_Integration", "No");}
222
- if (get_option("EWD_UFAQ_WPForms_Post_Count") == "") {update_option("EWD_UFAQ_WPForms_Post_Count", 5);}
223
- if (get_option("EWD_UFAQ_WPForms_FAQ_Location") == "") {update_option("EWD_UFAQ_WPForms_FAQ_Location", "Above");}
224
- if (get_option("EWD_UFAQ_Reveal_Effect") == "") {update_option("EWD_UFAQ_Reveal_Effect", "none");}
225
- if (get_option("EWD_UFAQ_Pretty_Permalinks") == "") {update_option("EWD_UFAQ_Pretty_Permalinks", "No");}
226
- if (get_option("EWD_UFAQ_Allow_Proposed_Answer") == "") {update_option("EWD_UFAQ_Allow_Proposed_Answer", "No");}
227
- if (get_option("EWD_UFAQ_Submit_Custom_Fields") == "") {update_option("EWD_UFAQ_Submit_Custom_Fields", "No");}
228
- if (get_option("EWD_UFAQ_Submit_Question_Captcha") == "") {update_option("EWD_UFAQ_Submit_Question_Captcha", "No");}
229
- if (get_option("EWD_UFAQ_Admin_Question_Notification") == "") {update_option("EWD_UFAQ_Admin_Question_Notification", "No");}
230
- if (get_option("EWD_UFAQ_Submit_FAQ_Email") == "") {update_option("EWD_UFAQ_Submit_FAQ_Email", 0);}
231
- if (get_option("EWD_UFAQ_Auto_Complete_Titles") == "") {update_option("EWD_UFAQ_Auto_Complete_Titles", "Yes");}
232
- if (get_option("EWD_UFAQ_Highlight_Search_Term") == "") {update_option("EWD_UFAQ_Highlight_Search_Term", "No");}
233
- if (get_option("EWD_UFAQ_Slug_Base") == "") {update_option("EWD_UFAQ_Slug_Base", "ufaqs");}
234
-
235
- if (get_option("EWD_UFAQ_FAQ_Elements") == "") {
236
- $FAQ_Elements = array();
237
- $FAQ_Elements[0] = "Author_Date";
238
- $FAQ_Elements[1] = "Body";
239
- $FAQ_Elements[2] = "Custom_Fields";
240
- $FAQ_Elements[3] = "Categories";
241
- $FAQ_Elements[4] = "Tags";
242
- $FAQ_Elements[5] = "Ratings";
243
- $FAQ_Elements[6] = "Social_Media";
244
- $FAQ_Elements[7] = "Permalink";
245
- $FAQ_Elements[8] = "Comments";
246
- $FAQ_Elements[9] = "Back_To_Top";
247
-
248
- update_option("EWD_UFAQ_FAQ_Elements", $FAQ_Elements);
249
- }
250
-
251
- if (get_option("EWD_UFAQ_Group_By_Category") == "") {update_option("EWD_UFAQ_Group_By_Category", "No");}
252
- if (get_option("EWD_UFAQ_Group_By_Category_Count") == "") {update_option("EWD_UFAQ_Group_By_Category_Count", "No");}
253
- if (get_option("EWD_UFAQ_Group_By_Order_By") == "") {update_option("EWD_UFAQ_Group_By_Order_By", "name");}
254
- if (get_option("EWD_UFAQ_Group_By_Order") == "") {update_option("EWD_UFAQ_Group_By_Order", "ASC");}
255
- if (get_option("EWD_UFAQ_Order_By") == "") {update_option("EWD_UFAQ_Order_By", "date");}
256
- if (get_option("EWD_UFAQ_Order") == "") {update_option("EWD_UFAQ_Order", "DESC");}
257
-
258
- if (get_option("EWD_UFAQ_Hide_Blank_Fields") == "") {update_option("EWD_UFAQ_Hide_Blank_Fields", "Yes");}
259
-
260
- if (get_option("EWD_UFAQ_Styling_Category_Heading_Type") == "") {update_option("EWD_UFAQ_Styling_Category_Heading_Type", "h4");}
261
- if (get_option("EWD_UFAQ_Styling_FAQ_Heading_Type") == "") {update_option("EWD_UFAQ_Styling_FAQ_Heading_Type", "h4");}
262
- if (get_option("EWD_UFAQ_Toggle_Symbol") == "") {update_option("EWD_UFAQ_Toggle_Symbol", "A");}
263
-
264
- if (get_option("EWD_UFAQ_Full_Version") == "") {update_option("EWD_UFAQ_Full_Version", "No");}
265
- if (get_option("EWD_UFAQ_Install_Flag") == "") {update_option("EWD_UFAQ_Update_Flag", "Yes");}
266
- if (get_option("EWD_UFAQ_Install_Flag") == "") {update_option("EWD_UFAQ_Install_Flag", "Yes");}
267
-
268
- if (get_option("EWD_UFAQ_Install_Version") == "") {update_option("EWD_UFAQ_Install_Version", 1.6);}
269
- if (get_option("EWD_UFAQ_Install_Time") == "") {update_option("EWD_UFAQ_Install_Time", time());}
270
- }
271
-
272
- $UFAQ_Full_Version = get_option("EWD_UFAQ_Full_Version");
273
- if (isset($_GET['post_type']) and $_GET['post_type'] == 'ufaq' and isset($_POST['EWD_UFAQ_Upgrade_To_Full']) and $UFAQ_Full_Version == "Yes") {add_action("admin_notices", "EWD_UFAQ_Upgrade_Notice");}
274
-
275
- $PrettyLinks = get_option("EWD_UFAQ_Pretty_Permalinks");
276
- if ($PrettyLinks == "Yes") {
277
- add_filter( 'query_vars', 'EWD_UFAQ_add_query_vars_filter' );
278
- add_filter('init', 'EWD_UFAQ_Rewrite_Rules');
279
- update_option("EWD_UFAQ_Update_RR_Rules", "No");
280
- }
281
-
282
- if (isset($_POST['EWD_UFAQ_Upgrade_To_Full'])) {
283
- add_action('admin_init', 'EWD_UFAQ_Upgrade_To_Full');
284
- }
285
-
286
- $Show_TinyMCE = get_option("EWD_UFAQ_Show_TinyMCE");
287
- if ($Show_TinyMCE == "Yes") {
288
- add_filter( 'mce_buttons', 'EWD_UFAQ_Register_TinyMCE_Buttons' );
289
- add_filter( 'mce_external_plugins', 'EWD_UFAQ_Register_TinyMCE_Javascript' );
290
- add_action('admin_head', 'EWD_UFAQ_Output_TinyMCE_Vars');
291
- }
292
-
293
- function EWD_UFAQ_Register_TinyMCE_Buttons( $buttons ) {
294
- array_push( $buttons, 'separator', 'UFAQ_Shortcodes' );
295
- return $buttons;
296
- }
297
-
298
- function EWD_UFAQ_Register_TinyMCE_Javascript( $plugin_array ) {
299
- $plugin_array['UFAQ_Shortcodes'] = plugins_url( '/js/tinymce-plugin.js',__FILE__ );
300
-
301
- return $plugin_array;
302
- }
303
-
304
- function EWD_UFAQ_Output_TinyMCE_Vars() {
305
- global $UFAQ_Full_Version;
306
- $UFAQ_Categories = get_terms('ufaq-category');
307
-
308
- echo "<script type='text/javascript'>";
309
- echo "var ufaq_premium = '" . $UFAQ_Full_Version . "';\n";
310
- echo "var ufaq_categories = " . json_encode($UFAQ_Categories) . ";\n";
311
- echo "</script>";
312
- }
313
-
314
- function Run_UFAQ_Tutorial() {
315
- update_option("UFAQ_Run_Tutorial", "Yes");
316
- }
317
-
318
- if (get_option("UFAQ_Run_Tutorial") == "Yes" and isset($_GET['page']) and $_GET['page'] == 'EWD-UFAQ-Options') {
319
- add_action( 'admin_enqueue_scripts', 'UFAQ_Set_Pointers', 10, 1);
320
- }
321
-
322
- function UFAQ_Set_Pointers($page) {
323
- $Pointers = UFAQ_Return_Pointers();
324
-
325
- //Arguments: pointers php file, version (dots will be replaced), prefix
326
- $manager = new UFAQPointersManager( $Pointers, '1.0', 'ufaq_admin_pointers' );
327
- $manager->parse();
328
- $pointers = $manager->filter( $page );
329
- if ( empty( $pointers ) ) { // nothing to do if no pointers pass the filter
330
- return;
331
- }
332
- wp_enqueue_style( 'wp-pointer' );
333
- $js_url = plugins_url( 'js/ewd-ufaq-pointers.js', __FILE__ );
334
- wp_enqueue_script( 'ufaq_admin_pointers', $js_url, array('wp-pointer'), NULL, TRUE );
335
- //data to pass to javascript
336
- $data = array(
337
- 'next_label' => __( 'Next' ),
338
- 'close_label' => __('Close'),
339
- 'pointers' => $pointers
340
- );
341
- wp_localize_script( 'ufaq_admin_pointers', 'MyAdminPointers', $data );
342
- //update_option("UFAQ_Run_Tutorial", "No");
343
- }
344
-
345
- function EWD_UFAQ_Show_Dashboard_Link() {
346
- set_transient('ewd-ufaq-getting-started', true, 30);
347
- }
348
-
349
- function UFAQ_Leave_Reply_Text($translation, $text, $domain) {
350
- global $post;
351
- if ($text == 'Leave a Reply' and (is_object($post) and $post->post_type == 'ufaq')) {
352
- $translations = get_translations_for_domain( $domain);
353
- return $translations->translate( 'Comment on this FAQ' );
354
- }
355
- return $translation;
356
- }
357
- add_filter('gettext', 'UFAQ_Leave_Reply_Text', 10, 4);
358
-
359
-
360
- function UFAQ_Post_Edit_Styles( $hook_suffix ){
361
- global $EWD_UFAQ_Version;
362
- $cpt = 'ufaq';
363
- if( in_array( $hook_suffix, array('post.php', 'post-new.php') ) ){
364
- $screen = get_current_screen();
365
- if( is_object( $screen ) && $cpt == $screen->post_type ){
366
- wp_enqueue_style( 'ewd-ufaq-post-edit-styles', plugins_url("ultimate-faqs/css/ewd-ufaq-post-edit-styles.css"), $EWD_UFAQ_Version );
367
- }
368
- }
369
- }
370
- add_action('admin_enqueue_scripts', 'UFAQ_Post_Edit_Styles');
371
-
372
- include "blocks/ewd-ufaq-blocks.php";
373
- include "Functions/Error_Notices.php";
374
- include "Functions/EWD_UFAQ_Add_Social_Media_Buttons.php";
375
- include "Functions/EWD_UFAQ_Add_Views_Column.php";
376
- include "Functions/EWD_UFAQ_Admin_Image_Upload.php";
377
- include "Functions/EWD_UFAQ_Captcha.php";
378
- include "Functions/EWD_UFAQ_Deactivation_Survey.php";
379
- include "Functions/EWD_UFAQ_Export.php";
380
- include "Functions/EWD_UFAQ_Help_Pointers.php";
381
- include "Functions/EWD_UFAQ_Import.php";
382
- include "Functions/EWD_UFAQ_Initial_Data.php";
383
- include "Functions/EWD_UFAQ_Meta_Boxes.php";
384
- include "Functions/EWD_UFAQ_Styling.php";
385
- include "Functions/EWD_UFAQ_Output_Pages.php";
386
- include "Functions/EWD_UFAQ_Pointers_Manager_Interface.php";
387
- include "Functions/EWD_UFAQ_Pointers_Manager_Class.php";
388
- include "Functions/EWD_UFAQ_Rewrite_Rules.php";
389
- include "Functions/EWD_UFAQ_Submit_Question.php";
390
- include "Functions/EWD_UFAQ_Upgrade_Box.php";
391
- include "Functions/EWD_UFAQ_Version_Update.php";
392
- include "Functions/EWD_UFAQ_Widgets.php";
393
- include "Functions/EWD_UFAQ_WooCommerce_Tab.php";
394
- include "Functions/EWD_UFAQ_WPForms_Integration.php";
395
- include "Functions/FrontEndAjaxUrl.php";
396
- include "Functions/Process_Ajax.php";
397
- include "Functions/Register_EWD_UFAQ_Posts_Taxonomies.php";
398
- include "Functions/Update_Admin_Databases.php";
399
- include "Functions/Update_EWD_UFAQ_Content.php";
400
-
401
- include "Shortcodes/DisplayFAQs.php";
402
- include "Shortcodes/Display_FAQ_Search.php";
403
- include "Shortcodes/Display_Popular_FAQs.php";
404
- include "Shortcodes/Display_Recent_FAQs.php";
405
- include "Shortcodes/Display_Top_Rated_FAQs.php";
406
- include "Shortcodes/SelectFAQ.php";
407
- include "Shortcodes/SubmitFAQ.php";
408
-
409
- if ($EWD_UFAQ_Version != get_option('EWD_UFAQ_Version')) {
410
- Set_EWD_UFAQ_Options();
411
- EWD_UFAQ_Version_Update();
412
- }
413
-
414
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
PHPSpreadsheet/vendor/phpoffice/phpspreadsheet/.gitattributes DELETED
@@ -1,2 +0,0 @@
1
- /tests export-ignore
2
- README.md export-ignore
 
 
PHPSpreadsheet/vendor/phpoffice/phpspreadsheet/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- /tests/codeCoverage
2
- /analysis
3
- /vendor/
4
- /phpunit.xml
5
- /.php_cs.cache
6
-
7
- ## IDE support
8
- *.buildpath
9
- *.project
10
- /.settings
11
- /.idea
 
 
 
 
 
 
 
 
 
 
 
Shortcodes/DisplayFAQs.php DELETED
@@ -1,700 +0,0 @@
1
- <?php
2
- function UFAQ_Display_FAQs_Block() {
3
- if(function_exists('render_block_core_block')){
4
- wp_register_script( 'ewd-ufaq-blocks-js', plugins_url( '../blocks/ewd-ufaq-blocks.js', __FILE__ ), array( 'wp-blocks', 'wp-element', 'wp-components', 'wp-editor' ) );
5
- wp_register_style( 'ewd-ufaq-blocks-css', plugins_url( '../blocks/ewd-ufaq-blocks.css', __FILE__ ), array( 'wp-edit-blocks' ), filemtime( plugin_dir_path( __FILE__ ) . '../blocks/ewd-ufaq-blocks.css' ) );
6
- register_block_type( 'ultimate-faqs/ewd-ufaq-display-faq-block', array(
7
- 'attributes' => array(
8
- 'post_count' => array(
9
- 'type' => 'string',
10
- ),
11
- 'include_category' => array(
12
- 'type' => 'string',
13
- ),
14
- 'exclude_category' => array(
15
- 'type' => 'string',
16
- ),
17
- ),
18
- 'editor_script' => 'ewd-ufaq-blocks-js',
19
- 'editor_style' => 'ewd-ufaq-blocks-css',
20
- 'render_callback' => 'Display_FAQs',
21
- ) );
22
- }
23
- // Define our shortcode, too, using the same render function as the block.
24
- add_shortcode( 'ultimate-faqs', 'Display_FAQs' );
25
- }
26
- add_action( 'init', 'UFAQ_Display_FAQs_Block' );
27
-
28
- function Display_FAQs($atts) {
29
- global $ewd_ufaq_schema_data;
30
-
31
- $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
32
- $FAQ_Toggle = get_option("EWD_UFAQ_Toggle");
33
- $Category_Toggle = get_option("EWD_UFAQ_Category_Toggle");
34
- $Category_Accordion = get_option("EWD_UFAQ_Category_Accordion");
35
- $Expand_Collapse_All = get_option("EWD_UFAQ_Expand_Collapse_All");
36
- $FAQ_Accordion = get_option("EWD_UFAQ_FAQ_Accordion");
37
- $Hide_Categories = get_option("EWD_UFAQ_Hide_Categories");
38
- $Hide_Tags = get_option("EWD_UFAQ_Hide_Tags");
39
- $Scroll_To_Top = get_option("EWD_UFAQ_Scroll_To_Top");
40
- $Display_Author = get_option("EWD_UFAQ_Display_Author");
41
- $Display_Date = get_option("EWD_UFAQ_Display_Date");
42
- $Display_Back_To_Top = get_option("EWD_UFAQ_Display_Back_To_Top");
43
- $Include_Permalink = get_option("EWD_UFAQ_Include_Permalink");
44
- $Permalink_Type = get_option("EWD_UFAQ_Permalink_Type");
45
- $Comments_On = get_option("EWD_UFAQ_Comments_On");
46
-
47
- $Display_Style = get_option("EWD_UFAQ_Display_Style");
48
- $FAQ_Number_Of_Columns = get_option("EWD_UFAQ_FAQ_Number_Of_Columns");
49
- $Responsive_Columns = get_option("EWD_UFAQ_Responsive_Columns");
50
- $Color_Block_Shape = get_option("EWD_UFAQ_Color_Block_Shape");
51
- $FAQs_Per_Page = get_option("EWD_UFAQ_FAQs_Per_Page");
52
- $Page_Type = get_option("EWD_UFAQ_Page_Type");
53
- $FAQ_Ratings = get_option("EWD_UFAQ_FAQ_Ratings");
54
- $Reveal_Effect = get_option("EWD_UFAQ_Reveal_Effect");
55
- $Pretty_Permalinks = get_option("EWD_UFAQ_Pretty_Permalinks");
56
- $Display_All_Answers = get_option("EWD_UFAQ_Display_All_Answers");
57
- $Highlight_Search_Term = get_option("EWD_UFAQ_Highlight_Search_Term");
58
- $Socialmedia_String = get_option("EWD_UFAQ_Social_Media");
59
- $Socialmedia = explode(",", $Socialmedia_String);
60
- $FAQ_Elements = get_option("EWD_UFAQ_FAQ_Elements");
61
- if (!is_array($FAQ_Elements)) {$FAQ_Elements = array();}
62
-
63
- $Group_By_Category = get_option("EWD_UFAQ_Group_By_Category");
64
- $Group_By_Category_Count = get_option("EWD_UFAQ_Group_By_Category_Count");
65
- $Group_By_Order_By = get_option("EWD_UFAQ_Group_By_Order_By");
66
- $Group_By_Order = get_option("EWD_UFAQ_Group_By_Order");
67
- $Order_By_Setting = get_option("EWD_UFAQ_Order_By");
68
- $Order_Setting = get_option("EWD_UFAQ_Order");
69
-
70
- $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
71
- if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
72
- $Hide_Blank_Fields = get_option("EWD_UFAQ_Hide_Blank_Fields");
73
-
74
- $Posted_Label = get_option("EWD_UFAQ_Posted_Label");
75
- if ($Posted_Label == "") {$Posted_Label = __("Posted ", 'ultimate-faqs');}
76
- $By_Label = get_option("EWD_UFAQ_By_Label");
77
- if ($By_Label == "") {$By_Label = __("by ", 'ultimate-faqs');}
78
- $On_Label = get_option("EWD_UFAQ_On_Label");
79
- if ($On_Label == "") {$On_Label = __("on ", 'ultimate-faqs');}
80
- $Category_Label = get_option("EWD_UFAQ_Category_Label");
81
- $Tag_Label = get_option("EWD_UFAQ_Tag_Label");
82
- $Back_To_Top_Label = get_option("EWD_UFAQ_Back_To_Top_Label");
83
- if ($Back_To_Top_Label == "") {$Back_To_Top_Label = __("Back to Top", 'ultimate-faqs');}
84
- $Permalink_Label = get_option("EWD_UFAQ_Permalink_Label");
85
- if ($Permalink_Label == "") {$Permalink_Label = __("Permalink", 'ultimate-faqs');}
86
- $No_Results_Found_Text = get_option("EWD_UFAQ_No_Results_Found_Text");
87
- if ($No_Results_Found_Text == "") {$No_Results_Found_Text = __("No result FAQ's contained the term '%s'", 'ultimate-faqs');}
88
-
89
- $Share_FAQ_Label = get_option("EWD_UFAQ_Share_FAQ_Label");
90
- if ($Share_FAQ_Label == "") {$Share_FAQ_Label = __("Share", 'ultimate-faqs');}
91
- $Find_FAQ_Helpful_Label = get_option("EWD_UFAQ_Find_FAQ_Helpful_Label");
92
- if ($Find_FAQ_Helpful_Label == "") {$Find_FAQ_Helpful_Label = __("Did you find this FAQ helpful?", 'ultimate-faqs');}
93
-
94
- $UFAQ_Styling_Category_Heading_Type = get_option("EWD_UFAQ_Styling_Category_Heading_Type");
95
- $UFAQ_Styling_FAQ_Heading_Type = get_option("EWD_UFAQ_Styling_FAQ_Heading_Type");
96
-
97
- $Toggle_Symbol = get_option("EWD_UFAQ_Toggle_Symbol");
98
- if ($Toggle_Symbol == "") {$Toggle_Symbol = 'A';}
99
-
100
- if ($Display_Style != "Color_Block") {$Color_Block_Shape = "";}
101
- else {$Color_Block_Shape = "ewd-ufaq-" . $Color_Block_Shape;}
102
-
103
- $Unique_ID = EWD_UFAQ_Rand_Chars(3);
104
- EWD_UFAQ_Enqueue_Scripts_In_Shortcode();
105
-
106
- $ReturnString = "";
107
- $HeaderString = "";
108
- $TitlesArray = array();
109
-
110
- // Get the attributes passed by the shortcode, and store them in new variables for processing
111
- extract( shortcode_atts( array(
112
- 'search_string' => "",
113
- 'post__in' => "",
114
- 'post__in_string' => "",
115
- 'include_tag' => "",
116
- 'include_category' => "",
117
- 'exclude_category' => "",
118
- 'include_category_ids' => "",
119
- 'exclude_category_ids' => "",
120
- 'include_category_children' => "Yes",
121
- 'no_comments' => "",
122
- 'orderby' => "",
123
- 'order' => "",
124
- 'ajax' => "No",
125
- 'faqs_only' => "No",
126
- 'current_url' => "",
127
- 'only_titles' => "No",
128
- 'display_all_answers' => "",
129
- 'faq_page' => 0,
130
- 'post_count'=>-1),
131
- $atts
132
- )
133
- );
134
-
135
- if ($current_url == "") {$current_url = $_SERVER['REQUEST_URI'];}
136
- if (strpos($current_url,'faq-tag') !== false) {$current_url = substr($current_url,0,strpos($current_url,'faq-tag'));}
137
- if (strpos($current_url,'faq-category') !== false) {$current_url = substr($current_url,0,strpos($current_url,'faq-category'));}
138
- if (strpos($current_url,'?include_tag') !== false) {$current_url = substr($current_url,0,strpos($current_url,'?include_tag'));}
139
- if (strpos($current_url,'?include_category') !== false) {$current_url = substr($current_url,0,strpos($current_url,'?include_category'));}
140
-
141
- if (strpos($No_Results_Found_Text, "%s")) {$No_Results_Found_Text = str_replace("%s", $search_string, $No_Results_Found_Text);}
142
-
143
- $search_string = strtolower($search_string);
144
-
145
- if ($FAQs_Per_Page == '') {$FAQs_Per_Page = 999999;}
146
- $Skip_FAQs = $faq_page * $FAQs_Per_Page;
147
- $Max_FAQ_Count = ($faq_page + 1) * $FAQs_Per_Page;
148
-
149
- if ($display_all_answers != "") {$Display_All_Answers = $display_all_answers;}
150
-
151
- if ($post__in != "") {
152
- $post_id_arr = json_decode(str_replace(array("&lsqb;", "&rsqb;"), array("[", "]"), $post__in));
153
- $post_id_arr[] = 0;
154
- }
155
- elseif ($post__in_string != "") {$post_id_arr = explode(",", $post__in_string);}
156
- else {$post_id_arr = "";}
157
-
158
- if ($orderby == "") {$orderby = $Order_By_Setting;}
159
- if ($orderby == "popular" or $orderby == "set_order" or $orderby == "top_rated") {
160
- $orig_order_setting = $orderby;
161
- $orderby = "meta_value_num";
162
- }
163
- else {$orig_order_setting = "";}
164
-
165
- if ($order == "") {$order = $Order_Setting;}
166
- if ($orig_order_setting == "popular") {$order = "DESC";}
167
- if ($orig_order_setting == "top_rated") {$order = "DESC";}
168
- if ($orig_order_setting == "set_order") {$order = "ASC";}
169
-
170
- if ($Group_By_Category == "Yes") {
171
- $Category_Array = get_terms('ufaq-category', array('orderby' => $Group_By_Order_By, 'order' => $Group_By_Order));
172
- }
173
- else {
174
- $Category_Array = array("EWD_UFAQ_ALL_CATEGORIES");
175
- }
176
-
177
- if ($post__in != "" and $Category_Array[0] != "EWD_UFAQ_ALL_CATEGORIES") {$Category_Array[] = "uncategorized";}
178
-
179
- if (isset($_GET['include_category'])) {$include_category = sanitize_text_field( $_GET['include_category'] );}
180
- if ($include_category_children == "No") {$include_children = false;}
181
- else {$include_children = true;}
182
- if (get_query_var('ufaq_category_slug') != "") {$include_category = get_query_var('ufaq_category_slug');}
183
- if ($include_category_ids != "" ) {$include_category_ids_array = explode(",", $include_category_ids);}
184
- if ($include_category_ids != "") {
185
- foreach ($include_category_ids_array as $Category_ID) {
186
- $Term = get_term_by('id', $Category_ID, 'ufaq-category');
187
- $include_category .= $Term->slug . ",";
188
- }
189
- $include_category = substr($include_category, 0, -1);
190
- }
191
- if ($include_category != "" ) {$include_category_array = explode(",", $include_category);}
192
- else {$include_category_array = array();}
193
- if (sizeOf($include_category_array) > 0) {
194
- $include_category_filter_array = array( 'taxonomy' => 'ufaq-category',
195
- 'field' => 'slug',
196
- 'terms' => $include_category_array,
197
- 'include_children' => $include_children
198
- );
199
- }
200
- if ($exclude_category_ids != "" ) {$exclude_category_ids_array = explode(",", $exclude_category_ids);}
201
- if ($exclude_category_ids != "") {
202
- foreach ($exclude_category_ids_array as $Category_ID) {
203
- $Term = get_term_by('id', $Category_ID, 'ufaq-category');
204
- $exclude_category .= $Term->slug . ",";
205
- }
206
- $exclude_category = substr($exclude_category, 0, -1);
207
- }
208
- if ($exclude_category != "" ) {$exclude_category_array = explode(",", $exclude_category);}
209
- else {$exclude_category_array = array();}
210
- if (sizeOf($exclude_category_array) > 0) {
211
- $exclude_category_filter_array = array( 'taxonomy' => 'ufaq-category',
212
- 'field' => 'slug',
213
- 'terms' => $exclude_category_array,
214
- 'operator' => 'NOT IN',
215
- 'include_children' => $include_children
216
- );
217
- }
218
-
219
- if (isset($_GET['include_tag'])) {$include_tag = sanitize_text_field( $_GET['include_tag'] );}
220
- if (get_query_var('ufaq_tag_slug') != "") {$include_tag = get_query_var('ufaq_tag_slug');}
221
- if (isset($include_tag) and $include_tag != "" ) {$include_tag_array = explode(",", $include_tag);}
222
- else {$include_tag_array = array();}
223
- if (sizeOf($include_tag_array) > 0) {
224
- $include_tag_filter_array = array( 'taxonomy' => 'ufaq-tag',
225
- 'field' => 'slug',
226
- 'terms' => $include_tag_array
227
- );
228
- }
229
-
230
- if ( ! isset($ewd_ufaq_schema_data) or ! is_array($ewd_ufaq_schema_data) ) {
231
- $ewd_ufaq_schema_data = array(
232
- '@context' => "https://schema.org",
233
- '@type' => 'FAQPage',
234
- 'mainEntity' => array()
235
- );
236
- }
237
-
238
- $Page_Permalink = get_the_permalink();
239
-
240
- $ReturnString .= "<div class='ufaq-faq-list' id='ufaq-faq-list'>";
241
- $HeaderString .= "<div class='ufaq-faq-header'>";
242
-
243
- if (get_query_var('single_faq') != "") {
244
- $FAQ = get_page_by_path(get_query_var('single_faq'),OBJECT,'ufaq');
245
- $ReturnString .= "<script>var Display_FAQ_ID = '" . $FAQ->ID . "-%Counter_Placeholder%';</script>";
246
- $Display_FAQ_ID = $FAQ->ID;
247
- }
248
- elseif (isset($_GET['Display_FAQ'])) {
249
- $ReturnString .= "<script>var Display_FAQ_ID = '" . intval( $_GET['Display_FAQ'] ) . "-%Counter_Placeholder%';</script>";
250
- $Display_FAQ_ID = intval( $_GET['Display_FAQ'] );
251
- }
252
- else {$Display_FAQ_ID = "";}
253
-
254
- if ($Custom_CSS != "") {$ReturnString .= "<style>" . $Custom_CSS . "</style>";}
255
- $ReturnString .= EWD_UFAQ_Add_Modified_Styles();
256
-
257
- $ReturnString .= "<script language='JavaScript' type='text/javascript'>";
258
- if ($FAQ_Accordion == "Yes") {$ReturnString .= "var faq_accordion = true;";}
259
- else {$ReturnString .= "var faq_accordion = false;";}
260
- if ($Scroll_To_Top == "Yes") {$ReturnString .= "var faq_scroll = true;";}
261
- else {$ReturnString .= "var faq_scroll = false;";}
262
- $ReturnString .= "var reveal_effect = '" . $Reveal_Effect . "';";
263
- $ReturnString .= "</script>";
264
-
265
- if ($Expand_Collapse_All == "Yes") {
266
- $ReturnString .= "<div class='ewd-ufaq-expand-collapse-div'><a>";
267
- $ReturnString .= "<span class='ewd-ufaq-expand-all'><span class='ewd-ufaq-toggle-all-symbol'>c</span> " . __("Expand All", 'ultimate-faqs') . "</span>";
268
- $ReturnString .= "<span class='ewd-ufaq-collapse-all ewd-ufaq-hidden'><span class='ewd-ufaq-toggle-all-symbol'>C</span> " . __("Collapse All", 'ultimate-faqs') . "</span>";
269
- $ReturnString .= "</div></a>";
270
- }
271
-
272
- if ($Display_Style == "List") {
273
- $ReturnString .= "%LIST_HEADER_PLACEHOLDER%";
274
- }
275
-
276
- $ReturnString .= "<div class='ewd-ufaq-faqs'>";
277
-
278
- if ($faqs_only == 'Yes') {$ReturnString = '';}
279
-
280
- $Counter = 0;
281
- $All_Categories = array();
282
- foreach ($Category_Array as $Category) {
283
-
284
- if ($Category != "EWD_UFAQ_ALL_CATEGORIES" and $Category != "uncategorized") {
285
- if (!EWD_UFAQ_Category_Matches($Category, $include_category_array, $exclude_category_array)) {continue;}
286
-
287
- $category_array = array( 'taxonomy' => 'ufaq-category',
288
- 'field' => 'slug',
289
- 'terms' => $Category->slug
290
- );
291
-
292
- $All_Categories[] = $Category->slug;
293
- }
294
- elseif ($Category == "uncategorized") {
295
- $category_array = array( 'taxonomy' => 'ufaq-category',
296
- 'field' => 'slug',
297
- 'terms' => $All_Categories,
298
- 'operator' => 'NOT IN'
299
- );
300
- }
301
-
302
- $tax_query_array = array('relation' => 'AND');
303
- if (isset($include_category_filter_array)) {$tax_query_array[] = $include_category_filter_array;}
304
- if (isset($exclude_category_filter_array)) {$tax_query_array[] = $exclude_category_filter_array;}
305
- if (isset($include_tag_filter_array)) {$tax_query_array[] = $include_tag_filter_array;}
306
- if (isset($category_array)) {$tax_query_array[] = $category_array;}
307
-
308
- $params = array('posts_per_page' => $post_count,
309
- 'post_status' => 'publish',
310
- 'post_type' => 'ufaq',
311
- 'tax_query' => $tax_query_array,
312
- 'orderby' => $orderby,
313
- 'order' => $order,
314
- 'suppress_filters' => false
315
- );
316
- unset($tax_query_array);
317
-
318
- if ($search_string != "") {$params['s'] = $search_string;}
319
- if (is_array($post_id_arr)) {$params['post__in'] = $post_id_arr;}
320
- if ($orig_order_setting == "popular") {$params['meta_key'] = 'ufaq_view_count';}
321
- if ($orig_order_setting == "top_rated") {$params['meta_key'] = 'FAQ_Total_Score';}
322
- if ($orig_order_setting == "set_order") {$params['meta_key'] = 'ufaq_order';}
323
- $FAQ_Query = new WP_Query($params);
324
-
325
- if ($Category != "EWD_UFAQ_ALL_CATEGORIES" and $Category != 'uncategorized' and $FAQ_Query->post_count > 0) {
326
- $ReturnString .= "<div class='ufaq-faq-category'>";
327
- $ReturnString .= "<div class='ufaq-faq-category-title" . ($Category_Toggle == "Yes" ? " ufaq-faq-category-title-toggle" : "") . ($Category_Accordion == "Yes" ? " ufaq-faq-category-title-accordion" : "") . "' data-categoryid='" . $Category->term_id . "-" . $Unique_ID . "'>";
328
- $ReturnString .= "<" . $UFAQ_Styling_Category_Heading_Type . ">" . $Category->name . ($Group_By_Category_Count == "Yes" ? " <span>(" . $FAQ_Query->post_count . ")" : "") . "</span></" . $UFAQ_Styling_Category_Heading_Type . ">";
329
- $ReturnString .= "</div>";
330
- $ReturnString .= "<div class='ufaq-faq-category-inner";
331
- if ($Category_Toggle == "Yes") {$ReturnString .= " ufaq-faq-category-body-hidden";}
332
- $ReturnString .= "' id='ufaq-faq-category-body-" . $Category->term_id . "-" . $Unique_ID . "'>";
333
-
334
- $HeaderString .= "<div class='ufaq-faq-header-category'>";
335
- $HeaderString .= "<div class='ufaq-faq-header-category-title' data-categoryid='" . $Category->term_id . "-" . $Unique_ID . "'>";
336
- $HeaderString .= "<" . $UFAQ_Styling_Category_Heading_Type . ">" . $Category->name . "</" . $UFAQ_Styling_Category_Heading_Type . ">";
337
- $HeaderString .= "</div>";
338
- }
339
-
340
- while ( $FAQ_Query->have_posts() ): $FAQ_Query->the_post(); global $post;
341
-
342
- if ($Counter < $Skip_FAQs) {
343
- $Counter++;
344
- continue;
345
- }
346
-
347
- if ($Counter >= $Max_FAQ_Count) {
348
- $ReturnString .= "<div class='ewd-ufaq-max-faqs-not-reached'></div>";
349
- break 2;
350
- }
351
-
352
- $faq = get_post();
353
- $Category_Terms = wp_get_post_terms($faq->ID, 'ufaq-category');
354
- $Tag_Terms = wp_get_post_terms($faq->ID, 'ufaq-tag');
355
-
356
- if ( isset( $post_id_array ) and is_array( $post_id_array ) ) {
357
- if ( ( $key = array_search( $faq->ID, $post_id_array ) ) !== false ) { unset( $post_id_array[$key] ); }
358
- }
359
-
360
- if ($Permalink_Type == "IndividualPage") {
361
- $FAQ_Permalink = get_permalink($faq->ID);
362
- }
363
- else {
364
- if ($Pretty_Permalinks == "Yes") {$FAQ_Permalink = $Page_Permalink . "single-faq/" . $faq->post_name;}
365
- else {$FAQ_Permalink = $Page_Permalink . "?Display_FAQ=" . $faq->ID;}
366
- }
367
-
368
- if ($Display_FAQ_ID == $faq->ID) {
369
- $ReturnString = str_replace("%Counter_Placeholder%", $Counter, $ReturnString);
370
- $Display_FAQ_ID = "";
371
- }
372
-
373
- $Post_Title = EWD_UFAQ_Add_Search_Spans($faq->post_title, $search_string, $Highlight_Search_Term);
374
- $Post_Content = EWD_UFAQ_Add_Search_Spans($faq->post_content, $search_string, $Highlight_Search_Term);
375
-
376
- $TitlesArray[] = json_encode($Post_Title);
377
- $HeaderString .= "<div class='ufaq-faq-header-title'><a href='' class='ufaq-faq-header-link' data-postid='" . $Unique_ID . "-" . $faq->ID . "-" . $Counter . "'>" . apply_filters('the_title', $Post_Title, $faq->ID) . "</a></div>";
378
-
379
- $ReturnString .= "<div class='ufaq-faq-div ufaq-faq-column-count-" . $FAQ_Number_Of_Columns . " ufaq-faq-responsive-columns-" . $Responsive_Columns . " ufaq-faq-display-style-" . $Display_Style . "' id='ufaq-post-" . $Unique_ID . "-" . $faq->ID . "-" . $Counter . "' data-postid='" . $Unique_ID . "-" . $faq->ID . "-" . $Counter . "'>";
380
-
381
- $ReturnString .= "<div class='ufaq-faq-title";
382
- if ($FAQ_Toggle != "No") {$ReturnString .= " ufaq-faq-toggle";}
383
- $ReturnString .= "' id='ufaq-title-" . $faq->ID . "' data-postid='" . $Unique_ID . "-" . $faq->ID . "-" . $Counter . "'>";
384
- $ReturnString .= "<a class='ewd-ufaq-post-margin' href='" . get_permalink($faq->ID) . "'><div class='ewd-ufaq-post-margin-symbol " . $Color_Block_Shape . "' id='ewd-ufaq-post-margin-symbol-" . $Unique_ID . "-" . $faq->ID . "-" . $Counter . "'><span id='ewd-ufaq-post-symbol-" . $Unique_ID . "-" . $faq->ID . "-" . $Counter;
385
- if ($Display_All_Answers == "Yes") {$ReturnString .= "'>" . $Toggle_Symbol . "</span></div>";}
386
- else {$ReturnString .= "'>" . strtolower($Toggle_Symbol) . "</span></div>";}
387
- $ReturnString .= "<div class='ufaq-faq-title-text'><" . $UFAQ_Styling_FAQ_Heading_Type . ">" . apply_filters('the_title', $Post_Title, $faq->ID) . "</" . $UFAQ_Styling_FAQ_Heading_Type . "></div><div class='ewd-ufaq-clear'></div></a>";
388
- $ReturnString .= "</div>";
389
-
390
- if (strlen($faq->post_excerpt) > 0) {$ReturnString .= "<div class='ufaq-faq-excerpt' id='ufaq-excerpt-" . $faq->ID . "'>" . apply_filters('the_content', html_entity_decode($faq->post_excerpt)) . "</div>";}
391
- $ReturnString .= "<div class='ufaq-faq-body ufaq-body-" . $faq->ID;
392
- if ($Display_All_Answers != "Yes") {$ReturnString .= " ewd-ufaq-hidden";}
393
- $ReturnString .= "' id='ufaq-body-" . $Unique_ID . "-" . $faq->ID . "-" . $Counter . "'>";
394
-
395
- foreach ($FAQ_Elements as $FAQ_Element) {
396
- if ($FAQ_Element == "Author_Date" and ($Display_Author == "Yes" or $Display_Date == "Yes")) {
397
- $Display_Author_Value = get_post_meta($faq->ID, "EWD_UFAQ_Post_Author", true);
398
- $Display_Date_Value = get_the_date("", $faq->ID);
399
- $ReturnString .= "<div class='ewd-ufaq-author-date'>";
400
- $ReturnString .= $Posted_Label . " " ;
401
- if ($Display_Author == "Yes" and $Display_Author_Value != "") {$ReturnString .= $By_Label . " <span class='ewd-ufaq-author'>" . $Display_Author_Value . "</span> ";}
402
- if ($Display_Date == "Yes") {$ReturnString .= $On_Label . " <span class='ewd-ufaq-date'>" . $Display_Date_Value . "</span> ";}
403
- $ReturnString .= "</div>";
404
- }
405
-
406
- if ($FAQ_Element == "Body") {
407
- $ReturnString .= "<div class='ewd-ufaq-post-margin ufaq-faq-post' id='ufaq-post-" . $faq->ID . "'>" . apply_filters('the_content', html_entity_decode($Post_Content)) . "</div>";
408
- }
409
-
410
- if ($FAQ_Element == "Custom_Fields" and sizeOf($FAQ_Fields_Array) > 0) {
411
- $ReturnString .= "<div class='ufaq-faq-custom-fields' id='ufaq-custom-fields-" . $faq->ID . "'>";
412
- foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {
413
- $Value = get_post_meta($faq->ID, "Custom_Field_" . $FAQ_Field_Item['FieldID'], true);
414
- if ($Hide_Blank_Fields != "Yes" or $Value != "") {
415
- $ReturnString .= "<div class='ufaq-custom-field-label'>" . $FAQ_Field_Item['FieldName'] . ": </div>";
416
- $ReturnString .= "<div class='ufaq-custom-field-value'>&nbsp;";
417
- if ($FAQ_Field_Item['FieldType'] == "file") {$ReturnString .= "<a href='" . $Value . "'>" . strrpos( $Value, "/") ? substr( $Value, strrpos( $Value, "/" ) + 1 ) : $Value . "</a>";}
418
- elseif ($FAQ_Field_Item['FieldType'] == "link") {$ReturnString .= "<a href='" . $Value . "' target='_blank'>" . $Value ."</a>";}
419
- else {$ReturnString .= $Value;}
420
- $ReturnString .= "</div>";
421
- $ReturnString .= "<div class='ewd-ufaq-clear'></div>";
422
- }
423
- unset($Value);
424
- }
425
- $ReturnString .= "</div>";
426
- }
427
-
428
- if ($FAQ_Element == "Categories" and $Hide_Categories == "No" and sizeOf($Category_Terms) > 0) {
429
- $ReturnString .= "<div class='ufaq-faq-categories' id='ufaq-categories-" . $faq->ID . "'>";
430
- if ($Category_Label == ""){
431
- if (sizeOf($Category_Terms) > 1) {$ReturnString .= __("Categories: ", 'ultimate-faqs');}
432
- else {$ReturnString .= __("Category: ", 'ultimate-faqs');}
433
- }
434
- else {$ReturnString .= $Category_Label . ": ";}
435
- foreach ($Category_Terms as $Category_Term) {
436
- if ($Pretty_Permalinks == "Yes") {$Category_URL = $current_url . "faq-category/" . $Category_Term->slug . "/";}
437
- else {$Category_URL = $current_url . "?include_category=" . $Category_Term->slug;}
438
- $ReturnString .= "<a href='" . esc_attr( $Category_URL ) ."'>" .$Category_Term->name . "</a>, ";
439
- }
440
- $ReturnString = substr($ReturnString, 0, strlen($ReturnString)-2);
441
- $ReturnString .= "</div>";
442
- }
443
-
444
- if ($FAQ_Element == "Tags" and $Hide_Tags == "No" and sizeOf($Tag_Terms) > 0) {
445
- $ReturnString .= "<div class='ufaq-faq-tags' id='ufaq-tags-" . $faq->ID . "'>";
446
- if ($Tag_Label == ""){
447
- if (sizeOf($Tag_Terms) > 1) {$ReturnString .= "Tags: ";}
448
- else {$ReturnString .= "Tag: ";}
449
- }
450
- else {$ReturnString .= $Tag_Label . ": ";}
451
- foreach ($Tag_Terms as $Tag_Term) {
452
- if ($Pretty_Permalinks == "Yes") {$Tag_URL = $current_url . "faq-tag/" . $Tag_Term->slug . "/";}
453
- else {$Tag_URL = $current_url . "?include_tag=" . $Tag_Term->slug;}
454
- $ReturnString .= "<a href='" . esc_attr( $Tag_URL ) . "'>" .$Tag_Term->name . "</a>, ";
455
- }
456
- $ReturnString = substr($ReturnString, 0, strlen($ReturnString)-2);
457
- $ReturnString .= "</div>";
458
- }
459
-
460
- if ($FAQ_Element == "Ratings" and $FAQ_Ratings == "Yes") {
461
- $Up_Votes = get_post_meta($faq->ID, "FAQ_Up_Votes", true);
462
- if ($Up_Votes == "") {$Up_Votes = 0;}
463
- $Down_Votes = get_post_meta($faq->ID, "FAQ_Down_Votes", true);
464
- if ($Down_Votes == "") {$Down_Votes = 0;}
465
-
466
- $Thumbs_Up_Image = get_option("EWD_UFAQ_Thumbs_Up_Image");
467
- $Thumbs_Down_Image = get_option("EWD_UFAQ_Thumbs_Down_Image");
468
-
469
- $ReturnString .= "<div class='ewd-ufaq-ratings'>";
470
- $ReturnString .= "<div class='ewd-ufaq-ratings-label'>";
471
- $ReturnString .= $Find_FAQ_Helpful_Label;
472
- $ReturnString .= "</div>";
473
- $ReturnString .= "<div class='ewd-ufaq-rating-button ewd-ufaq-up-vote" . ( ($Thumbs_Up_Image != '' && $Thumbs_Up_Image != 'http://') ? ' ewd-ufaq-rating-button-custom-up-image' : '' ) . "' data-ratingfaqid='" . $faq->ID . "'>";
474
- if($Thumbs_Up_Image != '' && $Thumbs_Up_Image != 'http://'){
475
- $ReturnString .= "<img src='" . $Thumbs_Up_Image . "' alt='" . __('Thumbs Up', 'ultimate-faqs') . "'>";
476
- }
477
- $ReturnString .= $Up_Votes;
478
- $ReturnString .= "</div>";
479
- $ReturnString .= "<div class='ewd-ufaq-rating-button ewd-ufaq-down-vote" . ( ($Thumbs_Down_Image != '' && $Thumbs_Down_Image != 'http://') ? ' ewd-ufaq-rating-button-custom-down-image' : '' ) . "' data-ratingfaqid='" . $faq->ID . "'>";
480
- if($Thumbs_Down_Image != '' && $Thumbs_Down_Image != 'http://'){
481
- $ReturnString .= "<img src='" . $Thumbs_Down_Image . "' alt='" . __('Thumbs Down', 'ultimate-faqs') . "'>";
482
- }
483
- $ReturnString .= $Down_Votes;
484
- $ReturnString .= "</div>";
485
- $ReturnString .= "</div>";
486
- $ReturnString .= "<div class='ewd-ufaq-clear'></div>";
487
- }
488
-
489
- if ($FAQ_Element == "Social_Media") {
490
- if ($Socialmedia[0] != "Blank" and $Socialmedia[0] != "") {
491
- $ReturnString .= "<div class='ufaq-social-links'><span class='ufaq-social-links-label'>" . $Share_FAQ_Label . ": </span>";
492
- $ReturnString .= "<ul class='rrssb-buttons'>";
493
- }
494
- if(in_array("Facebook", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Facebook", get_permalink($faq->ID), $faq->post_title);}
495
- if(in_array("Google", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Google", $FAQ_Permalink, $faq->post_title);}
496
- if(in_array("Twitter", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Twitter", $FAQ_Permalink, $faq->post_title);}
497
- if(in_array("Linkedin", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Linkedin", $FAQ_Permalink, $faq->post_title);}
498
- if(in_array("Pinterest", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Pinterest", $FAQ_Permalink, $faq->post_title);}
499
- if(in_array("Email", $Socialmedia)) {$ReturnString .= EWD_UFAQ_Add_Social_Media_Buttons("Email", $FAQ_Permalink, $faq->post_title);}
500
- if ($Socialmedia[0] != "Blank" and $Socialmedia[0] != "") {
501
- $ReturnString .= "</ul>";
502
- $ReturnString .= "</div>";
503
- }
504
- }
505
-
506
- if ($FAQ_Element == "Permalink" and ($Include_Permalink == "Yes" or $Include_Permalink == "Text" or $Include_Permalink == "Icon") and $ajax == "No") {
507
- $ReturnString .= "<div class='ufaq-permalink'>";
508
- $ReturnString .= "<a href='" . $FAQ_Permalink . "'>";
509
- if ($Include_Permalink == "Yes" or $Include_Permalink == "Text") {$ReturnString .= $Permalink_Label;}
510
- if ($Include_Permalink == "Yes" or $Include_Permalink == "Icon") {$ReturnString .= "<div class='ufaq-permalink-image'></div>";}
511
- $ReturnString .= "</a>";
512
- $ReturnString .= "</div>";
513
- }
514
-
515
- if ($FAQ_Element == "Comments" and comments_open($faq->ID) and $no_comments != "Yes" and $Comments_On == "Yes") {
516
- ob_start();
517
- $Comments = get_comments(array('post_id' => $faq->ID));
518
- wp_list_comments(array(), $Comments);
519
- comment_form(array(), $faq->ID);
520
- $ReturnString .= ob_get_contents();
521
- ob_end_clean();
522
- }
523
-
524
- if ($FAQ_Element == "Back_To_Top" and $Display_Back_To_Top == "Yes") {
525
- $ReturnString .= "<div class='ufaq-back-to-top'>";
526
- $ReturnString .= "<a class='ufaq-back-to-top-link'>";
527
- $ReturnString .= $Back_To_Top_Label;
528
- $ReturnString .= "</a>";
529
- $ReturnString .= "</div>";
530
- }
531
-
532
- }
533
-
534
- $schema_object = array(
535
- '@type' => 'Question',
536
- 'name' => $faq->post_title,
537
- 'acceptedAnswer' => array(
538
- '@type' => 'Answer',
539
- 'text' => $faq->post_content
540
- )
541
- );
542
-
543
- if ( isset($Up_Votes) ) { $schema_object['acceptedAnswer']['upvoteCount'] = $Up_Votes; }
544
- if ( isset($Down_Votes) ) { $schema_object['acceptedAnswer']['downvoteCount'] = $Down_Votes; }
545
- if ( isset($Display_Author_Value) ) {
546
- $schema_object['acceptedAnswer']['author'] = array(
547
- '@type' => 'Person',
548
- 'name' => $Display_Author_Value
549
- );
550
- }
551
-
552
- $ewd_ufaq_schema_data['mainEntity'][] = $schema_object;
553
-
554
- $ReturnString .= "</div>";
555
- $ReturnString .= "</div>";
556
-
557
- $Counter++;
558
- endwhile;
559
-
560
- if ($Category != "EWD_UFAQ_ALL_CATEGORIES" and $Category != "uncategorized" and $FAQ_Query->post_count > 0) {
561
- $ReturnString .= "</div>";
562
- $HeaderString .= "</div>";
563
- }
564
-
565
- if ($faqs_only != 'Yes') {$ReturnString .= "</div>";} //ewd-ufaq-faqs
566
- }
567
-
568
-
569
- if ($Counter == 0 and $search_string != "" and $faqs_only != 'Yes') {
570
- $ReturnString .= "<div class='ewd-ufaq-no-results'>" . $No_Results_Found_Text . "</div>";
571
- }
572
-
573
- if ($Group_By_Category == "Yes") {
574
- $ReturnString .= "</div>";
575
- }
576
-
577
- if ($faqs_only != 'Yes') {
578
- $ReturnString .= "</div>";
579
-
580
- $ReturnString .= "<div class='ewd-ufaq-bottom ewd-ufaq-page-type-" . $Page_Type . "' data-currentpage='" . $faq_page . "'>";
581
- $ReturnString .= "<form>";
582
- $ReturnString .= "<input type='hidden' name='include_category' value='" . esc_attr( $include_category ) . "' id='ufaq-include-category' />";
583
- $ReturnString .= "<input type='hidden' name='exclude_category' value='" . esc_attr( $exclude_category ) . "' id='ufaq-exclude-category' />";
584
- $ReturnString .= "<input type='hidden' name='orderby' value='" . esc_attr( $orderby ) . "' id='ufaq-orderby' />";
585
- $ReturnString .= "<input type='hidden' name='order' value='" . esc_attr( $order ) . "' id='ufaq-order' />";
586
- $ReturnString .= "<input type='hidden' name='post_count' value='" . esc_attr( $post_count ) . "' id='ufaq-post-count' />";
587
- $ReturnString .= "<input type='hidden' name='current_url' value='" . esc_attr( $_SERVER['REQUEST_URI'] ) . "' id='ufaq-current-url' />";
588
- $ReturnString .= "</form>";
589
- if ($Page_Type == 'Distinct') {$ReturnString .= "<div class='ewd-ufaq-previous-faqs " . ($Skip_FAQs == 0 ? 'ewd-ufaq-hidden' : '') . "'><h4>" . __('Previous', 'ultimate-faqs') . "</h4></div>";}
590
- if ($Page_Type == 'Distinct') {$ReturnString .= "<div class='ewd-ufaq-next-faqs " . ($Counter >= $Max_FAQ_Count ? '' : 'ewd-ufaq-hidden') . "'><h4>" . __('Next', 'ultimate-faqs') . "</h4></div>";}
591
- if ($Page_Type == 'Load_More') {$ReturnString .= "<div class='ewd-ufaq-load-more " . ($Counter >= $Max_FAQ_Count ? '' : 'ewd-ufaq-hidden') . "'><h4>" . __('Load More', 'ultimate-faqs') . "</h4></div>";}
592
- $ReturnString .= "</div>";
593
-
594
- $HeaderString .= "</div>";
595
- }
596
-
597
- $ReturnString = str_replace("%LIST_HEADER_PLACEHOLDER%", $HeaderString, $ReturnString);
598
-
599
- wp_reset_postdata();
600
-
601
- if ($only_titles == "Yes") {
602
- $UniqueTitles = array_unique($TitlesArray);
603
- $TitlesString = "";
604
- foreach ($UniqueTitles as $Title) {
605
- $TitlesString .= $Title . ",";
606
- }
607
- if ($TitlesString != "") {$TitlesString = substr($TitlesString, 0, -1);}
608
- return $TitlesString;
609
- }
610
-
611
- return $ReturnString;
612
- }
613
-
614
- function EWD_UFAQ_Category_Matches($Category, $include_category_array, $exclude_category_array) {
615
- $Excluded = EWD_UFAQ_Excluded_Category_Check($Category, $exclude_category_array);
616
- $Included = EWD_UFAQ_Included_Category_Check($Category, $include_category_array);
617
-
618
- if ($Included and !$Excluded) {
619
- return true;
620
- }
621
- else {
622
- return false;
623
- }
624
- }
625
-
626
- function EWD_UFAQ_Excluded_Category_Check($Category, $exclude_category_array) {
627
- if (sizeof($exclude_category_array) == 0) {return false;}
628
-
629
- if (in_array($Category->slug, $exclude_category_array)) {return true;}
630
- elseif ($Category->parent == 0) {return false;}
631
- else {
632
- $Parent_Category = get_term($Category->parent, 'ufaq-category');
633
- return EWD_UFAQ_Excluded_Category_Check($Parent_Category, $exclude_category_array);
634
- }
635
- }
636
-
637
- function EWD_UFAQ_Included_Category_Check($Category, $include_category_array) {
638
- if (sizeof($include_category_array) == 0) {return true;}
639
-
640
- if (in_array($Category->slug, $include_category_array)) {return true;}
641
- elseif ($Category->parent == 0) {return false;}
642
- else {
643
- $Parent_Category = get_term($Category->parent, 'ufaq-category');
644
- return EWD_UFAQ_Included_Category_Check($Parent_Category, $include_category_array);
645
- }
646
- }
647
-
648
- function EWD_UFAQ_Add_Search_Spans($Text, $search_string, $Highlight_Search_Term) {
649
- if ($Highlight_Search_Term != "Yes" or $search_string == "") {return $Text;}
650
-
651
- $Highlighted_Text = preg_replace("/($search_string)/i", "<span class='ufaq-search-highlight'>$1</span>", $Text);
652
- return $Highlighted_Text;
653
- }
654
-
655
- function EWD_UFAQ_Enqueue_Scripts_In_Shortcode() {
656
- wp_enqueue_script('ewd-ufaq-js');
657
-
658
- wp_enqueue_script("jquery-ui-core");
659
- wp_enqueue_script("jquery-effects-core");
660
- wp_enqueue_script('jquery-ui-autocomplete');
661
-
662
- $Reveal_Effect = get_option("EWD_UFAQ_Reveal_Effect");
663
-
664
- if ($Reveal_Effect == "blind") {wp_enqueue_script("jquery-effects-blind");}
665
- if ($Reveal_Effect == "bounce") {wp_enqueue_script("jquery-effects-bounce");}
666
- if ($Reveal_Effect == "clip") {wp_enqueue_script("jquery-effects-clip");}
667
- if ($Reveal_Effect == "drop") {wp_enqueue_script("jquery-effects-drop");}
668
- if ($Reveal_Effect == "explode") {wp_enqueue_script("jquery-effects-explode");}
669
- if ($Reveal_Effect == "fade") {wp_enqueue_script("jquery-effects-fade");}
670
- if ($Reveal_Effect == "fold") {wp_enqueue_script("jquery-effects-fold");}
671
- if ($Reveal_Effect == "highlight") {wp_enqueue_script("jquery-effects-highlight");}
672
- if ($Reveal_Effect == "pulsate") {wp_enqueue_script("jquery-effects-pulsate");}
673
- wp_enqueue_script("jquery-effects-scale");
674
- if ($Reveal_Effect == "shake") {wp_enqueue_script("jquery-effects-shake");}
675
- if ($Reveal_Effect == "slide") {wp_enqueue_script("jquery-effects-slide");}
676
- wp_enqueue_script("jquery-effects-transfer");
677
-
678
- add_action( 'wp_footer', 'EWD_UFAQ_Print_JSON_LD_Schema' );
679
- }
680
-
681
- function EWD_UFAQ_Print_JSON_LD_Schema() {
682
- global $ewd_ufaq_schema_data;
683
-
684
- $Disable_Microdata = get_option("EWD_UFAQ_Disable_Microdata");
685
-
686
- if ( is_array($ewd_ufaq_schema_data) and $Disable_Microdata != 'Yes' ) {
687
- echo '<script type="application/ld+json" class="ewd-ufaq-ld-json-data">';
688
- echo wp_json_encode( $ewd_ufaq_schema_data );
689
- echo '</script>';
690
- }
691
- }
692
-
693
- function EWD_UFAQ_Rand_Chars($CharLength = 10) {
694
- $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
695
- $randstring = '';
696
- for ($i = 0; $i < $CharLength; $i++) {
697
- $randstring .= $characters[rand(0, strlen($characters)-1)];
698
- }
699
- return $randstring;
700
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Shortcodes/Display_FAQ_Search.php DELETED
@@ -1,100 +0,0 @@
1
- <?php
2
- function UFAQ_AJAX_Search($atts) {
3
- global $wp;
4
-
5
- $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
6
- $Auto_Complete_Titles = get_option("EWD_UFAQ_Auto_Complete_Titles");
7
-
8
- $Enter_Question_Label = get_option("EWD_UFAQ_Enter_Question_Label");
9
- if ($Enter_Question_Label == "") {$Enter_Question_Label = __('Enter your question', 'ultimate-faqs');}
10
- $Search_Label = get_option("EWD_UFAQ_Search_Label");
11
- if ($Search_Label == "") {$Search_Label = __("Search", 'ultimate-faqs');}
12
- $Search_Placeholder_Label = get_option("EWD_UFAQ_Search_Placeholder_Label");
13
- if ($Search_Placeholder_Label == "") {$Search_Placeholder_Label = __("Enter your question", 'ultimate-faqs');}
14
-
15
- $current_url = $_SERVER['REQUEST_URI'];
16
- $ReturnString = "";
17
-
18
- EWD_UFAQ_Enqueue_Scripts_In_Shortcode();
19
-
20
- // Get the attributes passed by the shortcode, and store them in new variables for processing
21
- extract( shortcode_atts( array(
22
- 'include_category' => "",
23
- 'exclude_category' => "",
24
- 'show_on_load' => "No",
25
- 'orderby' => "",
26
- 'order' => "",
27
- 'post_count' => -1,
28
- 'wp_forms_load' => ""),
29
- $atts
30
- )
31
- );
32
-
33
- $ReturnString .= "<style type='text/css'>";
34
- $ReturnString .= ".ui-autocomplete {background:#FFF; border: #000 solid 1px; max-width:400px; max-height:200px; overflow:auto;}";
35
- $ReturnString .= $Custom_CSS;
36
- $ReturnString .= "</style>";
37
-
38
- $ReturnString .= EWD_UFAQ_Add_Modified_Styles();
39
-
40
- if ($Auto_Complete_Titles == "Yes" and $wp_forms_load != "Yes") {
41
- $ReturnString .= "<script>";
42
- $ReturnString .= "var autocompleteQuestion = 'Yes';\n";
43
- $ReturnString .= "var questionTitles = [";
44
- $ReturnString .= do_shortcode("[ultimate-faqs include_category='" . $include_category . "' exclude_category='" . $exclude_category . "' orderby='" . $orderby . "' order='" . $order . "' post_count='" . $post_count . "' only_titles='Yes']");
45
- $ReturnString .= "];\n";
46
- $ReturnString .= "</script>";
47
- }
48
-
49
- if ( $wp_forms_load != "Yes" ) {
50
- $ReturnString .= "<form action='#' method='post' id='ufaq-ajax-form' class='pure-form pure-form-aligned'>";
51
- $ReturnString .= "<input type='hidden' name='ufaq-input' value='Search'>";
52
- $ReturnString .= "<div id='ewd-ufaq-jquery-ajax-search' class='pure-control-group ui-front' style='position:relative;'>";
53
- $ReturnString .= "<label id='ufaq-ajax-search-lbl' class='ewd-otp-field-label ewd-otp-bold'>" . esc_html( $Enter_Question_Label ) . ":</label>";
54
- $ReturnString .= "<input type='hidden' name='include_category' value='" . esc_attr( $include_category ) . "' id='ufaq-include-category' />";
55
- $ReturnString .= "<input type='hidden' name='exclude_category' value='" . esc_attr( $exclude_category ) . "' id='ufaq-exclude-category' />";
56
- $ReturnString .= "<input type='hidden' name='orderby' value='" . esc_attr( $orderby ) . "' id='ufaq-orderby' />";
57
- $ReturnString .= "<input type='hidden' name='order' value='" . esc_attr( $order ) . "' id='ufaq-order' />";
58
- $ReturnString .= "<input type='hidden' name='post_count' value='" . esc_attr( $post_count ) . "' id='ufaq-post-count' />";
59
- $ReturnString .= "<input type='hidden' name='current_url' value='" . esc_attr( $_SERVER['REQUEST_URI'] ) . "' id='ufaq-current-url' />";
60
- $ReturnString .= "<input type='hidden' name='show_on_load' value='" . esc_attr( $show_on_load ) . "' id='ufaq-show-on-load' />";
61
- $ReturnString .= "<input type='text' id='ufaq-ajax-text-input' class='ufaq-text-input' name='Question ' placeholder='" . $Search_Placeholder_Label . "...' value='" . (isset($_GET['faq_search_term']) ? esc_attr($_GET['faq_search_term']) : '') . "'>";
62
- $ReturnString .= "</div>";
63
- if ($Auto_Complete_Titles != "Yes" and $show_on_load == "No") {$ReturnString .= "<label for='Submit'></label><input type='button' id='ufaq-ajax-search-btn' class='ewd-otp-submit pure-button pure-button-primary' name='Search' value='" . $Search_Label . "'>";}
64
- $ReturnString .= "</form>";
65
- }
66
-
67
- $ReturnString .= "<div id='ufaq-ajax-results'>";
68
- if ($show_on_load == "Yes" and $wp_forms_load != "Yes") {$ReturnString .= do_shortcode("[ultimate-faqs include_category='" . $include_category . "' exclude_category='" . $exclude_category . "' orderby='" . $orderby . "' order='" . $order . "' post_count='" . $post_count . "']");}
69
- $ReturnString .= "</div>";
70
-
71
- return $ReturnString;
72
- }
73
- function UFAQ_Search_FAQs_Block() {
74
- if(function_exists('render_block_core_block')){
75
- wp_register_script( 'ewd-ufaq-blocks-js', plugins_url( '../blocks/ewd-ufaq-blocks.js', __FILE__ ), array( 'wp-blocks', 'wp-element', 'wp-components', 'wp-editor' ) );
76
- wp_register_style( 'ewd-ufaq-blocks-css', plugins_url( '../blocks/ewd-ufaq-blocks.css', __FILE__ ), array( 'wp-edit-blocks' ), filemtime( plugin_dir_path( __FILE__ ) . '../blocks/ewd-ufaq-blocks.css' ) );
77
- register_block_type( 'ultimate-faqs/ewd-ufaq-search-block', array(
78
- 'attributes' => array(
79
- 'include_category' => array(
80
- 'type' => 'string',
81
- ),
82
- 'exclude_category' => array(
83
- 'type' => 'string',
84
- ),
85
- 'show_on_load' => array(
86
- 'type' => 'string',
87
- ),
88
- ),
89
- 'editor_script' => 'ewd-ufaq-blocks-js', // The script name we gave in the wp_register_script() call.
90
- 'editor_style' => 'ewd-ufaq-blocks-css',
91
- 'render_callback' => 'UFAQ_AJAX_Search',
92
- ) );
93
- }
94
- // Define our shortcode, too, using the same render function as the block.
95
- $UFAQ_Full_Version = get_option("EWD_UFAQ_Full_Version");
96
- if ($UFAQ_Full_Version == "Yes") { add_shortcode("ultimate-faq-search", "UFAQ_AJAX_Search"); }
97
- }
98
- add_action( 'init', 'UFAQ_Search_FAQs_Block' );
99
-
100
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Shortcodes/Display_Popular_FAQs.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- function UFAQ_Popular_FAQs_Block() {
3
- if(function_exists('render_block_core_block')){
4
- wp_register_script( 'ewd-ufaq-blocks-js', plugins_url( '../blocks/ewd-ufaq-blocks.js', __FILE__ ), array( 'wp-blocks', 'wp-element', 'wp-components', 'wp-editor' ) );
5
- wp_register_style( 'ewd-ufaq-blocks-css', plugins_url( '../blocks/ewd-ufaq-blocks.css', __FILE__ ), array( 'wp-edit-blocks' ), filemtime( plugin_dir_path( __FILE__ ) . '../blocks/ewd-ufaq-blocks.css' ) );
6
- register_block_type( 'ultimate-faqs/ewd-ufaq-popular-faqs-block', array(
7
- 'attributes' => array(
8
- 'post_count' => array(
9
- 'type' => 'integer',
10
- ),
11
- ),
12
- 'editor_script' => 'ewd-ufaq-blocks-js', // The script name we gave in the wp_register_script() call.
13
- 'editor_style' => 'ewd-ufaq-blocks-css',
14
- 'render_callback' => 'Display_Popular_FAQs',
15
- ) );
16
- }
17
- // Define our shortcode, too, using the same render function as the block.
18
- add_shortcode("popular-faqs", "Display_Popular_FAQs");
19
- }
20
- add_action( 'init', 'UFAQ_Popular_FAQs_Block' );
21
-
22
- function Display_Popular_FAQs($atts) {
23
- extract( shortcode_atts( array(
24
- 'no_comments' => "",
25
- 'post_count'=>5),
26
- $atts
27
- )
28
- );
29
- $ReturnString = do_shortcode("[ultimate-faqs post_count=".$post_count." no_comments='" . $no_comments . "' orderby='popular']");
30
-
31
- return $ReturnString;
32
- }
33
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Shortcodes/Display_Recent_FAQs.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- function UFAQ_Recent_FAQs_Block() {
3
- if(function_exists('render_block_core_block')){
4
- wp_register_script( 'ewd-ufaq-blocks-js', plugins_url( '../blocks/ewd-ufaq-blocks.js', __FILE__ ), array( 'wp-blocks', 'wp-element', 'wp-components', 'wp-editor' ) );
5
- wp_register_style( 'ewd-ufaq-blocks-css', plugins_url( '../blocks/ewd-ufaq-blocks.css', __FILE__ ), array( 'wp-edit-blocks' ), filemtime( plugin_dir_path( __FILE__ ) . '../blocks/ewd-ufaq-blocks.css' ) );
6
- register_block_type( 'ultimate-faqs/ewd-ufaq-recent-faqs-block', array(
7
- 'attributes' => array(
8
- 'post_count' => array(
9
- 'type' => 'integer',
10
- ),
11
- ),
12
- 'editor_script' => 'ewd-ufaq-blocks-js', // The script name we gave in the wp_register_script() call.
13
- 'editor_style' => 'ewd-ufaq-blocks-css',
14
- 'render_callback' => 'Display_Recent_FAQs',
15
- ) );
16
- }
17
- // Define our shortcode, too, using the same render function as the block.
18
- add_shortcode("recent-faqs", "Display_Recent_FAQs");
19
- }
20
- add_action( 'init', 'UFAQ_Recent_FAQs_Block' );
21
-
22
- function Display_Recent_FAQs($atts) {
23
- extract( shortcode_atts( array(
24
- 'no_comments' => "",
25
- 'post_count'=>5),
26
- $atts
27
- )
28
- );
29
- $ReturnString = do_shortcode("[ultimate-faqs post_count=".$post_count." no_comments='" . $no_comments . "' orderby='date']");
30
-
31
- return $ReturnString;
32
- }
33
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Shortcodes/Display_Top_Rated_FAQs.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- /* The function that creates the HTML on the front-end, based on the parameters
3
- * supplied in the product-catalog shortcode */
4
- function Display_Top_Rated_FAQs($atts) {
5
- extract( shortcode_atts( array(
6
- 'no_comments' => "",
7
- 'post_count'=>5),
8
- $atts
9
- )
10
- );
11
- $ReturnString = do_shortcode("[ultimate-faqs post_count=".$post_count." no_comments='" . $no_comments . "' orderby='top_rated']");
12
-
13
- return $ReturnString;
14
- }
15
- add_shortcode("top-rated-faqs", "Display_Top_Rated_FAQs");
16
-
17
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Shortcodes/SelectFAQ.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- /* The function that creates the HTML on the front-end, based on the parameters
3
- * supplied in the product-catalog shortcode */
4
- function Display_Select_FAQs($atts) {
5
- $ReturnString = "";
6
-
7
- extract( shortcode_atts( array(
8
- 'faq_name' => "",
9
- 'faq_slug' => "",
10
- 'faq_id' => "",
11
- 'no_comments' => ""),
12
- $atts
13
- )
14
- );
15
-
16
- if ($faq_name != "") {$name_array = explode(",", $faq_name);}
17
- else {$name_array = array();}
18
- if ($faq_slug != "") {$slug_array = explode(",", $faq_slug);}
19
- else {$slug_array = array();}
20
- if ($faq_id != "") {$id_array = explode(",", $faq_id);}
21
- else {$id_array = array();}
22
-
23
- $post_id_array = array();
24
-
25
- foreach ($name_array as $post_name) {
26
- $single_post = get_page_by_title($post_name, "OBJECT", "ufaq");
27
- $post_id_array[] = $single_post->ID;
28
- }
29
-
30
- foreach ($slug_array as $post_slug) {
31
- $single_post = get_page_by_path($post_slug, "OBJECT", "ufaq");
32
- $post_id_array[] = $single_post->ID;
33
- }
34
-
35
- foreach ($id_array as $post_id) {
36
- $post_id_array[] = (int) $post_id;
37
- }
38
-
39
- $json_ids = str_replace(array("[", "]"), array("&lsqb;", "&rsqb;"), json_encode($post_id_array));
40
- if (!empty($post_id_array)) {$ReturnString = do_shortcode("[ultimate-faqs post__in='" . $json_ids . "' no_comments='" . $no_comments . "']");}
41
-
42
- return $ReturnString;
43
- }
44
- add_shortcode("select-faq", "Display_Select_FAQs");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Shortcodes/SubmitFAQ.php DELETED
@@ -1,171 +0,0 @@
1
- <?php
2
- function Insert_Question_Form($atts) {
3
- global $user_message;
4
-
5
- $Custom_CSS = get_option('EWD_UFAQ_Custom_CSS');
6
- $Allow_Proposed_Answer = get_option("EWD_UFAQ_Allow_Proposed_Answer");
7
- $Submit_Custom_Fields = get_option("EWD_UFAQ_Submit_Custom_Fields");
8
- $Submit_Question_Captcha = get_option("EWD_UFAQ_Submit_Question_Captcha");
9
- $Submit_FAQ_Email = get_option("EWD_UFAQ_Submit_FAQ_Email");
10
-
11
- $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
12
- if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
13
-
14
- $ReturnString = "";
15
-
16
- // Get the attributes passed by the shortcode, and store them in new variables for processing
17
- extract( shortcode_atts( array(
18
- 'success_message' => __('Thank you for submitting an FAQ.', 'ultimate-faqs'),
19
- 'submit_faq_form_title' => __('Submit a Question', 'ultimate-faqs'),
20
- 'submit_faq_instructions' => __('Please fill out the form below to submit a question.', 'ultimate-faqs'),
21
- 'submit_text' => __('Send Question', 'ultimate-faqs')),
22
- $atts
23
- )
24
- );
25
- if (get_option("EWD_UFAQ_Thank_You_Submit_Label") != "") {$success_message = get_option("EWD_UFAQ_Thank_You_Submit_Label");}
26
- if (get_option("EWD_UFAQ_Submit_Question_Label") != "") {$submit_faq_form_title = get_option("EWD_UFAQ_Submit_Question_Label");}
27
- if (get_option("EWD_UFAQ_Please_Fill_Form_Below_Label") != "") {$submit_faq_instructions = get_option("EWD_UFAQ_Please_Fill_Form_Below_Label");}
28
- if (get_option("EWD_UFAQ_Send_Question_Label") != "") {$submit_text = get_option("EWD_UFAQ_Send_Question_Label");}
29
- $Question_Title_Label = get_option("EWD_UFAQ_Question_Title_Label");
30
- if ($Question_Title_Label == "") {$Question_Title_Label = __("Question Title", 'ultimate-faqs');}
31
- $What_Question_Being_Answered_Label = get_option("EWD_UFAQ_What_Question_Being_Answered_Label");
32
- if ($What_Question_Being_Answered_Label == "") {$What_Question_Being_Answered_Label = __("What question is being answered?", 'ultimate-faqs');}
33
- $Proposed_Answer_Label = get_option("EWD_UFAQ_Proposed_Answer_Label");
34
- if ($Proposed_Answer_Label == "") {$Proposed_Answer_Label = __("Proposed Answer", 'ultimate-faqs');}
35
- $Review_Author_Label = get_option("EWD_UFAQ_Review_Author_Label");
36
- if ($Review_Author_Label == "") {$Review_Author_Label = __("FAQ Author", 'ultimate-faqs');}
37
- $What_Name_With_Review_Label = get_option("EWD_UFAQ_What_Name_With_Review_Label");
38
- if ($What_Name_With_Review_Label == "") {$What_Name_With_Review_Label = __("What name should be displayed with your FAQ?", 'ultimate-faqs');}
39
-
40
- if (isset($_POST['Submit_Question'])) {$user_update = EWD_UFAQ_Submit_Question($success_message);}
41
-
42
- $ReturnString .= "<style type='text/css'>";
43
- $ReturnString .= $Custom_CSS;
44
- $ReturnString .= "</style>";
45
- $ReturnString .= EWD_UFAQ_Add_Modified_Styles();
46
-
47
- $ReturnString .= "<div class='ewd-ufaq-question-form'>";
48
-
49
- if (isset($_POST['Submit_Question'])) {
50
- $ReturnString .= "<div class='ewd-ufaq-question-update'>";
51
- $ReturnString .= $user_update;
52
- $ReturnString .= "</div>";
53
- }
54
-
55
- $ReturnString .= "<form id='question_form' method='post' action='#'>";
56
- $ReturnString .= wp_nonce_field( -1, '_wp_nonce', true, false);
57
- $ReturnString .= wp_referer_field( false );
58
-
59
- $ReturnString .= "<div class='form-field'>";
60
- $ReturnString .= "<div id='ewd-ufaq-review-title' class='ewd-ufaq-review-label'>";
61
- $ReturnString .= $Question_Title_Label . ": ";
62
- $ReturnString .= "</div>";
63
- $ReturnString .= "<div id='ewd-ufaq-review-author-input' class='ewd-ufaq-review-input'>";
64
- $ReturnString .= "<input type='text' name='Post_Title' id='Post_Title' />";
65
- $ReturnString .= "</div>";
66
- $ReturnString .= "<div id='ewd-ufaq-title-explanation' class='ewd-ufaq-review-explanation'>";
67
- $ReturnString .= "<p>" . $What_Question_Being_Answered_Label . "</p>";
68
- $ReturnString .= "</div>";
69
- $ReturnString .= "</div>";
70
-
71
- if ($Allow_Proposed_Answer == "Yes") {
72
- $ReturnString .= "<div class='ewd-ufaq-meta-field'>";
73
- $ReturnString .= "<label for='Post_Body'>";
74
- $ReturnString .= $Proposed_Answer_Label . ": ";
75
- $ReturnString .= "</label>";
76
- $ReturnString .= "<textarea name='Post_Body'></textarea>";
77
- $ReturnString .= "</div>";
78
- }
79
-
80
- if ($Submit_Custom_Fields == "Yes") {
81
- foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {
82
- if ($FAQ_Field_Item['FieldType'] == 'file') {continue;}
83
-
84
- $ReturnString .= "<div class='form-field'>";
85
- $ReturnString .= "<div class='ufaq-submit-custom-field-label'>" . $FAQ_Field_Item['FieldName'] . ": </div>";
86
- if ($FAQ_Field_Item['FieldType'] == 'text') {$ReturnString .= "<input type='text' name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' />";}
87
- if ($FAQ_Field_Item['FieldType'] == 'textarea') {$ReturnString .= "<textarea name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' ></textarea>";}
88
- if ($FAQ_Field_Item['FieldType'] == 'link') {$ReturnString .= "<input type='url' name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' />";}
89
- if ($FAQ_Field_Item['FieldType'] == 'date') {$ReturnString .= "<input type='date' name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' />";}
90
- if ($FAQ_Field_Item['FieldType'] == 'datetime') {$ReturnString .= "<input type='datetime-local' name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' />";}
91
- if ($FAQ_Field_Item['FieldType'] == 'select') {
92
- $Options = explode(",", $FAQ_Field_Item['FieldValues']);
93
- $ReturnString .= "<select name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' />";
94
- foreach ($Options as $Option) {$ReturnString .= "<option value='" . $Option . "' >" . $Option . "</option>";}
95
- $ReturnString .= '</select>';
96
- }
97
- if ($FAQ_Field_Item['FieldType'] == 'radio') {
98
- $Options = explode(",", $FAQ_Field_Item['FieldValues']);
99
- foreach ($Options as $Option) {$ReturnString .= "<input type='radio' name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "' value='" . $Option . "' > " . $Option . "<br />";}
100
- }
101
- if ($FAQ_Field_Item['FieldType'] == 'checkbox') {
102
- $Options = explode(",", $FAQ_Field_Item['FieldValues']);
103
- foreach ($Options as $Option) {$ReturnString .= "<input type='checkbox' name='Custom_Field_" . $FAQ_Field_Item['FieldID'] . "[]' value='" . $Option . "' > " . $Option . "<br />";}
104
- }
105
- $ReturnString .= "</div>";
106
- }
107
- }
108
-
109
- $ReturnString .= "<div class='form-field'>";
110
- $ReturnString .= "<div id='ewd-faq-review-author' class='ewd-faq-review-label'>";
111
- $ReturnString .= $Review_Author_Label . ": ";
112
- $ReturnString .= "</div>";
113
- $ReturnString .= "<div id='ewd-faq-review-author-input' class='ewd-faq-review-input'>";
114
- $ReturnString .= "<input type='text' name='Post_Author' id='Post_Author' />";
115
- $ReturnString .= "</div>";
116
- $ReturnString .= "<div id='ewd-faq-author-explanation' class='ewd-faq-review-explanation'>";
117
- $ReturnString .= "<p>" . $What_Name_With_Review_Label . "</p>";
118
- $ReturnString .= "</div>";
119
- $ReturnString .= "</div>";
120
-
121
- if ($Submit_FAQ_Email != 0) {
122
- $ReturnString .= "<div class='form-field'>";
123
- $ReturnString .= "<div id='ewd-faq-review-author' class='ewd-faq-review-label'>";
124
- $ReturnString .= __("Author Email", 'ultimate-faqs') . ": ";
125
- $ReturnString .= "</div>";
126
- $ReturnString .= "<div id='ewd-faq-author-email-input' class='ewd-faq-review-input'>";
127
- $ReturnString .= "<input type='text' name='Author_Email' id='Author_Email' />";
128
- $ReturnString .= "</div>";
129
- $ReturnString .= "<div id='ewd-faq-author-email-explanation' class='ewd-faq-review-explanation'>";
130
- $ReturnString .= "<p>" . __("This is only used to verify the authenticity of the FAQ. It is not displayed anywhere.", 'ultimate-faqs') . "</p>";
131
- $ReturnString .= "</div>";
132
- $ReturnString .= "</div>";
133
- }
134
-
135
- if ($Submit_Question_Captcha == "Yes") {
136
- $Code = rand(1000,9999);
137
- $ModifiedCode = EWD_UFAQ_Encrypt_Captcha_Code($Code);
138
- $Captcha_Image_Number_Label = get_option("EWD_UFAQ_Captcha_Image_Number_Label");
139
- if($Captcha_Image_Number_Label == ''){ $Captcha_Image_Number_Label = __("Image Number: ", 'ultimate-faqs'); }
140
-
141
- $ReturnString .= "<div class='ewd-faq-review-input'><label for='captcha_image'></label>";
142
- $ReturnString .= "<img src=" . EWD_UFAQ_CD_PLUGIN_URL . "Functions/EWD_UFAQ_Create_Captcha_Image.php?Code=" . $ModifiedCode . " />";
143
- $ReturnString .= "<input type='hidden' name='ewd_ufaq_modified_captcha' value='" . $ModifiedCode . "' />";
144
- $ReturnString .= "</div>";
145
- $ReturnString .= "<div class='ewd-faq-review-input'><label for='captcha_text'>" . $Captcha_Image_Number_Label . "</label>";
146
- $ReturnString .= "<input type='text' name='ewd_ufaq_captcha' value='' />";
147
- $ReturnString .= "</div>";
148
- }
149
-
150
- $ReturnString .= "<p class='submit'><input type='submit' name='Submit_Question' id='submit' class='button-primary' value='" . $submit_text . "' /></p></form>";
151
- $ReturnString .= "</div>";
152
-
153
- return $ReturnString;
154
- }
155
- function UFAQ_Submit_FAQ_Block() {
156
- if(function_exists('render_block_core_block')){
157
- wp_register_script( 'ewd-ufaq-blocks-js', plugins_url( '../blocks/ewd-ufaq-blocks.js', __FILE__ ), array( 'wp-blocks', 'wp-element', 'wp-components', 'wp-editor' ) );
158
- wp_register_style( 'ewd-ufaq-blocks-css', plugins_url( '../blocks/ewd-ufaq-blocks.css', __FILE__ ), array( 'wp-edit-blocks' ), filemtime( plugin_dir_path( __FILE__ ) . '../blocks/ewd-ufaq-blocks.css' ) );
159
- register_block_type( 'ultimate-faqs/ewd-ufaq-submit-faq-block', array(
160
- 'editor_script' => 'ewd-ufaq-blocks-js', // The script name we gave in the wp_register_script() call.
161
- 'editor_style' => 'ewd-ufaq-blocks-css',
162
- 'render_callback' => 'Insert_Question_Form',
163
- ) );
164
- // Define our shortcode, too, using the same render function as the block.
165
- }
166
- $UFAQ_Full_Version = get_option("EWD_UFAQ_Full_Version");
167
- if ($UFAQ_Full_Version == "Yes") {add_shortcode("submit-question", "Insert_Question_Form");}
168
- }
169
- add_action( 'init', 'UFAQ_Submit_FAQ_Block' );
170
-
171
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/dashboard-review-ask.css ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ewd-ufaq-hidden {
2
+ display: none;
3
+ }
4
+ .ewd-ufaq-clear {
5
+ clear: both;
6
+ }
7
+ .ewd-ufaq-main-dashboard-review-ask {
8
+ border-left-color: #6026b4;
9
+ }
10
+ .ewd-ufaq-review-ask-plugin-icon {
11
+ height: 100px;
12
+ width: 100px;
13
+ float: left;
14
+ margin: 12px 24px 16px 10px;
15
+ background-image: url( '../img/ewd-ufaq-icon.png' );
16
+ background-size: contain;
17
+ }
18
+ .ewd-ufaq-review-ask-text p {
19
+ padding: 10px 20px;
20
+ font-weight: 600;
21
+ font-size: 20px;
22
+ }
23
+ .ewd-ufaq-review-ask-action {
24
+ width: 90px;
25
+ padding: 6px;
26
+ margin-right: 18px;
27
+ text-align: center;
28
+ float: left;
29
+ border-radius: 4px;
30
+ cursor: pointer;
31
+ }
32
+ .ewd-ufaq-review-ask-white {
33
+ color: #999999;
34
+ border: 1px solid #bbbbbb;
35
+ }
36
+ .ewd-ufaq-review-ask-green {
37
+ color: #ffffff;
38
+ background: #22C9A3;
39
+ border: 1px solid #22C9A3;
40
+ font-weight: 600;
41
+ }
42
+ .ewd-ufaq-review-ask-green a {
43
+ color: #ffffff;
44
+ text-decoration: none;
45
+ }
46
+ .ewd-ufaq-review-ask-feedback-form {
47
+ position: relative;
48
+ float: left;
49
+ }.ewd-ufaq-review-ask-feedback-explanation textarea {
50
+ height: 70px;
51
+ width: 480px;
52
+ }
53
+ .ewd-ufaq-review-ask-send-feedback {
54
+ margin: 10px 0px;
55
+ }
56
+
57
+
58
+ .ewd-ufaq-review-ask-review-text span {
59
+ font-size: .8em;
60
+ font-weight: normal;
61
+ }
assets/css/ewd-ufaq-admin.css ADDED
@@ -0,0 +1,1118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ewd-ufaq-clear {
2
+ clear:both;
3
+ }
4
+
5
+ .ewd-ufaq-item {
6
+ cursor: move;
7
+ }
8
+
9
+ /************
10
+ EXTRA
11
+ ************/
12
+ #ewd-ufaq-custom-fields-table select {
13
+ width: 100% !important;
14
+ }
15
+ #ewd-ufaq-custom-fields-table th {
16
+ padding: 20px 10px 20px 10px !important;
17
+ }
18
+
19
+
20
+ /*
21
+ ==============================================
22
+ Toggle Font
23
+ ==============================================
24
+ */
25
+
26
+ @font-face { /* declare fonts */
27
+ font-family: 'ewd-toggle-icon';
28
+ src: url("../fonts/ewd-toggle-icon.eot");
29
+ src: url('../fonts/ewd-toggle-icon.woff2') format('woff2'),
30
+ url('../fonts/ewd-toggle-icon.woff') format('woff'),
31
+ url("../fonts/ewd-toggle-icon.ttf") format("truetype"),
32
+ url("../fonts/ewd-toggle-icon.svg#ewd-toggle-icon") format("svg");
33
+ font-weight: normal;
34
+ font-style: normal;
35
+ }
36
+
37
+ .ewd-ufaq-toggle-symbol {
38
+ font-family: 'ewd-toggle-icon';
39
+ letter-spacing: 6px;
40
+ font-size: 1.2em;
41
+ }
42
+
43
+ input[name=toggle_symbol] {
44
+ margin-right: 10px;
45
+ }
46
+
47
+
48
+ /****************
49
+ ORDER TABLE
50
+ ****************/
51
+ #ewd-ufaq-ordering-table-container {
52
+ width: calc(100% - 20px);
53
+ }
54
+ .ewd-ufaq-ordering-table thead tr,
55
+ .ewd-ufaq-ordering-table tfoot tr {
56
+ background: #F8F4FF;
57
+ }
58
+ .ewd-ufaq-ordering-table th {
59
+ padding: 12px 10px;
60
+ }
61
+ .ewd-ufaq-ordering-table td {
62
+ padding: 8px 10px;
63
+ }
64
+ .ewd-ufaq-ordering-table tbody tr:nth-of-type(2n+2) {
65
+ background: #F8F4FF;
66
+ }
67
+
68
+
69
+ /*
70
+ ==============================================
71
+ NEW DASHBOARD
72
+ ==============================================
73
+ */
74
+
75
+ /*** WRAP ***/
76
+
77
+ .ufaq_page_ewd-ufaq-dashboard #wpcontent {
78
+ padding-left: 0;
79
+ }
80
+ .ufaq_page_ewd-ufaq-dashboard .wrap {
81
+ margin: 10px 0 0;
82
+ }
83
+
84
+ .ewd-ufaq-import-export-container {
85
+ position: relative;
86
+ float: left;
87
+ margin-left: 32px;
88
+ width: calc(100% - 32px);
89
+ }
90
+
91
+
92
+ /*** BANNER ***/
93
+
94
+ .ewd-ufaq-dashboard-new-upgrade-banner {
95
+ position: relative;
96
+ float: left;
97
+ margin-left: -20px;
98
+ width: calc(100% + 20px);
99
+ height: 256px;
100
+ background: url(../img/ewd-ufaq-dashboard-banner.png) center no-repeat #1b0f49;
101
+ }
102
+ .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
103
+ position: absolute;
104
+ height: 112px;
105
+ width: 112px;
106
+ left: 172px;
107
+ top: 72px;
108
+ background: url(../img/ewd-ufaq-icon.png) no-repeat;
109
+ background-size: 112px 112px;
110
+ }
111
+ .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
112
+ position: absolute;
113
+ height: 112px;
114
+ width: 192px;
115
+ right: 128px;
116
+ top: 84px;
117
+ }
118
+ .ewd-ufaq-dashboard-new-upgrade-button {
119
+ position: relative;
120
+ float: right;
121
+ width: 188px;
122
+ border: 2px solid #0acbaa;
123
+ background-color: #0acbaa;
124
+ color: #fff;
125
+ padding: 6px 0;
126
+ font-size: 12px;
127
+ text-decoration: none;
128
+ text-align: center;
129
+ margin-bottom: 20px;
130
+ font-weight: bold;
131
+ border-radius: 2px;
132
+ }
133
+ .ewd-ufaq-dashboard-new-upgrade-button:hover {
134
+ background-color: #1CE6C3;
135
+ border-color: #1CE6C3;
136
+ color: #fff;
137
+ }
138
+ .ewd-ufaq-dashboard-new-upgrade-button.ewd-ufaq-dashboard-new-trial-button {
139
+ background-color: transparent;
140
+ color: #0acbaa;
141
+ font-size: 11px;
142
+ cursor: pointer;
143
+ width: 192px;
144
+ }
145
+ .ewd-ufaq-dashboard-new-upgrade-button.ewd-ufaq-dashboard-new-trial-button:hover {
146
+ background-color: #0acbaa;
147
+ border-color: #0acbaa;
148
+ color: #fff;
149
+ }
150
+ .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
151
+ position: absolute;
152
+ width: calc(100% - 680px);
153
+ height: 112px;
154
+ top: 76px;
155
+ left: 320px;
156
+ color: #fff;
157
+ }
158
+ .ewd-ufaq-dashboard-banner-title {
159
+ position: relative;
160
+ float: left;
161
+ width: 100%;
162
+ font-size: 29px;
163
+ line-height: 32px;
164
+ font-weight: bold;
165
+ }
166
+ .ewd-ufaq-dashboard-banner-brief {
167
+ position: relative;
168
+ float: left;
169
+ width: 100%;
170
+ margin-top: 14px;
171
+ font-size: 14px;
172
+ }
173
+
174
+ @media screen and (min-width: 1700px) {
175
+ .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
176
+ left: 272px;
177
+ }
178
+ .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
179
+ right: 228px;
180
+ }
181
+ .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
182
+ width: calc(100% - 880px);
183
+ left: 420px;
184
+ }
185
+ }
186
+ @media screen and (max-width: 1200px) {
187
+ .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
188
+ left: 54px;
189
+ }
190
+ .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
191
+ right: 32px;
192
+ }
193
+ .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
194
+ width: calc(100% - 466px);
195
+ left: 202px;
196
+ }
197
+ }
198
+ @media screen and (max-width: 800px) {
199
+ .ewd-ufaq-dashboard-new-upgrade-banner {
200
+ height: 512px;
201
+ height: 300px;
202
+ }
203
+ .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
204
+ left: calc(50% - 56px);
205
+ top: 48px;
206
+ display: none;
207
+ }
208
+ .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
209
+ width: 80%;
210
+ left: 10%;
211
+ top: 208px;
212
+ height: 160px;
213
+ text-align: center;
214
+ height: 140px;
215
+ top: 42px;
216
+ }
217
+ .ewd-ufaq-dashboard-banner-brief {
218
+ display: none;
219
+ }
220
+ .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
221
+ right: calc(50% - 96px);
222
+ top: 368px;
223
+ top: 172px;
224
+ }
225
+ }
226
+
227
+
228
+
229
+ /*** MENU ***/
230
+
231
+ .ewd-ufaq-admin-header-menu {
232
+ background-color: #6026B4;
233
+ margin-bottom: 16px;
234
+ position: relative;
235
+ float: left;
236
+ width: 100%;
237
+ }
238
+ body.post-type-ufaq .ewd-ufaq-admin-header-menu {
239
+ margin-left: -20px;
240
+ width: calc(100% + 20px);
241
+ }
242
+ .ewd-ufaq-admin-header-menu .nav-tab-wrapper, .wrap .ewd-ufaq-admin-header-menu h2.nav-tab-wrapper {
243
+ border-bottom: 0 !important;
244
+ margin: 0;
245
+ padding-top: 0;
246
+ padding-bottom: 0;
247
+ line-height: inherit;
248
+ }
249
+ .ewd-ufaq-admin-header-menu .nav-tab {
250
+ border: none;
251
+ margin-left: 0;
252
+ padding: 12px 48px;
253
+ font-size: 12px;
254
+ text-transform: uppercase;
255
+ background: #6026B4;
256
+ color: #fff;
257
+ border-right: 1px solid #854DD6;
258
+ }
259
+
260
+ .ewd-ufaq-admin-header-menu .nav-tab:hover {
261
+ background: #682CBF;
262
+ }
263
+ .ewd-ufaq-admin-header-menu .nav-tab-active {
264
+ background: #682CBF;
265
+ color: #fff;
266
+ }
267
+ .ewd-ufaq-admin-header-menu .nav-tab-active:hover {
268
+ background: #682CBF;
269
+ color: #fff;
270
+ }
271
+ .ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open {
272
+ display: none;
273
+ }
274
+
275
+ @media screen and (max-width: 1440px) {
276
+ .ewd-ufaq-admin-header-menu .nav-tab {
277
+ padding: 12px 32px;
278
+ }
279
+ }
280
+ @media screen and (max-width: 1150px) {
281
+ .ewd-ufaq-admin-header-menu .nav-tab {
282
+ padding: 12px 18px;
283
+ }
284
+ }
285
+ @media screen and (max-width: 800px) {
286
+ .ewd-ufaq-admin-header-menu .nav-tab {
287
+ padding: 12px 0;
288
+ margin: 0;
289
+ width: 100%;
290
+ clear: both;
291
+ text-align: center;
292
+ border-right: none;
293
+ border-bottom: 1px solid #854DD6;
294
+ }
295
+ .ewd-ufaq-admin-header-menu .nav-tab:last-of-type {
296
+ border-bottom: none;
297
+ }
298
+ .ewd-ufaq-admin-header-menu .nav-tab {
299
+ display: none;
300
+ }
301
+ .ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open {
302
+ display: block;
303
+ }
304
+ #ewd-ufaq-dash-mobile-menu-up-caret {
305
+ display: none;
306
+ }
307
+ #ewd-ufaq-dash-mobile-menu-down-caret {
308
+ display: inline;
309
+ }
310
+ }
311
+
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+ /*** CONTENT ***/
321
+
322
+ #ewd-ufaq-dashboard-content-area {
323
+ position: relative;
324
+ float: left;
325
+ width: calc(100% - 162px);
326
+ margin: 32px 20px 32px 142px;
327
+ }
328
+ #ewd-ufaq-dashboard-content-left {
329
+ position: relative;
330
+ float: left;
331
+ width: 74%;
332
+ }
333
+ #ewd-ufaq-dashboard-content-right {
334
+ position: relative;
335
+ float: right;
336
+ width: 24%;
337
+ }
338
+
339
+ .ewd-ufaq-dashboard-new-widget-box {
340
+ position: relative;
341
+ float: left;
342
+ background: #fff;
343
+ box-shadow: -2px 2px 6px #ccc;
344
+ margin-bottom: 16px;
345
+ }
346
+ .ewd-ufaq-dashboard-new-widget-box.ewd-widget-box-full {
347
+ width: 100%;
348
+ }
349
+ .ewd-ufaq-dashboard-new-widget-box.ewd-widget-box-two-thirds {
350
+ width: 66%;
351
+ }
352
+ .ewd-ufaq-dashboard-new-widget-box.ewd-widget-box-one-third {
353
+ width: 32%;
354
+ margin-left: 2%;
355
+ }
356
+ .ewd-ufaq-dashboard-new-widget-box-top, .ewd-ufaq-dashboard-new-widget-box-bottom {
357
+ position: relative;
358
+ float: left;
359
+ width: calc(100% - 32px);
360
+ padding: 8px 16px;
361
+ color: #777;
362
+ }
363
+ .ewd-ufaq-dashboard-new-widget-box-top {
364
+ padding: 12px 16px;
365
+ font-weight: bold;
366
+ color: #444;
367
+ }
368
+ .ewd-ufaq-dashboard-new-widget-box-bottom {
369
+ border-top: 1px solid #e2e2e2;
370
+ }
371
+
372
+ .ewd-ufaq-dashboard-key-widget {
373
+ position: relative;
374
+ float: left;
375
+ width: calc(100% - 144px);
376
+ min-height: 30px;
377
+ margin: 24px 24px 8px;
378
+ padding: 0 0 0 96px;
379
+ background-image: url(../img/dash-asset-key.png);
380
+ background-position: left top;
381
+ background-size: 64px 30px;
382
+ background-repeat: no-repeat;
383
+ }
384
+ .ewd-ufaq-dashboard-key-widget-input {
385
+ position: relative;
386
+ float: left;
387
+ width: calc(65% - 2px);
388
+ height: 30px;
389
+ padding: 4px 8px !important;
390
+ background: none;
391
+ border: 1px solid #e2e2e2 !important;
392
+ margin: 0 !important;
393
+ }
394
+ .ewd-ufaq-dashboard-key-widget-input::placeholder {
395
+ color: #bbb;
396
+ }
397
+ .ewd-ufaq-dashboard-key-widget-submit {
398
+ position: relative;
399
+ float: left;
400
+ width: 35%;
401
+ height: 30px;
402
+ font-size: 14px;
403
+ background: #f2b52f;
404
+ color: #fff;
405
+ border: none;
406
+ cursor: pointer;
407
+ margin: 0 !important;
408
+ }
409
+ .ewd-ufaq-dashboard-key-widget-submit:hover {
410
+ background: #F2BD49;
411
+ }
412
+ .ewd-ufaq-dashboard-key-widget-text {
413
+ position: relative;
414
+ float: left;
415
+ width: 100%;
416
+ margin-top: 7px;
417
+ font-size: 11px;
418
+ color: #888;
419
+ font-style: italic;
420
+ font-weight: normal;
421
+ }
422
+ .ewd-ufaq-dashboard-key-widget-text a {
423
+ color: #0acbaa;
424
+ text-decoration: none;
425
+ font-weight: bold;
426
+ }
427
+ .ewd-ufaq-dashboard-key-widget-text a:hover {
428
+ color: #1CE6C3;
429
+ text-decoration: none;
430
+ }
431
+
432
+ #ewd-ufaq-dashboard-support-widget-box .ewd-ufaq-dashboard-new-widget-box-top {
433
+ cursor: pointer;
434
+ }
435
+ #ewd-ufaq-dash-mobile-support-down-caret {
436
+ display: none;
437
+ float: right;
438
+ }
439
+ #ewd-ufaq-dash-mobile-support-up-caret {
440
+ display: inline;
441
+ float: right;
442
+ }
443
+ .ewd-ufaq-dashboard-support-widgets {
444
+ position: relative;
445
+ float: left;
446
+ width: 90%;
447
+ padding: 14px 5%;
448
+ }
449
+ .ewd-ufaq-dashboard-support-widgets li {
450
+ position: relative;
451
+ float: left;
452
+ width: 18.25%;
453
+ margin-right: 9%;
454
+ }
455
+ .ewd-ufaq-dashboard-support-widgets li:last-of-type {
456
+ margin-right: 0;
457
+ }
458
+ .ewd-ufaq-dashboard-support-widgets li a {
459
+ position: relative;
460
+ float: left;
461
+ width: 100%;
462
+ text-align: center;
463
+ color: #444;
464
+ text-decoration: none;
465
+ font-weight: bold;
466
+ }
467
+ .ewd-ufaq-dashboard-support-widgets li a:hover {
468
+ color: #6026B4;
469
+ }
470
+ .ewd-ufaq-dashboard-support-widgets li img {
471
+ position: relative;
472
+ float: left;
473
+ width: 80%;
474
+ height: auto;
475
+ border: none;
476
+ padding: 0 10% 12px;
477
+ }
478
+ .ewd-ufaq-dashboard-support-widgets li .ewd-ufaq-dashboard-support-widgets-text {
479
+ position: relative;
480
+ float: left;
481
+ width: 100%;
482
+ margin-top: 2px;
483
+ }
484
+
485
+ #ewd-ufaq-dashboard-optional-table .ewd-ufaq-dashboard-new-widget-box-top {
486
+ cursor: pointer;
487
+ }
488
+ #ewd-ufaq-dash-optional-table-down-caret {
489
+ display: none;
490
+ float: right;
491
+ }
492
+ #ewd-ufaq-dash-optional-table-up-caret {
493
+ display: inline;
494
+ float: right;
495
+ }
496
+
497
+ .ewd-ufaq-dashboard-testimonials {
498
+ position: relative;
499
+ float: left;
500
+ width: 100%;
501
+ }
502
+ .ewd-ufaq-dashboard-testimonials li {
503
+ position: relative;
504
+ float: left;
505
+ width: 100%;
506
+ text-align: center;
507
+ }
508
+ .ewd-ufaq-dashboard-testimonials li img {
509
+ position: relative;
510
+ float: left;
511
+ width: 140px;
512
+ height: auto;
513
+ margin-top: 8px;
514
+ margin-left: calc(50% - 70px);
515
+ }
516
+ .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-title {
517
+ position: relative;
518
+ float: left;
519
+ width: 100%;
520
+ margin: 28px 0 20px;
521
+ font-size: 30px;
522
+ line-height: 30px;
523
+ font-weight: bold;
524
+ }
525
+ .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-author {
526
+ position: relative;
527
+ float: left;
528
+ width: 100%;
529
+ font-size: 16px;
530
+ }
531
+ .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text {
532
+ position: relative;
533
+ float: left;
534
+ width: 80%;
535
+ margin: 24px 10% 0;
536
+ font-size: 12px;
537
+ }
538
+ .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text a {
539
+ color: #0acbaa;
540
+ text-decoration: none;
541
+ font-weight: bold;
542
+ }
543
+ .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text a:hover {
544
+ color: #1CE6C3;
545
+ }
546
+
547
+ .ewd-ufaq-dashboard-review-ask {
548
+ position: relative;
549
+ float: left;
550
+ width: calc(100% - 32px);
551
+ padding: 16px 16px 12px;
552
+ text-align: center;
553
+ }
554
+ .ewd-ufaq-dashboard-review-ask img {
555
+ position: relative;
556
+ float: left;
557
+ width: 110px;
558
+ height: auto;
559
+ margin-left: calc(50% - 55px);
560
+ }
561
+ .ewd-ufaq-dashboard-review-ask-text {
562
+ position: relative;
563
+ float: left;
564
+ width: 100%;
565
+ margin: 24px 0;
566
+ }
567
+ .ewd-ufaq-dashboard-review-ask-button {
568
+ clear: both;
569
+ position: relative;
570
+ float: left;
571
+ width: calc(100% - 2px);
572
+ border: 1px solid #888;
573
+ background-color: transparent;
574
+ color: #888;
575
+ padding: 6px 0;
576
+ font-size: 12px;
577
+ text-decoration: none;
578
+ text-align: center;
579
+ font-weight: bold;
580
+ border-radius: 2px;
581
+ }
582
+ .ewd-ufaq-dashboard-review-ask-button:hover {
583
+ background-color: #888;
584
+ border-color: #888;
585
+ color: #fff;
586
+ }
587
+ .ewd-ufaq-dashboard-review-ask-dismiss {
588
+ position: relative;
589
+ float: left;
590
+ background: transparent;
591
+ border: none;
592
+ margin: 16px 0 0 0;
593
+ padding: 0;
594
+ width: 100%;
595
+ text-align: center;
596
+ color: #999;
597
+ font-size: 11px;
598
+ text-transform: uppercase;
599
+ cursor: pointer;
600
+ }
601
+ .ewd-ufaq-dashboard-review-ask-dismiss:hover {
602
+ color: #555;
603
+ }
604
+
605
+ .ewd-ufaq-dashboard-guarantee {
606
+ position: relative;
607
+ float: left;
608
+ width: calc(100% - 208px);
609
+ min-height: 127px;
610
+ margin: 20px 24px;
611
+ padding: 0 0 0 160px;
612
+ background-image: url(../img/dash-asset-badge.png);
613
+ background-position: left top;
614
+ background-size: 128px 127px;
615
+ background-repeat: no-repeat;
616
+ color: #777;
617
+ }
618
+ .ewd-ufaq-dashboard-guarantee-title, .ewd-ufaq-dashboard-guarantee-text {
619
+ position: relative;
620
+ float: left;
621
+ width: 100%;
622
+ margin-top: 16px;
623
+ }
624
+ .ewd-ufaq-dashboard-guarantee-title {
625
+ font-size: 24px;
626
+ line-height: 24px;
627
+ }
628
+ .ewd-ufaq-dashboard-guarantee-text {
629
+ font-size: 12px;
630
+ font-weight: normal;
631
+ }
632
+
633
+ .ewd-ufaq-dashboard-get-premium-widget-trial-time {
634
+ position: relative;
635
+ float: left;
636
+ width: 100%;
637
+ margin-top: 6px;
638
+ background: #6026B4;
639
+ }
640
+ .ewd-ufaq-dashboard-get-premium-widget-trial-days, .ewd-ufaq-dashboard-get-premium-widget-trial-hours {
641
+ position: relative;
642
+ float: left;
643
+ text-align: center;
644
+ color: #fff;
645
+ font-size: 43px;
646
+ line-height: 35px;
647
+ padding: 24px 0 8px;
648
+ font-weight: bold;
649
+ }
650
+ .ewd-ufaq-dashboard-get-premium-widget-trial-days span, .ewd-ufaq-dashboard-get-premium-widget-trial-hours span {
651
+ position: relative;
652
+ float: left;
653
+ width: 100%;
654
+ font-size: 14px;
655
+ font-weight: normal;
656
+ }
657
+ .ewd-ufaq-dashboard-get-premium-widget-trial-days {
658
+ width: calc(50% - 7px);
659
+ border-right: 7px solid #fff;
660
+ }
661
+ .ewd-ufaq-dashboard-get-premium-widget-trial-hours {
662
+ width: 50%;
663
+ }
664
+ .ewd-ufaq-dashboard-get-premium-widget-trial-time-left {
665
+ position: relative;
666
+ float: left;
667
+ width: 100%;
668
+ margin: 28px 0 24px;
669
+ color: #6026B4;
670
+ font-size: 24px;
671
+ text-align: center;
672
+ font-weight: bold;
673
+ }
674
+ .ewd-ufaq-dashboard-get-premium-widget-features-title {
675
+ position: relative;
676
+ float: left;
677
+ width: calc(100% - 16px);
678
+ padding: 8px 8px 10px;
679
+ color: #0acbaa;
680
+ font-size: 18px;
681
+ line-height: 1.5;
682
+ font-weight: bold;
683
+ }
684
+ .ewd-ufaq-dashboard-get-premium-widget-features {
685
+ position: relative;
686
+ float: left;
687
+ width: calc(100% - 16px);
688
+ padding: 0 8px;
689
+ -webkit-margin-after: 0;
690
+ }
691
+ .ewd-ufaq-dashboard-get-premium-widget-features li {
692
+ clear: both;
693
+ position: relative;
694
+ float: left;
695
+ width: calc(100% - 36px);
696
+ margin-bottom: 8px;
697
+ padding-left: 36px;
698
+ background-image: url(../img/dash-asset-checkmark.png);
699
+ background-position: left top;
700
+ background-size: 20px;
701
+ background-repeat: no-repeat;
702
+ font-style: italic;
703
+ }
704
+ .ewd-ufaq-dashboard-get-premium-widget-features li:last-of-type {
705
+ background-image: none;
706
+ }
707
+ .ewd-ufaq-dashboard-get-premium-widget-button {
708
+ clear: both;
709
+ position: relative;
710
+ float: left;
711
+ width: calc(100% - 20px);
712
+ margin: 16px 8px 10px;
713
+ border: 2px solid #0acbaa;
714
+ background-color: #0acbaa;
715
+ color: #fff;
716
+ padding: 6px 0;
717
+ font-size: 12px;
718
+ text-decoration: none;
719
+ text-align: center;
720
+ font-weight: bold;
721
+ border-radius: 2px;
722
+ }
723
+ .ewd-ufaq-dashboard-get-premium-widget-button:hover {
724
+ background-color: #1CE6C3;
725
+ border-color: #1CE6C3;
726
+ color: #fff;
727
+ }
728
+ .ewd-ufaq-dashboard-get-premium-widget-button.ewd-ufaq-dashboard-new-trial-button {
729
+ background-color: transparent;
730
+ color: #0acbaa;
731
+ font-size: 11px;
732
+ cursor: pointer;
733
+ width: calc(100% - 16px);
734
+ margin: 0 8px 16px;
735
+ }
736
+ .ewd-ufaq-dashboard-get-premium-widget-button.ewd-ufaq-dashboard-new-trial-button:hover {
737
+ background-color: #0acbaa;
738
+ border-color: #0acbaa;
739
+ color: #fff;
740
+ }
741
+
742
+ .ewd-ufaq-dashboard-other-plugins {
743
+ position: relative;
744
+ float: left;
745
+ width: 100%;
746
+ }
747
+ .ewd-ufaq-dashboard-other-plugins li {
748
+ position: relative;
749
+ float: left;
750
+ width: 100%;
751
+ margin-bottom: 24px;
752
+ }
753
+ .ewd-ufaq-dashboard-other-plugins li:last-of-type {
754
+ margin-bottom: 12px;
755
+ }
756
+ .ewd-ufaq-dashboard-other-plugins li img {
757
+ position: relative;
758
+ float: left;
759
+ width: 64px;
760
+ height: auto;
761
+ margin-right: 16px;
762
+ border: none;
763
+ }
764
+ .ewd-ufaq-dashboard-other-plugins li .ewd-ufaq-dashboard-other-plugins-text {
765
+ position: relative;
766
+ float: left;
767
+ width: calc(100% - 80px);
768
+ }
769
+ .ewd-ufaq-dashboard-other-plugins li .ewd-ufaq-dashboard-other-plugins-title {
770
+ position: relative;
771
+ float: left;
772
+ width: 100%;
773
+ font-size: 16px;
774
+ color: #444;
775
+ font-weight: bold;
776
+ }
777
+ .ewd-ufaq-dashboard-other-plugins li .ewd-ufaq-dashboard-other-plugins-blurb {
778
+ position: relative;
779
+ float: left;
780
+ width: 100%;
781
+ font-size: 11px;
782
+ margin-top: 8px;
783
+ }
784
+
785
+ /** NEED HELP BOX ON PRODUCT EDIT SCREEN **/
786
+ .ewd-ufaq-need-help-text {
787
+ margin: 24px 0 22px;
788
+ text-align: center;
789
+ color: #888;
790
+ font-size: 15px;
791
+ line-height: 1.5;
792
+ }
793
+ .ewd-ufaq-need-help-button {
794
+ display: inherit;
795
+ width: 40%;
796
+ padding: 8px 0;
797
+ margin: 0 30% 16px;
798
+ text-align: center;
799
+ background: #f2b52f;
800
+ color: #fff;
801
+ font-size: 16px;
802
+ font-weight: bold;
803
+ text-decoration: none;
804
+ border: none;
805
+ box-shadow: none;
806
+ cursor: pointer;
807
+ }
808
+ .ewd-ufaq-need-help-button:hover {
809
+ background: #d7a73f;
810
+ color: #fff;
811
+ text-decoration: none;
812
+ }
813
+
814
+ #ewd-ufaq-dashboard-restart-walkthrough-widget-box .ewd-ufaq-dashboard-new-widget-box-top {
815
+ cursor: pointer;
816
+ }
817
+ #ewd-ufaq-dashboard-restart-walkthrough-down-caret {
818
+ display: none;
819
+ float: right;
820
+ }
821
+ #ewd-ufaq-dashboard-restart-walkthrough-up-caret {
822
+ display: inline;
823
+ float: right;
824
+ }
825
+
826
+ @media screen and (min-width: 1441px) {
827
+ #ewd-ufaq-dashboard-content-area {
828
+ width: calc(100% - 194px);
829
+ margin: 32px 20px 32px 174px;
830
+ }
831
+ }
832
+ @media screen and (max-width: 1150px) {
833
+ #ewd-ufaq-dashboard-content-area {
834
+ width: calc(100% - 40px);
835
+ margin: 16px 20px 32px;
836
+ }
837
+ }
838
+ @media screen and (max-width: 1000px) {
839
+ .ewd-ufaq-dashboard-key-widget-submit {
840
+ font-size: 12px;
841
+ }
842
+ }
843
+ @media screen and (max-width: 800px) {
844
+ #ewd-ufaq-dashboard-content-left, #ewd-ufaq-dashboard-content-right {
845
+ float: left;
846
+ width: 100%;
847
+ }
848
+ .ewd-ufaq-dashboard-new-widget-box.ewd-widget-box-two-thirds, .ewd-ufaq-dashboard-new-widget-box.ewd-widget-box-one-third {
849
+ width: 100%;
850
+ margin-left: 0;
851
+ }
852
+
853
+ .ewd-ufaq-dashboard-key-widget {
854
+ width: calc(100% - 48px);
855
+ margin: 16px 24px 8px;
856
+ padding: 54px 0 0 0;
857
+ background-image: url(../img/dash-asset-key.png);
858
+ background-size: 64px 30px;
859
+ background-position: center top;
860
+ background-repeat: no-repeat;
861
+ }
862
+ .ewd-ufaq-dashboard-key-widget-input {
863
+ width: 100%;
864
+ }
865
+ .ewd-ufaq-dashboard-key-widget-submit {
866
+ width: 100%;
867
+ margin: 8px 0 0 0 !important;
868
+ font-size: 14px;
869
+ }
870
+ .ewd-ufaq-dashboard-key-widget-text {
871
+ margin-top: 16px;
872
+ text-align: center;
873
+ }
874
+
875
+ .ewd-ufaq-dashboard-support-widgets {
876
+ width: 90%;
877
+ padding: 0 5%;
878
+ }
879
+ .ewd-ufaq-dashboard-support-widgets li {
880
+ width: 100%;
881
+ margin: 0 0 12px 0;
882
+ padding-bottom: 12px;
883
+ border-bottom: 1px solid #ddd;
884
+ }
885
+ .ewd-ufaq-dashboard-support-widgets li:last-of-type {
886
+ border-bottom: none;
887
+ margin-bottom: 0;
888
+ }
889
+ .ewd-ufaq-dashboard-support-widgets li a {
890
+ text-align: left;
891
+ color: #444;
892
+ }
893
+ .ewd-ufaq-dashboard-support-widgets li a:hover {
894
+ color: #6026B4;
895
+ }
896
+ .ewd-ufaq-dashboard-support-widgets li img {
897
+ width: 32px;
898
+ height: 32px;
899
+ padding: 0 24px 0 16px;
900
+ }
901
+ .ewd-ufaq-dashboard-support-widgets li .ewd-ufaq-dashboard-support-widgets-text {
902
+ width: calc(100% - 72px);
903
+ margin-top: 7px;
904
+ text-transform: uppercase;
905
+ font-size: 11px;
906
+ }
907
+ #ewd-ufaq-dashboard-support-widget-box .ewd-ufaq-dashboard-new-widget-box-bottom {
908
+ border-top: none;
909
+ }
910
+
911
+ #ewd-ufaq-dashboard-get-premium-widget-box {
912
+ display: none;
913
+ }
914
+ }
915
+
916
+ @media screen and (max-width: 568px) {
917
+ #ewd-ufaq-dashboard-guarantee-widget-box {
918
+ background: #6026B4;
919
+ }
920
+ .ewd-ufaq-dashboard-guarantee {
921
+ width: calc(100% - 48px);
922
+ padding: 0;
923
+ height: 199px;
924
+ background-image: url(../img/dash-asset-badge.png);
925
+ background-size: 200px 199px;
926
+ background-position: center top;
927
+ background-repeat: no-repeat;
928
+ }
929
+ .ewd-ufaq-dashboard-guarantee-title, .ewd-ufaq-dashboard-guarantee-text {
930
+ display: none;
931
+ }
932
+ }
933
+
934
+
935
+
936
+ /*** FOOTER ***/
937
+
938
+ #ewd-ufaq-dashboard-new-footer-one {
939
+ position: relative;
940
+ float: left;
941
+ width: 100%;
942
+ background: #fff;
943
+ color: #777;
944
+ }
945
+ .ewd-ufaq-dashboard-new-footer-one-inside {
946
+ position: relative;
947
+ float: left;
948
+ width: 80%;
949
+ margin: 0 10%;
950
+ }
951
+ .ewd-ufaq-dashboard-new-footer-one-left {
952
+ position: relative;
953
+ float: left;
954
+ width: calc(100% - 224px);
955
+ margin-bottom: 32px;
956
+ }
957
+ .ewd-ufaq-dashboard-new-footer-one-title {
958
+ position: relative;
959
+ float: left;
960
+ width: 100%;
961
+ margin-top: 56px;
962
+ font-size: 24px;
963
+ font-weight: bold;
964
+ }
965
+ .ewd-ufaq-dashboard-new-footer-one-benefits {
966
+ position: relative;
967
+ float: left;
968
+ width: 100%;
969
+ margin-top: 32px;
970
+ }
971
+ .ewd-ufaq-dashboard-new-footer-one-benefits li {
972
+ position: relative;
973
+ float: left;
974
+ width: calc(33.333333% - 36px);
975
+ margin-bottom: 11px;
976
+ padding-left: 36px;
977
+ background-image: url(../img/dash-asset-checkmark.png);
978
+ background-position: left top;
979
+ background-size: 20px;
980
+ background-repeat: no-repeat;
981
+ font-style: italic;
982
+ }
983
+
984
+ .ewd-ufaq-dashboard-new-footer-one-buttons {
985
+ position: relative;
986
+ float: right;
987
+ width: 192px;
988
+ margin-top: 112px;
989
+ }
990
+
991
+ #ewd-ufaq-dashboard-new-footer-two {
992
+ position: relative;
993
+ float: left;
994
+ width: 100%;
995
+ background: #150947;
996
+ color: #efd3f5;
997
+ }
998
+ .ewd-ufaq-dashboard-new-footer-two-inside {
999
+ position: relative;
1000
+ float: left;
1001
+ width: 90%;
1002
+ margin: 48px 5%;
1003
+ }
1004
+ .ewd-ufaq-dashboard-new-footer-two-icon {
1005
+ position: relative;
1006
+ float: left;
1007
+ width: 110px;
1008
+ height: auto;
1009
+ margin-right: 40px;
1010
+ }
1011
+ .ewd-ufaq-dashboard-new-footer-two-blurb {
1012
+ position: relative;
1013
+ float: left;
1014
+ width: 300px;
1015
+ line-height: 1.7;
1016
+ font-size: 12px;
1017
+ }
1018
+ .ewd-ufaq-dashboard-new-footer-two-menu {
1019
+ position: relative;
1020
+ float: right;
1021
+ width: 150px;
1022
+ -webkit-margin-after: 0;
1023
+ -webkit-margin-before: 0;
1024
+ }
1025
+ .ewd-ufaq-dashboard-new-footer-two-menu li {
1026
+ clear: both;
1027
+ position: relative;
1028
+ float: right;
1029
+ width: 100%;
1030
+ font-weight: bold;
1031
+ margin-bottom: 4px;
1032
+ color: #fff;
1033
+ font-size: 13px;
1034
+ }
1035
+ .ewd-ufaq-dashboard-new-footer-two-menu li:first-of-type {
1036
+ margin-bottom: 9px;
1037
+ }
1038
+ .ewd-ufaq-dashboard-new-footer-two-menu li:last-of-type {
1039
+ margin-bottom: 0;
1040
+ }
1041
+ .ewd-ufaq-dashboard-new-footer-two-menu li a {
1042
+ font-weight: normal;
1043
+ color: #D3DFF5;
1044
+ text-decoration: none;
1045
+ font-size: 12px;
1046
+ }
1047
+ .ewd-ufaq-dashboard-new-footer-two-menu li a:hover {
1048
+ color: #fff;
1049
+ }
1050
+
1051
+ @media screen and (max-width: 1100px) {
1052
+ .ewd-ufaq-dashboard-new-footer-one-left {
1053
+ width: 100%;
1054
+ margin-bottom: 0;
1055
+ }
1056
+ .ewd-ufaq-dashboard-new-footer-one-title {
1057
+ margin-top: 56px;
1058
+ font-size: 24px;
1059
+ line-height: 28px;
1060
+ text-align: center;
1061
+ }
1062
+ .ewd-ufaq-dashboard-new-footer-one-benefits li {
1063
+ width: calc(50% - 36px);
1064
+ }
1065
+ .ewd-ufaq-dashboard-new-footer-one-buttons {
1066
+ float: left;
1067
+ width: 100%;
1068
+ margin-top: 32px;
1069
+ margin-bottom: 24px;
1070
+ }
1071
+ .ewd-ufaq-dashboard-new-footer-one-buttons .ewd-ufaq-dashboard-new-upgrade-button {
1072
+ float: left;
1073
+ margin-left: calc(50% - 96px);
1074
+ }
1075
+
1076
+ .ewd-ufaq-dashboard-new-footer-two-icon {
1077
+ clear: both;
1078
+ float: left;
1079
+ margin: 0 0 16px calc(50% - 55px);
1080
+ }
1081
+ .ewd-ufaq-dashboard-new-footer-two-blurb {
1082
+ display: none;
1083
+ }
1084
+ .ewd-ufaq-dashboard-new-footer-two-menu {
1085
+ float: left;
1086
+ width: 100%;
1087
+ margin-top: 32px;
1088
+ }
1089
+ .ewd-ufaq-dashboard-new-footer-two-menu li {
1090
+ float: left;
1091
+ text-align: center;
1092
+ margin-bottom: 4px;
1093
+ font-size: 17px;
1094
+ }
1095
+ .ewd-ufaq-dashboard-new-footer-two-menu li:first-of-type {
1096
+ margin-bottom: 9px;
1097
+ }
1098
+ .ewd-ufaq-dashboard-new-footer-two-menu li:last-of-type {
1099
+ margin-bottom: 0;
1100
+ }
1101
+ .ewd-ufaq-dashboard-new-footer-two-menu li a {
1102
+ font-size: 16px;
1103
+ }
1104
+ }
1105
+ @media screen and (max-width: 568px) {
1106
+ .ewd-ufaq-dashboard-new-footer-one-benefits li {
1107
+ clear: both;
1108
+ width: calc(100% - 36px);
1109
+ }
1110
+ }
1111
+
1112
+
1113
+ /***************
1114
+ EXTRA
1115
+ ***************/
1116
+ input[name="ewd_ufaq_export_pdf"] {
1117
+ margin-top: 8px !important;
1118
+ }
{blocks → assets/css}/ewd-ufaq-blocks.css RENAMED
File without changes
assets/css/ewd-ufaq-wc-admin.css ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ewd-ufaq-explanation {
2
+ margin: 24px 2%;
3
+ font-size: 1.1em;
4
+ }
5
+ .ewd-ufaq-category-filter {
6
+ margin-bottom: 10px !important;
7
+ }
8
+ #ewd_ufaq_faqs.woocommerce_options_panel th {
9
+ padding: 15px 10px;
10
+ }
11
+ #ewd_ufaq_faqs.woocommerce_options_panel th:first-of-type {
12
+ width: 10%;
13
+ }
14
+ #ewd_ufaq_faqs.woocommerce_options_panel tr {
15
+ border-bottom: 1px solid #eee;
16
+ }
17
+ #ewd-ufaq-add-delete-faq-form-container {
18
+ position: relative;
19
+ float: left;
20
+ width: 100%;
21
+ clear: both;
22
+ }
23
+ #ewd-ufaq-add-faq-form-div, #ewd-ufaq-delete-faq-form-div {
24
+ position: relative;
25
+ float: left;
26
+ width: 45%;
27
+ padding: 0 2%;
28
+ }
29
+ #ewd-ufaq-delete-faq-form-div {
30
+ margin-top: 31px;
31
+ border-left: 1px solid #eee;
32
+ }
33
+ @media screen and (max-width: 1200px) {
34
+ #ewd-ufaq-add-faq-form-div, #ewd-ufaq-delete-faq-form-div {
35
+ width: 96%;
36
+ }
37
+ #ewd-ufaq-delete-faq-form-div {
38
+ border-left: none;
39
+ }
40
+ }
41
+ .ewd-ufaq-delete-faq-button, .ewd-ufaq-add-faq-button {
42
+ clear: both;
43
+ position: relative;
44
+ margin: 12px 0 12px 10px;
45
+ padding: 5px 8px;
46
+ border: none;
47
+ background: #bbb;
48
+ color: #fff;
49
+ cursor: pointer;
50
+ }
51
+ .ewd-ufaq-delete-faq-button:hover, .ewd-ufaq-add-faq-button:hover {
52
+ background: #ccc;
53
+ }
{css → assets/css}/ewd-ufaq-welcome-screen.css RENAMED
@@ -137,21 +137,6 @@
137
  background: #aaa;
138
  }
139
 
140
- .ewd-ufaq-welcome-screen-box-content label {
141
- width: 160px;
142
- position: relative;
143
- float: left;
144
- font-weight: bold;
145
- }
146
- .ewd-ufaq-welcome-screen-option label {
147
- width: auto;
148
- float: none;
149
- font-weight: normal;
150
- }
151
- .ewd-ufaq-welcome-screen-option label.ewd-ufaq-admin-switch {
152
- width: 40px
153
- }
154
-
155
  .ewd-ufaq-welcome-screen-box-content input {
156
  margin: 0;
157
  }
@@ -159,136 +144,13 @@
159
  margin-bottom: 8px;
160
  }
161
 
162
-
163
  .ewd-ufaq-welcome-screen-show-created-categories {
164
  display: none;
165
  }
166
-
167
- .ewd-ufaq-welcome-screen-show-created-categories-name {
168
- position: relative;
169
- float: left;
170
- width: 40%;
171
- width: calc(40% - 2px);
172
- padding: 9px 5%;
173
- border-left: 1px solid #ccc;
174
- border-right: 1px solid #ccc;
175
- font-size: 15px;
176
- font-weight: bold;
177
- border-top: 1px solid #ccc;
178
- border-bottom: 1px solid #ccc;
179
- }
180
- .ewd-ufaq-welcome-screen-show-created-categories-description {
181
- position: relative;
182
- float: right;
183
- width: 40%;
184
- width: calc(40% - 1px);
185
- border-right: 1px solid #ccc;
186
- padding: 9px 5%;
187
- font-size: 15px;
188
- font-weight: bold;
189
- border-top: 1px solid #ccc;
190
- border-bottom: 1px solid #ccc;
191
- }
192
- .ewd-ufaq-welcome-screen-category-name {
193
- position: relative;
194
- float: left;
195
- width: 40%;
196
- width: calc(40% - 2px);
197
- padding: 7px 5%;
198
- height: 18px;
199
- overflow: hidden;
200
- border-left: 1px solid #ccc;
201
- border-right: 1px solid #ccc;
202
- border-bottom: 1px solid #ccc;
203
- }
204
- .ewd-ufaq-welcome-screen-category-description {
205
- position: relative;
206
- float: right;
207
- width: 40%;
208
- width: calc(40% - 1px);
209
- padding: 7px 5%;
210
- height: 18px;
211
- overflow: hidden;
212
- border-right: 1px solid #ccc;
213
- border-bottom: 1px solid #ccc;
214
- }
215
-
216
  .ewd-ufaq-welcome-screen-show-created-faqs {
217
  display: none;
218
  }
219
 
220
- .ewd-ufaq-welcome-screen-show-created-faq-question {
221
- position: relative;
222
- float: left;
223
- width: 28.333333%;
224
- width: calc(28.333333% - 2px);
225
- padding: 9px 2.5%;
226
- border-left: 1px solid #ccc;
227
- border-right: 1px solid #ccc;
228
- font-size: 15px;
229
- font-weight: bold;
230
- border-top: 1px solid #ccc;
231
- border-bottom: 1px solid #ccc;
232
- }
233
- .ewd-ufaq-welcome-screen-show-created-faq-answer {
234
- position: relative;
235
- float: right;
236
- width: 28.333333%;
237
- width: calc(28.333333% - 1px);
238
- border-right: 1px solid #ccc;
239
- padding: 9px 2.5%;
240
- font-size: 15px;
241
- font-weight: bold;
242
- border-top: 1px solid #ccc;
243
- border-bottom: 1px solid #ccc;
244
- }
245
- .ewd-ufaq-welcome-screen-show-created-faq-category {
246
- position: relative;
247
- float: right;
248
- width: 28.333333%;
249
- width: calc(28.333333% - 1px);
250
- border-right: 1px solid #ccc;
251
- padding: 9px 2.5%;
252
- font-size: 15px;
253
- font-weight: bold;
254
- border-top: 1px solid #ccc;
255
- border-bottom: 1px solid #ccc;
256
- }
257
- .ewd-ufaq-welcome-screen-faq-question {
258
- position: relative;
259
- float: left;
260
- width: 28.333333%;
261
- width: calc(28.333333% - 2px);
262
- padding: 7px 2.5%;
263
- height: 18px;
264
- overflow: hidden;
265
- border-left: 1px solid #ccc;
266
- border-right: 1px solid #ccc;
267
- border-bottom: 1px solid #ccc;
268
- }
269
- .ewd-ufaq-welcome-screen-faq-answer {
270
- position: relative;
271
- float: right;
272
- width: 28.333333%;
273
- width: calc(28.333333% - 1px);
274
- padding: 7px 2.5%;
275
- height: 18px;
276
- overflow: hidden;
277
- border-right: 1px solid #ccc;
278
- border-bottom: 1px solid #ccc;
279
- }
280
- .ewd-ufaq-welcome-screen-faq-category {
281
- position: relative;
282
- float: right;
283
- width: 28.333333%;
284
- width: calc(28.333333% - 1px);
285
- padding: 7px 2.5%;
286
- height: 18px;
287
- overflow: hidden;
288
- border-right: 1px solid #ccc;
289
- border-bottom: 1px solid #ccc;
290
- }
291
-
292
  .ewd-ufaq-welcome-screen-add-catalogue-categories h3 {
293
  padding-bottom: 0;
294
  margin-bottom: 0;
@@ -308,3 +170,20 @@
308
  background: #eee;
309
  }
310
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  background: #aaa;
138
  }
139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  .ewd-ufaq-welcome-screen-box-content input {
141
  margin: 0;
142
  }
144
  margin-bottom: 8px;
145
  }
146
 
 
147
  .ewd-ufaq-welcome-screen-show-created-categories {
148
  display: none;
149
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  .ewd-ufaq-welcome-screen-show-created-faqs {
151
  display: none;
152
  }
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  .ewd-ufaq-welcome-screen-add-catalogue-categories h3 {
155
  padding-bottom: 0;
156
  margin-bottom: 0;
170
  background: #eee;
171
  }
172
 
173
+ /*CREATED TABLES*/
174
+ .ewd-ufaq-welcome-screen-show-created-categories,
175
+ .ewd-ufaq-welcome-screen-show-created-faqs {
176
+ width: 100%;
177
+ border-collapse: collapse;
178
+ }
179
+ .ewd-ufaq-welcome-screen-show-created-categories th,
180
+ .ewd-ufaq-welcome-screen-show-created-categories td,
181
+ .ewd-ufaq-welcome-screen-show-created-faqs th,
182
+ .ewd-ufaq-welcome-screen-show-created-faqs td {
183
+ border: 1px solid #ccc;
184
+ padding: 12px;
185
+ }
186
+ .ewd-ufaq-welcome-screen-show-created-categories img,
187
+ .ewd-ufaq-welcome-screen-show-created-faqs img {
188
+ max-width: 100%;
189
+ }
assets/css/ewd-ufaq-wpforms.css ADDED
@@ -0,0 +1,614 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-hidden {
2
+ display:none;
3
+ }
4
+
5
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-category-title-toggle {
6
+ cursor: pointer;
7
+ }
8
+
9
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-category-body-hidden {
10
+ display: none;
11
+ }
12
+
13
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-clear {
14
+ clear:both;
15
+ }
16
+
17
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-permalink {
18
+ margin: 24px 0;
19
+ }
20
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-permalink-image {
21
+ background: url("../img/insert_link.png");
22
+ height: 21px;
23
+ width: 30px;
24
+ margin-top: -32px;
25
+ margin-left: 112px;
26
+ }
27
+
28
+
29
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-author {
30
+ font-weight: 600;
31
+ }
32
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-date {
33
+ font-weight: 600;
34
+ }
35
+
36
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-category-title {
37
+ width: 100%;
38
+ clear: both;
39
+ }
40
+
41
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-category{
42
+ margin-bottom: 20px;
43
+ }
44
+
45
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-category-inner {
46
+ margin-bottom: 48px;
47
+ }
48
+
49
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-body {
50
+ padding:10px 25px;
51
+ padding-left: 55px;
52
+ }
53
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-search{
54
+ margin:5px 0 !important;
55
+ }
56
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-search-highlight {
57
+ background: #f7ff00;
58
+ }
59
+ .ewd-otp-field-label{
60
+ width: auto !important;
61
+ }
62
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-text-input {
63
+ border-radius: 0 !important;
64
+ margin:15px !important;
65
+ }
66
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-submit{
67
+ border-radius: 0 !important;
68
+ }
69
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-header{
70
+ margin:10px;
71
+ }
72
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-header a:hover{
73
+ text-decoration: none;
74
+ }
75
+ div.wpforms-container-full .wpforms-form div.ewd-ufaq-faq-title div.ewd-ufaq-post-margin{
76
+ text-decoration: none;
77
+ }
78
+ div.wpforms-container-full .wpforms-form div.ewd-ufaq-faq-title div.ewd-ufaq-post-margin-symbol{
79
+ text-decoration: none;
80
+ float: left;
81
+ text-align: center;
82
+ /* width:35px;
83
+ height: 35px;*/
84
+ width: auto;
85
+ height: auto;
86
+ margin-right: 15px;
87
+ padding: 2px 0px 0px 2px;
88
+ line-height: 1;
89
+ border-style: solid;
90
+ }
91
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-title .ewd-ufaq-post-margin-symbol span{
92
+ display: inline-block;
93
+ font-size: 30px;
94
+ margin: 0 auto;
95
+ }
96
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-title-text {
97
+ float: left;
98
+ width: 85%;
99
+ }
100
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-title h1,
101
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-title h2,
102
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-title h3,
103
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-title h4,
104
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-title h5,
105
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-title h6 {
106
+ display:inline-block;
107
+ margin:5px !important;
108
+ }
109
+
110
+
111
+
112
+
113
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-custom-field-label, div.wpforms-container-full .wpforms-form .ewd-ufaq-custom-field-value {
114
+ position: relative;
115
+ float: left;
116
+ margin-top: 14px;
117
+ }
118
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-custom-field-label {
119
+ font-weight: normal;
120
+ }
121
+
122
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-body .comment-respond {
123
+ margin-top: 24px;
124
+ }
125
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-body li.comment {
126
+ list-style-type: none;
127
+ }
128
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-body textarea {
129
+ clear: both;
130
+ display: block;
131
+ position: relative;
132
+ width: 35%;
133
+ height: 100px;
134
+ }
135
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-body .comment-form-comment label {
136
+ clear: both;
137
+ display: block;
138
+ position: relative;
139
+ width: 100%;
140
+ }
141
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-body .submit {
142
+ width: auto;
143
+ background: transparent;
144
+ cursor: pointer;
145
+ color: #111;
146
+ margin-bottom: 20px;
147
+ }
148
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-body .submit:hover {
149
+ background: #111;
150
+ color: #fff;
151
+ }
152
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-body .comment-author img {
153
+ margin-right: 8px;
154
+ }
155
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-body .comment-body p {
156
+ margin: 10px 0;
157
+ margin-top: 10px !important;
158
+ }
159
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-body .reply {
160
+ text-transform: uppercase;
161
+ }
162
+
163
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-body .ewd-ufaq-back-to-top-link {
164
+ cursor: pointer;
165
+ }
166
+
167
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-ratings {
168
+ padding: 14px 0 0;
169
+ display: inline-block;
170
+ width: 100%;
171
+ margin-bottom: 20px;
172
+ }
173
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-down-vote {
174
+ background-position: 0px 8px !important;
175
+ height: 50px !important;
176
+ }
177
+
178
+
179
+ /***********************
180
+ * Pagination
181
+ ***********************/
182
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-bottom {
183
+ clear: both;
184
+ }
185
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-previous-faqs h4 {
186
+ float: left;
187
+ padding-left: 12px;
188
+ cursor: pointer;
189
+ font-weight: 600;
190
+ }
191
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-next-faqs h4 {
192
+ float: right;
193
+ padding-right: 12px;
194
+ cursor: pointer;
195
+ font-weight: 600;
196
+ }
197
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-load-more h4 {
198
+ text-align: center;
199
+ cursor: pointer;
200
+ font-weight: 600;
201
+ }
202
+
203
+
204
+ /***********************
205
+ * Columns
206
+ ***********************/
207
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-two {
208
+ width: 48%;
209
+ margin-right: 2%;
210
+ float: left;
211
+ clear: none;
212
+ }
213
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-three {
214
+ width: 31%;
215
+ margin-right: 2%;
216
+ float: left;
217
+ clear: none;
218
+ }
219
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-four {
220
+ width: 23%;
221
+ margin-right: 2%;
222
+ float: left;
223
+ clear: none;
224
+ }
225
+
226
+ @media only screen and (max-width: 960px) {
227
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-three.ewd-ufaq-faq-responsive-columns-1,
228
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-four.ewd-ufaq-faq-responsive-columns-1 {
229
+ width: 48%;
230
+ margin-right: 2%;
231
+ }
232
+ }
233
+ @media only screen and (max-width: 520px) {
234
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-two.ewd-ufaq-faq-responsive-columns-1,
235
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-three.ewd-ufaq-faq-responsive-columns-1,
236
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-four.ewd-ufaq-faq-responsive-columns-1 {
237
+ width: 100%;
238
+ margin-right: none;
239
+ }
240
+ }
241
+
242
+ /***********************
243
+ Color Block Style
244
+ ***********************/
245
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-color_block .ewd-ufaq-post-margin-symbol {
246
+ background-color: #1188cc;
247
+ color: #ffffff;
248
+ }
249
+
250
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-Circle {
251
+ border-radius: 18px;
252
+ }
253
+
254
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-Square {
255
+ border-radius: 0px;
256
+ }
257
+
258
+
259
+ /***********************
260
+ Block Style
261
+ ***********************/
262
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-div {
263
+ margin: 2px 0;
264
+ padding:2px 0;
265
+ clear: both;
266
+ }
267
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-toggle:hover, div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-toggle a:hover{
268
+ cursor: pointer;
269
+ cursor: hand;
270
+ text-decoration: none;
271
+ }
272
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-block a, div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-block a:visited, div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-block a:active{
273
+ text-decoration: none;
274
+ }
275
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-block:hover,
276
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-block:hover a,
277
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-block:hover h1,
278
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-block:hover h2,
279
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-block:hover h3,
280
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-block:hover h4,
281
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-block:hover h5,
282
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-block:hover h6 {
283
+ text-decoration: none !important;
284
+ color:#fff;
285
+ background: #1188cc;
286
+ }
287
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-block.ewd-ufaq-post-active, div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-block.ewd-ufaq-post-active a{
288
+ color:#fff;
289
+ background: #1188cc;
290
+ }
291
+
292
+
293
+ /***********************
294
+ List Style
295
+ ***********************/
296
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-header-title a {
297
+ display: inline-block;
298
+ }
299
+
300
+
301
+
302
+ /***********************
303
+ Minimalist Style
304
+ ***********************/
305
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-minimalist {
306
+ border-bottom: 1px solid #aaa;
307
+ padding: 8px 0;
308
+ }
309
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-post-margin-symbol {
310
+ float: right;
311
+ height: auto;
312
+ }
313
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-post-margin-symbol span {
314
+ font-size: 22px;
315
+ }
316
+
317
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-faq-body {
318
+ padding: 20px 25px 10px;
319
+ padding-left: 40px;
320
+ }
321
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-faq-tags, div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-social-links {
322
+ margin-top: 4px;
323
+ }
324
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-social-links ul {
325
+ float: left;
326
+ margin-bottom: 14px;
327
+ position: relative;
328
+ width: auto;
329
+ }
330
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-permalink {
331
+ margin: 24px 0;
332
+ }
333
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-permalink-image {
334
+ margin-top: -32px;
335
+ margin-left: 112px;
336
+ }
337
+
338
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-author-date {
339
+ margin-bottom: 14px;
340
+ }
341
+
342
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-faq-categories {
343
+ margin: 14px 0;
344
+ }
345
+
346
+
347
+
348
+ /***********************
349
+ Border Block Style
350
+ ***********************/
351
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-div {
352
+ margin: 2px 0;
353
+ padding:2px 0;
354
+ clear: both;
355
+ }
356
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-toggle:hover, div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-toggle a:hover{
357
+ cursor: pointer;
358
+ cursor: hand;
359
+ text-decoration: none;
360
+ }
361
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block a, div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block a:visited, div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block a:active{
362
+ text-decoration: none;
363
+ }
364
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block:hover,
365
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block:hover a,
366
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block:hover h1,
367
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block:hover h2,
368
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block:hover h3,
369
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block:hover h4,
370
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block:hover h5,
371
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block:hover h6 {
372
+ text-decoration: none !important;
373
+ color:#fff;
374
+ background: #1188cc;
375
+ }
376
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active, div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active a{
377
+ color:#fff !important;
378
+ background: #1188cc;
379
+ }
380
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-body {
381
+ color:#555 !important;
382
+ background: #fff;
383
+ border: 3px solid #1188cc;
384
+ border-bottom: 2px solid #1188cc;
385
+ }
386
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-body a {
387
+ color:#000 !important;
388
+ background: transparent;
389
+ }
390
+
391
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-tags, div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-social-links {
392
+ margin-top: 4px;
393
+ }
394
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-social-links ul {
395
+ float: left;
396
+ margin-bottom: 14px;
397
+ position: relative;
398
+ width: auto;
399
+ }
400
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-permalink {
401
+ margin: 24px 0;
402
+ }
403
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-permalink-image {
404
+ margin-top: -32px;
405
+ margin-left: 112px;
406
+ }
407
+
408
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-author-date {
409
+ margin-bottom: 14px;
410
+ }
411
+
412
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-categories {
413
+ margin: 14px 0;
414
+ }
415
+
416
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active .ewd-ufaq-faq-title-text {
417
+ color: #fff !important;
418
+ }
419
+
420
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block .comment-reply-title {
421
+ background: transparent !important;
422
+ color: #000 !important;
423
+ }
424
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-border_block:hover .comment-reply-title {
425
+ color: #000 !important;
426
+ }
427
+
428
+
429
+
430
+ /***********************
431
+ Contemporary Style
432
+ ***********************/
433
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-contemporary {
434
+ border-bottom: 1px solid #ccc;
435
+ padding: 0;
436
+ margin: 0;
437
+ }
438
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-contemporary:first-of-type {
439
+ border-top: 1px solid #ccc;
440
+ }
441
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-faq-title {
442
+ background: #f7f7f7;
443
+ padding: 8px 0 8px 4px;
444
+ }
445
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-post-margin-symbol {
446
+ float: right;
447
+ height: auto;
448
+ }
449
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-faq-body {
450
+ padding: 20px 25px 10px;
451
+ padding-left: 40px;
452
+ }
453
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-faq-tags, div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-social-links {
454
+ margin-top: 4px;
455
+ }
456
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-social-links ul {
457
+ float: left;
458
+ margin-bottom: 14px;
459
+ position: relative;
460
+ width: auto;
461
+ }
462
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-permalink {
463
+ margin-left: 0;
464
+ margin-bottom: 10px;
465
+ }
466
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-back-to-top {
467
+ margin-bottom: 14px;
468
+ }
469
+
470
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-social-links-label {
471
+ float: left;
472
+ margin-right: 8px;
473
+ position: relative;
474
+ top: 3px;
475
+ }
476
+
477
+
478
+
479
+
480
+ /***********************
481
+ Ratings
482
+ ***********************/
483
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-rating-button {
484
+ position: relative;
485
+ float: left;
486
+ width: 60px;
487
+ height: 48px;
488
+ margin-right: 12px;
489
+ line-height: 48px;
490
+ font-weight: 600;
491
+ cursor: pointer;
492
+
493
+ }
494
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-rating-button img {
495
+ position: absolute;
496
+ top: 0;
497
+ left: 0;
498
+ width: 75%;
499
+ height: auto;
500
+ }
501
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-rating-button span {
502
+ text-align: right;
503
+ width: 100%;
504
+ display: block;
505
+ }
506
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-up-vote {
507
+ background: transparent;
508
+ background-repeat: no-repeat;
509
+ }
510
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-down-vote {
511
+ background: transparent;
512
+ background-repeat: no-repeat;
513
+ }
514
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-ratings-custom-image {
515
+ background: transparent;
516
+ }
517
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-up-image,
518
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-down-image {
519
+ background: none;
520
+ padding-left: 0;
521
+ }
522
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-up-image img,
523
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-down-image img {
524
+ position: relative;
525
+ float: left;
526
+ width: 48px;
527
+ height: auto;
528
+ margin-right: 4px;
529
+ }
530
+
531
+
532
+ /************************
533
+ * Expand/Collapse
534
+ ************************/
535
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-expand-all,
536
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-collapse-all {
537
+ text-decoration: none;
538
+ cursor: pointer;
539
+ font-size: 0.9em;
540
+ }
541
+
542
+ /*
543
+ ==============================================
544
+ Toggle Font
545
+ ==============================================
546
+ */
547
+
548
+ @font-face { /* declare fonts */
549
+ font-family: 'ewd-toggle-icon';
550
+ src: url("../fonts/ewd-toggle-icon.eot");
551
+ src: url('../fonts/ewd-toggle-icon.woff2') format('woff2'),
552
+ url('../fonts/ewd-toggle-icon.woff') format('woff'),
553
+ url("../fonts/ewd-toggle-icon.ttf") format("truetype"),
554
+ url("../fonts/ewd-toggle-icon.svg#ewd-toggle-icon") format("svg");
555
+ font-weight: normal;
556
+ font-style: normal;
557
+ }
558
+
559
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-title .ewd-ufaq-post-margin-symbol,
560
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-toggle-all-symbol {
561
+ font-family: 'ewd-toggle-icon';
562
+ }
563
+
564
+
565
+ /*
566
+ ==============================================
567
+ PChanges
568
+ ==============================================
569
+ */
570
+
571
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-question-update{
572
+ font-size: 1.2em;
573
+ margin-bottom: 20px;
574
+ }
575
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-question-form .form-field {
576
+ margin-bottom: 20px;
577
+ }
578
+
579
+ .rrssb-buttons li a .rrssb-text {
580
+ color: #fff;
581
+ margin-left: 5px;
582
+ }
583
+
584
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-social-links .rrssb-buttons li {
585
+ margin-bottom: 5px;
586
+ }
587
+
588
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-permalink{
589
+ clear: both;
590
+ }
591
+ @media only screen and (max-width: 810px) {
592
+
593
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-faq-title-text {
594
+ width: 80%;
595
+ }
596
+
597
+ }
598
+
599
+
600
+
601
+ /*
602
+ ==============================================
603
+ Pagination
604
+ ==============================================
605
+ */
606
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-previous-faqs, div.wpforms-container-full .wpforms-form .ewd-ufaq-next-faqs {
607
+ margin-top: 16px;
608
+ }
609
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-previous-faqs {
610
+ float: left;
611
+ }
612
+ div.wpforms-container-full .wpforms-form .ewd-ufaq-next-faqs {
613
+ float: right;
614
+ }
css/ewd-ufaq-styles.css → assets/css/ewd-ufaq.css RENAMED
@@ -1,617 +1,616 @@
1
- .ewd-ufaq-hidden {
2
- display:none;
3
- }
4
-
5
- .ufaq-faq-category-title-toggle {
6
- cursor: pointer;
7
- }
8
-
9
- .ufaq-faq-category-body-hidden {
10
- display: none;
11
- }
12
-
13
- .ewd-ufaq-clear {
14
- clear:both;
15
- }
16
-
17
- .ufaq-permalink {
18
- margin: 24px 0;
19
- }
20
- .ufaq-permalink-image {
21
- background: url("../images/insert_link.png");
22
- height: 21px;
23
- width: 30px;
24
- margin-top: -32px;
25
- margin-left: 112px;
26
- }
27
-
28
- .ewd-ufaq-author-date {
29
- }
30
-
31
- .ewd-ufaq-author {
32
- font-weight: 600;
33
- }
34
- .ewd-ufaq-date {
35
- font-weight: 600;
36
- }
37
- .ufaq-faq-categories, .ufaq-faq-tags{
38
- }
39
-
40
- .ufaq {}
41
- /*.ufaq-faq-title {
42
- cursor:pointer;
43
- }*/
44
- .ufaq-faq-category-title {
45
- width: 100%;
46
- clear: both;
47
- }
48
-
49
- .ufaq-faq-category{
50
- margin-bottom: 20px;
51
- }
52
-
53
- .ufaq-faq-category-inner {
54
- margin-bottom: 48px;
55
- }
56
-
57
- .ufaq-faq-body {
58
- padding:10px 25px;
59
- padding-left: 55px;
60
- }
61
- .ufaq-faq-search{
62
- margin:5px 0 !important;
63
- }
64
- .ufaq-search-highlight {
65
- background: #f7ff00;
66
- }
67
- .ewd-otp-field-label{
68
- width: auto !important;
69
- }
70
- .ufaq-text-input {
71
- border-radius: 0 !important;
72
- margin:15px !important;
73
- }
74
- .ewd-ufaq-submit{
75
- border-radius: 0 !important;
76
- }
77
- .ufaq-faq-header{
78
- margin:10px;
79
- }
80
- .ufaq-faq-header a:hover{
81
- text-decoration: none;
82
- }
83
- div.ufaq-faq-title div.ewd-ufaq-post-margin{
84
- text-decoration: none;
85
- }
86
- div.ufaq-faq-title div.ewd-ufaq-post-margin-symbol{
87
- display: inline-block;
88
- text-decoration: none;
89
- float: left;
90
- text-align: center;
91
- /* width:35px;
92
- height: 35px;*/
93
- width: auto;
94
- height: auto;
95
- margin-right: 15px;
96
- padding: 2px 0px 0px 2px;
97
- line-height: 1;
98
- }
99
- .ufaq-faq-title .ewd-ufaq-post-margin-symbol span{
100
- display: inline-block;
101
- font-size: 30px;
102
- margin:0 auto;
103
- }
104
- .ufaq-faq-title-text {
105
- float:left;
106
- width: 90%;
107
- }
108
- .ufaq-faq-title h1,
109
- .ufaq-faq-title h2,
110
- .ufaq-faq-title h3,
111
- .ufaq-faq-title h4,
112
- .ufaq-faq-title h5,
113
- .ufaq-faq-title h6 {
114
- display:inline-block;
115
- margin:5px !important;
116
- }
117
-
118
-
119
-
120
-
121
- .ufaq-custom-field-label, .ufaq-custom-field-value {
122
- position: relative;
123
- float: left;
124
- margin-top: 14px;
125
- }
126
- .ufaq-custom-field-label {
127
- font-weight: normal;
128
- }
129
-
130
- .ufaq-faq-body .comment-respond {
131
- margin-top: 24px;
132
- }
133
- .ufaq-faq-body li.comment {
134
- list-style-type: none;
135
- }
136
- .ufaq-faq-body textarea {
137
- clear: both;
138
- display: block;
139
- position: relative;
140
- width: 35%;
141
- height: 100px;
142
- }
143
- .ufaq-faq-body .comment-form-comment label {
144
- clear: both;
145
- display: block;
146
- position: relative;
147
- width: 100%;
148
- }
149
- .ufaq-faq-body .submit {
150
- width: auto;
151
- background: transparent;
152
- cursor: pointer;
153
- color: #111;
154
- margin-bottom: 20px;
155
- }
156
- .ufaq-faq-body .submit:hover {
157
- background: #111;
158
- color: #fff;
159
- }
160
- .ufaq-faq-body .comment-author img {
161
- margin-right: 8px;
162
- }
163
- .ufaq-faq-body .comment-body p {
164
- margin: 10px 0;
165
- margin-top: 10px !important;
166
- }
167
- .ufaq-faq-body .reply {
168
- text-transform: uppercase;
169
- }
170
-
171
- .ufaq-faq-body .ufaq-back-to-top-link {
172
- cursor: pointer;
173
- }
174
-
175
- .ewd-ufaq-ratings {
176
- padding: 14px 0 0;
177
- }
178
- .ewd-ufaq-down-vote {
179
- background-position: 0px 8px !important;
180
- height: 50px !important;
181
- }
182
-
183
-
184
- /***********************
185
- * Pagination
186
- ***********************/
187
- .ewd-ufaq-bottom {
188
- clear: both;
189
- }
190
- .ewd-ufaq-previous-faqs h4 {
191
- float: left;
192
- padding-left: 12px;
193
- cursor: pointer;
194
- font-weight: 600;
195
- }
196
- .ewd-ufaq-next-faqs h4 {
197
- float: right;
198
- padding-right: 12px;
199
- cursor: pointer;
200
- font-weight: 600;
201
- }
202
- .ewd-ufaq-load-more h4 {
203
- text-align: center;
204
- cursor: pointer;
205
- font-weight: 600;
206
- }
207
-
208
-
209
- /***********************
210
- * Columns
211
- ***********************/
212
- .ufaq-faq-div.ufaq-faq-column-count-Two {
213
- width: 48%;
214
- margin-right: 2%;
215
- float: left;
216
- clear: none;
217
- }
218
- .ufaq-faq-div.ufaq-faq-column-count-Three {
219
- width: 31%;
220
- margin-right: 2%;
221
- float: left;
222
- clear: none;
223
- }
224
- .ufaq-faq-div.ufaq-faq-column-count-Four {
225
- width: 23%;
226
- margin-right: 2%;
227
- float: left;
228
- clear: none;
229
- }
230
-
231
- @media only screen and (max-width: 960px) {
232
- .ufaq-faq-div.ufaq-faq-column-count-Three.ufaq-faq-responsive-columns-Yes,
233
- .ufaq-faq-div.ufaq-faq-column-count-Four.ufaq-faq-responsive-columns-Yes {
234
- width: 48%;
235
- margin-right: 2%;
236
- }
237
- }
238
- @media only screen and (max-width: 520px) {
239
- .ufaq-faq-div.ufaq-faq-column-count-Two.ufaq-faq-responsive-columns-Yes,
240
- .ufaq-faq-div.ufaq-faq-column-count-Three.ufaq-faq-responsive-columns-Yes,
241
- .ufaq-faq-div.ufaq-faq-column-count-Four.ufaq-faq-responsive-columns-Yes {
242
- width: 100%;
243
- margin-right: none;
244
- }
245
- }
246
-
247
- /***********************
248
- Color Block Style
249
- ***********************/
250
- .ufaq-faq-display-style-Color_Block .ewd-ufaq-post-margin-symbol {
251
- background-color: #1188cc;
252
- color: #ffffff;
253
- }
254
-
255
- .ewd-ufaq-Circle {
256
- border-radius: 18px;
257
- }
258
-
259
- .ewd-ufaq-Square {
260
- border-radius: 0px;
261
- }
262
-
263
-
264
- /***********************
265
- Block Style
266
- ***********************/
267
- .ufaq-faq-div {
268
- margin: 2px 0;
269
- padding:2px 0;
270
- clear: both;
271
- }
272
- .ufaq-faq-toggle:hover, .ufaq-faq-toggle a:hover{
273
- cursor: pointer;
274
- cursor: hand;
275
- text-decoration: none;
276
- }
277
- .ufaq-faq-title{
278
- }
279
- .ufaq-faq-display-style-Block a, .ufaq-faq-display-style-Block a:visited, .ufaq-faq-display-style-Block a:active{
280
- text-decoration: none;
281
- }
282
- .ufaq-faq-display-style-Block:hover,
283
- .ufaq-faq-display-style-Block:hover a,
284
- .ufaq-faq-display-style-Block:hover h1,
285
- .ufaq-faq-display-style-Block:hover h2,
286
- .ufaq-faq-display-style-Block:hover h3,
287
- .ufaq-faq-display-style-Block:hover h4,
288
- .ufaq-faq-display-style-Block:hover h5,
289
- .ufaq-faq-display-style-Block:hover h6 {
290
- text-decoration: none !important;
291
- color:#fff !important;
292
- background: #1188cc;
293
- }
294
- .ufaq-faq-display-style-Block.ewd-ufaq-post-active, .ufaq-faq-display-style-Block.ewd-ufaq-post-active a{
295
- color:#fff !important;
296
- background: #1188cc;
297
- }
298
-
299
-
300
- /***********************
301
- List Style
302
- ***********************/
303
- .ufaq-faq-header-title a{
304
- display: inline-block;
305
- }
306
-
307
-
308
-
309
- /***********************
310
- Minimalist Style
311
- ***********************/
312
- .ufaq-faq-display-style-Minimalist {
313
- border-bottom: 1px solid #aaa;
314
- padding: 8px 0;
315
- }
316
- .ufaq-faq-display-style-Minimalist .ewd-ufaq-post-margin-symbol {
317
- float: right;
318
- height: auto;
319
- }
320
- .ufaq-faq-display-style-Minimalist .ewd-ufaq-post-margin-symbol span {
321
- font-size: 22px;
322
- }
323
-
324
- .ufaq-faq-display-style-Minimalist .ufaq-faq-body {
325
- padding: 20px 25px 10px;
326
- padding-left: 40px;
327
- }
328
- .ufaq-faq-display-style-Minimalist .ufaq-faq-tags, .ufaq-faq-display-style-Minimalist .ufaq-social-links {
329
- margin-top: 4px;
330
- }
331
- .ufaq-faq-display-style-Minimalist .ufaq-social-links ul {
332
- float: left;
333
- margin-bottom: 14px;
334
- position: relative;
335
- width: auto;
336
- }
337
- .ufaq-faq-display-style-Minimalist .ufaq-permalink {
338
- margin: 24px 0;
339
- }
340
- .ufaq-faq-display-style-Minimalist .ufaq-permalink-image {
341
- margin-top: -32px;
342
- margin-left: 112px;
343
- }
344
-
345
- .ufaq-faq-display-style-Minimalist .ewd-ufaq-author-date {
346
- margin-bottom: 14px;
347
- }
348
-
349
- .ufaq-faq-display-style-Minimalist .ufaq-faq-categories {
350
- margin: 14px 0;
351
- }
352
-
353
-
354
-
355
- /***********************
356
- Border Block Style
357
- ***********************/
358
- .ufaq-faq-div {
359
- margin: 2px 0;
360
- padding:2px 0;
361
- clear: both;
362
- }
363
- .ufaq-faq-toggle:hover, .ufaq-faq-toggle a:hover{
364
- cursor: pointer;
365
- cursor: hand;
366
- text-decoration: none;
367
- }
368
- .ufaq-faq-title{
369
- }
370
- .ufaq-faq-display-style-Border_Block a, .ufaq-faq-display-style-Border_Block a:visited, .ufaq-faq-display-style-Border_Block a:active{
371
- text-decoration: none;
372
- }
373
- .ufaq-faq-display-style-Border_Block:hover,
374
- .ufaq-faq-display-style-Border_Block:hover a,
375
- .ufaq-faq-display-style-Border_Block:hover h1,
376
- .ufaq-faq-display-style-Border_Block:hover h2,
377
- .ufaq-faq-display-style-Border_Block:hover h3,
378
- .ufaq-faq-display-style-Border_Block:hover h4,
379
- .ufaq-faq-display-style-Border_Block:hover h5,
380
- .ufaq-faq-display-style-Border_Block:hover h6 {
381
- text-decoration: none !important;
382
- color:#fff !important;
383
- background: #1188cc;
384
- }
385
- .ufaq-faq-display-style-Border_Block.ewd-ufaq-post-active, .ufaq-faq-display-style-Border_Block.ewd-ufaq-post-active a{
386
- color:#fff !important;
387
- background: #1188cc;
388
- }
389
- .ufaq-faq-display-style-Border_Block .ufaq-faq-body {
390
- color:#555 !important;
391
- background: #fff;
392
- border: 3px solid #1188cc;
393
- border-bottom: 2px solid #1188cc;
394
- }
395
- .ufaq-faq-display-style-Border_Block .ufaq-faq-body a {
396
- color:#000 !important;
397
- background: transparent;
398
- }
399
-
400
- .ufaq-faq-display-style-Border_Block .ufaq-faq-tags, .ufaq-faq-display-style-Border_Block .ufaq-social-links {
401
- margin-top: 4px;
402
- }
403
- .ufaq-faq-display-style-Border_Block .ufaq-social-links ul {
404
- float: left;
405
- margin-bottom: 14px;
406
- position: relative;
407
- width: auto;
408
- }
409
- .ufaq-faq-display-style-Border_Block .ufaq-permalink {
410
- margin: 24px 0;
411
- }
412
- .ufaq-faq-display-style-Border_Block .ufaq-permalink-image {
413
- margin-top: -32px;
414
- margin-left: 112px;
415
- }
416
-
417
- .ufaq-faq-display-style-Border_Block .ewd-ufaq-author-date {
418
- margin-bottom: 14px;
419
- }
420
-
421
- .ufaq-faq-display-style-Border_Block .ufaq-faq-categories {
422
- margin: 14px 0;
423
- }
424
-
425
- .ufaq-faq-display-style-Border_Block.ewd-ufaq-post-active .ufaq-faq-title-text {
426
- color: #fff !important;
427
- }
428
-
429
- .ufaq-faq-display-style-Border_Block .comment-reply-title {
430
- background: transparent !important;
431
- color: #000 !important;
432
- }
433
- .ufaq-faq-display-style-Border_Block:hover .comment-reply-title {
434
- color: #000 !important;
435
- }
436
-
437
-
438
-
439
- /***********************
440
- Contemporary Style
441
- ***********************/
442
- .ufaq-faq-display-style-Contemporary {
443
- border-bottom: 1px solid #ccc;
444
- padding: 0;
445
- margin: 0;
446
- }
447
- .ufaq-faq-display-style-Contemporary:first-of-type {
448
- border-top: 1px solid #ccc;
449
- }
450
- .ufaq-faq-display-style-Contemporary .ufaq-faq-title {
451
- background: #f7f7f7;
452
- padding: 8px 0 8px 4px;
453
- }
454
- .ufaq-faq-display-style-Contemporary .ewd-ufaq-post-margin-symbol {
455
- float: right;
456
- height: auto;
457
- }
458
- .ufaq-faq-display-style-Contemporary .ufaq-faq-body {
459
- padding: 20px 25px 10px;
460
- padding-left: 40px;
461
- }
462
- .ufaq-faq-display-style-Contemporary .ufaq-faq-tags, .ufaq-faq-display-style-Contemporary .ufaq-social-links {
463
- margin-top: 4px;
464
- }
465
- .ufaq-faq-display-style-Contemporary .ufaq-social-links ul {
466
- float: left;
467
- margin-bottom: 14px;
468
- position: relative;
469
- width: auto;
470
- }
471
- .ufaq-faq-display-style-Contemporary .ufaq-permalink {
472
- margin-left: 0;
473
- margin-bottom: 10px;
474
- }
475
- .ufaq-faq-display-style-Contemporary .ufaq-back-to-top {
476
- margin-bottom: 14px;
477
- }
478
-
479
- .ufaq-social-links-label {
480
- float: left;
481
- margin-right: 8px;
482
- position: relative;
483
- top: 3px;
484
- }
485
-
486
-
487
-
488
-
489
- /***********************
490
- Ratings
491
- ***********************/
492
- .ewd-ufaq-rating-button {
493
- height: 48px;
494
- padding-left: 52px;
495
- margin-right: 12px;
496
- line-height: 48px;
497
- float: left;
498
- font-weight: 600;
499
- cursor: pointer;
500
-
501
- }
502
- .ewd-ufaq-up-vote {
503
- background: url("../images/Thumbs-up-icon.png");
504
- background-repeat: no-repeat;
505
- }
506
- .ewd-ufaq-down-vote {
507
- background: url("../images/Thumbs-down-icon.png");
508
- background-repeat: no-repeat;
509
- }
510
- .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-up-image,
511
- .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-down-image {
512
- background: none;
513
- padding-left: 0;
514
- }
515
- .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-up-image img,
516
- .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-down-image img {
517
- position: relative;
518
- float: left;
519
- width: 48px;
520
- height: auto;
521
- margin-right: 4px;
522
- }
523
-
524
-
525
- /************************
526
- * Expand/Collapse
527
- ************************/
528
- .ewd-ufaq-expand-all,
529
- .ewd-ufaq-collapse-all {
530
- text-decoration: none;
531
- cursor: pointer;
532
- font-size: 0.9em;
533
- }
534
-
535
- /*
536
- ==============================================
537
- Toggle Font
538
- ==============================================
539
- */
540
-
541
- @font-face { /* declare fonts */
542
- font-family: 'ewd-toggle-icon';
543
- src: url("fonts/ewd-toggle-icon.eot");
544
- src: url('fonts/ewd-toggle-icon.woff2') format('woff2'),
545
- url('fonts/ewd-toggle-icon.woff') format('woff'),
546
- url("fonts/ewd-toggle-icon.ttf") format("truetype"),
547
- url("fonts/ewd-toggle-icon.svg#ewd-toggle-icon") format("svg");
548
- font-weight: normal;
549
- font-style: normal;
550
- }
551
-
552
- .ufaq-faq-title .ewd-ufaq-post-margin-symbol,
553
- .ewd-ufaq-toggle-all-symbol {
554
- font-family: 'ewd-toggle-icon';
555
- }
556
-
557
-
558
- /*
559
- ==============================================
560
- PChanges
561
- ==============================================
562
- */
563
-
564
- .ewd-ufaq-question-update{
565
- font-size: 1.2em;
566
- margin-bottom: 20px;
567
- }
568
- .ewd-ufaq-question-form .form-field {
569
- margin-bottom: 20px;
570
- }
571
-
572
- .rrssb-buttons li a .rrssb-text {
573
- color: #fff;
574
- margin-left: 5px;
575
- }
576
-
577
- .ufaq-social-links .rrssb-buttons li {
578
- margin-bottom: 5px;
579
- }
580
-
581
- .ufaq-permalink{
582
- clear: both;
583
- }
584
- @media only screen and (max-width: 810px) {
585
-
586
- .ufaq-faq-title-text {
587
- width: 80%;
588
- }
589
-
590
- }
591
-
592
-
593
-
594
- /*
595
- ==============================================
596
- Pagination
597
- ==============================================
598
- */
599
- .ewd-ufaq-previous-faqs, .ewd-ufaq-next-faqs {
600
- margin-top: 16px;
601
- }
602
- .ewd-ufaq-previous-faqs {
603
- float: left;
604
- }
605
- .ewd-ufaq-next-faqs {
606
- float: right;
607
- }
608
-
609
-
610
- /*
611
- =============================================
612
- WP Forms
613
- =============================================
614
- */
615
- .ewd-ufaq-wpforms-label {
616
-
617
- }
1
+ .ewd-ufaq-hidden {
2
+ display:none;
3
+ }
4
+
5
+ .ewd-ufaq-faq-category-title-toggle {
6
+ cursor: pointer;
7
+ }
8
+
9
+ .ewd-ufaq-faq-category-body-hidden {
10
+ display: none;
11
+ }
12
+
13
+ .ewd-ufaq-clear {
14
+ clear:both;
15
+ }
16
+
17
+ .ewd-ufaq-permalink {
18
+ margin: 24px 0;
19
+ }
20
+ .ewd-ufaq-permalink-image {
21
+ background: url("../img/insert_link.png");
22
+ height: 21px;
23
+ width: 30px;
24
+ margin-top: -32px;
25
+ margin-left: 112px;
26
+ }
27
+
28
+
29
+ .ewd-ufaq-author {
30
+ font-weight: 600;
31
+ }
32
+ .ewd-ufaq-date {
33
+ font-weight: 600;
34
+ }
35
+
36
+ .ewd-ufaq-faq-category-title {
37
+ width: 100%;
38
+ clear: both;
39
+ }
40
+
41
+ .ewd-ufaq-faq-category{
42
+ margin-bottom: 20px;
43
+ }
44
+
45
+ .ewd-ufaq-faq-category-inner {
46
+ margin-bottom: 48px;
47
+ }
48
+
49
+ .ewd-ufaq-faq-body {
50
+ padding:10px 25px;
51
+ padding-left: 55px;
52
+ }
53
+ .ewd-ufaq-faq-search{
54
+ margin:5px 0 !important;
55
+ }
56
+ .ewd-ufaq-search-highlight {
57
+ background: #f7ff00;
58
+ }
59
+ .ewd-otp-field-label{
60
+ width: auto !important;
61
+ }
62
+ .ewd-ufaq-text-input {
63
+ border-radius: 0 !important;
64
+ margin:15px !important;
65
+ }
66
+ .ewd-ufaq-submit{
67
+ border-radius: 0 !important;
68
+ }
69
+ .ewd-ufaq-faq-header{
70
+ margin:10px;
71
+ }
72
+ .ewd-ufaq-faq-header a:hover{
73
+ text-decoration: none;
74
+ }
75
+ div.ewd-ufaq-faq-title div.ewd-ufaq-post-margin{
76
+ text-decoration: none;
77
+ }
78
+ div.ewd-ufaq-faq-title div.ewd-ufaq-post-margin-symbol{
79
+ text-decoration: none;
80
+ float: left;
81
+ text-align: center;
82
+ /* width:35px;
83
+ height: 35px;*/
84
+ width: auto;
85
+ height: auto;
86
+ margin-right: 15px;
87
+ padding: 2px 0px 0px 2px;
88
+ line-height: 1;
89
+ border-style: solid;
90
+ }
91
+ .ewd-ufaq-faq-title .ewd-ufaq-post-margin-symbol span{
92
+ display: inline-block;
93
+ font-size: 30px;
94
+ margin: 0 auto;
95
+ }
96
+ .ewd-ufaq-faq-title-text {
97
+ float: left;
98
+ width: 85%;
99
+ }
100
+ .ewd-ufaq-faq-title h1,
101
+ .ewd-ufaq-faq-title h2,
102
+ .ewd-ufaq-faq-title h3,
103
+ .ewd-ufaq-faq-title h4,
104
+ .ewd-ufaq-faq-title h5,
105
+ .ewd-ufaq-faq-title h6 {
106
+ display:inline-block;
107
+ margin:5px !important;
108
+ }
109
+
110
+
111
+
112
+
113
+ .ewd-ufaq-custom-field-label, .ewd-ufaq-custom-field-value {
114
+ position: relative;
115
+ float: left;
116
+ margin-top: 14px;
117
+ }
118
+ .ewd-ufaq-custom-field-label {
119
+ font-weight: normal;
120
+ }
121
+
122
+ .ewd-ufaq-faq-body .comment-respond {
123
+ margin-top: 24px;
124
+ }
125
+ .ewd-ufaq-faq-body li.comment {
126
+ list-style-type: none;
127
+ }
128
+ .ewd-ufaq-faq-body textarea {
129
+ clear: both;
130
+ display: block;
131
+ position: relative;
132
+ width: 35%;
133
+ height: 100px;
134
+ }
135
+ .ewd-ufaq-faq-body .comment-form-comment label {
136
+ clear: both;
137
+ display: block;
138
+ position: relative;
139
+ width: 100%;
140
+ }
141
+ .ewd-ufaq-faq-body .submit {
142
+ width: auto;
143
+ background: transparent;
144
+ cursor: pointer;
145
+ color: #111;
146
+ margin-bottom: 20px;
147
+ }
148
+ .ewd-ufaq-faq-body .submit:hover {
149
+ background: #111;
150
+ color: #fff;
151
+ }
152
+ .ewd-ufaq-faq-body .comment-author img {
153
+ margin-right: 8px;
154
+ }
155
+ .ewd-ufaq-faq-body .comment-body p {
156
+ margin: 10px 0;
157
+ margin-top: 10px !important;
158
+ }
159
+ .ewd-ufaq-faq-body .reply {
160
+ text-transform: uppercase;
161
+ }
162
+
163
+ .ewd-ufaq-faq-body .ewd-ufaq-back-to-top-link {
164
+ cursor: pointer;
165
+ }
166
+
167
+ .ewd-ufaq-ratings {
168
+ padding: 14px 0 0;
169
+ display: inline-block;
170
+ width: 100%;
171
+ margin-bottom: 20px;
172
+ }
173
+ .ewd-ufaq-down-vote {
174
+ background-position: 0px 8px !important;
175
+ height: 50px !important;
176
+ }
177
+
178
+
179
+ /***********************
180
+ * Pagination
181
+ ***********************/
182
+ .ewd-ufaq-bottom {
183
+ clear: both;
184
+ }
185
+ .ewd-ufaq-previous-faqs h4 {
186
+ float: left;
187
+ padding-left: 12px;
188
+ cursor: pointer;
189
+ font-weight: 600;
190
+ }
191
+ .ewd-ufaq-next-faqs h4 {
192
+ float: right;
193
+ padding-right: 12px;
194
+ cursor: pointer;
195
+ font-weight: 600;
196
+ }
197
+ .ewd-ufaq-load-more h4 {
198
+ text-align: center;
199
+ cursor: pointer;
200
+ font-weight: 600;
201
+ }
202
+
203
+
204
+ /***********************
205
+ * Columns
206
+ ***********************/
207
+ .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-two {
208
+ width: 48%;
209
+ margin-right: 2%;
210
+ float: left;
211
+ clear: none;
212
+ }
213
+ .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-three {
214
+ width: 31%;
215
+ margin-right: 2%;
216
+ float: left;
217
+ clear: none;
218
+ }
219
+ .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-four {
220
+ width: 23%;
221
+ margin-right: 2%;
222
+ float: left;
223
+ clear: none;
224
+ }
225
+
226
+ @media only screen and (max-width: 960px) {
227
+ .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-three.ewd-ufaq-faq-responsive-columns-1,
228
+ .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-four.ewd-ufaq-faq-responsive-columns-1 {
229
+ width: 48%;
230
+ margin-right: 2%;
231
+ }
232
+ }
233
+ @media only screen and (max-width: 520px) {
234
+ .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-two.ewd-ufaq-faq-responsive-columns-1,
235
+ .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-three.ewd-ufaq-faq-responsive-columns-1,
236
+ .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-four.ewd-ufaq-faq-responsive-columns-1 {
237
+ width: 100%;
238
+ margin-right: none;
239
+ }
240
+ }
241
+
242
+ /***********************
243
+ Color Block Style
244
+ ***********************/
245
+ .ewd-ufaq-faq-display-style-color_block .ewd-ufaq-post-margin-symbol {
246
+ background-color: #1188cc;
247
+ color: #ffffff;
248
+ }
249
+
250
+ .ewd-ufaq-Circle {
251
+ border-radius: 18px;
252
+ }
253
+
254
+ .ewd-ufaq-Square {
255
+ border-radius: 0px;
256
+ }
257
+
258
+
259
+ /***********************
260
+ Block Style
261
+ ***********************/
262
+ .ewd-ufaq-faq-div {
263
+ margin: 2px 0;
264
+ padding:2px 0;
265
+ clear: both;
266
+ }
267
+ .ewd-ufaq-faq-toggle:hover, .ewd-ufaq-faq-toggle a:hover{
268
+ cursor: pointer;
269
+ cursor: hand;
270
+ text-decoration: none;
271
+ }
272
+ .ewd-ufaq-faq-display-style-block a, .ewd-ufaq-faq-display-style-block a:visited, .ewd-ufaq-faq-display-style-block a:active{
273
+ text-decoration: none;
274
+ }
275
+ .ewd-ufaq-faq-display-style-block:hover,
276
+ .ewd-ufaq-faq-display-style-block:hover a,
277
+ .ewd-ufaq-faq-display-style-block:hover h1,
278
+ .ewd-ufaq-faq-display-style-block:hover h2,
279
+ .ewd-ufaq-faq-display-style-block:hover h3,
280
+ .ewd-ufaq-faq-display-style-block:hover h4,
281
+ .ewd-ufaq-faq-display-style-block:hover h5,
282
+ .ewd-ufaq-faq-display-style-block:hover h6 {
283
+ text-decoration: none !important;
284
+ color:#fff;
285
+ background: #1188cc;
286
+ }
287
+ .ewd-ufaq-faq-display-style-block.ewd-ufaq-post-active, .ewd-ufaq-faq-display-style-block.ewd-ufaq-post-active a{
288
+ color:#fff;
289
+ background: #1188cc;
290
+ }
291
+
292
+
293
+ /***********************
294
+ List Style
295
+ ***********************/
296
+ .ewd-ufaq-faq-header-title a {
297
+ display: inline-block;
298
+ }
299
+
300
+
301
+
302
+ /***********************
303
+ Minimalist Style
304
+ ***********************/
305
+ .ewd-ufaq-faq-display-style-minimalist {
306
+ border-bottom: 1px solid #aaa;
307
+ padding: 8px 0;
308
+ }
309
+ .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-post-margin-symbol {
310
+ float: right;
311
+ height: auto;
312
+ }
313
+ .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-post-margin-symbol span {
314
+ font-size: 22px;
315
+ }
316
+
317
+ .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-faq-body {
318
+ padding: 20px 25px 10px;
319
+ padding-left: 40px;
320
+ }
321
+ .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-faq-tags, .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-social-links {
322
+ margin-top: 4px;
323
+ }
324
+ .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-social-links ul {
325
+ float: left;
326
+ margin-bottom: 14px;
327
+ position: relative;
328
+ width: auto;
329
+ }
330
+ .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-permalink {
331
+ margin: 24px 0;
332
+ }
333
+ .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-permalink-image {
334
+ margin-top: -32px;
335
+ margin-left: 112px;
336
+ }
337
+
338
+ .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-author-date {
339
+ margin-bottom: 14px;
340
+ }
341
+
342
+ .ewd-ufaq-faq-display-style-minimalist .ewd-ufaq-faq-categories {
343
+ margin: 14px 0;
344
+ }
345
+
346
+
347
+
348
+ /***********************
349
+ Border Block Style
350
+ ***********************/
351
+ .ewd-ufaq-faq-div {
352
+ margin: 2px 0;
353
+ padding:2px 0;
354
+ clear: both;
355
+ }
356
+ .ewd-ufaq-faq-toggle:hover, .ewd-ufaq-faq-toggle a:hover{
357
+ cursor: pointer;
358
+ cursor: hand;
359
+ text-decoration: none;
360
+ }
361
+ .ewd-ufaq-faq-display-style-border_block a, .ewd-ufaq-faq-display-style-border_block a:visited, .ewd-ufaq-faq-display-style-border_block a:active{
362
+ text-decoration: none;
363
+ }
364
+ .ewd-ufaq-faq-display-style-border_block:hover,
365
+ .ewd-ufaq-faq-display-style-border_block:hover a,
366
+ .ewd-ufaq-faq-display-style-border_block:hover h1,
367
+ .ewd-ufaq-faq-display-style-border_block:hover h2,
368
+ .ewd-ufaq-faq-display-style-border_block:hover h3,
369
+ .ewd-ufaq-faq-display-style-border_block:hover h4,
370
+ .ewd-ufaq-faq-display-style-border_block:hover h5,
371
+ .ewd-ufaq-faq-display-style-border_block:hover h6 {
372
+ text-decoration: none !important;
373
+ color:#fff;
374
+ background: #1188cc;
375
+ }
376
+ .ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active, .ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active a{
377
+ color:#fff !important;
378
+ background: #1188cc;
379
+ }
380
+ .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-body {
381
+ color:#555 !important;
382
+ background: #fff;
383
+ border: 3px solid #1188cc;
384
+ border-bottom: 2px solid #1188cc;
385
+ }
386
+ .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-body a {
387
+ color:#000 !important;
388
+ background: transparent;
389
+ }
390
+
391
+ .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-tags, .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-social-links {
392
+ margin-top: 4px;
393
+ }
394
+ .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-social-links ul {
395
+ float: left;
396
+ margin-bottom: 14px;
397
+ position: relative;
398
+ width: auto;
399
+ }
400
+ .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-permalink {
401
+ margin: 24px 0;
402
+ }
403
+ .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-permalink-image {
404
+ margin-top: -32px;
405
+ margin-left: 112px;
406
+ }
407
+
408
+ .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-author-date {
409
+ margin-bottom: 14px;
410
+ }
411
+
412
+ .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-categories {
413
+ margin: 14px 0;
414
+ }
415
+
416
+ .ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active .ewd-ufaq-faq-title-text {
417
+ color: #fff !important;
418
+ }
419
+
420
+ .ewd-ufaq-faq-display-style-border_block .comment-reply-title {
421
+ background: transparent !important;
422
+ color: #000 !important;
423
+ }
424
+ .ewd-ufaq-faq-display-style-border_block:hover .comment-reply-title {
425
+ color: #000 !important;
426
+ }
427
+
428
+
429
+
430
+ /***********************
431
+ Contemporary Style
432
+ ***********************/
433
+ .ewd-ufaq-faq-display-style-contemporary {
434
+ border-bottom: 1px solid #ccc;
435
+ padding: 0;
436
+ margin: 0;
437
+ }
438
+ .ewd-ufaq-faq-display-style-contemporary:first-of-type {
439
+ border-top: 1px solid #ccc;
440
+ }
441
+ .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-faq-title {
442
+ background: #f7f7f7;
443
+ padding: 8px 0 8px 4px;
444
+ }
445
+ .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-post-margin-symbol {
446
+ float: right;
447
+ height: auto;
448
+ }
449
+ .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-faq-body {
450
+ padding: 20px 25px 10px;
451
+ padding-left: 40px;
452
+ }
453
+ .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-faq-tags, .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-social-links {
454
+ margin-top: 4px;
455
+ }
456
+ .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-social-links ul {
457
+ float: left;
458
+ margin-bottom: 14px;
459
+ position: relative;
460
+ width: auto;
461
+ }
462
+ .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-permalink {
463
+ margin-left: 0;
464
+ margin-bottom: 10px;
465
+ }
466
+ .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-back-to-top {
467
+ margin-bottom: 14px;
468
+ }
469
+
470
+ .ewd-ufaq-social-links-label {
471
+ float: left;
472
+ margin-right: 8px;
473
+ position: relative;
474
+ top: 3px;
475
+ }
476
+
477
+
478
+
479
+
480
+ /***********************
481
+ Ratings
482
+ ***********************/
483
+ .ewd-ufaq-rating-button {
484
+ position: relative;
485
+ float: left;
486
+ width: 60px;
487
+ height: 48px;
488
+ margin-right: 12px;
489
+ line-height: 48px;
490
+ font-weight: 600;
491
+ cursor: pointer;
492
+
493
+ }
494
+ .ewd-ufaq-rating-button img {
495
+ position: absolute;
496
+ top: 0;
497
+ left: 0;
498
+ width: 75%;
499
+ height: auto;
500
+ }
501
+ .ewd-ufaq-rating-button span {
502
+ text-align: right;
503
+ width: 100%;
504
+ display: block;
505
+ }
506
+ .ewd-ufaq-up-vote {
507
+ background: transparent;
508
+ background-repeat: no-repeat;
509
+ }
510
+ .ewd-ufaq-down-vote {
511
+ background: transparent;
512
+ background-repeat: no-repeat;
513
+ }
514
+ .ewd-ufaq-ratings-custom-image {
515
+ background: transparent;
516
+ }
517
+ .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-up-image,
518
+ .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-down-image {
519
+ background: none;
520
+ padding-left: 0;
521
+ }
522
+ .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-up-image img,
523
+ .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-down-image img {
524
+ position: relative;
525
+ float: left;
526
+ width: 48px;
527
+ height: auto;
528
+ margin-right: 4px;
529
+ }
530
+
531
+
532
+ /************************
533
+ * Expand/Collapse
534
+ ************************/
535
+ .ewd-ufaq-expand-all,
536
+ .ewd-ufaq-collapse-all {
537
+ text-decoration: none;
538
+ cursor: pointer;
539
+ font-size: 0.9em;
540
+ }
541
+
542
+ /*
543
+ ==============================================
544
+ Toggle Font
545
+ ==============================================
546
+ */
547
+
548
+ @font-face { /* declare fonts */
549
+ font-family: 'ewd-toggle-icon';
550
+ src: url("../fonts/ewd-toggle-icon.eot");
551
+ src: url('../fonts/ewd-toggle-icon.woff2') format('woff2'),
552
+ url('../fonts/ewd-toggle-icon.woff') format('woff'),
553
+ url("../fonts/ewd-toggle-icon.ttf") format("truetype"),
554
+ url("../fonts/ewd-toggle-icon.svg#ewd-toggle-icon") format("svg");
555
+ font-weight: normal;
556
+ font-style: normal;
557
+ }
558
+
559
+ .ewd-ufaq-faq-title .ewd-ufaq-post-margin-symbol,
560
+ .ewd-ufaq-toggle-all-symbol {
561
+ font-family: 'ewd-toggle-icon';
562
+ }
563
+
564
+
565
+ /*
566
+ ==============================================
567
+ PChanges
568
+ ==============================================
569
+ */
570
+
571
+ .ewd-ufaq-question-update{
572
+ font-size: 1.2em;
573
+ margin-bottom: 20px;
574
+ }
575
+ .ewd-ufaq-question-form .form-field {
576
+ margin-bottom: 20px;
577
+ }
578
+
579
+ .rrssb-buttons li a .rrssb-text {
580
+ color: #fff;
581
+ margin-left: 5px;
582
+ }
583
+
584
+ .ewd-ufaq-social-links .rrssb-buttons li {
585
+ margin-bottom: 5px;
586
+ }
587
+
588
+ .ewd-ufaq-permalink{
589
+ clear: both;
590
+ }
591
+ @media only screen and (max-width: 810px) {
592
+
593
+ .ewd-ufaq-faq-title-text {
594
+ width: 80%;
595
+ }
596
+
597
+ }
598
+
599
+
600
+
601
+ /*
602
+ ==============================================
603
+ Pagination
604
+ ==============================================
605
+ */
606
+ .ewd-ufaq-previous-faqs, .ewd-ufaq-next-faqs {
607
+ margin-top: 16px;
608
+ }
609
+ .ewd-ufaq-previous-faqs {
610
+ float: left;
611
+ }
612
+ .ewd-ufaq-next-faqs {
613
+ float: right;
614
+ }
615
+
616
+
 
assets/css/jquery-ui.min.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.12.1 - 2016-09-14
2
+ * http://jqueryui.com
3
+ * Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?bgShadowXPos=&bgOverlayXPos=&bgErrorXPos=&bgHighlightXPos=&bgContentXPos=&bgHeaderXPos=&bgActiveXPos=&bgHoverXPos=&bgDefaultXPos=&bgShadowYPos=&bgOverlayYPos=&bgErrorYPos=&bgHighlightYPos=&bgContentYPos=&bgHeaderYPos=&bgActiveYPos=&bgHoverYPos=&bgDefaultYPos=&bgShadowRepeat=&bgOverlayRepeat=&bgErrorRepeat=&bgHighlightRepeat=&bgContentRepeat=&bgHeaderRepeat=&bgActiveRepeat=&bgHoverRepeat=&bgDefaultRepeat=&iconsHover=url(%22images%2Fui-icons_555555_256x240.png%22)&iconsHighlight=url(%22images%2Fui-icons_777620_256x240.png%22)&iconsHeader=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsError=url(%22images%2Fui-icons_cc0000_256x240.png%22)&iconsDefault=url(%22images%2Fui-icons_777777_256x240.png%22)&iconsContent=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsActive=url(%22images%2Fui-icons_ffffff_256x240.png%22)&bgImgUrlShadow=&bgImgUrlOverlay=&bgImgUrlHover=&bgImgUrlHighlight=&bgImgUrlHeader=&bgImgUrlError=&bgImgUrlDefault=&bgImgUrlContent=&bgImgUrlActive=&opacityFilterShadow=Alpha(Opacity%3D30)&opacityFilterOverlay=Alpha(Opacity%3D30)&opacityShadowPerc=30&opacityOverlayPerc=30&iconColorHover=%23555555&iconColorHighlight=%23777620&iconColorHeader=%23444444&iconColorError=%23cc0000&iconColorDefault=%23777777&iconColorContent=%23444444&iconColorActive=%23ffffff&bgImgOpacityShadow=0&bgImgOpacityOverlay=0&bgImgOpacityError=95&bgImgOpacityHighlight=55&bgImgOpacityContent=75&bgImgOpacityHeader=75&bgImgOpacityActive=65&bgImgOpacityHover=75&bgImgOpacityDefault=75&bgTextureShadow=flat&bgTextureOverlay=flat&bgTextureError=flat&bgTextureHighlight=flat&bgTextureContent=flat&bgTextureHeader=flat&bgTextureActive=flat&bgTextureHover=flat&bgTextureDefault=flat&cornerRadius=3px&fwDefault=normal&ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&cornerRadiusShadow=8px&thicknessShadow=5px&offsetLeftShadow=0px&offsetTopShadow=0px&opacityShadow=.3&bgColorShadow=%23666666&opacityOverlay=.3&bgColorOverlay=%23aaaaaa&fcError=%235f3f3f&borderColorError=%23f1a899&bgColorError=%23fddfdf&fcHighlight=%23777620&borderColorHighlight=%23dad55e&bgColorHighlight=%23fffa90&fcContent=%23333333&borderColorContent=%23dddddd&bgColorContent=%23ffffff&fcHeader=%23333333&borderColorHeader=%23dddddd&bgColorHeader=%23e9e9e9&fcActive=%23ffffff&borderColorActive=%23003eff&bgColorActive=%23007fff&fcHover=%232b2b2b&borderColorHover=%23cccccc&bgColorHover=%23ededed&fcDefault=%23454545&borderColorDefault=%23c5c5c5&bgColorDefault=%23f6f6f6
5
+ * Copyright jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;font-size:100%}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup > .ui-controlgroup-item:focus,.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc( 100% - 2.4em )}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-text{display:block;margin-right:20px;overflow:hidden;text-overflow:ellipsis}.ui-selectmenu-button.ui-button{text-align:left;white-space:nowrap;width:14em}.ui-selectmenu-icon.ui-icon{float:right;margin-top:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:.222em 0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:2em}.ui-spinner-button{width:1.6em;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top-style:none;border-bottom-style:none;border-right-style:none}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #c5c5c5}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#2b2b2b;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #003eff;background:#007fff;font-weight:normal;color:#fff}.ui-icon-background,.ui-state-active .ui-icon-background{border:#003eff;background-color:#fff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #dad55e;background:#fffa90;color:#777620}.ui-state-checked{border:1px solid #dad55e;background:#fffa90}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#777620}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_555555_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_777620_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cc0000_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_777777_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px}.ui-widget-overlay{background:#aaa;opacity:.003;filter:Alpha(Opacity=.3)}.ui-widget-shadow{-webkit-box-shadow:0 0 5px #666;box-shadow:0 0 5px #666}
css/ewd-ufaq-plugin-deactivation.css → assets/css/plugin-deactivation.css RENAMED
File without changes
{css → assets/css}/rrssb-min.css RENAMED
File without changes
{css → assets}/fonts/ewd-toggle-icon.eot RENAMED
File without changes
{css → assets}/fonts/ewd-toggle-icon.svg RENAMED
File without changes
{css → assets}/fonts/ewd-toggle-icon.ttf RENAMED
File without changes
{css → assets}/fonts/ewd-toggle-icon.woff RENAMED
File without changes
{css → assets}/fonts/ewd-toggle-icon.woff2 RENAMED
File without changes
{images → assets/img}/Icon_Documentation_Grey.png RENAMED
File without changes
{images → assets/img}/Icon_PluginForum_Grey.png RENAMED
File without changes
{images → assets/img}/Icon_WP_Grey.png RENAMED
File without changes
{images → assets/img}/Icon_Youtube_Grey.png RENAMED
File without changes
{images → assets/img}/Thumbs-down-icon.png RENAMED
File without changes
{images → assets/img}/Thumbs-up-icon.png RENAMED
File without changes
{images → assets/img}/UPCP_Icons-07-300x300.png RENAMED
File without changes
{images → assets/img}/URP_Icons-03.png RENAMED
File without changes
{images → assets/img}/US_Related_Sales_Icon.png RENAMED
File without changes
{images → assets/img}/dash-asset-badge-old.png RENAMED
File without changes
{images → assets/img}/dash-asset-badge.png RENAMED
File without changes
{images → assets/img}/dash-asset-checkmark.png RENAMED
File without changes
{images → assets/img}/dash-asset-key.png RENAMED
File without changes
{images → assets/img}/dash-asset-stars.png RENAMED
File without changes
{images → assets/img}/ewd-dashboard-icon-ufaq-01.png RENAMED
File without changes
{images → assets/img}/ewd-dashboard-icon-ufaq-02.png RENAMED
File without changes
{images → assets/img}/ewd-dashboard-icon-ufaq-03.png RENAMED
File without changes
{images → assets/img}/ewd-logo-white.png RENAMED
File without changes
{images → assets/img}/ewd-support-icon-documentation.png RENAMED
File without changes
{images → assets/img}/ewd-support-icon-faqs.png RENAMED
File without changes
{images → assets/img}/ewd-support-icon-forum.png RENAMED
File without changes
{images → assets/img}/ewd-support-icon-youtube.png RENAMED
File without changes
{images → assets/img}/ewd-ufaq-dashboard-banner.png RENAMED
File without changes
{images → assets/img}/ewd-ufaq-icon.png RENAMED
File without changes
{images → assets/img}/ewd-upcp-icon.png RENAMED
File without changes
{images → assets/img}/ewd-urp-icon.png RENAMED
File without changes
{images → assets/img}/insert_link.png RENAMED
File without changes
{images → assets/img}/options-asset-info.png RENAMED
File without changes
{images → assets/img}/options-asset-lock.png RENAMED
File without changes
{images → assets/img}/options-asset-star.png RENAMED
File without changes
{images → assets/img}/support_icons_ufaq-01.png RENAMED
File without changes
{images → assets/img}/support_icons_ufaq-02.png RENAMED
File without changes
{images → assets/img}/support_icons_ufaq-03.png RENAMED
File without changes
{images → assets/img}/ufaq-buttonsicons-04.png RENAMED
File without changes
assets/js/dashboard-review-ask.js ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( document ).ready( function( $ ) {
2
+ jQuery( '.ewd-ufaq-main-dashboard-review-ask' ).css( 'display', 'block' );
3
+
4
+ jQuery(document).on( 'click', '.ewd-ufaq-main-dashboard-review-ask .notice-dismiss', function( event ) {
5
+ var data = 'ask_review_time=7&action=ewd_ufaq_hide_review_ask';
6
+ jQuery.post( ajaxurl, data, function() {} );
7
+ });
8
+
9
+ jQuery( '.ewd-ufaq-review-ask-yes' ).on( 'click', function() {
10
+ jQuery( '.ewd-ufaq-review-ask-feedback-text' ).removeClass( 'ewd-ufaq-hidden' );
11
+ jQuery( '.ewd-ufaq-review-ask-starting-text' ).addClass( 'ewd-ufaq-hidden' );
12
+
13
+ jQuery( '.ewd-ufaq-review-ask-no-thanks' ).removeClass( 'ewd-ufaq-hidden' );
14
+ jQuery( '.ewd-ufaq-review-ask-review' ).removeClass( 'ewd-ufaq-hidden' );
15
+
16
+ jQuery( '.ewd-ufaq-review-ask-not-really' ).addClass( 'ewd-ufaq-hidden' );
17
+ jQuery( '.ewd-ufaq-review-ask-yes' ).addClass( 'ewd-ufaq-hidden' );
18
+
19
+ var data = 'ask_review_time=7&action=ewd_ufaq_hide_review_ask';
20
+ jQuery.post( ajaxurl, data, function() {} );
21
+ });
22
+
23
+ jQuery( '.ewd-ufaq-review-ask-not-really' ).on( 'click', function() {
24
+ jQuery( '.ewd-ufaq-review-ask-review-text' ).removeClass( 'ewd-ufaq-hidden' );
25
+ jQuery( '.ewd-ufaq-review-ask-starting-text' ).addClass( 'ewd-ufaq-hidden' );
26
+
27
+ jQuery( '.ewd-ufaq-review-ask-feedback-form' ).removeClass( 'ewd-ufaq-hidden' );
28
+ jQuery( '.ewd-ufaq-review-ask-actions' ).addClass( 'ewd-ufaq-hidden' );
29
+
30
+ var data = 'ask_review_time=1000&action=ewd_ufaq_hide_review_ask';
31
+ jQuery.post( ajaxurl, data, function() {} );
32
+ });
33
+
34
+ jQuery( '.ewd-ufaq-review-ask-no-thanks' ).on( 'click', function() {
35
+ var data = 'ask_review_time=1000&action=ewd_ufaq_hide_review_ask';
36
+ jQuery.post( ajaxurl, data, function() {} );
37
+
38
+ jQuery( '.ewd-ufaq-main-dashboard-review-ask' ).css( 'display', 'none' );
39
+ });
40
+
41
+ jQuery( '.ewd-ufaq-review-ask-review' ).on( 'click', function() {
42
+ jQuery( '.ewd-ufaq-review-ask-feedback-text' ).addClass( 'ewd-ufaq-hidden' );
43
+ jQuery( '.ewd-ufaq-review-ask-thank-you-text' ).removeClass( 'ewd-ufaq-hidden' );
44
+
45
+ var data = 'ask_review_time=1000&action=ewd_ufaq_hide_review_ask';
46
+ jQuery.post( ajaxurl, data, function() {} );
47
+ });
48
+
49
+ jQuery( '.ewd-ufaq-review-ask-send-feedback' ).on( 'click', function() {
50
+ var feedback = jQuery( '.ewd-ufaq-review-ask-feedback-explanation textarea' ).val();
51
+ var email_address = jQuery( '.ewd-ufaq-review-ask-feedback-explanation input[name="feedback_email_address"]' ).val();
52
+ var data = 'feedback=' + feedback + '&email_address=' + email_address + '&action=ewd_ufaq_send_feedback';
53
+ jQuery.post( ajaxurl, data, function() {} );
54
+
55
+ var data = 'ask_review_time=1000&action=ewd_ufaq_hide_review_ask';
56
+ jQuery.post( ajaxurl, data, function() {} );
57
+
58
+ jQuery( '.ewd-ufaq-review-ask-feedback-form' ).addClass( 'ewd-ufaq-hidden' );
59
+ jQuery( '.ewd-ufaq-review-ask-review-text' ).addClass( 'ewd-ufaq-hidden' );
60
+ jQuery( '.ewd-ufaq-review-ask-thank-you-text' ).removeClass( 'ewd-ufaq-hidden' );
61
+ });
62
+ });
assets/js/ewd-ufaq-admin.js ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //NEW DASHBOARD MOBILE MENU AND WIDGET TOGGLING
2
+ jQuery(document).ready(function($){
3
+ $('#ewd-ufaq-dash-mobile-menu-open').click(function(){
4
+ $('.ewd-ufaq-admin-header-menu .nav-tab:nth-of-type(1n+2)').toggle();
5
+ $('#ewd-ufaq-dash-mobile-menu-up-caret').toggle();
6
+ $('#ewd-ufaq-dash-mobile-menu-down-caret').toggle();
7
+ return false;
8
+ });
9
+ $(function(){
10
+ $(window).resize(function(){
11
+ if($(window).width() > 800){
12
+ $('.ewd-ufaq-admin-header-menu .nav-tab:nth-of-type(1n+2)').show();
13
+ }
14
+ else{
15
+ $('.ewd-ufaq-admin-header-menu .nav-tab:nth-of-type(1n+2)').hide();
16
+ $('#ewd-ufaq-dash-mobile-menu-up-caret').hide();
17
+ $('#ewd-ufaq-dash-mobile-menu-down-caret').show();
18
+ }
19
+ }).resize();
20
+ });
21
+ $('#ewd-ufaq-dashboard-support-widget-box .ewd-ufaq-dashboard-new-widget-box-top').click(function(){
22
+ $('#ewd-ufaq-dashboard-support-widget-box .ewd-ufaq-dashboard-new-widget-box-bottom').toggle();
23
+ $('#ewd-ufaq-dash-mobile-support-up-caret').toggle();
24
+ $('#ewd-ufaq-dash-mobile-support-down-caret').toggle();
25
+ });
26
+ $('#ewd-ufaq-dashboard-optional-table .ewd-ufaq-dashboard-new-widget-box-top').click(function(){
27
+ $('#ewd-ufaq-dashboard-optional-table .ewd-ufaq-dashboard-new-widget-box-bottom').toggle();
28
+ $('#ewd-ufaq-dash-optional-table-up-caret').toggle();
29
+ $('#ewd-ufaq-dash-optional-table-down-caret').toggle();
30
+ });
31
+ });
32
+
33
+ jQuery(document).ready(function($) {
34
+
35
+ $( '.ewd-ufaq-list' ).sortable({
36
+ items: '.ewd-ufaq-item',
37
+ opacity: 0.6,
38
+ cursor: 'move',
39
+ axis: 'y',
40
+ update: function() {
41
+ var order = jQuery( this ).sortable( 'serialize' ) + '&action=ewd_ufaq_update_order';
42
+ jQuery.post( ajaxurl, order, function( response ) {} );
43
+ }
44
+ });
45
+ });
46
+
47
+ jQuery(document).ready(function($) {
48
+
49
+ if ( ewd_ufaq_php_data.ordering ) { return; }
50
+
51
+ $( 'input[name="ewd-ufaq-settings[faq-order-by]"][value="set_order"]' ).prop( 'disabled', true );
52
+ });
53
+
54
+ jQuery(document).ready(function($){
55
+
56
+ $( '.sap-new-admin-add-button' ).on( 'click', function() {
57
+
58
+ setTimeout( ewd_ufaq_field_added_handler, 500);
59
+ });
60
+ });
61
+
62
+ function ewd_ufaq_field_added_handler() {
63
+
64
+ var highest = 0;
65
+ jQuery( '.sap-infinite-table input[data-name="id"]' ).each( function() {
66
+ highest = Math.max( highest, this.value );
67
+ });
68
+
69
+ jQuery( '.sap-infinite-table tbody tr:last-of-type span.sap-infinite-table-hidden-value' ).html( highest + 1 );
70
+ jQuery( '.sap-infinite-table tbody tr:last-of-type input[data-name="id"]' ).val( highest + 1 );
71
+ }
{blocks → assets/js}/ewd-ufaq-blocks.js RENAMED
@@ -1,161 +1,161 @@
1
- var el = wp.element.createElement,
2
- registerBlockType = wp.blocks.registerBlockType,
3
- ServerSideRender = wp.components.ServerSideRender,
4
- TextControl = wp.components.TextControl,
5
- InspectorControls = wp.editor.InspectorControls;
6
-
7
- registerBlockType( 'ultimate-faqs/ewd-ufaq-display-faq-block', {
8
- title: 'Display FAQs',
9
- icon: 'editor-help',
10
- category: 'ewd-ufaq-blocks',
11
- attributes: {
12
- post_count: { type: 'string' },
13
- include_category: { type: 'string' },
14
- exclude_category: { type: 'string' },
15
- },
16
-
17
- edit: function( props ) {
18
- var returnString = [];
19
- returnString.push(
20
- el( InspectorControls, {},
21
- el( TextControl, {
22
- label: 'Number of FAQs',
23
- value: props.attributes.post_count,
24
- onChange: ( value ) => { props.setAttributes( { post_count: value } ); },
25
- } ),
26
- el( TextControl, {
27
- label: 'Include Category',
28
- value: props.attributes.include_category,
29
- onChange: ( value ) => { props.setAttributes( { include_category: value } ); },
30
- } ),
31
- el( TextControl, {
32
- label: 'Exclude Category',
33
- value: props.attributes.exclude_category,
34
- onChange: ( value ) => { props.setAttributes( { exclude_category: value } ); },
35
- } )
36
- ),
37
- );
38
- returnString.push( el( 'div', { class: 'ewd-ufaq-admin-block ewd-ufaq-admin-block-display-faqs' }, 'Display FAQs Block' ) );
39
- return returnString;
40
- },
41
-
42
- save: function() {
43
- return null;
44
- },
45
- } );
46
-
47
- registerBlockType( 'ultimate-faqs/ewd-ufaq-search-block', {
48
- title: 'Search FAQs',
49
- icon: 'editor-help',
50
- category: 'ewd-ufaq-blocks',
51
- attributes: {
52
- include_category: { type: 'string' },
53
- exclude_category: { type: 'string' },
54
- show_on_load: { type: 'string' },
55
- },
56
-
57
- edit: function( props ) {
58
- var returnString = [];
59
- returnString.push(
60
- el( InspectorControls, {},
61
- el( TextControl, {
62
- label: 'Include Category',
63
- value: props.attributes.include_category,
64
- onChange: ( value ) => { props.setAttributes( { include_category: value } ); },
65
- } ),
66
- el( TextControl, {
67
- label: 'Exclude Category',
68
- value: props.attributes.exclude_category,
69
- onChange: ( value ) => { props.setAttributes( { exclude_category: value } ); },
70
- } ),
71
- el( TextControl, {
72
- label: 'Show all FAQs on Page Load? (Yes or No)',
73
- value: props.attributes.show_on_load,
74
- onChange: ( value ) => { props.setAttributes( { show_on_load: value } ); },
75
- } )
76
- ),
77
- );
78
- returnString.push( el( 'div', { class: 'ewd-ufaq-admin-block ewd-ufaq-admin-block-search-faqs' }, 'Search FAQs Block' ) );
79
- return returnString;
80
- },
81
-
82
- save: function() {
83
- return null;
84
- },
85
- } );
86
-
87
- registerBlockType( 'ultimate-faqs/ewd-ufaq-submit-faq-block', {
88
- title: 'Submit FAQ',
89
- icon: 'editor-help',
90
- category: 'ewd-ufaq-blocks',
91
- attributes: {
92
- },
93
-
94
- edit: function( props ) {
95
- var returnString = [];
96
- returnString.push( el( 'div', { class: 'ewd-ufaq-admin-block ewd-ufaq-admin-block-submit-faq' }, 'Submit Question Block' ) );
97
- return returnString;
98
- },
99
-
100
- save: function() {
101
- return null;
102
- },
103
- } );
104
-
105
- registerBlockType( 'ultimate-faqs/ewd-ufaq-recent-faqs-block', {
106
- title: 'Recent FAQs',
107
- icon: 'editor-help',
108
- category: 'ewd-ufaq-blocks',
109
- attributes: {
110
- post_count: { type: 'string' },
111
- },
112
-
113
- edit: function( props ) {
114
- var returnString = [];
115
- returnString.push(
116
- el( InspectorControls, {},
117
- el( TextControl, {
118
- label: 'Number of FAQs',
119
- value: props.attributes.post_count,
120
- onChange: ( value ) => { props.setAttributes( { post_count: value } ); },
121
- } )
122
- ),
123
- );
124
- returnString.push( el( 'div', { class: 'ewd-ufaq-admin-block ewd-ufaq-admin-block-recent-faqs' }, 'Recent FAQs Block' ) );
125
- return returnString;
126
- },
127
-
128
- save: function() {
129
- return null;
130
- },
131
- } );
132
-
133
- registerBlockType( 'ultimate-faqs/ewd-ufaq-popular-faqs-block', {
134
- title: 'Popular FAQs',
135
- icon: 'editor-help',
136
- category: 'ewd-ufaq-blocks',
137
- attributes: {
138
- post_count: { type: 'string' },
139
- },
140
-
141
- edit: function( props ) {
142
- var returnString = [];
143
- returnString.push(
144
- el( InspectorControls, {},
145
- el( TextControl, {
146
- label: 'Number of FAQs',
147
- value: props.attributes.post_count,
148
- onChange: ( value ) => { props.setAttributes( { post_count: value } ); },
149
- } )
150
- ),
151
- );
152
- returnString.push( el( 'div', { class: 'ewd-ufaq-admin-block ewd-ufaq-admin-block-popular-faqs' }, 'Popular FAQs Block' ) );
153
- return returnString;
154
- },
155
-
156
- save: function() {
157
- return null;
158
- },
159
- } );
160
-
161
-
1
+ var el = wp.element.createElement,
2
+ registerBlockType = wp.blocks.registerBlockType,
3
+ ServerSideRender = wp.components.ServerSideRender,
4
+ TextControl = wp.components.TextControl,
5
+ InspectorControls = wp.editor.InspectorControls;
6
+
7
+ registerBlockType( 'ultimate-faqs/ewd-ufaq-display-faq-block', {
8
+ title: 'Display FAQs',
9
+ icon: 'editor-help',
10
+ category: 'ewd-ufaq-blocks',
11
+ attributes: {
12
+ post_count: { type: 'string' },
13
+ include_category: { type: 'string' },
14
+ exclude_category: { type: 'string' },
15
+ },
16
+
17
+ edit: function( props ) {
18
+ var returnString = [];
19
+ returnString.push(
20
+ el( InspectorControls, {},
21
+ el( TextControl, {
22
+ label: 'Number of FAQs',
23
+ value: props.attributes.post_count,
24
+ onChange: ( value ) => { props.setAttributes( { post_count: value } ); },
25
+ } ),
26
+ el( TextControl, {
27
+ label: 'Include Category',
28
+ value: props.attributes.include_category,
29
+ onChange: ( value ) => { props.setAttributes( { include_category: value } ); },
30
+ } ),
31
+ el( TextControl, {
32
+ label: 'Exclude Category',
33
+ value: props.attributes.exclude_category,
34
+ onChange: ( value ) => { props.setAttributes( { exclude_category: value } ); },
35
+ } )
36
+ ),
37
+ );
38
+ returnString.push( el( 'div', { class: 'ewd-ufaq-admin-block ewd-ufaq-admin-block-display-faqs' }, 'Display FAQs Block' ) );
39
+ return returnString;
40
+ },
41
+
42
+ save: function() {
43
+ return null;
44
+ },
45
+ } );
46
+
47
+ registerBlockType( 'ultimate-faqs/ewd-ufaq-search-block', {
48
+ title: 'Search FAQs',
49
+ icon: 'editor-help',
50
+ category: 'ewd-ufaq-blocks',
51
+ attributes: {
52
+ include_category: { type: 'string' },
53
+ exclude_category: { type: 'string' },
54
+ show_on_load: { type: 'string' },
55
+ },
56
+
57
+ edit: function( props ) {
58
+ var returnString = [];
59
+ returnString.push(
60
+ el( InspectorControls, {},
61
+ el( TextControl, {
62
+ label: 'Include Category',
63
+ value: props.attributes.include_category,
64
+ onChange: ( value ) => { props.setAttributes( { include_category: value } ); },
65
+ } ),
66
+ el( TextControl, {
67
+ label: 'Exclude Category',
68
+ value: props.attributes.exclude_category,
69
+ onChange: ( value ) => { props.setAttributes( { exclude_category: value } ); },
70
+ } ),
71
+ el( TextControl, {
72
+ label: 'Show all FAQs on Page Load? (Yes or No)',
73
+ value: props.attributes.show_on_load,
74
+ onChange: ( value ) => { props.setAttributes( { show_on_load: value } ); },
75
+ } )
76
+ ),
77
+ );
78
+ returnString.push( el( 'div', { class: 'ewd-ufaq-admin-block ewd-ufaq-admin-block-search-faqs' }, 'Search FAQs Block' ) );
79
+ return returnString;
80
+ },
81
+
82
+ save: function() {
83
+ return null;
84
+ },
85
+ } );
86
+
87
+ registerBlockType( 'ultimate-faqs/ewd-ufaq-submit-faq-block', {
88
+ title: 'Submit FAQ',
89
+ icon: 'editor-help',
90
+ category: 'ewd-ufaq-blocks',
91
+ attributes: {
92
+ },
93
+
94
+ edit: function( props ) {
95
+ var returnString = [];
96
+ returnString.push( el( 'div', { class: 'ewd-ufaq-admin-block ewd-ufaq-admin-block-submit-faq' }, 'Submit Question Block' ) );
97
+ return returnString;
98
+ },
99
+
100
+ save: function() {
101
+ return null;
102
+ },
103
+ } );
104
+
105
+ registerBlockType( 'ultimate-faqs/ewd-ufaq-recent-faqs-block', {
106
+ title: 'Recent FAQs',
107
+ icon: 'editor-help',
108
+ category: 'ewd-ufaq-blocks',
109
+ attributes: {
110
+ post_count: { type: 'string' },
111
+ },
112
+
113
+ edit: function( props ) {
114
+ var returnString = [];
115
+ returnString.push(
116
+ el( InspectorControls, {},
117
+ el( TextControl, {
118
+ label: 'Number of FAQs',
119
+ value: props.attributes.post_count,
120
+ onChange: ( value ) => { props.setAttributes( { post_count: value } ); },
121
+ } )
122
+ ),
123
+ );
124
+ returnString.push( el( 'div', { class: 'ewd-ufaq-admin-block ewd-ufaq-admin-block-recent-faqs' }, 'Recent FAQs Block' ) );
125
+ return returnString;
126
+ },
127
+
128
+ save: function() {
129
+ return null;
130
+ },
131
+ } );
132
+
133
+ registerBlockType( 'ultimate-faqs/ewd-ufaq-popular-faqs-block', {
134
+ title: 'Popular FAQs',
135
+ icon: 'editor-help',
136
+ category: 'ewd-ufaq-blocks',
137
+ attributes: {
138
+ post_count: { type: 'string' },
139
+ },
140
+
141
+ edit: function( props ) {
142
+ var returnString = [];
143
+ returnString.push(
144
+ el( InspectorControls, {},
145
+ el( TextControl, {
146
+ label: 'Number of FAQs',
147
+ value: props.attributes.post_count,
148
+ onChange: ( value ) => { props.setAttributes( { post_count: value } ); },
149
+ } )
150
+ ),
151
+ );
152
+ returnString.push( el( 'div', { class: 'ewd-ufaq-admin-block ewd-ufaq-admin-block-popular-faqs' }, 'Popular FAQs Block' ) );
153
+ return returnString;
154
+ },
155
+
156
+ save: function() {
157
+ return null;
158
+ },
159
+ } );
160
+
161
+
{js → assets/js}/ewd-ufaq-wc-admin.js RENAMED
@@ -1,58 +1,58 @@
1
- jQuery(document).ready(function() {
2
- jQuery('.ewd-ufaq-add-faq-button').on('click', function(event) {
3
- var Post_ID = jQuery('#ewd-ufaq-post-id').val();
4
-
5
- var FAQs = [];
6
- jQuery('.ewd-ufaq-add-faq').each(function() {
7
- if (jQuery(this).is(':checked')) {FAQs.push(jQuery(this).val());}
8
- jQuery(this).prop('checked', false);
9
- });
10
-
11
- var data = 'FAQs=' + JSON.stringify(FAQs) + '&Post_ID=' + Post_ID + '&action=ewd_ufaq_add_wc_faqs';
12
- jQuery.post(ajaxurl, data, function(response) {
13
- var Add_FAQs = jQuery.parseJSON(response);
14
- jQuery(Add_FAQs).each(function(index, el) {
15
- var HTML = "<tr class='ewd-ufaq-faq-row ewd-ufaq-delete-faq-row' data-faqid='" + el.ID + "'>";
16
- HTML += "<td><input type='checkbox' class='ewd-ufaq-delete-faq' name='Delete_FAQs[]' value='" + el.ID + "'/></td>";
17
- HTML += "<td>" + el.Name + "</td>";
18
- HTML += "</tr>";
19
- jQuery('.ewd-ufaq-delete-table tr:last').after(HTML);
20
- });
21
- });
22
-
23
- event.preventDefault();
24
- })
25
- });
26
-
27
- jQuery(document).ready(function() {
28
- jQuery('.ewd-ufaq-delete-faq-button').on('click', function(event) {
29
- var Post_ID = jQuery('#ewd-ufaq-post-id').val();
30
-
31
- var FAQs = [];
32
- jQuery('.ewd-ufaq-delete-faq').each(function() {
33
- if (jQuery(this).is(':checked')) {FAQs.push(jQuery(this).val());}
34
- jQuery(this).prop('checked', false);
35
- });
36
-
37
- var data = 'FAQs=' + JSON.stringify(FAQs) + '&Post_ID=' + Post_ID + '&action=ewd_ufaq_delete_wc_faqs';
38
- jQuery.post(ajaxurl, data, function(response) {});
39
-
40
- jQuery(FAQs).each(function(index, el) {
41
- jQuery(".ewd-ufaq-delete-faq-row[data-faqid='" + el + "']").fadeOut('500', function() {jQuery(this).remove();});
42
- });
43
-
44
- event.preventDefault();
45
- })
46
- });
47
-
48
- jQuery(document).ready(function() {
49
- jQuery('.ewd-ufaq-category-filter').on('change', function() {
50
- var Cat_ID = jQuery(this).val();
51
-
52
- var data = 'Cat_ID=' + Cat_ID + '&action=ewd_ufaq_wc_faq_category';
53
- jQuery.post(ajaxurl, data, function(response) {
54
- jQuery('.ewd-ufaq-faq-add-table').remove();
55
- jQuery('.ewd-ufaq-category-filter').after(response);
56
- });
57
- })
58
  });
1
+ jQuery(document).ready(function() {
2
+ jQuery('.ewd-ufaq-add-faq-button').on('click', function(event) {
3
+ var Post_ID = jQuery('#ewd-ufaq-post-id').val();
4
+
5
+ var FAQs = [];
6
+ jQuery('.ewd-ufaq-add-faq').each(function() {
7
+ if (jQuery(this).is(':checked')) {FAQs.push(jQuery(this).val());}
8
+ jQuery(this).prop('checked', false);
9
+ });
10
+
11
+ var data = 'FAQs=' + JSON.stringify(FAQs) + '&Post_ID=' + Post_ID + '&action=ewd_ufaq_add_wc_faqs';
12
+ jQuery.post(ajaxurl, data, function(response) {
13
+ var Add_FAQs = jQuery.parseJSON(response);
14
+ jQuery(Add_FAQs).each(function(index, el) {
15
+ var HTML = "<tr class='ewd-ufaq-faq-row ewd-ufaq-delete-faq-row' data-faqid='" + el.ID + "'>";
16
+ HTML += "<td><input type='checkbox' class='ewd-ufaq-delete-faq' name='Delete_FAQs[]' value='" + el.ID + "'/></td>";
17
+ HTML += "<td>" + el.Name + "</td>";
18
+ HTML += "</tr>";
19
+ jQuery('.ewd-ufaq-delete-table tr:last').after(HTML);
20
+ });
21
+ });
22
+
23
+ event.preventDefault();
24
+ })
25
+ });
26
+
27
+ jQuery(document).ready(function() {
28
+ jQuery('.ewd-ufaq-delete-faq-button').on('click', function(event) {
29
+ var Post_ID = jQuery('#ewd-ufaq-post-id').val();
30
+
31
+ var FAQs = [];
32
+ jQuery('.ewd-ufaq-delete-faq').each(function() {
33
+ if (jQuery(this).is(':checked')) {FAQs.push(jQuery(this).val());}
34
+ jQuery(this).prop('checked', false);
35
+ });
36
+
37
+ var data = 'FAQs=' + JSON.stringify(FAQs) + '&Post_ID=' + Post_ID + '&action=ewd_ufaq_delete_wc_faqs';
38
+ jQuery.post(ajaxurl, data, function(response) {});
39
+
40
+ jQuery(FAQs).each(function(index, el) {
41
+ jQuery(".ewd-ufaq-delete-faq-row[data-faqid='" + el + "']").fadeOut('500', function() {jQuery(this).remove();});
42
+ });
43
+
44
+ event.preventDefault();
45
+ })
46
+ });
47
+
48
+ jQuery(document).ready(function() {
49
+ jQuery('.ewd-ufaq-category-filter').on('change', function() {
50
+ var Cat_ID = jQuery(this).val();
51
+
52
+ var data = 'Cat_ID=' + Cat_ID + '&action=ewd_ufaq_wc_faq_category';
53
+ jQuery.post(ajaxurl, data, function(response) {
54
+ jQuery('.ewd-ufaq-faq-add-table').remove();
55
+ jQuery('.ewd-ufaq-category-filter').after(response);
56
+ });
57
+ })
58
  });
js/ewd-ufaq-getting-started.js → assets/js/ewd-ufaq-welcome-screen.js RENAMED
@@ -26,10 +26,10 @@ jQuery(document).ready(function() {
26
 
27
  var data = 'category_name=' + category_name + '&category_description=' + category_description + '&action=ewd_ufaq_welcome_add_category';
28
  jQuery.post(ajaxurl, data, function(response) {
29
- var HTML = '<div class="ewd-ufaq-welcome-screen-category">';
30
- HTML += '<div class="ewd-ufaq-welcome-screen-category-name">' + category_name + '</div>';
31
- HTML += '<div class="ewd-ufaq-welcome-screen-category-description">' + category_description + '</div>';
32
- HTML += '</div>';
33
 
34
  jQuery('.ewd-ufaq-welcome-screen-show-created-categories').append(HTML);
35
 
@@ -51,7 +51,7 @@ jQuery(document).ready(function() {
51
  var faq_accordion = jQuery('input[name="faq_accordion"]:checked').val();
52
  var faq_toggle = jQuery('input[name="faq_toggle"]:checked').val();
53
  var group_by_category = jQuery('input[name="group_by_category"]:checked').val();
54
- var order_by_setting = jQuery('select[name="order_by_setting"]').val();
55
 
56
  var data = 'faq_accordion=' + faq_accordion + '&faq_toggle=' + faq_toggle + '&group_by_category=' + group_by_category + '&order_by_setting=' + order_by_setting + '&action=ewd_ufaq_welcome_set_options';
57
  jQuery.post(ajaxurl, data, function(response) {
@@ -75,11 +75,11 @@ jQuery(document).ready(function() {
75
 
76
  var data = 'faq_question=' + faq_question + '&faq_answer=' + faq_answer + '&faq_category=' + faq_category + '&action=ewd_ufaq_welcome_add_faq';
77
  jQuery.post(ajaxurl, data, function(response) {
78
- var HTML = '<div class="ewd-ufaq-welcome-screen-faq">';
79
- HTML += '<div class="ewd-ufaq-welcome-screen-faq-question">' + faq_question + '</div>';
80
- HTML += '<div class="ewd-ufaq-welcome-screen-faq-answer">' + faq_answer + '</div>';
81
- HTML += '<div class="ewd-ufaq-welcome-screen-faq-category">' + faq_category_name + '</div>';
82
- HTML += '</div>';
83
 
84
  jQuery('.ewd-ufaq-welcome-screen-show-created-faqs').append(HTML);
85
  });
26
 
27
  var data = 'category_name=' + category_name + '&category_description=' + category_description + '&action=ewd_ufaq_welcome_add_category';
28
  jQuery.post(ajaxurl, data, function(response) {
29
+ var HTML = '<tr class="ewd-ufaq-welcome-screen-category">';
30
+ HTML += '<td class="ewd-ufaq-welcome-screen-category-name">' + category_name + '</td>';
31
+ HTML += '<td class="ewd-ufaq-welcome-screen-category-description">' + category_description + '</td>';
32
+ HTML += '</tr>';
33
 
34
  jQuery('.ewd-ufaq-welcome-screen-show-created-categories').append(HTML);
35
 
51
  var faq_accordion = jQuery('input[name="faq_accordion"]:checked').val();
52
  var faq_toggle = jQuery('input[name="faq_toggle"]:checked').val();
53
  var group_by_category = jQuery('input[name="group_by_category"]:checked').val();
54
+ var order_by_setting = jQuery('select[name="order_by_setting"]').val();
55
 
56
  var data = 'faq_accordion=' + faq_accordion + '&faq_toggle=' + faq_toggle + '&group_by_category=' + group_by_category + '&order_by_setting=' + order_by_setting + '&action=ewd_ufaq_welcome_set_options';
57
  jQuery.post(ajaxurl, data, function(response) {
75
 
76
  var data = 'faq_question=' + faq_question + '&faq_answer=' + faq_answer + '&faq_category=' + faq_category + '&action=ewd_ufaq_welcome_add_faq';
77
  jQuery.post(ajaxurl, data, function(response) {
78
+ var HTML = '<tr class="ewd-ufaq-welcome-screen-faq">';
79
+ HTML += '<td class="ewd-ufaq-welcome-screen-faq-question">' + faq_question + '</td>';
80
+ HTML += '<td class="ewd-ufaq-welcome-screen-faq-answer">' + faq_answer + '</td>';
81
+ HTML += '<td class="ewd-ufaq-welcome-screen-faq-category">' + faq_category_name + '</td>';
82
+ HTML += '</tr>';
83
 
84
  jQuery('.ewd-ufaq-welcome-screen-show-created-faqs').append(HTML);
85
  });
assets/js/ewd-ufaq.js ADDED
@@ -0,0 +1,440 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var filtering_running = false;
2
+ var wpforms_search_running = 'No';
3
+
4
+ jQuery(function(){ //DOM Ready
5
+ ufaqSetClickHandlers();
6
+ UFAQSetAutoCompleteClickHandlers();
7
+ UFAQSetRatingHandlers();
8
+ UFAQSetExpandCollapseHandlers();
9
+ UFAQSetPaginationHandlers();
10
+
11
+ UFAQWPFormsHandler();
12
+ });
13
+
14
+ function ewd_ufaq_run_effect( display, faq_element ) {
15
+
16
+ var selected_effect = ewd_ufaq_php_data.reveal_effect;
17
+
18
+ // most effect types need no options passed by default
19
+ var options = {};
20
+
21
+ // some effects have required parameters
22
+ if ( selected_effect === 'size' ) {
23
+
24
+ options = { to: { width: 200, height: 60 } };
25
+ }
26
+
27
+ // run the effect
28
+ if ( display == 'show' ) { faq_element.find( '.ewd-ufaq-faq-body' ).show( selected_effect, options, 500, ewd_ufaq_toggle_hidden_class( faq_element ) ); }
29
+ if ( display == 'hide' ) { faq_element.find( '.ewd-ufaq-faq-body' ).hide( selected_effect, options, 500, ewd_ufaq_toggle_hidden_class( faq_element ) ); }
30
+ };
31
+
32
+ // callback function to bring a hidden box back
33
+ function ewd_ufaq_toggle_hidden_class( faq_element ) {
34
+
35
+ setTimeout( function() { faq_element.find( '.ewd-ufaq-faq-body' ).toggleClass( 'ewd-ufaq-hidden' ); }, 500 );
36
+ };
37
+
38
+ function ufaqSetClickHandlers() {
39
+
40
+ jQuery( '.ewd-ufaq-faq-toggle' ).off( 'click' ).on( 'click', function( event ) {
41
+
42
+ jQuery( this ).attr( 'aria-expanded', function ( i, attr ) {
43
+ return attr == 'true' ? 'false' : 'true'
44
+ });
45
+
46
+ event.preventDefault();
47
+
48
+ faq = jQuery( this ).parent();
49
+
50
+ if ( faq.find( '.ewd-ufaq-faq-body' ).hasClass( 'ewd-ufaq-hidden' ) ) {
51
+
52
+ EWD_UFAQ_Reveal_FAQ( faq );
53
+
54
+ if ( ewd_ufaq_php_data.faq_scroll ) { jQuery('html, body').animate({scrollTop: jQuery(this).offset().top -80}, 100); }
55
+ }
56
+ else {
57
+
58
+ EWD_UFAQ_Hide_FAQ( faq );
59
+ }
60
+ });
61
+
62
+ jQuery( '.ewd-ufaq-faq-category-title-toggle' ).off( 'click' ).on( 'click', function() {
63
+
64
+ var category = jQuery( this ).parent();
65
+ var category_inner = category.find( '.ewd-ufaq-faq-category-inner' );
66
+
67
+ category_inner.toggleClass( 'ewd-ufaq-faq-category-body-hidden' );
68
+
69
+ if ( ! ewd_ufaq_php_data.category_accordion ) { return; }
70
+
71
+ jQuery( '.ewd-ufaq-faq-category-inner' ).each( function( index, object ) {
72
+
73
+ if ( object != category_inner.get( 0 ) ) { jQuery( this ).addClass( 'ewd-ufaq-faq-category-body-hidden' ); }
74
+ });
75
+ });
76
+
77
+ jQuery( '.ewd-ufaq-back-to-top-link' ).off( 'click' ).on( 'click', function( event ) {
78
+ event.preventDefault();
79
+
80
+ jQuery( 'html, body' ).animate( { scrollTop: jQuery( '#ewd-ufaq-faq-list' ).offset().top -80 }, 100 );
81
+ });
82
+
83
+ jQuery( '.ewd-ufaq-faq-header-link' ).off( 'click' ).on( 'click', function( event ) {
84
+ event.preventDefault();
85
+
86
+ var faq_id = jQuery( this ).data( 'postid' );
87
+ var faq = jQuery( '#ewd-ufaq-post-' + faq_id ).first();
88
+
89
+ if ( faq.find( '.ewd-ufaq-faq-body' ).hasClass( 'ewd-ufaq-hidden' ) ) {
90
+
91
+ EWD_UFAQ_Reveal_FAQ( faq );
92
+ }
93
+
94
+ jQuery( 'html, body' ).animate( { scrollTop: faq.offset().top - 20 }, 100 );
95
+ });
96
+ }
97
+
98
+ function UFAQSetAutoCompleteClickHandlers() {
99
+
100
+ jQuery( '.ewd-ufaq-text-auto-complete' ).on( 'keyup', function() {
101
+
102
+ jQuery( '.ewd-ufaq-text-auto-complete' ).autocomplete({
103
+
104
+ source: ewd_ufaq_php_data.question_titles,
105
+ minLength: 3,
106
+ appendTo: '#ewd-ufaq-jquery-ajax-search',
107
+ select: function( event, ui ) {
108
+ jQuery( this ).val( ui.item.value );
109
+ ewd_ufaq_ajax_reload();
110
+ }
111
+ });
112
+
113
+ jQuery( '.ewd-ufaq-text-auto-complete' ).autocomplete( 'enable' );
114
+ });
115
+ }
116
+
117
+ function EWD_UFAQ_Reveal_FAQ( faq_element ) {
118
+
119
+ var post_id = faq_element.data( 'post_id' );
120
+
121
+ var data = 'post_id=' + post_id + '&action=ewd_ufaq_record_view';
122
+ jQuery.post(ajaxurl, data, function(response) {});
123
+
124
+ faq_element.find( '.ewd-ufaq-post-margin-symbol' ).html( faq_element.find( '.ewd-ufaq-post-margin-symbol' ).html().toUpperCase() );
125
+
126
+ faq_element.find( '.ewd-ufaq-faq-excerpt' ).addClass( 'ewd-ufaq-hidden' );
127
+
128
+ if ( ewd_ufaq_php_data.reveal_effect != 'none' ) { ewd_ufaq_run_effect( 'show', faq_element ); }
129
+ else { faq_element.find( '.ewd-ufaq-faq-body' ).removeClass( 'ewd-ufaq-hidden' ); }
130
+
131
+ if ( ewd_ufaq_php_data.faq_accordion ) {
132
+
133
+ jQuery( '.ewd-ufaq-faq-div' ).each( function() {
134
+
135
+ if ( jQuery( this ).prop( 'id' ) != faq_element.prop( 'id' ) ) {
136
+
137
+ EWD_UFAQ_Hide_FAQ( jQuery(this) );
138
+ }
139
+ else {
140
+
141
+ jQuery( this ).addClass( 'ewd-ufaq-post-active' );
142
+ }
143
+ });
144
+ }
145
+ else {
146
+
147
+ faq_element.addClass( 'ewd-ufaq-post-active' );
148
+ }
149
+ }
150
+
151
+ function EWD_UFAQ_Hide_FAQ( faq_element ) {
152
+
153
+ var post_id = faq_element.data( 'post_id' );
154
+
155
+ faq_element.find( '.ewd-ufaq-faq-excerpt' ).removeClass( 'ewd-ufaq-hidden' );
156
+
157
+ if ( ewd_ufaq_php_data.reveal_effect != 'none' ) { ewd_ufaq_run_effect( 'hide', faq_element ); }
158
+ else { faq_element.find( '.ewd-ufaq-faq-body' ).addClass( 'ewd-ufaq-hidden' ); }
159
+
160
+ faq_element.removeClass( 'ewd-ufaq-post-active' );
161
+ faq_element.find( '.ewd-ufaq-post-margin-symbol' ).html( faq_element.find( '.ewd-ufaq-post-margin-symbol' ).html().toLowerCase() );
162
+ }
163
+
164
+ jQuery(document).ready(function() {
165
+
166
+ jQuery( '#ewd-ufaq-ajax-search-submit' ).click( function() {
167
+
168
+ jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', 1 );
169
+
170
+ ewd_ufaq_ajax_reload();
171
+ });
172
+
173
+ jQuery( '#ewd-ufaq-ajax-form' ).submit( function( event ) {
174
+
175
+ event.preventDefault();
176
+
177
+ ewd_ufaq_ajax_reload();
178
+ });
179
+
180
+ jQuery( '#ewd-ufaq-ajax-text-input' ).keyup( function() {
181
+
182
+ ewd_ufaq_ajax_reload();
183
+ });
184
+
185
+ if ( jQuery( '#ewd-ufaq-ajax-text-input' ).length ) {
186
+
187
+ if ( jQuery( '#ewd-ufaq-ajax-text-input' ).val() != '' ) { ewd_ufaq_ajax_reload(); }
188
+ }
189
+
190
+ if ( ewd_ufaq_php_data.display_faq != 0 ) {
191
+
192
+ var faq = jQuery( '.ewd-ufaq-faq-div[data-post_id="' + ewd_ufaq_php_data.display_faq + '"]' );
193
+
194
+ EWD_UFAQ_Reveal_FAQ( faq );
195
+
196
+ if ( ewd_ufaq_php_data.faq_scroll ) { jQuery('html, body').animate({scrollTop: faq.offset().top -80}, 100); }
197
+ }
198
+ });
199
+
200
+ var request_count = 0;
201
+ function ewd_ufaq_ajax_reload( pagination, append_results, search_string ) {
202
+
203
+ filtering_running = true;
204
+
205
+ var search_string = search_string ? search_string : jQuery( '.ewd-ufaq-text-input' ).val();
206
+ var include_cat = jQuery( '#ewd-ufaq-include-category' ).val();
207
+ var exclude_cat = jQuery( '#ewd-ufaq-exclude-category' ).val();
208
+ var orderby = jQuery( '#ewd-ufaq-orderby' ).val();
209
+ var order = jQuery( '#ewd-ufaq-order' ).val();
210
+ var post_count = jQuery( '#ewd-ufaq-post-count' ).val();
211
+ var current_url = jQuery( '#ewd-ufaq-current-url' ).val();
212
+ var show_on_load = jQuery( '#ewd-ufaq-show-on-load' ).val();
213
+
214
+ if ( search_string == undefined ) { search_string = ''; }
215
+
216
+ if ( pagination == 'Yes' ) {
217
+
218
+ var faqs_only = 'Yes';
219
+ var faq_page = jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' );
220
+ }
221
+ else {
222
+
223
+ jQuery( '.ewd-ufaq-faqs' ).html( '<h3>' + ewd_ufaq_php_data.retrieving_results + '</h3>' );
224
+
225
+ var faqs_only = 'No';
226
+ var faq_page = 0;
227
+ }
228
+
229
+ request_count = request_count + 1;
230
+
231
+ if (show_on_load == 'No' && Question.length == 0) {jQuery('#ewd-ufaq-ajax-results').html(''); return;}
232
+
233
+ var data = 'search_string=' + search_string + '&include_category=' + include_cat + '&exclude_category=' + exclude_cat + '&orderby=' + orderby + '&order=' + order + '&post_count=' + post_count + '&request_count=' + request_count + '&current_url=' + current_url + '&faqs_only=' + faqs_only + '&faq_page=' + faq_page + '&action=ewd_ufaq_search';
234
+ jQuery.post( ajaxurl, data, function( response ) {
235
+
236
+ if ( response.data.request_count == request_count ) {
237
+
238
+ if ( append_results == 'Yes' ) { jQuery( '.ewd-ufaq-faqs' ).append( response.data.output ); }
239
+ else { jQuery( '.ewd-ufaq-faqs' ).html( response.data.output ); }
240
+
241
+ jQuery( '.ewd-ufaq-bottom' ).data( 'max_page', response.data.max_page );
242
+
243
+ jQuery( '.ewd-ufaq-expand-all' ).removeClass( 'ewd-ufaq-hidden' );
244
+ jQuery( '.ewd-ufaq-collapse-all' ).addClass( 'ewd-ufaq-hidden' );
245
+
246
+ ufaqSetClickHandlers();
247
+ UFAQSetRatingHandlers();
248
+ UFAQSetPaginationHandlers();
249
+ UFAQUpdatePaginationButtons();
250
+ UFAQSetExpandCollapseHandlers();
251
+
252
+ filtering_running = false;
253
+ }
254
+ });
255
+ }
256
+
257
+ function UFAQSetRatingHandlers() {
258
+
259
+ jQuery( '.ewd-ufaq-rating-button' ).off( 'click' ).on( 'click', function() {
260
+
261
+ var faq_id = jQuery( this ).data( 'faq_id' );
262
+ jQuery( '*[data-faq_id="' + faq_id + '"]' ).off( 'click' );
263
+
264
+ var current_count = jQuery( this ).find( 'span' ).html();
265
+ current_count++;
266
+ jQuery( this ).find( 'span' ).html( current_count );
267
+
268
+ if ( jQuery( this ).hasClass( 'ewd-ufaq-up-vote' ) ) { vote_type = 'up'; }
269
+ else { vote_type = 'down'; }
270
+
271
+ var data = 'faq_id=' + faq_id + '&vote_type=' + vote_type + '&action=ewd_ufaq_update_rating';
272
+
273
+ jQuery.post( ajaxurl, data );
274
+ });
275
+ }
276
+
277
+ function UFAQSetExpandCollapseHandlers() {
278
+
279
+ jQuery('.ewd-ufaq-expand-all').off('click').on('click', function() {
280
+
281
+ var accordion_setting = ewd_ufaq_php_data.faq_accordion;
282
+ ewd_ufaq_php_data.faq_accordion = false; // turn FAQ accordion off while expanding all
283
+
284
+ jQuery( '.ewd-ufaq-faq-toggle' ).each( function() {
285
+
286
+ var faq = jQuery(this).parent();
287
+
288
+ jQuery(this).attr('aria-expanded', 'true');
289
+
290
+ EWD_UFAQ_Reveal_FAQ( faq );
291
+ });
292
+
293
+ ewd_ufaq_php_data.faq_accordion = accordion_setting; //reset FAQ accordion setting
294
+
295
+ jQuery('.ewd-ufaq-faq-category-inner').removeClass('ewd-ufaq-faq-category-body-hidden');
296
+ jQuery('.ewd-ufaq-collapse-all').removeClass('ewd-ufaq-hidden');
297
+ jQuery('.ewd-ufaq-expand-all').addClass('ewd-ufaq-hidden');
298
+ });
299
+
300
+ jQuery('.ewd-ufaq-collapse-all').off('click').on('click', function() {
301
+
302
+ jQuery('.ewd-ufaq-faq-toggle').each(function() {
303
+
304
+ var faq = jQuery(this).parent();
305
+
306
+ jQuery(this).attr('aria-expanded', 'false');
307
+
308
+ EWD_UFAQ_Hide_FAQ( faq );
309
+ });
310
+
311
+ if ( jQuery( '.ewd-ufaq-faq-category-title-toggle' ).length ) { jQuery( '.ewd-ufaq-faq-category-inner' ).addClass( 'ewd-ufaq-faq-category-body-hidden' );}
312
+
313
+ jQuery('.ewd-ufaq-expand-all').removeClass('ewd-ufaq-hidden');
314
+ jQuery('.ewd-ufaq-collapse-all').addClass('ewd-ufaq-hidden');
315
+ });
316
+ }
317
+
318
+ function UFAQSetPaginationHandlers() {
319
+
320
+ jQuery('.ewd-ufaq-previous-faqs').off( 'click' ).on('click', function() {
321
+
322
+ var current_page = jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' );
323
+
324
+ jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', Math.max( current_page - 1, 0 ) );
325
+ jQuery( '.ewd-ufaq-max-faqs-not-reached' ).remove();
326
+
327
+ ewd_ufaq_ajax_reload( 'Yes', 'No' );
328
+ });
329
+
330
+ jQuery('.ewd-ufaq-next-faqs').off( 'click' ).on('click', function() {
331
+
332
+ var current_page = jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' );
333
+
334
+ jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', current_page + 1 );
335
+ jQuery( '.ewd-ufaq-max-faqs-not-reached' ).remove();
336
+
337
+ ewd_ufaq_ajax_reload( 'Yes', 'No' );
338
+ });
339
+
340
+ jQuery( '.ewd-ufaq-load-more' ).off( 'click' ).on( 'click', function() {
341
+
342
+ var current_page = jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' );
343
+
344
+ jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', current_page + 1 );
345
+ jQuery( '.ewd-ufaq-max-faqs-not-reached' ).remove();
346
+
347
+ ewd_ufaq_ajax_reload( 'Yes', 'Yes' );
348
+ });
349
+
350
+ if ( jQuery( '.ewd-ufaq-pagination-infinite_scroll' ).length ) {
351
+
352
+ jQuery( window ).scroll( function() {
353
+
354
+ var infinite_pos = jQuery( '.ewd-ufaq-pagination-infinite_scroll').position();
355
+
356
+ if ( infinite_pos != undefined && jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' ) != jQuery( '.ewd-ufaq-bottom' ).data( 'max_page' ) ) {
357
+
358
+ if ( ( jQuery( window ).height() + jQuery( window ).scrollTop() > infinite_pos.top ) && filtering_running == false ) {
359
+
360
+ jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' ) + 1 );
361
+
362
+ ewd_ufaq_ajax_reload( 'Yes', 'Yes' );
363
+ }
364
+ }
365
+ });
366
+ }
367
+ }
368
+
369
+ function UFAQUpdatePaginationButtons() {
370
+
371
+ jQuery('.ewd-ufaq-bottom').first().appendTo('.ewd-ufaq-faq-list');
372
+
373
+ if ( jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' ) < jQuery( '.ewd-ufaq-bottom' ).data( 'max_page' ) ) {
374
+
375
+ jQuery( '.ewd-ufaq-load-more, .ewd-ufaq-next-faqs' ).removeClass( 'ewd-ufaq-hidden' );
376
+ }
377
+ else { jQuery( '.ewd-ufaq-load-more, .ewd-ufaq-next-faqs' ).addClass( 'ewd-ufaq-hidden' ); }
378
+
379
+ if ( jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' ) <= 1 ) {
380
+
381
+ jQuery( '.ewd-ufaq-previous-faqs' ).addClass( 'ewd-ufaq-hidden' );
382
+ }
383
+ else { jQuery( '.ewd-ufaq-previous-faqs' ).removeClass( 'ewd-ufaq-hidden' ); }
384
+ }
385
+
386
+ function UFAQWPFormsHandler() {
387
+
388
+ if ( typeof wpforms_integration === 'undefined' || wpforms_integration === null ) { return; }
389
+
390
+ if ( wpforms_integration.ufaq_enabled == 'disabled' ) { return; }
391
+
392
+ var target_field = wpforms_integration.ufaq_selected_field;
393
+
394
+ jQuery( '#wpforms-' + wpforms_integration.form_id + '-field_' + wpforms_integration.ufaq_selected_field ).on( 'keyup', function() {
395
+
396
+ var search_string = jQuery( this ).val();
397
+
398
+ if ( search_string.length > 12 ) {
399
+
400
+ jQuery( '.ewd-ufaq-wpforms-faq-results' ).removeClass( 'ewd-ufaq-hidden' );
401
+ jQuery( '.ewd-ufaq-wpforms-label' ).removeClass( 'ewd-ufaq-hidden' );
402
+
403
+ ewd_ufaq_ajax_reload( 'No', 'No', search_string );
404
+ }
405
+ else if ( ! filtering_running ) {
406
+
407
+ jQuery( '.ewd-ufaq-faqs' ).html( ' ' );
408
+ jQuery( '.ewd-ufaq-wpforms-faq-results' ).addClass( 'ewd-ufaq-hidden' );
409
+ jQuery( '.ewd-ufaq-wpforms-label' ).addClass( 'ewd-ufaq-hidden' );
410
+ }
411
+
412
+ });
413
+ }
414
+
415
+ /*jQuery(document).ready(function() {
416
+ jQuery('a[href*=#]:not([href=#])').click(function() {
417
+ var post_id = jQuery(this).attr("data-postid");
418
+ var selectedIDString = 'ewd-ufaq-body-'+post_id;
419
+
420
+ if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
421
+ var target = jQuery(this.hash);
422
+ target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']');
423
+ if (target.length) {
424
+
425
+ jQuery('html,body').on("scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove", function(){
426
+ jQuery('html,body').stop();
427
+ });
428
+
429
+ if (jQuery('#'+selectedIDString).hasClass("ewd-ufaq-hidden")) {
430
+ EWD_UFAQ_Reveal_FAQ(post_id, selectedIDString);
431
+ }
432
+
433
+ jQuery('html,body').animate({
434
+ scrollTop: target.offset().top
435
+ }, 1000);
436
+ //return false;
437
+ }
438
+ }
439
+ });
440
+ });*/
js/ewd-ufaq-plugin-deactivation.js → assets/js/plugin-deactivation.js RENAMED
File without changes
blocks/ewd-ufaq-blocks.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- add_filter( 'block_categories', 'ewd_ufaq_add_block_category' );
3
- function ewd_ufaq_add_block_category( $categories ) {
4
- $categories[] = array(
5
- 'slug' => 'ewd-ufaq-blocks',
6
- 'title' => __( 'Ultimate FAQs', 'ultimate-faqs' ),
7
- );
8
- return $categories;
9
- }
10
-
 
 
 
 
 
 
 
 
 
 
css/Admin.css DELETED
@@ -1,3025 +0,0 @@
1
- .ewd-ufaq-clear {
2
- clear:both;
3
- }
4
-
5
- .ewd-ufaq-item {
6
- cursor: move;
7
- }
8
-
9
-
10
- /***********************************************************
11
- * TABBED OPTIONS PAGE
12
- ***********************************************************/
13
-
14
- .ufaq-hidden {
15
- display:none;
16
- }
17
-
18
- .ufaq-options-page-tabbed {
19
- min-height:450px;
20
- height:auto;
21
- }
22
- .ufaq-options-page-tabbed-nav{
23
- position: relative;
24
- top: 0;
25
- left: 0;
26
- width:15%;
27
- z-index: 1;
28
- min-width:100px;
29
- margin:0 !important;
30
- }
31
-
32
- .ufaq-options-submenu-div li {
33
- float:left;
34
- padding: 0;
35
- width:100%;
36
- margin:0; !important;
37
- }
38
- .ufaq-options-submenu-div a {
39
- display:block;
40
- height:40px;
41
- line-height:40px;
42
- font-weight:10;
43
- padding-left:20px;
44
- }
45
- .ufaq-options-submenu-div a.options-subnav-tab-active,
46
- .ufaq-options-submenu-div a.styling-subnav-tab-active{
47
- box-shadow: inset 2px 0 0 #1188cc;
48
- background-color: #ffffff !important;
49
- color: #29324e;
50
- }
51
- .ufaq-options-submenu-div a.options-subnav-tab,
52
- .ufaq-options-submenu-div a.styling-subnav-tab{
53
- background-color: rgba(224, 224, 224, 0.5);
54
- }
55
- .ufaq-options-submenu-div a:hover {
56
- color: #29324e;
57
- background-color: rgba(199,199,199, 0.5);
58
- box-shadow: inset 2px 0 0 #1188cc;
59
-
60
- }
61
-
62
- .ufaq-options-submenu-div {
63
- float:left;
64
- width:100px;
65
- border: 1px solid #e5e5e5;
66
- }
67
- .ufaq-options-page-tabbed-content,
68
- .ufaq-styling-page-tabbed-content {
69
- float:left;
70
- width:80%;
71
- z-index: 999;
72
- background:#fff;
73
- margin:0 !important;
74
- position:relative;
75
- min-height:400px;
76
- border: 1px solid #e5e5e5;
77
- padding-bottom:5px;
78
- }
79
- .ufaq-option-set,
80
- .ufaq-styling-set{
81
- width:85%;
82
- margin:0 auto;
83
- position:relative;
84
- left:10px;
85
- min-height:400px;
86
- }
87
- .ufaq-options-page-tab-title{
88
- margin:15px 0 !important;
89
- }
90
-
91
- .ufaq-options-page-tabbed p.submit {
92
- float: right;
93
- margin-right: 10px;
94
- margin-top: 15px;
95
- padding: 3px;
96
- }
97
-
98
-
99
- @media only screen and (max-width: 650px) {
100
- .ufaq-options-page-tabbed,
101
- .ufaq-styling-page-tabbed{
102
- margin:0;
103
- }
104
- .ufaq-options-submenu-div {
105
- width: 100%;
106
- }
107
- .ufaq-options-page-tabbed-nav{
108
- width:100%;
109
- }
110
- .ufaq-options-page-tabbed li{
111
- float:none;
112
- }
113
- .ufaq-options-page-tabbed a.styling-subnav-tab{
114
- width:25%;
115
- float:left;
116
- padding:0;
117
- text-align:center;
118
- }
119
- .ufaq-options-page-tabbed a.options-subnav-tab-active{
120
- }
121
-
122
- .ufaq-options-page-tabbed-content,
123
- .ufaq-styling-page-tabbed-content{
124
- width:100%;
125
- }
126
-
127
- }
128
-
129
- /***********************************************************
130
- FLEXBOX STYLING
131
- ***********************************************************/
132
- .ufaq-option-set h3,
133
- .ufaq-styling-set h3 {
134
- padding-top:10px;
135
- padding-bottom: 5px;
136
- border-bottom: 2px solid #eee;
137
- }
138
- .ufaq-options-table th {
139
- padding:15px 5px;
140
- height:1em;
141
- }
142
-
143
- .ufaq-options-page-tabbed input[type=text],
144
- .ufaq-styling-page-tabbed input[type=text] {
145
- width: 100%;
146
- }
147
- .ufaq-options-page-tabbed select,
148
- .ufaq-options-page-tabbed textarea
149
- {
150
- width:50% !important;
151
- }
152
-
153
- .ufaq-styling-page-tabbed select,
154
- .ufaq-styling-page-tabbed textarea{
155
-
156
- }
157
-
158
- .ufaq-options-div {
159
- width:100%;
160
- }
161
- .ufaq-options-div.ufaq-options-flex {
162
- width:100%;
163
- display:flex;
164
- display: -webkit-flex;
165
- flex-flow: row wrap;
166
- -webkit-flex-flow: row wrap;
167
- }
168
- .ufaq-subsection{
169
- margin: 0 10px 10px 0;
170
- flex-grow:1;
171
- }
172
- .ufaq-subsection-half{
173
- width:50%;
174
- }
175
-
176
- .ufaq-options-page-tabbed .submit{
177
- float:left;
178
- margin-top:0;
179
- }
180
- .ufaq-options-page-tabbed .submit input[type=submit]{
181
- position:relative;
182
- /* left:100px;*/
183
- }
184
-
185
- .ufaq-subsection-header {
186
- font-size:1.2em;
187
- font-weight:900;
188
- padding: 10px;
189
- margin:0;
190
- }
191
-
192
- .ufaq-subsection-content{
193
- padding: 10px;
194
- }
195
- .ufaq-subsection-content.ufaq-subsection-full{
196
- border: none;
197
- padding: 5px;
198
- }
199
-
200
- /*Subsection Rows*/
201
- .ufaq-subsection-content .ufaq-option-label {
202
- display:inline;
203
- }
204
- .ufaq-subsection-content .ufaq-option-checkbox {
205
- display:inline;
206
- }
207
- .ufaq-subsection-content .ufaq-option {
208
- padding: 5px 0;
209
- }
210
- /* Color Pickers */
211
- .ewd-ufaq-spectrum {margin-right: 6px;}
212
-
213
-
214
- #ufaq-subsection-inline .ufaq-option {
215
- }
216
- @media only screen and (max-width: 650px) {
217
- #ufaq-subsection-inline .ufaq-option {
218
- display:block;
219
- }
220
- }
221
-
222
-
223
-
224
- /************
225
- EXTRA
226
- ************/
227
- #ewd-ufaq-custom-fields-table select {
228
- width: 100% !important;
229
- }
230
- #ewd-ufaq-custom-fields-table th {
231
- padding: 20px 10px 20px 10px !important;
232
- }
233
-
234
- .ewd-ufaq-elements-table {
235
- width: 100%;
236
- border-collapse: collapse;
237
- }
238
- .ewd-ufaq-elements-table th, .ewd-ufaq-elements-table td {
239
- background: #f3f3f3;
240
- margin: 0;
241
- padding: 8px 16px;
242
- width: calc(100% - 32px);
243
- }
244
- .ewd-ufaq-elements-table td {
245
- border-bottom: 1px solid #ccc;
246
- cursor: all-scroll;
247
- }
248
- .ewd-ufaq-elements-table th {
249
- background: #662D91;
250
- color: #fff;
251
- text-align: left;
252
- }
253
-
254
-
255
-
256
- /********************************
257
- * Dashboard Styling
258
- ********************************/
259
- .ewd-ufaq-dark_overlay {
260
- display: none;
261
- position: fixed;
262
- top: 0;
263
- left: 0;
264
- width: 100%;
265
- height: 100%;
266
- background-color: black;
267
- z-index: 1001;
268
- -moz-opacity: 0.3;
269
- opacity: .80;
270
- filter: alpha(opacity=80);
271
- }
272
-
273
- .ewd-ufaq-bright_content {
274
- display: none;
275
- position: absolute;
276
- top: 48px;
277
- left: 25%;
278
- width: 50%;
279
- height: 400px;
280
- padding: 16px;
281
- background-color: white;
282
- z-index: 1002;
283
- overflow: auto;
284
- }
285
- #form1 a {
286
- color:white !important;
287
- }
288
- .ewd-ufaq-bright_content a img {
289
- padding: 1em;
290
- float: left;
291
- }
292
- /*Dashboard styling*/
293
- .ewd-dashboard-top, .ewd-dashboard-middle, .ewd-dashboard-footer {
294
- width: 90%;
295
- margin-top: 1.5em;
296
- }
297
-
298
- .ewd-dashboard-middle {
299
- box-shadow: 2px 2px 5px #666666;
300
- background-color: white;
301
- padding: 1em;
302
- }
303
-
304
- .ewd-dashboard-middle > table.widefat {
305
-
306
- border: 0px !important;
307
- box-shadow: none !important;
308
- }
309
-
310
- .ewd-dashboard-footer {
311
- padding-left: 1.25em;
312
- }
313
-
314
- #wpfooter {
315
- bottom: initial;
316
- }
317
-
318
-
319
- .ewd-ufaq-dashboard-submit {
320
- height: 40px !important;
321
- width: 150px;
322
- background-color: #8dc73f !important;
323
- border-radius: 0px !important;
324
- box-shadow: none !important;
325
- color: white !important;
326
- }
327
-
328
- .ewd-ufaq-dashboard-table {
329
- border: 0px !important;
330
- box-shadow: none !important;
331
- }
332
-
333
- .ewd-ufaq-dashboard-select {
334
- height: 40px !important;
335
- }
336
-
337
- .ewd-ufaq-updates, .ewd-ufaq-blog, .ewd-ufaq-plugins {
338
- width: 30%;
339
- display: inline-block;
340
- position: relative;
341
- float: left;
342
- height: 300px;
343
- margin-right: 1em;
344
- box-shadow: 2px 2px 5px #666666;
345
- padding: 0.5em;
346
- }
347
-
348
- #ewd-ufaq-dashboard-leave-review {
349
- position: relative;
350
- float: left;
351
- margin-top: 20px;
352
- width: calc(90% + 2em);
353
- background: #9D64BC;
354
- color: #fff;
355
- }
356
- #ewd-ufaq-dashboard-leave-review h3 {
357
- background: #262262;
358
- color: #fff;
359
- text-align: center;
360
- }
361
- #ewd-ufaq-dashboard-leave-review h3 span {
362
- font-family: 'dashicons';
363
- color: #F5E836;
364
- }
365
- #ewd-ufaq-dashboard-leave-review h3 span:before {
366
- content: "\f155\f155\f155\f155\f155";
367
- }
368
- #ewd-ufaq-dashboard-leave-review .ewd-dashboard-content .ewd-dashboard-leave-review-text {
369
- position: relative;
370
- float: left;
371
- width: 55%;
372
- margin: 8px 0 8px 5%;
373
- font-size: 1.25em;
374
- line-height: 1.3;
375
- }
376
- #ewd-ufaq-dashboard-leave-review .ewd-dashboard-content .ewd-dashboard-leave-review-link {
377
- position: relative;
378
- float: left;
379
- width: 30%;
380
- margin: 8px 5% ;
381
- padding: 12px 0;
382
- background: #F5E836;
383
- color: #9D64BC;
384
- font-size: 1.25em;
385
- text-align: center;
386
- border-radius: 3px;
387
- }
388
- #ewd-ufaq-dashboard-leave-review .ewd-dashboard-content .ewd-dashboard-leave-review-link:hover {
389
- background: #F5EE90;
390
- color: #9D64BC;
391
- text-decoration: none;
392
- }
393
- #ewd-ufaq-dashboard-leave-review .ewd-dashboard-leave-review-dismiss {
394
- position: relative;
395
- float: left;
396
- background: #262262;
397
- border: none;
398
- margin: 0;
399
- padding: 0;
400
- padding: 4px 0;
401
- width: 100%;
402
- text-align: center;
403
- color: #fff;
404
- font-size: 12px;
405
- cursor: pointer;
406
- }
407
-
408
- .ewd-ufaq-dashboard-box {
409
- color: white;
410
- width: 20%;
411
- display: inline-block;
412
- height: 80px;
413
- margin-right: 25px;
414
- padding: 5px 5px 5px 5px;
415
- box-shadow: 2px 2px 5px #666666;
416
- min-width: 160px;/* pchanges */
417
- margin-top: 10px;/* pchanges */
418
- }
419
- .ewd-ufaq-dashboard-box a {
420
- text-decoration: none;
421
- }
422
-
423
- .ewd-ufaq-dashboard-h3 {
424
- color:grey;
425
- }
426
-
427
- .ewd-dashboard-box-icon {
428
- width: 40%;
429
- height: 95%;
430
- display: inline-block;
431
- margin-left: 0.5em;
432
- }
433
-
434
- .ewd-dashboard-box-icon > img {
435
- height: 100%;
436
- opacity: 0.75;
437
- }
438
-
439
- .ewd-dashboard-box-value-and-field-container {
440
- float:right;
441
- padding-top: 0.5em;
442
- padding-right: 0.5em;
443
- width: 50%;
444
- display:inline-block;
445
- }
446
- .ewd-dashboard-box-support-value {
447
- font-size: 22px;
448
- line-height: 1;
449
- text-align:right;
450
- }
451
- .ewd-dashboard-box-value {
452
- font-size: 42px;
453
- line-height: 1;
454
- text-align: right;
455
- }
456
- .ewd-dashboard-box-field {
457
- text-align: right;
458
- }
459
-
460
- #ewd-dashboard-box-orders {
461
- background-color: #f7941d;
462
- }
463
- #ewd-dashboard-box-links {
464
- background-color: #00bff3;
465
- }
466
- #ewd-dashboard-box-views {
467
- background-color: #662d91;
468
- }
469
- #ewd-dashboard-box-support {
470
- background-color: #ed1c24;
471
- cursor: pointer;
472
- }
473
-
474
- #ewd-ufaq-dashboard-thead tr th {
475
- border-bottom: none;
476
- }
477
- #ewd-ufaq-dashboard-thead tr th a {
478
- padding: none !important;
479
- }
480
- #ewd-ufaq-dashboard-thead tr th a, #ewd-ufaq-dashboard-tbody tr td {
481
- width: 150px;
482
-
483
- }
484
- #ewd-ufaq-dashboard-tbody tr td {
485
- padding: 8px;
486
- }
487
- #ewd-ufaq-dashboard-thead tr th a span {
488
- text-transform: uppercase;
489
- color: #595959;
490
- }
491
- #ewd-ufaq-dashboard-tbody, #ewd-ufaq-dashboard-thead {
492
- display: block;
493
- }
494
-
495
- #ewd-ufaq-dashboard-tbody {
496
- height:300px;
497
- overflow-y: scroll;
498
- }
499
- .ewd-ufaq-dashboard-h3 {
500
- margin: 0 !important;
501
- padding: 0.5em;
502
- }
503
- .ewd-ufaq-dashboard-h3 .fa {
504
- float: right;
505
- font-size: larger;
506
- }
507
-
508
-
509
- .ewd-dashboard-content {
510
- padding: 8px 12px;
511
- margin: 0;
512
- }
513
- .ewd-dashboard-content a {
514
- text-decoration: none;
515
- }
516
- .ewd-dashboard-content a:hover {
517
- text-decoration: underline;
518
- }
519
-
520
- .ewd-dashboard-plugin-icons {
521
- width: 90%;
522
- margin-right: 5%;
523
- }
524
- #ewd-dashboard-plugins div.inside {
525
- display: inline-flex;
526
- }
527
-
528
- #light a {
529
- text-decoration: none;
530
- }
531
- #light a:hover {
532
- text-decoration: underline;
533
- }
534
-
535
- .ewd-dashboard-box-value.ewd-font-22 {
536
- font-size: 22px;
537
- }
538
-
539
- /*
540
- ==============================================
541
- Toggle Font
542
- ==============================================
543
- */
544
-
545
- @font-face { /* declare fonts */
546
- font-family: 'ewd-toggle-icon';
547
- src: url("fonts/ewd-toggle-icon.eot");
548
- src: url('fonts/ewd-toggle-icon.woff2') format('woff2'),
549
- url('fonts/ewd-toggle-icon.woff') format('woff'),
550
- url("fonts/ewd-toggle-icon.ttf") format("truetype"),
551
- url("fonts/ewd-toggle-icon.svg#ewd-toggle-icon") format("svg");
552
- font-weight: normal;
553
- font-style: normal;
554
- }
555
-
556
- .ufaq-toggle-symbol {
557
- font-family: 'ewd-toggle-icon';
558
- letter-spacing: 6px;
559
- font-size: 1.2em;
560
- }
561
-
562
- input[name=toggle_symbol] {
563
- margin-right: 10px;
564
- }
565
-
566
-
567
-
568
- /***********************************************************
569
- * ADDITIONAL DASHBOARD
570
- ***********************************************************/
571
- /**--Start Upgrade Area--**/
572
- #ewd-ufaq-dashboard-top-upgrade {
573
- position: relative;
574
- float: left;
575
- width: 100%;
576
- }
577
- #ewd-ufaq-dashboard-top-upgrade-left {
578
- position: relative;
579
- float: left;
580
- width: 70%;
581
- margin-right: 2em;
582
- }
583
- #ewd-ufaq-dashboard-top-upgrade-left .inside, #ewd-ufaq-dashboard-top-upgrade-right .inside {
584
- display: block;
585
- }
586
- #ewd-ufaq-dashboard-top-upgrade-left .inside, #ewd-ufaq-dashboard-top-upgrade-left .postbox {
587
- background: #e5e5e5;
588
- }
589
- #ewd-ufaq-dashboard-top-upgrade-left .inside h3 {
590
- color: #262262;
591
- margin-bottom: 8px;
592
- }
593
- #ewd-ufaq-dashboard-top-upgrade-left .inside ul {
594
- position: relative;
595
- float: left;
596
- width: 100%;
597
- width: calc(100% - 16px);
598
- list-style-type: disc;
599
- padding-left: 16px;
600
- margin-top: 0;
601
- }
602
- #ewd-ufaq-dashboard-top-upgrade-left .inside ul li {
603
- margin-bottom: 1px;
604
- }
605
- #ewd-ufaq-dashboard-top-upgrade-left .inside ul li span {
606
- position: relative;
607
- left: 0;
608
- }
609
- #ewd-ufaq-dashboard-top-upgrade-left .inside .purchaseButton {
610
- position: relative;
611
- display: block;
612
- width: 340px;
613
- margin: 0 auto 12px;
614
- padding: 12px 0;
615
- background: #4A4694;
616
- background: #afadc9;
617
- background: -moz-linear-gradient(top, #afadc9 0%, #8f8da8 100%);
618
- background: -webkit-linear-gradient(top, #afadc9 0%,#8f8da8 100%);
619
- background: linear-gradient(to bottom, #afadc9 0%,#8f8da8 100%);
620
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#afadc9', endColorstr='#8f8da8',GradientType=0 );
621
- border-bottom: 2px solid #262262;
622
- border-radius: 4px;
623
- color: #fff;
624
- font-size: 17px;
625
- text-align: center;
626
- line-height: 1.3;
627
- text-decoration: none;
628
- }
629
- #ewd-ufaq-dashboard-top-upgrade-left .inside .purchaseButton:hover {
630
- background: #4A4694;
631
- background: #c5bcdb;
632
- background: -moz-linear-gradient(top, #c5bcdb 0%, #a09eb8 100%);
633
- background: -webkit-linear-gradient(top, #c5bcdb 0%,#a09eb8 100%);
634
- background: linear-gradient(to bottom, #c5bcdb 0%,#a09eb8 100%);
635
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#c5bcdb', endColorstr='#a09eb8',GradientType=0 );
636
- text-decoration: none;
637
- }
638
- @media screen and (max-width: 768px) {
639
- #ewd-ufaq-dashboard-top-upgrade-left .inside .purchaseButton {
640
- width: calc(98% - 12px);
641
- }
642
- }
643
- #ewd-ufaq-dashboard-top-upgrade-left .inside input[type="text"] {
644
- padding: 9px 8px;
645
- width: 81%;
646
- float: left;
647
- font-size: 15px;
648
- margin: 0;
649
- margin-bottom: 6px;
650
- border: none;
651
- }
652
- #ewd-ufaq-dashboard-top-upgrade-left .inside input[type="text"]::-webkit-input-placeholder {
653
- font-size: 15px;
654
- color: #ccc;
655
- }
656
- #ewd-ufaq-dashboard-top-upgrade-left .inside input[type="text"]::-moz-placeholder {
657
- font-size: 15px;
658
- color: #ccc;
659
- }
660
- #ewd-ufaq-dashboard-top-upgrade-left .inside input[type="text"]:-ms-input-placeholder {
661
- font-size: 15px;
662
- color: #ccc;
663
- }
664
- #ewd-ufaq-dashboard-top-upgrade-left .inside input[type="text"]:-moz-placeholder {
665
- font-size: 15px;
666
- color: #ccc;
667
- }
668
- #ewd-ufaq-dashboard-top-upgrade-left .inside input[type="submit"] {
669
- padding: 9px 8px;
670
- width: 18%;
671
- float: left;
672
- border: 0;
673
- cursor: pointer;
674
- margin: 0;
675
- margin-bottom: 6px;
676
- background: #c6ab55;
677
- color: #fff;
678
- font-weight: bold;
679
- border-bottom: 2px solid #a69b50;
680
- }
681
- #ewd-ufaq-dashboard-top-upgrade-left .inside input[type="submit"]:hover {
682
- background: #E8CD79;
683
- }
684
-
685
- #ewd-ufaq-dashboard-top-upgrade-right {
686
- position: relative;
687
- float: left;
688
- width: 25%;
689
- }
690
- #ewd-ufaq-dashboard-top-upgrade-right .postbox .hndle{
691
- border: none;
692
- }
693
- #ewd-ufaq-dashboard-top-upgrade-right .ewd-ufaq-dashboard-h3{
694
- margin: 0;
695
- }
696
- #ewd-ufaq-dashboard-top-upgrade-right .inside, #ewd-ufaq-dashboard-top-upgrade-right .postbox {
697
- background: #e5e5e5;
698
- background: rgba(38,34,98,.4);
699
- }
700
- #ewd-ufaq-dashboard-top-upgrade-right .inside {
701
- padding: 0;
702
- margin: 0;
703
- }
704
- #ewd-ufaq-dashboard-top-upgrade-right .inside .topPart {
705
- position: relative;
706
- float: left;
707
- width: calc(100% - 72px);
708
- text-align: center;
709
- padding: 4px 36px 21px;
710
- background: #262262;
711
- color: #fff;
712
- font-size: 24px;
713
- font-style: italic;
714
- line-height: 1.3;
715
- margin-top: -20px;
716
- }
717
- #ewd-ufaq-dashboard-top-upgrade-right .inside .bottomPart {
718
- position: relative;
719
- float: left;
720
- padding: 21px 36px 22px;
721
- width: calc(100% - 72px);
722
- color: #fff;
723
- font-size: 24px;
724
- line-height: 1.3;
725
- text-align: center;
726
- border-top: 3px solid #c6ab55;
727
- }
728
- #ewd-ufaq-dashboard-top-upgrade-right .inside .bottomPart span.freeTrialText {
729
- color: #262262;
730
- }
731
- #ewd-ufaq-dashboard-top-upgrade-right .inside .bottomPart a.freeTrialPurchaseLink {
732
- color: #E8CD79;
733
- text-decoration: underline
734
- }
735
- #ewd-ufaq-dashboard-top-upgrade-right .inside .bottomPart a.freeTrialPurchaseLink:hover {
736
- color: #262262;
737
- text-decoration: underline
738
- }
739
-
740
- /**--End Upgrade Area--**/
741
-
742
- .ewd-ufaq-dashboard-h3 {
743
- background-color: #262262 ;
744
- color: white;
745
- margin: initial;
746
- padding: 8px 12px;
747
- }
748
- .ewd-ufaq-postbox-collapsible {
749
- overflow: hidden;
750
- }
751
-
752
-
753
-
754
- /***********************************************************
755
- WOOCOMMERCE PRODUCT FAQ AREA
756
- ***********************************************************/
757
- .ewd-ufaq-explanation {
758
- margin: 24px 2%;
759
- font-size: 1.1em;
760
- }
761
- .ewd-ufaq-category-filter {
762
- margin-bottom: 10px !important;
763
- }
764
- #ewd_ufaq_faqs.woocommerce_options_panel th {
765
- padding: 15px 10px;
766
- }
767
- #ewd_ufaq_faqs.woocommerce_options_panel th:first-of-type {
768
- width: 10%;
769
- }
770
- #ewd_ufaq_faqs.woocommerce_options_panel tr {
771
- border-bottom: 1px solid #eee;
772
- }
773
- #ewd-ufaq-add-delete-faq-form-container {
774
- position: relative;
775
- float: left;
776
- width: 100%;
777
- clear: both;
778
- }
779
- #ewd-ufaq-add-faq-form-div, #ewd-ufaq-delete-faq-form-div {
780
- position: relative;
781
- float: left;
782
- width: 45%;
783
- padding: 0 2%;
784
- }
785
- #ewd-ufaq-delete-faq-form-div {
786
- margin-top: 31px;
787
- border-left: 1px solid #eee;
788
- }
789
- @media screen and (max-width: 1200px) {
790
- #ewd-ufaq-add-faq-form-div, #ewd-ufaq-delete-faq-form-div {
791
- width: 96%;
792
- }
793
- #ewd-ufaq-delete-faq-form-div {
794
- border-left: none;
795
- }
796
- }
797
- .ewd-ufaq-delete-faq-button, .ewd-ufaq-add-faq-button {
798
- clear: both;
799
- position: relative;
800
- margin: 12px 0 12px 10px;
801
- padding: 5px 8px;
802
- border: none;
803
- background: #bbb;
804
- color: #fff;
805
- cursor: pointer;
806
- }
807
- .ewd-ufaq-delete-faq-button:hover, .ewd-ufaq-add-faq-button:hover {
808
- background: #ccc;
809
- }
810
-
811
-
812
- /*************************************************
813
- SHORTCODE REMINDER IN BASIC AREA OF OPTIONS TAB
814
- *************************************************/
815
- .ewd-ufaq-shortcode-reminder {
816
- position: relative;
817
- float: left;
818
- width: calc(95% - 48px);
819
- padding: 14px 2.5% 12px calc(2.5% + 48px);
820
- height: 22px;
821
- margin: 0 0 16px;
822
- background: url(../images/options-asset-star.png) #f1f1f1;
823
- background-size: 48px 48px;
824
- background-position: left top;
825
- background-repeat: no-repeat;
826
- }
827
- @media screen and (max-width: 782px) {
828
- .ewd-ufaq-shortcode-reminder {
829
- width: calc(90% - 48px);
830
- margin: 0 2.5% 16px;
831
- }
832
- }
833
- @media screen and (max-width: 568px) {
834
- .ewd-ufaq-shortcode-reminder {
835
- padding: 6px 2.5% 2px calc(2.5% + 48px);
836
- height: 40px;
837
- }
838
- }
839
-
840
-
841
- /***********************************************************
842
- NEW ASK FOR REVIEW POPUP
843
- ***********************************************************/
844
- #ewd-ufaq-review-ask-overlay {
845
- position: fixed;
846
- top: 0;
847
- left: 0;
848
- width: 100%;
849
- height: 100%;
850
- background: #000;
851
- background: rgba(0,0,0,.825);
852
- z-index: 1001;
853
- }
854
- .ewd-ufaq-review-ask-popup {
855
- position: absolute;
856
- top: 48px;
857
- left: 25%;
858
- width: 50%;
859
- height: auto;
860
- /*padding: 16px;*/
861
- background-color: white;
862
- z-index: 1002;
863
- overflow: auto;
864
- }
865
- @media screen and (max-width: 900px) {
866
- .ewd-ufaq-review-ask-popup {
867
- width: 90%;
868
- left: 5%;
869
- }
870
- }
871
- .ewd-ufaq-review-ask-popup p, .ewd-ufaq-review-ask-popup a {
872
- font-size: 15px;
873
- }
874
- .ewd-ufaq-review-ask-popup p:first-of-type {
875
- margin-top: 0;
876
- }
877
- .ewd-ufaq-review-ask-title {
878
- position: relative;
879
- float: left;
880
- width: calc(100% - 32px);
881
- padding: 16px;
882
- background: #9D64BC;
883
- color: #fff;
884
- font-size: 20px;
885
- }
886
- .ewd-ufaq-review-ask-content {
887
- position: relative;
888
- float: left;
889
- width: calc(100% - 74px);
890
- margin: 16px 37px 16px 16px;
891
- border-left: 5px solid #9d64bc;
892
- padding-left: 16px;
893
- }
894
- .ewd-ufaq-review-ask-content-link {
895
- background: #262262;
896
- color: #fff;
897
- position: relative;
898
- float: left;
899
- width: 160px;
900
- padding: 10px 0;
901
- text-align: center;
902
- text-decoration: none;
903
- }
904
- .ewd-ufaq-review-ask-content-link:hover {
905
- background: #9D64BC;
906
- color: #fff;
907
- }
908
- .ewd-ufaq-review-ask-footer-links {
909
- position: relative;
910
- float: left;
911
- width: calc(100% - 74px);
912
- margin: 18px 37px 12px;
913
- }
914
- .ewd-ufaq-hide-review-ask {
915
- position: relative;
916
- float: left;
917
- width: 160px;
918
- padding: 4px 0;
919
- margin-bottom: 12px;
920
- text-align: center;
921
- color: #fff;
922
- cursor: pointer;
923
- }
924
- #ewd-ufaq-hide-review-ask-week {
925
- background: transparent;
926
- border: 2px solid #c6ab55;
927
- color: #c6ab55;
928
- margin-right: 16px;
929
- }
930
- #ewd-ufaq-hide-review-ask-week:hover {
931
- background: #c6ab55;
932
- color: #fff;
933
- }
934
- #ewd-ufaq-hide-review-ask-never {
935
- background: transparent;
936
- border: 2px solid #c6ab55;
937
- color: #c6ab55;
938
- }
939
- #ewd-ufaq-hide-review-ask-never:hover {
940
- background: #c6ab55;
941
- color: #fff;
942
- }
943
-
944
-
945
-
946
- /*
947
- ==============================================
948
- PChanges
949
- ==============================================
950
- */
951
- @media screen and (max-width: 782px) {
952
- .ewd-ufaq-overview-table td {
953
- display: table-cell !important;
954
- }
955
- }
956
-
957
-
958
-
959
- .ewd-ufaq-meta-field {
960
- margin-top: 8px;
961
- clear: both;
962
- }
963
-
964
- .ewd-ufaq-meta-field label{
965
- display: inline-block;
966
- width: 200px;
967
- float: left;
968
- min-height: 1px;
969
- }
970
- .ewd-ufaq-meta-field input[type="checkbox"] {
971
- margin: 1px 4px 5px 1px;
972
- }
973
-
974
-
975
-
976
-
977
- /*
978
- ==============================================
979
- NEW DASHBOARD
980
- ==============================================
981
- */
982
-
983
-
984
- /*** WRAP ***/
985
-
986
- .toplevel_page_EWD-UFAQ-Options #wpcontent {
987
- padding-left: 0;
988
- }
989
- .toplevel_page_EWD-UFAQ-Options .wrap {
990
- margin: 10px 0 0;
991
- }
992
- .toplevel_page_EWD-UFAQ-Options .wrap.ufaq-options-page-tabbed {
993
- margin: 10px 0 0 32px;
994
- width: calc(100% - 32px);
995
- }
996
- .toplevel_page_EWD-UFAQ-Options .Header {
997
- padding-left: 20px;
998
- }
999
- #ewd-dashboard-top, .ewd-dashboard-middle, .ewd-dashboard-footer {
1000
- padding-left: 20px;
1001
- width: calc(100% - 20px);
1002
- }
1003
-
1004
- .ewd-ufaq-import-export-container {
1005
- position: relative;
1006
- float: left;
1007
- margin-left: 32px;
1008
- width: calc(100% - 32px);
1009
- }
1010
-
1011
-
1012
- /*** BANNER ***/
1013
-
1014
- .ewd-ufaq-dashboard-new-upgrade-banner {
1015
- position: relative;
1016
- float: left;
1017
- width: 100%;
1018
- height: 256px;
1019
- background: url(../images/ewd-ufaq-dashboard-banner.png) center no-repeat #1b0f49;
1020
- }
1021
- .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
1022
- position: absolute;
1023
- height: 112px;
1024
- width: 112px;
1025
- left: 172px;
1026
- top: 72px;
1027
- background: url(../images/ewd-ufaq-icon.png) no-repeat;
1028
- background-size: 112px 112px;
1029
- }
1030
- .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
1031
- position: absolute;
1032
- height: 112px;
1033
- width: 192px;
1034
- right: 128px;
1035
- top: 84px;
1036
- }
1037
- .ewd-ufaq-dashboard-new-upgrade-button {
1038
- position: relative;
1039
- float: right;
1040
- width: 188px;
1041
- border: 2px solid #0acbaa;
1042
- background-color: #0acbaa;
1043
- color: #fff;
1044
- padding: 6px 0;
1045
- font-size: 12px;
1046
- text-decoration: none;
1047
- text-align: center;
1048
- margin-bottom: 20px;
1049
- font-weight: bold;
1050
- border-radius: 2px;
1051
- }
1052
- .ewd-ufaq-dashboard-new-upgrade-button:hover {
1053
- background-color: #1CE6C3;
1054
- border-color: #1CE6C3;
1055
- color: #fff;
1056
- }
1057
- .ewd-ufaq-dashboard-new-upgrade-button.ewd-ufaq-dashboard-new-trial-button {
1058
- background-color: transparent;
1059
- color: #0acbaa;
1060
- font-size: 11px;
1061
- cursor: pointer;
1062
- width: 192px;
1063
- }
1064
- .ewd-ufaq-dashboard-new-upgrade-button.ewd-ufaq-dashboard-new-trial-button:hover {
1065
- background-color: #0acbaa;
1066
- border-color: #0acbaa;
1067
- color: #fff;
1068
- }
1069
- .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
1070
- position: absolute;
1071
- width: calc(100% - 680px);
1072
- height: 112px;
1073
- top: 76px;
1074
- left: 320px;
1075
- color: #fff;
1076
- }
1077
- .ewd-ufaq-dashboard-banner-title {
1078
- position: relative;
1079
- float: left;
1080
- width: 100%;
1081
- font-size: 29px;
1082
- line-height: 32px;
1083
- font-weight: bold;
1084
- }
1085
- .ewd-ufaq-dashboard-banner-brief {
1086
- position: relative;
1087
- float: left;
1088
- width: 100%;
1089
- margin-top: 14px;
1090
- font-size: 14px;
1091
- }
1092
-
1093
- @media screen and (min-width: 1700px) {
1094
- .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
1095
- left: 272px;
1096
- }
1097
- .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
1098
- right: 228px;
1099
- }
1100
- .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
1101
- width: calc(100% - 880px);
1102
- left: 420px;
1103
- }
1104
- }
1105
- @media screen and (max-width: 1200px) {
1106
- .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
1107
- left: 54px;
1108
- }
1109
- .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
1110
- right: 32px;
1111
- }
1112
- .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
1113
- width: calc(100% - 466px);
1114
- left: 202px;
1115
- }
1116
- }
1117
- @media screen and (max-width: 800px) {
1118
- .ewd-ufaq-dashboard-new-upgrade-banner {
1119
- height: 512px;
1120
- height: 300px;
1121
- }
1122
- .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
1123
- left: calc(50% - 56px);
1124
- top: 48px;
1125
- display: none;
1126
- }
1127
- .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
1128
- width: 80%;
1129
- left: 10%;
1130
- top: 208px;
1131
- height: 160px;
1132
- text-align: center;
1133
- height: 140px;
1134
- top: 42px;
1135
- }
1136
- .ewd-ufaq-dashboard-banner-brief {
1137
- display: none;
1138
- }
1139
- .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
1140
- right: calc(50% - 96px);
1141
- top: 368px;
1142
- top: 172px;
1143
- }
1144
- }
1145
-
1146
-
1147
- /*** START BLACK FRIDAY ***/
1148
-
1149
- .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text.ewd-ufaq-bf-banner {
1150
- top: 28px;
1151
- color: rgba(255,255,255,.7);
1152
- }
1153
-
1154
- .ewd-ufaq-bf-banner .ewd-ufaq-dashboard-banner-title {
1155
- margin-top: 40px;
1156
- }
1157
-
1158
- .ewd-ufaq-dashboard-banner-black-friday-text {
1159
- position: relative;
1160
- float: left;
1161
- width: 100%;
1162
- padding: 15px 0;
1163
- background: rgba(255,255,255,.9);
1164
- color: #1b0f49;
1165
- border-radius: 3px;
1166
- margin-bottom: -20px;
1167
- }
1168
- .ewd-ufaq-dashboard-banner-black-friday-title {
1169
- position: relative;
1170
- float: left;
1171
- width: calc(100% - 40px);
1172
- padding: 0 20px;
1173
- font-size: 29px;
1174
- line-height: 32px;
1175
- font-weight: bold;
1176
- }
1177
- .ewd-ufaq-dashboard-banner-black-friday-brief,
1178
- .ewd-ufaq-dashboard-banner-black-friday-brief-mobile {
1179
- position: relative;
1180
- float: left;
1181
- width: calc(100% - 40px);
1182
- padding: 0 20px;
1183
- margin-top: 14px;
1184
- font-size: 12px;
1185
- }
1186
- .ewd-ufaq-dashboard-banner-black-friday-brief-mobile {
1187
- display: none;
1188
- }
1189
-
1190
- @media screen and (max-width: 1560px) {
1191
- .ewd-ufaq-bf-banner .ewd-ufaq-dashboard-banner-title {
1192
- font-size: 20px;
1193
- }
1194
- }
1195
- @media screen and (max-width: 1440px) {
1196
- .ewd-ufaq-bf-banner .ewd-ufaq-dashboard-banner-brief {
1197
- display: none;
1198
- }
1199
- }
1200
- @media screen and (max-width: 1140px) {
1201
- .ewd-ufaq-dashboard-banner-black-friday-brief {
1202
- display: none;
1203
- }
1204
- .ewd-ufaq-dashboard-banner-black-friday-brief-mobile {
1205
- display: block;
1206
- }
1207
- }
1208
- @media screen and (max-width: 840px) {
1209
- .ewd-ufaq-dashboard-banner-black-friday-brief-mobile {
1210
- display: none;
1211
- }
1212
- }
1213
- @media screen and (max-width: 800px) {
1214
- .ewd-ufaq-bf-banner .ewd-ufaq-dashboard-banner-title {
1215
- display: none;
1216
- }
1217
- }
1218
-
1219
- /*** END BLACK FRIDAY ***/
1220
-
1221
-
1222
-
1223
-
1224
- /*** MENU ***/
1225
-
1226
- .EWD_UFAQ_Menu {
1227
- background-color: #6026B4;
1228
- margin-bottom: 16px;
1229
- }
1230
- body.post-type-ufaq .EWD_UFAQ_Menu {
1231
- margin-top: 64px;
1232
- }
1233
- .EWD_UFAQ_Menu .nav-tab-wrapper, .wrap .EWD_UFAQ_Menu h2.nav-tab-wrapper {
1234
- border-bottom: 0 !important;
1235
- margin: 0;
1236
- padding-top: 0;
1237
- padding-bottom: 0;
1238
- line-height: inherit;
1239
- }
1240
- .EWD_UFAQ_Menu .nav-tab {
1241
- border: none;
1242
- margin-left: 0;
1243
- padding: 12px 48px;
1244
- font-size: 12px;
1245
- text-transform: uppercase;
1246
- background: #6026B4;
1247
- color: #fff;
1248
- border-right: 1px solid #854DD6;
1249
- }
1250
-
1251
- .EWD_UFAQ_Menu .nav-tab:hover {
1252
- background: #682CBF;
1253
- }
1254
- .EWD_UFAQ_Menu .nav-tab-active {
1255
- background: #874ED9;
1256
- color: #fff;
1257
- }
1258
- .EWD_UFAQ_Menu .nav-tab-active:hover {
1259
- background: #874ED9;
1260
- color: #fff;
1261
- }
1262
- .EWD_UFAQ_Menu .nav-tab#ewd-ufaq-dash-mobile-menu-open {
1263
- display: none;
1264
- }
1265
-
1266
- @media screen and (max-width: 1440px) {
1267
- .EWD_UFAQ_Menu .nav-tab {
1268
- padding: 12px 32px;
1269
- }
1270
- }
1271
- @media screen and (max-width: 1150px) {
1272
- .EWD_UFAQ_Menu .nav-tab {
1273
- padding: 12px 18px;
1274
- }
1275
- }
1276
- @media screen and (max-width: 800px) {
1277
- .EWD_UFAQ_Menu .nav-tab {
1278
- padding: 12px 0;
1279
- margin: 0;
1280
- width: 100%;
1281
- clear: both;
1282
- text-align: center;
1283
- border-right: none;
1284
- border-bottom: 1px solid #854DD6;
1285
- }
1286
- .EWD_UFAQ_Menu .nav-tab:last-of-type {
1287
- border-bottom: none;
1288
- }
1289
- .EWD_UFAQ_Menu .nav-tab {
1290
- display: none;
1291
- }
1292
- .EWD_UFAQ_Menu .nav-tab#ewd-ufaq-dash-mobile-menu-open {
1293
- display: block;
1294
- }
1295
- #ewd-ufaq-dash-mobile-menu-up-caret {
1296
- display: none;
1297
- }
1298
- #ewd-ufaq-dash-mobile-menu-down-caret {
1299
- display: inline;
1300
- }
1301
- }
1302
-
1303
-
1304
-
1305
- /*** CONTENT ***/
1306
-
1307
- #ewd-ufaq-dashboard-content-area {
1308
- position: relative;
1309
- float: left;
1310
- width: calc(100% - 162px);
1311
- margin: 32px 20px 32px 142px;
1312
- }
1313
- #ewd-ufaq-dashboard-content-left {
1314
- position: relative;
1315
- float: left;
1316
- width: 74%;
1317
- }
1318
- #ewd-ufaq-dashboard-content-right {
1319
- position: relative;
1320
- float: right;
1321
- width: 24%;
1322
- }
1323
-
1324
- .ewd-ufaq-dashboard-new-widget-box {
1325
- position: relative;
1326
- float: left;
1327
- background: #fff;
1328
- box-shadow: -2px 2px 6px #ccc;
1329
- margin-bottom: 16px;
1330
- }
1331
- .ewd-ufaq-dashboard-new-widget-box.ewd-widget-box-full {
1332
- width: 100%;
1333
- }
1334
- .ewd-ufaq-dashboard-new-widget-box.ewd-widget-box-two-thirds {
1335
- width: 66%;
1336
- }
1337
- .ewd-ufaq-dashboard-new-widget-box.ewd-widget-box-one-third {
1338
- width: 32%;
1339
- margin-left: 2%;
1340
- }
1341
- .ewd-ufaq-dashboard-new-widget-box-top, .ewd-ufaq-dashboard-new-widget-box-bottom {
1342
- position: relative;
1343
- float: left;
1344
- width: calc(100% - 32px);
1345
- padding: 8px 16px;
1346
- color: #777;
1347
- }
1348
- .ewd-ufaq-dashboard-new-widget-box-top {
1349
- padding: 12px 16px;
1350
- font-weight: bold;
1351
- color: #444;
1352
- }
1353
- .ewd-ufaq-dashboard-new-widget-box-bottom {
1354
- border-top: 1px solid #e2e2e2;
1355
- }
1356
-
1357
- .ewd-ufaq-dashboard-key-widget {
1358
- position: relative;
1359
- float: left;
1360
- width: calc(100% - 144px);
1361
- min-height: 30px;
1362
- margin: 24px 24px 8px;
1363
- padding: 0 0 0 96px;
1364
- background-image: url(../images/dash-asset-key.png);
1365
- background-position: left top;
1366
- background-size: 64px 30px;
1367
- background-repeat: no-repeat;
1368
- }
1369
- .ewd-ufaq-dashboard-key-widget-input {
1370
- position: relative;
1371
- float: left;
1372
- width: calc(65% - 2px);
1373
- height: 30px;
1374
- padding: 4px 8px !important;
1375
- background: none;
1376
- border: 1px solid #e2e2e2 !important;
1377
- margin: 0 !important;
1378
- }
1379
- .ewd-ufaq-dashboard-key-widget-input::placeholder {
1380
- color: #bbb;
1381
- }
1382
- .ewd-ufaq-dashboard-key-widget-submit {
1383
- position: relative;
1384
- float: left;
1385
- width: 35%;
1386
- height: 30px;
1387
- font-size: 14px;
1388
- background: #f2b52f;
1389
- color: #fff;
1390
- border: none;
1391
- cursor: pointer;
1392
- margin: 0 !important;
1393
- }
1394
- .ewd-ufaq-dashboard-key-widget-submit:hover {
1395
- background: #F2BD49;
1396
- }
1397
- .ewd-ufaq-dashboard-key-widget-text {
1398
- position: relative;
1399
- float: left;
1400
- width: 100%;
1401
- margin-top: 7px;
1402
- font-size: 11px;
1403
- color: #888;
1404
- font-style: italic;
1405
- font-weight: normal;
1406
- }
1407
- .ewd-ufaq-dashboard-key-widget-text a {
1408
- color: #0acbaa;
1409
- text-decoration: none;
1410
- font-weight: bold;
1411
- }
1412
- .ewd-ufaq-dashboard-key-widget-text a:hover {
1413
- color: #1CE6C3;
1414
- text-decoration: none;
1415
- }
1416
-
1417
- #ewd-ufaq-dashboard-support-widget-box .ewd-ufaq-dashboard-new-widget-box-top {
1418
- cursor: pointer;
1419
- }
1420
- #ewd-ufaq-dash-mobile-support-down-caret {
1421
- display: none;
1422
- float: right;
1423
- }
1424
- #ewd-ufaq-dash-mobile-support-up-caret {
1425
- display: inline;
1426
- float: right;
1427
- }
1428
- .ewd-ufaq-dashboard-support-widgets {
1429
- position: relative;
1430
- float: left;
1431
- width: 90%;
1432
- padding: 14px 5%;
1433
- }
1434
- .ewd-ufaq-dashboard-support-widgets li {
1435
- position: relative;
1436
- float: left;
1437
- width: 18.25%;
1438
- margin-right: 9%;
1439
- }
1440
- .ewd-ufaq-dashboard-support-widgets li:last-of-type {
1441
- margin-right: 0;
1442
- }
1443
- .ewd-ufaq-dashboard-support-widgets li a {
1444
- position: relative;
1445
- float: left;
1446
- width: 100%;
1447
- text-align: center;
1448
- color: #444;
1449
- text-decoration: none;
1450
- font-weight: bold;
1451
- }
1452
- .ewd-ufaq-dashboard-support-widgets li a:hover {
1453
- color: #6026B4;
1454
- }
1455
- .ewd-ufaq-dashboard-support-widgets li img {
1456
- position: relative;
1457
- float: left;
1458
- width: 80%;
1459
- height: auto;
1460
- border: none;
1461
- padding: 0 10% 12px;
1462
- }
1463
- .ewd-ufaq-dashboard-support-widgets li .ewd-ufaq-dashboard-support-widgets-text {
1464
- position: relative;
1465
- float: left;
1466
- width: 100%;
1467
- margin-top: 2px;
1468
- }
1469
-
1470
- #ewd-ufaq-dashboard-optional-table .ewd-ufaq-dashboard-new-widget-box-top {
1471
- cursor: pointer;
1472
- }
1473
- #ewd-ufaq-dash-optional-table-down-caret {
1474
- display: none;
1475
- float: right;
1476
- }
1477
- #ewd-ufaq-dash-optional-table-up-caret {
1478
- display: inline;
1479
- float: right;
1480
- }
1481
-
1482
- .ewd-ufaq-dashboard-testimonials {
1483
- position: relative;
1484
- float: left;
1485
- width: 100%;
1486
- }
1487
- .ewd-ufaq-dashboard-testimonials li {
1488
- position: relative;
1489
- float: left;
1490
- width: 100%;
1491
- text-align: center;
1492
- }
1493
- .ewd-ufaq-dashboard-testimonials li img {
1494
- position: relative;
1495
- float: left;
1496
- width: 140px;
1497
- height: auto;
1498
- margin-top: 8px;
1499
- margin-left: calc(50% - 70px);
1500
- }
1501
- .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-title {
1502
- position: relative;
1503
- float: left;
1504
- width: 100%;
1505
- margin: 28px 0 20px;
1506
- font-size: 30px;
1507
- line-height: 30px;
1508
- font-weight: bold;
1509
- }
1510
- .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-author {
1511
- position: relative;
1512
- float: left;
1513
- width: 100%;
1514
- font-size: 16px;
1515
- }
1516
- .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text {
1517
- position: relative;
1518
- float: left;
1519
- width: 80%;
1520
- margin: 24px 10% 0;
1521
- font-size: 12px;
1522
- }
1523
- .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text a {
1524
- color: #0acbaa;
1525
- text-decoration: none;
1526
- font-weight: bold;
1527
- }
1528
- .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text a:hover {
1529
- color: #1CE6C3;
1530
- }
1531
-
1532
- .ewd-ufaq-dashboard-review-ask {
1533
- position: relative;
1534
- float: left;
1535
- width: calc(100% - 32px);
1536
- padding: 16px 16px 12px;
1537
- text-align: center;
1538
- }
1539
- .ewd-ufaq-dashboard-review-ask img {
1540
- position: relative;
1541
- float: left;
1542
- width: 110px;
1543
- height: auto;
1544
- margin-left: calc(50% - 55px);
1545
- }
1546
- .ewd-ufaq-dashboard-review-ask-text {
1547
- position: relative;
1548
- float: left;
1549
- width: 100%;
1550
- margin: 24px 0;
1551
- }
1552
- .ewd-ufaq-dashboard-review-ask-button {
1553
- clear: both;
1554
- position: relative;
1555
- float: left;
1556
- width: calc(100% - 2px);
1557
- border: 1px solid #888;
1558
- background-color: transparent;
1559
- color: #888;
1560
- padding: 6px 0;
1561
- font-size: 12px;
1562
- text-decoration: none;
1563
- text-align: center;
1564
- font-weight: bold;
1565
- border-radius: 2px;
1566
- }
1567
- .ewd-ufaq-dashboard-review-ask-button:hover {
1568
- background-color: #888;
1569
- border-color: #888;
1570
- color: #fff;
1571
- }
1572
- .ewd-ufaq-dashboard-review-ask-dismiss {
1573
- position: relative;
1574
- float: left;
1575
- background: transparent;
1576
- border: none;
1577
- margin: 16px 0 0 0;
1578
- padding: 0;
1579
- width: 100%;
1580
- text-align: center;
1581
- color: #999;
1582
- font-size: 11px;
1583
- text-transform: uppercase;
1584
- cursor: pointer;
1585
- }
1586
- .ewd-ufaq-dashboard-review-ask-dismiss:hover {
1587
- color: #555;
1588
- }
1589
-
1590
- .ewd-ufaq-dashboard-guarantee {
1591
- position: relative;
1592
- float: left;
1593
- width: calc(100% - 208px);
1594
- min-height: 127px;
1595
- margin: 20px 24px;
1596
- padding: 0 0 0 160px;
1597
- background-image: url(../images/dash-asset-badge.png);
1598
- background-position: left top;
1599
- background-size: 128px 127px;
1600
- background-repeat: no-repeat;
1601
- color: #777;
1602
- }
1603
- .ewd-ufaq-dashboard-guarantee-title, .ewd-ufaq-dashboard-guarantee-text {
1604
- position: relative;
1605
- float: left;
1606
- width: 100%;
1607
- margin-top: 16px;
1608
- }
1609
- .ewd-ufaq-dashboard-guarantee-title {
1610
- font-size: 24px;
1611
- line-height: 24px;
1612
- }
1613
- .ewd-ufaq-dashboard-guarantee-text {
1614
- font-size: 12px;
1615
- font-weight: normal;
1616
- }
1617
-
1618
- .ewd-ufaq-dashboard-get-premium-widget-trial-time {
1619
- position: relative;
1620
- float: left;
1621
- width: 100%;
1622
- margin-top: 6px;
1623
- background: #6026B4;
1624
- }
1625
- .ewd-ufaq-dashboard-get-premium-widget-trial-days, .ewd-ufaq-dashboard-get-premium-widget-trial-hours {
1626
- position: relative;
1627
- float: left;
1628
- text-align: center;
1629
- color: #fff;
1630
- font-size: 43px;
1631
- line-height: 35px;
1632
- padding: 24px 0 8px;
1633
- font-weight: bold;
1634
- }
1635
- .ewd-ufaq-dashboard-get-premium-widget-trial-days span, .ewd-ufaq-dashboard-get-premium-widget-trial-hours span {
1636
- position: relative;
1637
- float: left;
1638
- width: 100%;
1639
- font-size: 14px;
1640
- font-weight: normal;
1641
- }
1642
- .ewd-ufaq-dashboard-get-premium-widget-trial-days {
1643
- width: calc(50% - 7px);
1644
- border-right: 7px solid #fff;
1645
- }
1646
- .ewd-ufaq-dashboard-get-premium-widget-trial-hours {
1647
- width: 50%;
1648
- }
1649
- .ewd-ufaq-dashboard-get-premium-widget-trial-time-left {
1650
- position: relative;
1651
- float: left;
1652
- width: 100%;
1653
- margin: 28px 0 24px;
1654
- color: #6026B4;
1655
- font-size: 24px;
1656
- text-align: center;
1657
- font-weight: bold;
1658
- }
1659
- .ewd-ufaq-dashboard-get-premium-widget-features-title {
1660
- position: relative;
1661
- float: left;
1662
- width: calc(100% - 16px);
1663
- padding: 8px 8px 10px;
1664
- color: #0acbaa;
1665
- font-size: 18px;
1666
- line-height: 1.5;
1667
- font-weight: bold;
1668
- }
1669
- .ewd-ufaq-dashboard-get-premium-widget-features {
1670
- position: relative;
1671
- float: left;
1672
- width: calc(100% - 16px);
1673
- padding: 0 8px;
1674
- -webkit-margin-after: 0;
1675
- }
1676
- .ewd-ufaq-dashboard-get-premium-widget-features li {
1677
- clear: both;
1678
- position: relative;
1679
- float: left;
1680
- width: calc(100% - 36px);
1681
- margin-bottom: 8px;
1682
- padding-left: 36px;
1683
- background-image: url(../images/dash-asset-checkmark.png);
1684
- background-position: left top;
1685
- background-size: 20px;
1686
- background-repeat: no-repeat;
1687
- font-style: italic;
1688
- }
1689
- .ewd-ufaq-dashboard-get-premium-widget-features li:last-of-type {
1690
- background-image: none;
1691
- }
1692
- .ewd-ufaq-dashboard-get-premium-widget-button {
1693
- clear: both;
1694
- position: relative;
1695
- float: left;
1696
- width: calc(100% - 20px);
1697
- margin: 16px 8px 10px;
1698
- border: 2px solid #0acbaa;
1699
- background-color: #0acbaa;
1700
- color: #fff;
1701
- padding: 6px 0;
1702
- font-size: 12px;
1703
- text-decoration: none;
1704
- text-align: center;
1705
- font-weight: bold;
1706
- border-radius: 2px;
1707
- }
1708
- .ewd-ufaq-dashboard-get-premium-widget-button:hover {
1709
- background-color: #1CE6C3;
1710
- border-color: #1CE6C3;
1711
- color: #fff;
1712
- }
1713
- .ewd-ufaq-dashboard-get-premium-widget-button.ewd-ufaq-dashboard-new-trial-button {
1714
- background-color: transparent;
1715
- color: #0acbaa;
1716
- font-size: 11px;
1717
- cursor: pointer;
1718
- width: calc(100% - 16px);
1719
- margin: 0 8px 16px;
1720
- }
1721
- .ewd-ufaq-dashboard-get-premium-widget-button.ewd-ufaq-dashboard-new-trial-button:hover {
1722
- background-color: #0acbaa;
1723
- border-color: #0acbaa;
1724
- color: #fff;
1725
- }
1726
-
1727
- .ewd-ufaq-dashboard-other-plugins {
1728
- position: relative;
1729
- float: left;
1730
- width: 100%;
1731
- }
1732
- .ewd-ufaq-dashboard-other-plugins li {
1733
- position: relative;
1734
- float: left;
1735
- width: 100%;
1736
- margin-bottom: 24px;
1737
- }
1738
- .ewd-ufaq-dashboard-other-plugins li:last-of-type {
1739
- margin-bottom: 12px;
1740
- }
1741
- .ewd-ufaq-dashboard-other-plugins li img {
1742
- position: relative;
1743
- float: left;
1744
- width: 64px;
1745
- height: auto;
1746
- margin-right: 16px;
1747
- border: none;
1748
- }
1749
- .ewd-ufaq-dashboard-other-plugins li .ewd-ufaq-dashboard-other-plugins-text {
1750
- position: relative;
1751
- float: left;
1752
- width: calc(100% - 80px);
1753
- }
1754
- .ewd-ufaq-dashboard-other-plugins li .ewd-ufaq-dashboard-other-plugins-title {
1755
- position: relative;
1756
- float: left;
1757
- width: 100%;
1758
- font-size: 16px;
1759
- color: #444;
1760
- font-weight: bold;
1761
- }
1762
- .ewd-ufaq-dashboard-other-plugins li .ewd-ufaq-dashboard-other-plugins-blurb {
1763
- position: relative;
1764
- float: left;
1765
- width: 100%;
1766
- font-size: 11px;
1767
- margin-top: 8px;
1768
- }
1769
-
1770
- @media screen and (min-width: 1441px) {
1771
- #ewd-ufaq-dashboard-content-area {
1772
- width: calc(100% - 194px);
1773
- margin: 32px 20px 32px 174px;
1774
- }
1775
- }
1776
- @media screen and (max-width: 1150px) {
1777
- #ewd-ufaq-dashboard-content-area {
1778
- width: calc(100% - 40px);
1779
- margin: 16px 20px 32px;
1780
- }
1781
- }
1782
- @media screen and (max-width: 1000px) {
1783
- .ewd-ufaq-dashboard-key-widget-submit {
1784
- font-size: 12px;
1785
- }
1786
- }
1787
- @media screen and (max-width: 800px) {
1788
- #ewd-ufaq-dashboard-content-left, #ewd-ufaq-dashboard-content-right {
1789
- float: left;
1790
- width: 100%;
1791
- }
1792
- .ewd-ufaq-dashboard-new-widget-box.ewd-widget-box-two-thirds, .ewd-ufaq-dashboard-new-widget-box.ewd-widget-box-one-third {
1793
- width: 100%;
1794
- margin-left: 0;
1795
- }
1796
-
1797
- .ewd-ufaq-dashboard-key-widget {
1798
- width: calc(100% - 48px);
1799
- margin: 16px 24px 8px;
1800
- padding: 54px 0 0 0;
1801
- background-image: url(../images/dash-asset-key.png);
1802
- background-size: 64px 30px;
1803
- background-position: center top;
1804
- background-repeat: no-repeat;
1805
- }
1806
- .ewd-ufaq-dashboard-key-widget-input {
1807
- width: 100%;
1808
- }
1809
- .ewd-ufaq-dashboard-key-widget-submit {
1810
- width: 100%;
1811
- margin: 8px 0 0 0 !important;
1812
- font-size: 14px;
1813
- }
1814
- .ewd-ufaq-dashboard-key-widget-text {
1815
- margin-top: 16px;
1816
- text-align: center;
1817
- }
1818
-
1819
- .ewd-ufaq-dashboard-support-widgets {
1820
- width: 90%;
1821
- padding: 0 5%;
1822
- }
1823
- .ewd-ufaq-dashboard-support-widgets li {
1824
- width: 100%;
1825
- margin: 0 0 12px 0;
1826
- padding-bottom: 12px;
1827
- border-bottom: 1px solid #ddd;
1828
- }
1829
- .ewd-ufaq-dashboard-support-widgets li:last-of-type {
1830
- border-bottom: none;
1831
- margin-bottom: 0;
1832
- }
1833
- .ewd-ufaq-dashboard-support-widgets li a {
1834
- text-align: left;
1835
- color: #444;
1836
- }
1837
- .ewd-ufaq-dashboard-support-widgets li a:hover {
1838
- color: #6026B4;
1839
- }
1840
- .ewd-ufaq-dashboard-support-widgets li img {
1841
- width: 32px;
1842
- height: 32px;
1843
- padding: 0 24px 0 16px;
1844
- }
1845
- .ewd-ufaq-dashboard-support-widgets li .ewd-ufaq-dashboard-support-widgets-text {
1846
- width: calc(100% - 72px);
1847
- margin-top: 7px;
1848
- text-transform: uppercase;
1849
- font-size: 11px;
1850
- }
1851
- #ewd-ufaq-dashboard-support-widget-box .ewd-ufaq-dashboard-new-widget-box-bottom {
1852
- border-top: none;
1853
- }
1854
-
1855
- #ewd-ufaq-dashboard-get-premium-widget-box {
1856
- display: none;
1857
- }
1858
- }
1859
-
1860
- @media screen and (max-width: 568px) {
1861
- #ewd-ufaq-dashboard-guarantee-widget-box {
1862
- background: #6026B4;
1863
- }
1864
- .ewd-ufaq-dashboard-guarantee {
1865
- width: calc(100% - 48px);
1866
- padding: 0;
1867
- height: 199px;
1868
- background-image: url(../images/dash-asset-badge.png);
1869
- background-size: 200px 199px;
1870
- background-position: center top;
1871
- background-repeat: no-repeat;
1872
- }
1873
- .ewd-ufaq-dashboard-guarantee-title, .ewd-ufaq-dashboard-guarantee-text {
1874
- display: none;
1875
- }
1876
- }
1877
-
1878
-
1879
-
1880
- /*** FOOTER ***/
1881
-
1882
- #ewd-ufaq-dashboard-new-footer-one {
1883
- position: relative;
1884
- float: left;
1885
- width: 100%;
1886
- background: #fff;
1887
- color: #777;
1888
- }
1889
- .ewd-ufaq-dashboard-new-footer-one-inside {
1890
- position: relative;
1891
- float: left;
1892
- width: 80%;
1893
- margin: 0 10%;
1894
- }
1895
- .ewd-ufaq-dashboard-new-footer-one-left {
1896
- position: relative;
1897
- float: left;
1898
- width: calc(100% - 224px);
1899
- margin-bottom: 32px;
1900
- }
1901
- .ewd-ufaq-dashboard-new-footer-one-title {
1902
- position: relative;
1903
- float: left;
1904
- width: 100%;
1905
- margin-top: 56px;
1906
- font-size: 24px;
1907
- font-weight: bold;
1908
- }
1909
- .ewd-ufaq-dashboard-new-footer-one-benefits {
1910
- position: relative;
1911
- float: left;
1912
- width: 100%;
1913
- margin-top: 32px;
1914
- }
1915
- .ewd-ufaq-dashboard-new-footer-one-benefits li {
1916
- position: relative;
1917
- float: left;
1918
- width: calc(33.333333% - 36px);
1919
- margin-bottom: 11px;
1920
- padding-left: 36px;
1921
- background-image: url(../images/dash-asset-checkmark.png);
1922
- background-position: left top;
1923
- background-size: 20px;
1924
- background-repeat: no-repeat;
1925
- font-style: italic;
1926
- }
1927
-
1928
- .ewd-ufaq-dashboard-new-footer-one-buttons {
1929
- position: relative;
1930
- float: right;
1931
- width: 192px;
1932
- margin-top: 112px;
1933
- }
1934
-
1935
- #ewd-ufaq-dashboard-new-footer-two {
1936
- position: relative;
1937
- float: left;
1938
- width: 100%;
1939
- background: #150947;
1940
- color: #E5D3F5;
1941
- }
1942
- .ewd-ufaq-dashboard-new-footer-two-inside {
1943
- position: relative;
1944
- float: left;
1945
- width: 90%;
1946
- margin: 48px 5%;
1947
- }
1948
- .ewd-ufaq-dashboard-new-footer-two-icon {
1949
- position: relative;
1950
- float: left;
1951
- width: 110px;
1952
- height: auto;
1953
- margin-right: 40px;
1954
- }
1955
- .ewd-ufaq-dashboard-new-footer-two-blurb {
1956
- position: relative;
1957
- float: left;
1958
- width: 300px;
1959
- line-height: 1.7;
1960
- font-size: 12px;
1961
- }
1962
- .ewd-ufaq-dashboard-new-footer-two-menu {
1963
- position: relative;
1964
- float: right;
1965
- width: 150px;
1966
- -webkit-margin-after: 0;
1967
- -webkit-margin-before: 0;
1968
- }
1969
- .ewd-ufaq-dashboard-new-footer-two-menu li {
1970
- clear: both;
1971
- position: relative;
1972
- float: right;
1973
- width: 100%;
1974
- font-weight: bold;
1975
- margin-bottom: 4px;
1976
- color: #fff;
1977
- font-size: 13px;
1978
- }
1979
- .ewd-ufaq-dashboard-new-footer-two-menu li:first-of-type {
1980
- margin-bottom: 9px;
1981
- }
1982
- .ewd-ufaq-dashboard-new-footer-two-menu li:last-of-type {
1983
- margin-bottom: 0;
1984
- }
1985
- .ewd-ufaq-dashboard-new-footer-two-menu li a {
1986
- font-weight: normal;
1987
- color: #E5D3F5;
1988
- text-decoration: none;
1989
- font-size: 12px;
1990
- }
1991
- .ewd-ufaq-dashboard-new-footer-two-menu li a:hover {
1992
- color: #fff;
1993
- }
1994
-
1995
- @media screen and (max-width: 1100px) {
1996
- .ewd-ufaq-dashboard-new-footer-one-left {
1997
- width: 100%;
1998
- margin-bottom: 0;
1999
- }
2000
- .ewd-ufaq-dashboard-new-footer-one-title {
2001
- margin-top: 56px;
2002
- font-size: 24px;
2003
- line-height: 28px;
2004
- text-align: center;
2005
- }
2006
- .ewd-ufaq-dashboard-new-footer-one-benefits li {
2007
- width: calc(50% - 36px);
2008
- }
2009
- .ewd-ufaq-dashboard-new-footer-one-buttons {
2010
- float: left;
2011
- width: 100%;
2012
- margin-top: 32px;
2013
- margin-bottom: 24px;
2014
- }
2015
- .ewd-ufaq-dashboard-new-footer-one-buttons .ewd-ufaq-dashboard-new-upgrade-button {
2016
- float: left;
2017
- margin-left: calc(50% - 96px);
2018
- }
2019
-
2020
- .ewd-ufaq-dashboard-new-footer-two-icon {
2021
- clear: both;
2022
- float: left;
2023
- margin: 0 0 16px calc(50% - 55px);
2024
- }
2025
- .ewd-ufaq-dashboard-new-footer-two-blurb {
2026
- display: none;
2027
- }
2028
- .ewd-ufaq-dashboard-new-footer-two-menu {
2029
- float: left;
2030
- width: 100%;
2031
- margin-top: 32px;
2032
- }
2033
- .ewd-ufaq-dashboard-new-footer-two-menu li {
2034
- float: left;
2035
- text-align: center;
2036
- margin-bottom: 4px;
2037
- font-size: 17px;
2038
- }
2039
- .ewd-ufaq-dashboard-new-footer-two-menu li:first-of-type {
2040
- margin-bottom: 9px;
2041
- }
2042
- .ewd-ufaq-dashboard-new-footer-two-menu li:last-of-type {
2043
- margin-bottom: 0;
2044
- }
2045
- .ewd-ufaq-dashboard-new-footer-two-menu li a {
2046
- font-size: 16px;
2047
- }
2048
- }
2049
- @media screen and (max-width: 568px) {
2050
- .ewd-ufaq-dashboard-new-footer-one-benefits li {
2051
- clear: both;
2052
- width: calc(100% - 36px);
2053
- }
2054
- }
2055
-
2056
-
2057
-
2058
- /***********************************************************************************
2059
- * POINTERS
2060
- ***********************************************************************************/
2061
-
2062
- .wp-pointer-content ul {
2063
- list-style: disc;
2064
- padding-left: 40px;
2065
- }
2066
-
2067
- .wp-pointer-content iframe {
2068
- margin-top:18px;
2069
- }
2070
-
2071
- .ewd-feup-pointer-count {
2072
- margin-top: 40px;
2073
- margin-bottom: -40px;
2074
- }
2075
-
2076
- .ufaq-skip-all-tutorial-pop-ups {
2077
- cursor: pointer;
2078
- color: #0073aa;
2079
- }
2080
-
2081
- /* Color Pickers */
2082
- .ewd-feup-spectrum {margin-bottom: 6px;}
2083
-
2084
-
2085
- /************************
2086
- TOGGLE SWITCHES
2087
- ************************/
2088
- .ewd-ufaq-admin-hide-radios {
2089
- display: none;
2090
- }
2091
-
2092
- /* The switch - the box around the slider */
2093
- .ewd-ufaq-admin-switch {
2094
- position: relative;
2095
- display: inline-block;
2096
- width: 40px;
2097
- height: 22px;
2098
- }
2099
-
2100
- /* Hide default HTML checkbox */
2101
- .ewd-ufaq-admin-switch input {display:none;}
2102
-
2103
- /* The slider */
2104
- .ewd-ufaq-admin-switch-slider {
2105
- position: absolute;
2106
- cursor: pointer;
2107
- top: 0;
2108
- left: 0;
2109
- right: 0;
2110
- bottom: 0;
2111
- background-color: #ccc;
2112
- -webkit-transition: .4s;
2113
- transition: .4s;
2114
- }
2115
-
2116
- .ewd-ufaq-admin-switch-slider:before {
2117
- position: absolute;
2118
- content: "";
2119
- height: 14px;
2120
- width: 14px;
2121
- left: 4px;
2122
- bottom: 4px;
2123
- background-color: white;
2124
- -webkit-transition: .4s;
2125
- transition: .4s;
2126
- }
2127
-
2128
- input:checked + .ewd-ufaq-admin-switch-slider {
2129
- background-color: #0acbaa;
2130
- }
2131
-
2132
- input:focus + .ewd-ufaq-admin-switch-slider {
2133
- box-shadow: 0 0 1px #0acbaa;
2134
- }
2135
-
2136
- input:checked + .ewd-ufaq-admin-switch-slider:before {
2137
- -webkit-transform: translateX(18px);
2138
- -ms-transform: translateX(18px);
2139
- transform: translateX(18px);
2140
- }
2141
-
2142
- /* Rounded sliders */
2143
- .ewd-ufaq-admin-switch-slider.round {
2144
- border-radius: 34px;
2145
- }
2146
-
2147
- .ewd-ufaq-admin-switch-slider.round:before {
2148
- border-radius: 50%;
2149
- }
2150
-
2151
-
2152
-
2153
- /************************
2154
- OTHER OPTION PAGE STYLING
2155
- ************************/
2156
- tr.ewd-ufaq-admin-tr-spacer {
2157
- height: 24px;
2158
- }
2159
-
2160
- .ufaq-option-set,
2161
- .ufaq-styling-set{
2162
- left: 0;
2163
- }
2164
-
2165
- .ufaq-option-set .form-table,
2166
- .ufaq-styling-set .form-table {
2167
- width: 100%;
2168
- box-sizing: border-box;
2169
- margin: 0 auto 16px;
2170
- box-shadow: 0 1px 12px #ddd;
2171
- display: block;
2172
- padding: 11px 5%;
2173
- }
2174
- .ufaq-option-set .form-table.noSubSections,
2175
- .ufaq-styling-set .form-table.noSubSections {
2176
- width: 100%;
2177
- margin: 0;
2178
- box-shadow: none;
2179
- padding: 11px 0;
2180
- }
2181
- .ufaq-option-set .form-table th,
2182
- .ufaq-styling-set .form-table th {
2183
- color: #555;
2184
- padding: 15px 46px 24px 0;
2185
- background-image: url(../images/options-asset-info.png);
2186
- background-position: calc(100% - 20px) 15px;
2187
- background-size: 18px 18px;
2188
- background-repeat: no-repeat;
2189
- cursor: pointer;
2190
- }
2191
- .ufaq-option-set .form-table th.ewd-ufaq-admin-no-info-button,
2192
- .ufaq-styling-set .form-table th.ewd-ufaq-admin-no-info-button {
2193
- background-image: none !important;
2194
- cursor: default;
2195
- }
2196
- .ufaq-option-set .form-table.noSubSections th,
2197
- .ufaq-styling-set .form-table.noSubSections th {
2198
- padding-left: 0;
2199
- }
2200
- .ufaq-option-set .form-table td,
2201
- .ufaq-styling-set .form-table td {
2202
- padding-top: 12px;
2203
- }
2204
- .ufaq-option-set .form-table td p,
2205
- .ufaq-styling-set .form-table td p {
2206
- display: none;
2207
- }
2208
- /*.ufaq-option-set .form-table th br,
2209
- .ufaq-styling-set .form-table th br {
2210
- display: none;
2211
- }
2212
- .ewd-ufaq-admin-info-button {
2213
- display: inline-block;
2214
- position: relative;
2215
- margin-left: 8px;
2216
- top: 4px;
2217
- width: 18px;
2218
- height: 18px;
2219
- background-image: url(../images/options-asset-info.png);
2220
- background-position: left top;
2221
- background-size: 18px 18px;
2222
- background-repeat: no-repeat;
2223
- cursor: pointer;
2224
- }
2225
- */
2226
- .ewd-ufaq-admin-section-heading {
2227
- position: relative;
2228
- float: left;
2229
- background: #6026B4;
2230
- margin: 8px 0 0;
2231
- font-size: 15px;
2232
- font-weight: bold;
2233
- color: #fff;
2234
- padding: 12px 2%;
2235
- width: 96%;
2236
- text-transform: uppercase;
2237
- z-index: 2;
2238
- }
2239
-
2240
-
2241
- .ewd-ufaq-premium-options-table {
2242
- position: relative;
2243
- }
2244
- tr[data-filtertype].ewd-ufaq-premium-options-table-overlay {
2245
- position: absolute;
2246
- top: 0;
2247
- left: 0;
2248
- width: 100%;
2249
- height: 100%;
2250
- background: rgba(0,0,0,.73);
2251
- }
2252
- .ewd-ufaq-unlock-premium {
2253
- position: absolute;
2254
- width: 200px;
2255
- height: 200px;
2256
- padding: 16px;
2257
- background: #fff;
2258
- left: calc(50% - 100px);
2259
- }
2260
- .ewd-ufaq-unlock-premium img {
2261
- position: relative;
2262
- float: left;
2263
- width: 40px;
2264
- height: auto;
2265
- margin: 16px 80px 24px;
2266
- }
2267
- .ewd-ufaq-unlock-premium p {
2268
- margin: 16px 0;
2269
- text-align: center;
2270
- color: #888;
2271
- }
2272
- .ewd-ufaq-unlock-premium .ewd-ufaq-dashboard-get-premium-widget-button {
2273
- clear: both;
2274
- position: relative;
2275
- float: left;
2276
- width: calc(100% - 20px);
2277
- margin: 16px 8px;
2278
- border: 2px solid #0acbaa;
2279
- background-color: #0acbaa;
2280
- color: #fff;
2281
- padding: 6px 0;
2282
- font-size: 12px;
2283
- text-decoration: none;
2284
- text-align: center;
2285
- font-weight: bold;
2286
- border-radius: 2px;
2287
- }
2288
- .ewd-ufaq-unlock-premium .ewd-ufaq-dashboard-get-premium-widget-button:hover {
2289
- background-color: #1CE6C3;
2290
- border-color: #1CE6C3;
2291
- color: #fff;
2292
- }
2293
-
2294
- .ufaq-option-set,
2295
- .ufaq-styling-set{
2296
- position: relative;
2297
- float: left;
2298
- width: 90%;
2299
- margin: 0 0 0 5%;
2300
- padding: 0;
2301
- }
2302
- .ufaq-options-page-tab-title {
2303
- font-size: 18px;
2304
- color: #6026B4;
2305
- margin: 32px 0 0 !important;
2306
- }
2307
- .ufaq-option-set label span,
2308
- .ufaq-styling-set label span {
2309
- color: #666;
2310
- }
2311
-
2312
-
2313
- /* RADIO BUTTON AND CHECKBOX */
2314
- .ewd-ufaq-admin-input-container input, .ewd-ufaq-admin-input-container input:disabled {
2315
- position: absolute;
2316
- opacity: 0;
2317
- }
2318
- .ewd-ufaq-admin-radio-button {
2319
- position: relative;
2320
- float: left;
2321
- height: 14px;
2322
- width: 14px;
2323
- top: 1px;
2324
- margin-right: 12px;
2325
- background-color: #fff;
2326
- border: 2px solid #aaa;
2327
- border-radius: 50%;
2328
- }
2329
- .ewd-ufaq-admin-input-container:hover input ~ .ewd-ufaq-admin-radio-button {
2330
- background-color: #E6FFFB;
2331
- border-color: #0acbaa;
2332
- }
2333
- .ewd-ufaq-admin-input-container input:checked ~ .ewd-ufaq-admin-radio-button {
2334
- border-color: #0acbaa;
2335
- background-color: #fff;
2336
- }
2337
- .ewd-ufaq-admin-radio-button:after {
2338
- content: "";
2339
- position: absolute;
2340
- display: none;
2341
- }
2342
- .ewd-ufaq-admin-input-container input:checked ~ .ewd-ufaq-admin-radio-button:after {
2343
- display: block;
2344
- }
2345
- .ewd-ufaq-admin-input-container .ewd-ufaq-admin-radio-button:after {
2346
- top: 3px;
2347
- left: 3px;
2348
- width: 8px;
2349
- height: 8px;
2350
- border-radius: 50%;
2351
- background: #0acbaa;
2352
- }
2353
-
2354
- .ewd-ufaq-admin-checkbox {
2355
- position: relative;
2356
- float: left;
2357
- height: 14px;
2358
- width: 14px;
2359
- top: 1px;
2360
- margin-right: 12px;
2361
- background-color: #fff;
2362
- border: 2px solid #aaa;
2363
- }
2364
- .ewd-ufaq-admin-input-container:hover input ~ .ewd-ufaq-admin-checkbox {
2365
- background-color: #E6FFFB;
2366
- border-color: #0acbaa;
2367
- }
2368
- .ewd-ufaq-admin-input-container input:checked ~ .ewd-ufaq-admin-checkbox {
2369
- border-color: #0acbaa;
2370
- background-color: #fff;
2371
- }
2372
- .ewd-ufaq-admin-checkbox:after {
2373
- content: "";
2374
- position: absolute;
2375
- display: none;
2376
- }
2377
- .ewd-ufaq-admin-input-container input:checked ~ .ewd-ufaq-admin-checkbox:after {
2378
- display: block;
2379
- }
2380
- .ewd-ufaq-admin-input-container .ewd-ufaq-admin-checkbox:after {
2381
- left: 4px;
2382
- top: 1px;
2383
- width: 4px;
2384
- height: 8px;
2385
- border: solid #0acbaa;
2386
- border-width: 0 2px 2px 0;
2387
- -webkit-transform: rotate(45deg);
2388
- -ms-transform: rotate(45deg);
2389
- transform: rotate(45deg);
2390
- }
2391
-
2392
- /* Textbox and Text Area and Select boxes */
2393
- .ufaq-option-set input[type=text],
2394
- .ufaq-option-set input[type=search],
2395
- .ufaq-option-set input[type=tel],
2396
- .ufaq-option-set input[type=url],
2397
- .ufaq-option-set input[type=week],
2398
- .ufaq-option-set input[type=password],
2399
- .ufaq-option-set input[type=color],
2400
- .ufaq-option-set input[type=email],
2401
- .ufaq-option-set input[type=number],
2402
- .ufaq-option-set textarea,
2403
- .ufaq-option-set select,
2404
- .ufaq-styling-set input[type=text],
2405
- .ufaq-styling-set input[type=search],
2406
- .ufaq-styling-set input[type=tel],
2407
- .ufaq-styling-set input[type=url],
2408
- .ufaq-styling-set input[type=week],
2409
- .ufaq-styling-set input[type=password],
2410
- .ufaq-styling-set input[type=color],
2411
- .ufaq-styling-set input[type=email],
2412
- .ufaq-styling-set input[type=number],
2413
- .ufaq-styling-set textarea,
2414
- .ufaq-styling-set select {
2415
- border: 2px solid #ccc;
2416
- border-radius: 5px;
2417
- box-shadow: none;
2418
- }
2419
- .ufaq-options-page-tabbed select,
2420
- .ufaq-options-page-tabbed textarea
2421
- {
2422
- width: auto !important;
2423
- min-width: 50%;
2424
- max-width: 100% !important;
2425
- }
2426
- .ufaq-option-set textarea {
2427
- min-width: 300px;
2428
- min-height: 200px;
2429
- }
2430
-
2431
- /* menu side tabs */
2432
- .ufaq-options-submenu-div, .ufaq-options-page-tabbed-content, .ufaq-styling-page-tabbed-content {
2433
- border: none;
2434
- }
2435
- .ufaq-options-submenu-div {
2436
- width: 160px;
2437
- box-shadow: -1px 1px 8px #ccc;
2438
- overflow: hidden;
2439
- }
2440
- .ufaq-options-page-tabbed-content, .ufaq-styling-page-tabbed-content {
2441
- width: calc(100% - 200px);
2442
- }
2443
- .ufaq-options-page-tabbed-nav {
2444
- width: 100%;
2445
- }
2446
- .ufaq-options-page-tabbed a.options-subnav-tab,
2447
- .ufaq-options-page-tabbed a.styling-subnav-tab {
2448
- background-color: #e2e2e2;
2449
- border-bottom: 1px solid #f1f1f1;
2450
- color: #555;
2451
- font-weight: bold;
2452
- padding-left: 20px;
2453
- width: calc(100% - 20px);
2454
- text-align: left;
2455
- }
2456
- .ufaq-options-page-tabbed .ufaq-options-submenu-div li:last-of-type a.options-subnav-tab,
2457
- .ufaq-options-page-tabbed .ufaq-options-submenu-div li:last-of-type a.styling-subnav-tab:last-of-type {
2458
- border-bottom: none;
2459
- }
2460
- .ufaq-options-page-tabbed a.options-subnav-tab-active,
2461
- .ufaq-options-page-tabbed a.styling-subnav-tab-active {
2462
- box-shadow: none;
2463
- background-color: #fff !important;
2464
- color: #6026B4;
2465
- border-left: 4px solid #6026B4;
2466
- }
2467
- .ufaq-options-page-tabbed .ufaq-options-submenu-div a:hover {
2468
- color: #29324e;
2469
- background-color: rgba(199,199,199, 0.5);
2470
- box-shadow: none;
2471
- border-left: 4px solid #29324e;
2472
- }
2473
- .ufaq-options-page-tabbed .ufaq-options-submenu-div a.options-subnav-tab-active:hover,
2474
- .ufaq-options-page-tabbed .ufaq-options-submenu-div a.styling-subnav-tab-active:hover {
2475
- color: #6026B4;
2476
- background-color: #fff;
2477
- border-left: 4px solid #6026B4;
2478
- }
2479
-
2480
-
2481
- /* SIDEBAR ITEMS ORDER TABLE */
2482
- .ufaq-sidebar-items-order-container {
2483
- }
2484
- .ufaq-sidebar-items-order-element {
2485
- background: #f3f3f3;
2486
- margin: 0;
2487
- padding: 8px 16px;
2488
- width: calc(100% - 32px);
2489
- }
2490
- .ufaq-sidebar-items-order-element {
2491
- border-bottom: 1px solid #ccc;
2492
- cursor: all-scroll;
2493
- }
2494
- .ufaq-sidebar-items-order-element:first-of-type {
2495
- border-top: 1px solid #ccc;
2496
- }
2497
- .ufaq-sidebar-items-order-element:active {
2498
- background: #662D91;
2499
- color: #fff;
2500
- }
2501
-
2502
-
2503
- /* STYLING SUB-SECTIONS AND OPTIONS */
2504
- .ewd-ufaq-admin-styling-section {
2505
- clear: both;
2506
- position: relative;
2507
- float: left;
2508
- width: 100%;
2509
- margin: 0 0 32px;
2510
- box-sizing: border-box;
2511
- box-shadow: 0 1px 12px #ddd;
2512
- display: block;
2513
- padding: 11px 0;
2514
- min-height: 240px;
2515
- }
2516
- .ewd-ufaq-admin-styling-section.Yes {
2517
- min-height: 0;
2518
- }
2519
- .ewd-ufaq-admin-styling-section.noSubSections {
2520
- margin: 0;
2521
- box-shadow: none;
2522
- }
2523
- .ewd-ufaq-admin-styling-subsection {
2524
- clear: both;
2525
- position: relative;
2526
- float: left;
2527
- width: 90%;
2528
- padding: 20px 5% 0;
2529
- border-bottom: 1px solid #ddd;
2530
- }
2531
- .ewd-ufaq-admin-styling-subsection:last-of-type {
2532
- border-bottom: none;
2533
- }
2534
- .ewd-ufaq-admin-styling-subsection:first-of-type {
2535
- padding: 0 5%;
2536
- }
2537
- .ewd-ufaq-admin-styling-subsection.noBottomBorder {
2538
- border-bottom: none;
2539
- }
2540
- .ewd-ufaq-admin-styling-subsection-label {
2541
- position: relative;
2542
- float: left;
2543
- width: 228px;
2544
- color: #555;
2545
- padding: 15px 28px 16px 0;
2546
- font-weight: 600;
2547
- font-size: 14px;
2548
- line-height: 1.3;
2549
- }
2550
- .ewd-ufaq-admin-styling-subsection-label span.notBold {
2551
- font-weight: 400;
2552
- }
2553
- .ewdOptionHasInfo .ewd-ufaq-admin-styling-subsection-label {
2554
- padding: 15px 56px 14px 0;
2555
- width: 200px;
2556
- background-image: url(../images/options-asset-info.png);
2557
- background-position: calc(100% - 30px) 15px;
2558
- background-size: 18px 18px;
2559
- background-repeat: no-repeat;
2560
- cursor: pointer;
2561
- }
2562
- .ewdOptionHasInfo fieldset p {
2563
- display: none;
2564
- }
2565
- .ewd-ufaq-admin-styling-subsection-content {
2566
- position: relative;
2567
- float: left;
2568
- width: calc(100% - 256px);
2569
- padding: 15px 0 16px;
2570
- }
2571
- .ewd-ufaq-admin-styling-subsection-content-each {
2572
- position: relative;
2573
- float: left;
2574
- width: 100%;
2575
- margin-bottom: 20px;
2576
- }
2577
- .ewd-ufaq-admin-styling-subsection-content-label {
2578
- position: relative;
2579
- float: left;
2580
- width: 30%;
2581
- margin-right: 3%;
2582
- color: #999;
2583
- text-transform: uppercase;
2584
- font-size: 12px;
2585
- font-weight: 600;
2586
- }
2587
- .ewd-ufaq-admin-styling-subsection-content-right {
2588
- position: relative;
2589
- float: left;
2590
- width: 67%;
2591
- }
2592
- .ewd-ufaq-admin-styling-subsection-content-color-picker {
2593
- position: relative;
2594
- float: left;
2595
- width: 50%;
2596
- margin-bottom: 8px;
2597
- }
2598
- .ewd-ufaq-admin-styling-subsection-content-color-picker input.ewd-ufaq-spectrum {
2599
- position: absolute;
2600
- right: 0;
2601
- bottom: 0;
2602
- border: none;
2603
- margin: 0 !important;
2604
- width: calc(100% - 42px);
2605
- border-radius: 0;
2606
- background: transparent !important;
2607
- color: #888 !important;
2608
- padding: 0;
2609
- font-size: 12px;
2610
- }
2611
- .ewd-ufaq-admin-styling-subsection-content-color-picker .sp-replacer {
2612
- padding: 0 !important;
2613
- margin-right: 8px !important;
2614
- border-radius: 2px;
2615
- }
2616
- .ewd-ufaq-admin-styling-subsection-content-color-picker .sp-preview {
2617
- width: 32px !important;
2618
- height: 32px !important;
2619
- margin: 0 !important;
2620
- border: none !important
2621
- }
2622
- .ewd-ufaq-admin-styling-subsection-content-color-picker .sp-dd {
2623
- display: none !important;
2624
- }
2625
- .ewd-ufaq-admin-styling-subsection-content-color-picker-label {
2626
- position: absolute;
2627
- right: 0;
2628
- top: 0;
2629
- width: calc(100% - 42px);
2630
- color: #555;
2631
- font-size: 13px;
2632
- font-weight: 600;
2633
- text-transform: uppercase;
2634
- }
2635
- input.ewd-ufaq-admin-font-size {
2636
- border-radius: 2px !important;
2637
- width: 100px !important;
2638
- }
2639
- .ewd-ufaq-admin-styling-section fieldset label {
2640
- line-height: 1.4em;
2641
- margin: .25em 0 .5em;
2642
- display: inline-block;
2643
- font-size: 14px;
2644
- }
2645
- .ewd-ufaq-admin-styling-subsection-content-each fieldset.ewdAdminIconChoice label {
2646
- position: relative;
2647
- float: left;
2648
- width: 25%;
2649
- }
2650
- .ewd-ufaq-admin-styling-section .ewd-admin-labelling-section {
2651
- position: relative;
2652
- float: left;
2653
- width: 100%;
2654
- }
2655
- .ewd-ufaq-admin-styling-section .ewd-admin-labelling-section label {
2656
- position: relative;
2657
- float: left;
2658
- width: 49%;
2659
- margin: 0 2% 8px 0;
2660
- }
2661
- .ewd-ufaq-admin-styling-section .ewd-admin-labelling-section label:nth-of-type(2n+2) {
2662
- margin-right: 0;
2663
- }
2664
- .ewd-ufaq-admin-styling-section .ewd-admin-labelling-section label p {
2665
- margin: 0 0 4px;
2666
- font-size: 14px;
2667
- color: #555;
2668
- font-weight: 600;
2669
- }
2670
- .ewd-ufaq-admin-styling-section .ewd-admin-labelling-section label input[type="text"] {
2671
- width: 100% !important;
2672
- min-width: auto !important;
2673
- max-width: none !important;
2674
- }
2675
- .ewd-ufaq-admin-styling-section .ewd-admin-labelling-section label input[type="text"]::-webkit-input-placeholder {
2676
- color: #bbb;
2677
- font-weight: 400;
2678
- font-size: 13px;
2679
- }
2680
- .ewd-ufaq-admin-styling-section .ewd-admin-labelling-section label input[type="text"]:-moz-placeholder {
2681
- color: #bbb;
2682
- font-weight: 400;
2683
- font-size: 13px;
2684
- }
2685
- .ewd-ufaq-admin-styling-section .ewd-admin-labelling-section label input[type="text"]::-moz-placeholder {
2686
- color: #bbb;
2687
- font-weight: 400;
2688
- font-size: 13px;
2689
- }
2690
- .ewd-ufaq-admin-styling-section .ewd-admin-labelling-section label input[type="text"]:-ms-input-placeholder {
2691
- color: #bbb;
2692
- font-weight: 400;
2693
- font-size: 13px;
2694
- }
2695
- .ewd-ufaq-admin-styling-section .ewd-admin-labelling-section label input[type="text"]:placeholder {
2696
- color: #bbb;
2697
- font-weight: 400;
2698
- font-size: 13px;
2699
- }
2700
-
2701
-
2702
- /*LOCK PREMIUM CONTENT*/
2703
- .ewd-ufaq-premium-options-table {
2704
- position: relative;
2705
- min-height: 240px;
2706
- }
2707
- .ewd-ufaq-premium-options-table.Yes {
2708
- min-height: 0;
2709
- }
2710
- .ewd-ufaq-premium-options-table-overlay {
2711
- position: absolute;
2712
- top: 0;
2713
- left: 0;
2714
- width: 100%;
2715
- height: 100%;
2716
- background: rgba(0,0,0,.45);
2717
- }
2718
- .ewd-ufaq-premium-options-table-overlay th {
2719
- background-image: none !important;
2720
- }
2721
- .ewd-ufaq-unlock-premium {
2722
- position: absolute;
2723
- width: 200px;
2724
- height: 200px;
2725
- padding: 16px;
2726
- background: #fff;
2727
- left: calc(50% - 116px);
2728
- }
2729
- .ewd-ufaq-admin-styling-section .ewd-ufaq-unlock-premium {
2730
- margin-top: 15px;
2731
- }
2732
- .ewd-ufaq-unlock-premium img {
2733
- position: relative;
2734
- float: left;
2735
- width: 40px;
2736
- height: auto;
2737
- margin: 16px 80px 24px;
2738
- }
2739
- .ewd-ufaq-unlock-premium p {
2740
- margin: 16px 0;
2741
- text-align: center;
2742
- color: #888;
2743
- }
2744
- .ewd-ufaq-unlock-premium .ewd-ufaq-dashboard-get-premium-widget-button {
2745
- clear: both;
2746
- position: relative;
2747
- float: left;
2748
- width: calc(100% - 20px);
2749
- margin: 16px 8px;
2750
- border: 2px solid #0acbaa;
2751
- background-color: #0acbaa;
2752
- color: #fff;
2753
- padding: 6px 0;
2754
- font-size: 12px;
2755
- text-decoration: none;
2756
- text-align: center;
2757
- font-weight: bold;
2758
- border-radius: 2px;
2759
- }
2760
- .ewd-ufaq-unlock-premium .ewd-ufaq-dashboard-get-premium-widget-button:hover {
2761
- background-color: #1CE6C3;
2762
- border-color: #1CE6C3;
2763
- color: #fff;
2764
- }
2765
-
2766
-
2767
- /**************************
2768
- * WP Dashboard Review Ask
2769
- ***************************/
2770
- .ewd-ufaq-main-dashboard-review-ask {
2771
- border-left-color: #6026b4;
2772
- }
2773
- .ewd-ufaq-review-ask-plugin-icon {
2774
- height: 100px;
2775
- width: 100px;
2776
- float: left;
2777
- margin: 12px 24px 16px 10px;
2778
- background-image: url(../images/ewd-ufaq-icon.png);
2779
- background-size: contain;
2780
- }
2781
- .ewd-ufaq-review-ask-text p {
2782
- padding: 10px 20px;
2783
- font-weight: 600;
2784
- font-size: 20px;
2785
- }
2786
- .ewd-ufaq-review-ask-review-text span {
2787
- font-size: .8em;
2788
- font-weight: normal;
2789
- }
2790
- .ewd-ufaq-review-ask-action {
2791
- width: 90px;
2792
- padding: 6px;
2793
- margin-right: 18px;
2794
- text-align: center;
2795
- float: left;
2796
- border-radius: 4px;
2797
- cursor: pointer;
2798
- }
2799
- .ewd-ufaq-review-ask-white {
2800
- color: #999999;
2801
- border: 1px solid #bbbbbb;
2802
- }
2803
- .ewd-ufaq-review-ask-green {
2804
- color: #ffffff;
2805
- background: #22C9A3;
2806
- border: 1px solid #22C9A3;
2807
- font-weight: 600;
2808
- }
2809
- .ewd-ufaq-review-ask-green a {
2810
- color: #ffffff;
2811
- text-decoration: none;
2812
- }
2813
- .ewd-ufaq-review-ask-feedback-form {
2814
- position: relative;
2815
- float: left;
2816
- }.ewd-ufaq-review-ask-feedback-explanation textarea {
2817
- height: 70px;
2818
- width: 480px;
2819
- }
2820
- .ewd-ufaq-review-ask-send-feedback {
2821
- margin: 10px 0px;
2822
- }
2823
-
2824
-
2825
- /*************
2826
- RESPONSIVE
2827
- *************/
2828
- @media screen and (max-width: 1099px) {
2829
- .ufaq-options-submenu-div, .ufaq-options-page-tabbed-content, .ufaq-styling-page-tabbed-content {
2830
- clear: both;
2831
- width: calc(100% - 40px);
2832
- }
2833
- }
2834
- @media screen and (max-width: 782px) {
2835
- .toplevel_page_EWD-UFAQ-Options .OptionTab {
2836
- padding: 15px 0;
2837
- }
2838
- .toplevel_page_EWD-UFAQ-Options .wrap.ufaq-options-page-tabbed {
2839
- margin: 10px 0 0 0;
2840
- width: 100%;
2841
- }
2842
- .ufaq-options-submenu-div {
2843
- margin: 0 0 20px 20px;
2844
- }
2845
- .ufaq-options-page-tabbed-content, .ufaq-styling-page-tabbed-content {
2846
- width: 100%;
2847
- }
2848
- .ufaq-option-set,
2849
- .ufaq-styling-set {
2850
- width: 100%;
2851
- margin: 0;
2852
- }
2853
- .ufaq-options-page-tab-title {
2854
- text-align: center;
2855
- }
2856
- .ewd-ufaq-admin-section-heading {
2857
- text-align: center;
2858
- }
2859
- .ufaq-option-set .form-table,
2860
- .ufaq-styling-set .form-table {
2861
- box-shadow: none;
2862
- }
2863
- .ufaq-option-set .form-table,
2864
- .ufaq-styling-set .form-table,
2865
- .ufaq-option-set .form-table tbody,
2866
- .ufaq-option-set .form-table tr,
2867
- .ufaq-option-set .form-table th,
2868
- .ufaq-option-set .form-table td,
2869
- .ufaq-styling-set .form-table tbody,
2870
- .ufaq-styling-set .form-table tr,
2871
- .ufaq-styling-set .form-table th,
2872
- .ufaq-styling-set .form-table td {
2873
- clear: both;
2874
- float: left;
2875
- width: 100%;
2876
- }
2877
- .ufaq-option-set .form-table,
2878
- .ufaq-styling-set .form-table {
2879
- padding: 11px 0;
2880
- }
2881
- .ufaq-option-set .form-table th,
2882
- .ufaq-styling-set .form-table th {
2883
- padding: 20px 5% 8px;
2884
- width: 90%;
2885
- height: auto;
2886
- margin: 0;
2887
- background-image: url(../images/options-asset-info.png);
2888
- background-position: 95% 20px;
2889
- background-size: 18px 18px;
2890
- background-repeat: no-repeat;
2891
- cursor: pointer;
2892
- }
2893
- .ufaq-option-set .form-table td,
2894
- .ufaq-styling-set .form-table td {
2895
- padding-top: 4px;
2896
- }
2897
- .ufaq-option-set .form-table td fieldset,
2898
- .ufaq-styling-set .form-table td fieldset{
2899
- position: relative;
2900
- }
2901
- .ufaq-option-set .form-table td label,
2902
- .ufaq-styling-set .form-table td label {
2903
- position: relative;
2904
- clear: both;
2905
- float: left;
2906
- width: 90%;
2907
- margin-left: 5% !important;
2908
- }
2909
- .ufaq-option-set .form-table td label.ewd-ufaq-admin-switch,
2910
- .ufaq-styling-set .form-table td label.ewd-ufaq-admin-switch {
2911
- position: absolute;
2912
- width: 40px;
2913
- top: -35px;
2914
- right: 5%;
2915
- }
2916
- .ufaq-option-set .form-table td p,
2917
- .ufaq-styling-set .form-table td p {
2918
- display: none;
2919
- position: relative;
2920
- float: left;
2921
- width: 90%;
2922
- padding: 10px 5% 24px;
2923
- background: #f3f3f3;
2924
- border-bottom: 1px solid #ccc;
2925
- font-size: 13px;
2926
- }
2927
- .ufaq-option-set .form-table td input[type="button"] {
2928
- display: block;
2929
- margin: 10px auto 4px;
2930
- }
2931
- .ewd-ufaq-admin-styling-section .ewd-admin-labelling-section label {
2932
- width: 95%;
2933
- margin: 0 2.5% 8px;
2934
- }
2935
- .ewd-ufaq-admin-input-container {
2936
- width: calc(100% - 16px);
2937
- padding-left: 16px;
2938
- }
2939
-
2940
- .ewd-ufaq-admin-styling-section {
2941
- box-shadow: none;
2942
- }
2943
- .ewd-ufaq-admin-styling-subsection, .ewd-ufaq-admin-styling-subsection:first-of-type {
2944
- width: 100%;
2945
- padding-right: 0;
2946
- padding-left: 0;
2947
- }
2948
- .ewd-ufaq-admin-styling-subsection-label {
2949
- width: 90%;
2950
- padding: 0 5% 8px;
2951
- }
2952
- .ewdOptionHasInfo .ewd-ufaq-admin-styling-subsection-label {
2953
- padding: 0 calc(5% + 38px) 8px 5%;
2954
- width: calc(90% - 38px);
2955
- background-image: url(../images/options-asset-info.png);
2956
- background-position: 95% 0;
2957
- background-size: 18px 18px;
2958
- background-repeat: no-repeat;
2959
- }
2960
- .ewd-ufaq-admin-styling-subsection:first-of-type .ewd-ufaq-admin-styling-subsection-label {
2961
- padding: 20px 5% 8px;
2962
- }
2963
- .ewdOptionHasInfo:first-of-type .ewd-ufaq-admin-styling-subsection-label {
2964
- padding: 20px calc(5% + 38px) 8px 5%;
2965
- background-image: url(../images/options-asset-info.png);
2966
- background-position: 950% 20px;
2967
- background-size: 18px 18px;
2968
- background-repeat: no-repeat;
2969
- }
2970
- .ewd-ufaq-admin-styling-subsection-content {
2971
- width: 100%;
2972
- padding: 0 ;
2973
- }
2974
- .ewd-ufaq-admin-styling-subsection-content-each {
2975
- margin-bottom: 10px;
2976
- padding-bottom: 10px;
2977
- border-bottom: 1px solid #ddd;
2978
- }
2979
- .ewd-ufaq-admin-styling-subsection-content-each:last-of-type {
2980
- border-bottom: none;
2981
- }
2982
- .ewd-ufaq-admin-styling-subsection-content-label, .ewd-ufaq-admin-styling-subsection-content-right {
2983
- width: calc(90% - 16px);
2984
- padding: 0 0 0 calc(5% + 16px);
2985
- }
2986
- .ewd-ufaq-admin-styling-subsection-content-label {
2987
- padding-top: 10px;
2988
- padding-bottom: 15px;
2989
- }
2990
- .ewd-ufaq-admin-styling-subsection-content label {
2991
- width: 90%;
2992
- margin-left: 5% !important;
2993
- }
2994
- .ewd-ufaq-admin-styling-subsection p {
2995
- display: none;
2996
- position: relative;
2997
- float: left;
2998
- width: 90%;
2999
- padding: 10px 5% 24px;
3000
- background: #f3f3f3;
3001
- border-bottom: 1px solid #ccc;
3002
- font-size: 13px;
3003
- }
3004
- .ewd-ufaq-admin-styling-section .ewd-admin-labelling-section label p {
3005
- display: block;
3006
- padding: 10px 0 0;
3007
- background: transparent;
3008
- border-bottom: none;
3009
- }
3010
- .ewd-ufaq-admin-styling-text-input {
3011
- width: 100%;
3012
- }
3013
- .ewd-ufaq-admin-styling-subsection input[type="button"] {
3014
- display: block;
3015
- margin: 10px auto 0;
3016
- }
3017
- }
3018
-
3019
- /****************
3020
- ORDER TABLE
3021
- ****************/
3022
- .ufaq-order-table thead tr,
3023
- .ufaq-order-table tfoot tr {
3024
- background: #F8F4FF;
3025
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/CSSTidy/class.csstidy.php DELETED
@@ -1,1001 +0,0 @@
1
- <?php
2
- /**
3
- * CSSTidy - CSS Parser and Optimiser
4
- *
5
- * CSS Parser class
6
- *
7
- * This file is part of CSSTidy.
8
- *
9
- * CSSTidy is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * CSSTidy is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with CSSTidy; if not, write to the Free Software
21
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
- *
23
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
24
- * @package csstidy
25
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
26
- */
27
-
28
- /**
29
- * Various CSS data needed for correct optimisations etc.
30
- *
31
- * @version 1.3
32
- */
33
- require('data.inc.php');
34
-
35
- /**
36
- * Contains a class for printing CSS code
37
- *
38
- * @version 1.0
39
- */
40
- require('class.csstidy_print.php');
41
-
42
- /**
43
- * Contains a class for optimising CSS code
44
- *
45
- * @version 1.0
46
- */
47
- require('class.csstidy_optimise.php');
48
-
49
- /**
50
- * CSS Parser class
51
- *
52
- * This class represents a CSS parser which reads CSS code and saves it in an array.
53
- * In opposite to most other CSS parsers, it does not use regular expressions and
54
- * thus has full CSS2 support and a higher reliability.
55
- * Additional to that it applies some optimisations and fixes to the CSS code.
56
- * An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php
57
- * @package csstidy
58
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
59
- * @version 1.3
60
- */
61
- if (!class_exists('csstidy')) {
62
- class csstidy {
63
-
64
- /**
65
- * Saves the parsed CSS
66
- * @var array
67
- * @access public
68
- */
69
- var $css = array();
70
-
71
- /**
72
- * Saves the parsed CSS (raw)
73
- * @var array
74
- * @access private
75
- */
76
- var $tokens = array();
77
-
78
- /**
79
- * Printer class
80
- * @see csstidy_print
81
- * @var object
82
- * @access public
83
- */
84
- var $print;
85
-
86
- /**
87
- * Optimiser class
88
- * @see csstidy_optimise
89
- * @var object
90
- * @access private
91
- */
92
- var $optimise;
93
-
94
- /**
95
- * Saves the CSS charset (@charset)
96
- * @var string
97
- * @access private
98
- */
99
- var $charset = '';
100
-
101
- /**
102
- * Saves all @import URLs
103
- * @var array
104
- * @access private
105
- */
106
- var $import = array();
107
-
108
- /**
109
- * Saves the namespace
110
- * @var string
111
- * @access private
112
- */
113
- var $namespace = '';
114
-
115
- /**
116
- * Contains the version of csstidy
117
- * @var string
118
- * @access private
119
- */
120
- var $version = '1.3';
121
-
122
- /**
123
- * Stores the settings
124
- * @var array
125
- * @access private
126
- */
127
- var $settings = array();
128
-
129
- /**
130
- * Saves the parser-status.
131
- *
132
- * Possible values:
133
- * - is = in selector
134
- * - ip = in property
135
- * - iv = in value
136
- * - instr = in string (started at " or ' or ( )
137
- * - ic = in comment (ignore everything)
138
- * - at = in @-block
139
- *
140
- * @var string
141
- * @access private
142
- */
143
- var $status = 'is';
144
-
145
-
146
- /**
147
- * Saves the current at rule (@media)
148
- * @var string
149
- * @access private
150
- */
151
- var $at = '';
152
-
153
- /**
154
- * Saves the current selector
155
- * @var string
156
- * @access private
157
- */
158
- var $selector = '';
159
-
160
- /**
161
- * Saves the current property
162
- * @var string
163
- * @access private
164
- */
165
- var $property = '';
166
-
167
- /**
168
- * Saves the position of , in selectors
169
- * @var array
170
- * @access private
171
- */
172
- var $sel_separate = array();
173
-
174
- /**
175
- * Saves the current value
176
- * @var string
177
- * @access private
178
- */
179
- var $value = '';
180
-
181
- /**
182
- * Saves the current sub-value
183
- *
184
- * Example for a subvalue:
185
- * background:url(foo.png) red no-repeat;
186
- * "url(foo.png)", "red", and "no-repeat" are subvalues,
187
- * seperated by whitespace
188
- * @var string
189
- * @access private
190
- */
191
- var $sub_value = '';
192
-
193
- /**
194
- * Array which saves all subvalues for a property.
195
- * @var array
196
- * @see sub_value
197
- * @access private
198
- */
199
- var $sub_value_arr = array();
200
-
201
- /**
202
- * Saves the char which opened the last string
203
- * @var string
204
- * @access private
205
- */
206
- var $str_char = '';
207
- var $cur_string = '';
208
-
209
- /**
210
- * Status from which the parser switched to ic or instr
211
- * @var string
212
- * @access private
213
- */
214
- var $from = '';
215
-
216
- /**
217
- * Variable needed to manage string-in-strings, for example url("foo.png")
218
- * @var string
219
- * @access private
220
- */
221
- var $str_in_str = false;
222
-
223
- /**
224
- * =true if in invalid at-rule
225
- * @var bool
226
- * @access private
227
- */
228
- var $invalid_at = false;
229
-
230
- /**
231
- * =true if something has been added to the current selector
232
- * @var bool
233
- * @access private
234
- */
235
- var $added = false;
236
-
237
- /**
238
- * Array which saves the message log
239
- * @var array
240
- * @access private
241
- */
242
- var $log = array();
243
-
244
- /**
245
- * Saves the line number
246
- * @var integer
247
- * @access private
248
- */
249
- var $line = 1;
250
-
251
- /**
252
- * Loads standard template and sets default settings
253
- * @access private
254
- * @version 1.3
255
- */
256
- function __construct()
257
- {
258
- $this->settings['remove_bslash'] = true;
259
- $this->settings['compress_colors'] = true;
260
- $this->settings['compress_font-weight'] = true;
261
- $this->settings['lowercase_s'] = false;
262
- $this->settings['optimise_shorthands'] = 1;
263
- $this->settings['remove_last_;'] = false;
264
- $this->settings['case_properties'] = 1;
265
- $this->settings['sort_properties'] = false;
266
- $this->settings['sort_selectors'] = false;
267
- $this->settings['merge_selectors'] = 2;
268
- $this->settings['discard_invalid_properties'] = false;
269
- $this->settings['css_level'] = 'CSS2.1';
270
- $this->settings['preserve_css'] = false;
271
- $this->settings['timestamp'] = false;
272
-
273
- $this->load_template('default');
274
- $this->print = new csstidy_print($this);
275
- $this->optimise = new csstidy_optimise($this);
276
- }
277
-
278
- /**
279
- * Get the value of a setting.
280
- * @param string $setting
281
- * @access public
282
- * @return mixed
283
- * @version 1.0
284
- */
285
- function get_cfg($setting)
286
- {
287
- if(isset($this->settings[$setting]))
288
- {
289
- return $this->settings[$setting];
290
- }
291
- return false;
292
- }
293
-
294
- /**
295
- * Set the value of a setting.
296
- * @param string $setting
297
- * @param mixed $value
298
- * @access public
299
- * @return bool
300
- * @version 1.0
301
- */
302
- function set_cfg($setting,$value)
303
- {
304
- if(isset($this->settings[$setting]) && $value !== '')
305
- {
306
- $this->settings[$setting] = $value;
307
- return true;
308
- }
309
- return false;
310
- }
311
-
312
- /**
313
- * Adds a token to $this->tokens
314
- * @param mixed $type
315
- * @param string $data
316
- * @param bool $do add a token even if preserve_css is off
317
- * @access private
318
- * @version 1.0
319
- */
320
- function _add_token($type, $data, $do = false) {
321
- if($this->get_cfg('preserve_css') || $do) {
322
- $this->tokens[] = array($type, ($type == COMMENT) ? $data : trim($data));
323
- }
324
- }
325
-
326
- /**
327
- * Add a message to the message log
328
- * @param string $message
329
- * @param string $type
330
- * @param integer $line
331
- * @access private
332
- * @version 1.0
333
- */
334
- function log($message,$type,$line = -1)
335
- {
336
- if($line === -1)
337
- {
338
- $line = $this->line;
339
- }
340
- $line = intval($line);
341
- $add = array('m' => $message, 't' => $type);
342
- if(!isset($this->log[$line]) || !in_array($add,$this->log[$line]))
343
- {
344
- $this->log[$line][] = $add;
345
- }
346
- }
347
-
348
- /**
349
- * Parse unicode notations and find a replacement character
350
- * @param string $string
351
- * @param integer $i
352
- * @access private
353
- * @return string
354
- * @version 1.2
355
- */
356
- function _unicode(&$string, &$i)
357
- {
358
- ++$i;
359
- $add = '';
360
- $tokens =& $GLOBALS['csstidy']['tokens'];
361
- $replaced = false;
362
-
363
- while($i < strlen($string) && (ctype_xdigit($string{$i}) || ctype_space($string{$i})) && strlen($add) < 6)
364
- {
365
- $add .= $string{$i};
366
-
367
- if(ctype_space($string{$i})) {
368
- break;
369
- }
370
- $i++;
371
- }
372
-
373
- if(hexdec($add) > 47 && hexdec($add) < 58 || hexdec($add) > 64 && hexdec($add) < 91 || hexdec($add) > 96 && hexdec($add) < 123)
374
- {
375
- $this->log('Replaced unicode notation: Changed \\'. $add .' to ' . chr(hexdec($add)),'Information');
376
- $add = chr(hexdec($add));
377
- $replaced = true;
378
- }
379
- else {
380
- $add = trim('\\'.$add);
381
- }
382
-
383
- if(@ctype_xdigit($string{$i+1}) && ctype_space($string{$i})
384
- && !$replaced || !ctype_space($string{$i})) {
385
- $i--;
386
- }
387
-
388
- if($add != '\\' || !$this->get_cfg('remove_bslash') || strpos($tokens, $string{$i+1}) !== false) {
389
- return $add;
390
- }
391
-
392
- if($add == '\\') {
393
- $this->log('Removed unnecessary backslash','Information');
394
- }
395
- return '';
396
- }
397
-
398
- /**
399
- * Loads a new template
400
- * @param string $content either filename (if $from_file == true), content of a template file, "high_compression", "highest_compression", "low_compression", or "default"
401
- * @param bool $from_file uses $content as filename if true
402
- * @access public
403
- * @version 1.1
404
- * @see http://csstidy.sourceforge.net/templates.php
405
- */
406
- function load_template($content, $from_file=true)
407
- {
408
- $predefined_templates =& $GLOBALS['csstidy']['predefined_templates'];
409
- if($content == 'high_compression' || $content == 'default' || $content == 'highest_compression' || $content == 'low_compression')
410
- {
411
- $this->template = $predefined_templates[$content];
412
- return;
413
- }
414
-
415
- if($from_file)
416
- {
417
- $content = strip_tags(file_get_contents($content),'<span>');
418
- }
419
- $content = str_replace("\r\n","\n",$content); // Unify newlines (because the output also only uses \n)
420
- $template = explode('|',$content);
421
-
422
- for ($i = 0; $i < count($template); $i++ )
423
- {
424
- $this->template[$i] = $template[$i];
425
- }
426
- }
427
-
428
- /**
429
- * Starts parsing from URL
430
- * @param string $url
431
- * @access public
432
- * @version 1.0
433
- */
434
- function parse_from_url($url)
435
- {
436
- return $this->parse(@file_get_contents($url));
437
- }
438
-
439
- /**
440
- * Checks if there is a token at the current position
441
- * @param string $string
442
- * @param integer $i
443
- * @access public
444
- * @version 1.11
445
- */
446
- function is_token(&$string, $i)
447
- {
448
- $tokens =& $GLOBALS['csstidy']['tokens'];
449
- return (strpos($tokens, $string{$i}) !== false && !csstidy::escaped($string,$i));
450
- }
451
-
452
-
453
- /**
454
- * Parses CSS in $string. The code is saved as array in $this->css
455
- * @param string $string the CSS code
456
- * @access public
457
- * @return bool
458
- * @version 1.1
459
- */
460
- function parse($string) {
461
- // PHP bug? Settings need to be refreshed in PHP4
462
- $this->print = new csstidy_print($this);
463
- $this->optimise = new csstidy_optimise($this);
464
-
465
- $all_properties =& $GLOBALS['csstidy']['all_properties'];
466
- $at_rules =& $GLOBALS['csstidy']['at_rules'];
467
-
468
- $this->css = array();
469
- $this->print->input_css = $string;
470
- $string = str_replace("\r\n","\n",$string) . ' ';
471
- $cur_comment = '';
472
-
473
- for ($i = 0, $size = strlen($string); $i < $size; $i++ )
474
- {
475
- if($string{$i} == "\n" || $string{$i} == "\r")
476
- {
477
- ++$this->line;
478
- }
479
-
480
- switch($this->status)
481
- {
482
- /* Case in at-block */
483
- case 'at':
484
- if(csstidy::is_token($string,$i))
485
- {
486
- if($string{$i} == '/' && @$string{$i+1} == '*')
487
- {
488
- $this->status = 'ic'; ++$i;
489
- $this->from = 'at';
490
- }
491
- elseif($string{$i} == '{')
492
- {
493
- $this->status = 'is';
494
- $this->_add_token(AT_START, $this->at);
495
- }
496
- elseif($string{$i} == ',')
497
- {
498
- $this->at = trim($this->at).',';
499
- }
500
- elseif($string{$i} == '\\')
501
- {
502
- $this->at .= $this->_unicode($string,$i);
503
- }
504
- }
505
- else
506
- {
507
- $lastpos = strlen($this->at)-1;
508
- if(!( (ctype_space($this->at{$lastpos}) || csstidy::is_token($this->at,$lastpos) && $this->at{$lastpos} == ',') && ctype_space($string{$i})))
509
- {
510
- $this->at .= $string{$i};
511
- }
512
- }
513
- break;
514
-
515
- /* Case in-selector */
516
- case 'is':
517
- if(csstidy::is_token($string,$i))
518
- {
519
- if($string{$i} == '/' && @$string{$i+1} == '*' && trim($this->selector) == '')
520
- {
521
- $this->status = 'ic'; ++$i;
522
- $this->from = 'is';
523
- }
524
- elseif($string{$i} == '@' && trim($this->selector) == '')
525
- {
526
- // Check for at-rule
527
- $this->invalid_at = true;
528
- foreach($at_rules as $name => $type)
529
- {
530
- if(!strcasecmp(substr($string,$i+1,strlen($name)),$name))
531
- {
532
- ($type == 'at') ? $this->at = '@'.$name : $this->selector = '@'.$name;
533
- $this->status = $type;
534
- $i += strlen($name);
535
- $this->invalid_at = false;
536
- }
537
- }
538
-
539
- if($this->invalid_at)
540
- {
541
- $this->selector = '@';
542
- $invalid_at_name = '';
543
- for($j = $i+1; $j < $size; ++$j)
544
- {
545
- if(!ctype_alpha($string{$j}))
546
- {
547
- break;
548
- }
549
- $invalid_at_name .= $string{$j};
550
- }
551
- $this->log('Invalid @-rule: '.$invalid_at_name.' (removed)','Warning');
552
- }
553
- }
554
- elseif(($string{$i} == '"' || $string{$i} == "'"))
555
- {
556
- $this->cur_string = $string{$i};
557
- $this->status = 'instr';
558
- $this->str_char = $string{$i};
559
- $this->from = 'is';
560
- }
561
- elseif($this->invalid_at && $string{$i} == ';')
562
- {
563
- $this->invalid_at = false;
564
- $this->status = 'is';
565
- }
566
- elseif($string{$i} == '{')
567
- {
568
- $this->status = 'ip';
569
- $this->_add_token(SEL_START, $this->selector);
570
- $this->added = false;
571
- }
572
- elseif($string{$i} == '}')
573
- {
574
- $this->_add_token(AT_END, $this->at);
575
- $this->at = '';
576
- $this->selector = '';
577
- $this->sel_separate = array();
578
- }
579
- elseif($string{$i} == ',')
580
- {
581
- $this->selector = trim($this->selector).',';
582
- $this->sel_separate[] = strlen($this->selector);
583
- }
584
- elseif($string{$i} == '\\')
585
- {
586
- $this->selector .= $this->_unicode($string,$i);
587
- }
588
- // remove unnecessary universal selector, FS#147
589
- else if(!($string{$i} == '*' && @in_array($string{$i+1}, array('.', '#', '[', ':')))) {
590
- $this->selector .= $string{$i};
591
- }
592
- }
593
- else
594
- {
595
- $lastpos = strlen($this->selector)-1;
596
- if($lastpos == -1 || !( (ctype_space($this->selector{$lastpos}) || csstidy::is_token($this->selector,$lastpos) && $this->selector{$lastpos} == ',') && ctype_space($string{$i})))
597
- {
598
- $this->selector .= $string{$i};
599
- }
600
- }
601
- break;
602
-
603
- /* Case in-property */
604
- case 'ip':
605
- if(csstidy::is_token($string,$i))
606
- {
607
- if(($string{$i} == ':' || $string{$i} == '=') && $this->property != '')
608
- {
609
- $this->status = 'iv';
610
- if(!$this->get_cfg('discard_invalid_properties') || csstidy::property_is_valid($this->property)) {
611
- $this->_add_token(PROPERTY, $this->property);
612
- }
613
- }
614
- elseif($string{$i} == '/' && @$string{$i+1} == '*' && $this->property == '')
615
- {
616
- $this->status = 'ic'; ++$i;
617
- $this->from = 'ip';
618
- }
619
- elseif($string{$i} == '}')
620
- {
621
- $this->explode_selectors();
622
- $this->status = 'is';
623
- $this->invalid_at = false;
624
- $this->_add_token(SEL_END, $this->selector);
625
- $this->selector = '';
626
- $this->property = '';
627
- }
628
- elseif($string{$i} == ';')
629
- {
630
- $this->property = '';
631
- }
632
- elseif($string{$i} == '\\')
633
- {
634
- $this->property .= $this->_unicode($string,$i);
635
- }
636
- }
637
- elseif(!ctype_space($string{$i}))
638
- {
639
- $this->property .= $string{$i};
640
- }
641
- break;
642
-
643
- /* Case in-value */
644
- case 'iv':
645
- $pn = (($string{$i} == "\n" || $string{$i} == "\r") && $this->property_is_next($string,$i+1) || $i == strlen($string)-1);
646
- if(csstidy::is_token($string,$i) || $pn)
647
- {
648
- if($string{$i} == '/' && @$string{$i+1} == '*')
649
- {
650
- $this->status = 'ic'; ++$i;
651
- $this->from = 'iv';
652
- }
653
- elseif(($string{$i} == '"' || $string{$i} == "'" || $string{$i} == '('))
654
- {
655
- $this->cur_string = $string{$i};
656
- $this->str_char = ($string{$i} == '(') ? ')' : $string{$i};
657
- $this->status = 'instr';
658
- $this->from = 'iv';
659
- }
660
- elseif($string{$i} == ',')
661
- {
662
- $this->sub_value = trim($this->sub_value).',';
663
- }
664
- elseif($string{$i} == '\\')
665
- {
666
- $this->sub_value .= $this->_unicode($string,$i);
667
- }
668
- elseif($string{$i} == ';' || $pn)
669
- {
670
- if($this->selector{0} == '@' && isset($at_rules[substr($this->selector,1)]) && $at_rules[substr($this->selector,1)] == 'iv')
671
- {
672
- $this->sub_value_arr[] = trim($this->sub_value);
673
-
674
- $this->status = 'is';
675
-
676
- switch($this->selector)
677
- {
678
- case '@charset': $this->charset = $this->sub_value_arr[0]; break;
679
- case '@namespace': $this->namespace = implode(' ',$this->sub_value_arr); break;
680
- case '@import': $this->import[] = implode(' ',$this->sub_value_arr); break;
681
- }
682
-
683
- $this->sub_value_arr = array();
684
- $this->sub_value = '';
685
- $this->selector = '';
686
- $this->sel_separate = array();
687
- }
688
- else
689
- {
690
- $this->status = 'ip';
691
- }
692
- }
693
- elseif($string{$i} != '}')
694
- {
695
- $this->sub_value .= $string{$i};
696
- }
697
- if(($string{$i} == '}' || $string{$i} == ';' || $pn) && !empty($this->selector))
698
- {
699
- if($this->at == '')
700
- {
701
- $this->at = DEFAULT_AT;
702
- }
703
-
704
- // case settings
705
- if($this->get_cfg('lowercase_s'))
706
- {
707
- $this->selector = strtolower($this->selector);
708
- }
709
- $this->property = strtolower($this->property);
710
-
711
- $this->optimise->subvalue();
712
- if($this->sub_value != '') {
713
- $this->sub_value_arr[] = $this->sub_value;
714
- $this->sub_value = '';
715
- }
716
-
717
- $this->value = implode(' ',$this->sub_value_arr);
718
-
719
- $this->selector = trim($this->selector);
720
-
721
- $this->optimise->value();
722
-
723
- $valid = csstidy::property_is_valid($this->property);
724
- if((!$this->invalid_at || $this->get_cfg('preserve_css')) && (!$this->get_cfg('discard_invalid_properties') || $valid))
725
- {
726
- $this->css_add_property($this->at,$this->selector,$this->property,$this->value);
727
- $this->_add_token(VALUE, $this->value);
728
- $this->optimise->shorthands();
729
- }
730
- if(!$valid)
731
- {
732
- if($this->get_cfg('discard_invalid_properties'))
733
- {
734
- $this->log('Removed invalid property: '.$this->property,'Warning');
735
- }
736
- else
737
- {
738
- $this->log('Invalid property in '.strtoupper($this->get_cfg('css_level')).': '.$this->property,'Warning');
739
- }
740
- }
741
-
742
- $this->property = '';
743
- $this->sub_value_arr = array();
744
- $this->value = '';
745
- }
746
- if($string{$i} == '}')
747
- {
748
- $this->explode_selectors();
749
- $this->_add_token(SEL_END, $this->selector);
750
- $this->status = 'is';
751
- $this->invalid_at = false;
752
- $this->selector = '';
753
- }
754
- }
755
- elseif(!$pn)
756
- {
757
- $this->sub_value .= $string{$i};
758
-
759
- if(ctype_space($string{$i}))
760
- {
761
- $this->optimise->subvalue();
762
- if($this->sub_value != '') {
763
- $this->sub_value_arr[] = $this->sub_value;
764
- $this->sub_value = '';
765
- }
766
- }
767
- }
768
- break;
769
-
770
- /* Case in string */
771
- case 'instr':
772
- if($this->str_char == ')' && ($string{$i} == '"' || $string{$i} == '\'') && !$this->str_in_str && !csstidy::escaped($string,$i))
773
- {
774
- $this->str_in_str = true;
775
- }
776
- elseif($this->str_char == ')' && ($string{$i} == '"' || $string{$i} == '\'') && $this->str_in_str && !csstidy::escaped($string,$i))
777
- {
778
- $this->str_in_str = false;
779
- }
780
- $temp_add = $string{$i}; // ...and no not-escaped backslash at the previous position
781
- if( ($string{$i} == "\n" || $string{$i} == "\r") && !($string{$i-1} == '\\' && !csstidy::escaped($string,$i-1)) )
782
- {
783
- $temp_add = "\\A ";
784
- $this->log('Fixed incorrect newline in string','Warning');
785
- }
786
- if (!($this->str_char == ')' && in_array($string{$i}, $GLOBALS['csstidy']['whitespace']) && !$this->str_in_str)) {
787
- $this->cur_string .= $temp_add;
788
- }
789
- if($string{$i} == $this->str_char && !csstidy::escaped($string,$i) && !$this->str_in_str)
790
- {
791
- $this->status = $this->from;
792
- if (!preg_match('|[' . implode('', $GLOBALS['csstidy']['whitespace']) . ']|uis', $this->cur_string) && $this->property != 'content') {
793
- if ($this->str_char == '"' || $this->str_char == '\'') {
794
- $this->cur_string = substr($this->cur_string, 1, -1);
795
- } else if (strlen($this->cur_string) > 3 && ($this->cur_string[1] == '"' || $this->cur_string[1] == '\'')) /* () */ {
796
- $this->cur_string = $this->cur_string[0] . substr($this->cur_string, 2, -2) . substr($this->cur_string, -1);
797
- }
798
- }
799
- if($this->from == 'iv')
800
- {
801
- $this->sub_value .= $this->cur_string;
802
- }
803
- elseif($this->from == 'is')
804
- {
805
- $this->selector .= $this->cur_string;
806
- }
807
- }
808
- break;
809
-
810
- /* Case in-comment */
811
- case 'ic':
812
- if($string{$i} == '*' && $string{$i+1} == '/')
813
- {
814
- $this->status = $this->from;
815
- $i++;
816
- $this->_add_token(COMMENT, $cur_comment);
817
- $cur_comment = '';
818
- }
819
- else
820
- {
821
- $cur_comment .= $string{$i};
822
- }
823
- break;
824
- }
825
- }
826
-
827
- $this->optimise->postparse();
828
-
829
- $this->print->_reset();
830
-
831
- return !(empty($this->css) && empty($this->import) && empty($this->charset) && empty($this->tokens) && empty($this->namespace));
832
- }
833
-
834
- /**
835
- * Explodes selectors
836
- * @access private
837
- * @version 1.0
838
- */
839
- function explode_selectors()
840
- {
841
- // Explode multiple selectors
842
- if($this->get_cfg('merge_selectors') == 1)
843
- {
844
- $new_sels = array();
845
- $lastpos = 0;
846
- $this->sel_separate[] = strlen($this->selector);
847
- foreach($this->sel_separate as $num => $pos)
848
- {
849
- if($num == count($this->sel_separate)-1) {
850
- $pos += 1;
851
- }
852
-
853
- $new_sels[] = substr($this->selector,$lastpos,$pos-$lastpos-1);
854
- $lastpos = $pos;
855
- }
856
-
857
- if(count($new_sels) > 1)
858
- {
859
- foreach($new_sels as $selector)
860
- {
861
- $this->merge_css_blocks($this->at,$selector,$this->css[$this->at][$this->selector]);
862
- }
863
- unset($this->css[$this->at][$this->selector]);
864
- }
865
- }
866
- $this->sel_separate = array();
867
- }
868
-
869
- /**
870
- * Checks if a character is escaped (and returns true if it is)
871
- * @param string $string
872
- * @param integer $pos
873
- * @access public
874
- * @return bool
875
- * @version 1.02
876
- */
877
- function escaped(&$string,$pos)
878
- {
879
- return !(@($string{$pos-1} != '\\') || csstidy::escaped($string,$pos-1));
880
- }
881
-
882
- /**
883
- * Adds a property with value to the existing CSS code
884
- * @param string $media
885
- * @param string $selector
886
- * @param string $property
887
- * @param string $new_val
888
- * @access private
889
- * @version 1.2
890
- */
891
- function css_add_property($media,$selector,$property,$new_val)
892
- {
893
- if($this->get_cfg('preserve_css') || trim($new_val) == '') {
894
- return;
895
- }
896
-
897
- $this->added = true;
898
- if(isset($this->css[$media][$selector][$property]))
899
- {
900
- if((csstidy::is_important($this->css[$media][$selector][$property]) && csstidy::is_important($new_val)) || !csstidy::is_important($this->css[$media][$selector][$property]))
901
- {
902
- unset($this->css[$media][$selector][$property]);
903
- $this->css[$media][$selector][$property] = trim($new_val);
904
- }
905
- }
906
- else
907
- {
908
- $this->css[$media][$selector][$property] = trim($new_val);
909
- }
910
- }
911
-
912
- /**
913
- * Adds CSS to an existing media/selector
914
- * @param string $media
915
- * @param string $selector
916
- * @param array $css_add
917
- * @access private
918
- * @version 1.1
919
- */
920
- function merge_css_blocks($media,$selector,$css_add)
921
- {
922
- foreach($css_add as $property => $value)
923
- {
924
- $this->css_add_property($media,$selector,$property,$value,false);
925
- }
926
- }
927
-
928
- /**
929
- * Checks if $value is !important.
930
- * @param string $value
931
- * @return bool
932
- * @access public
933
- * @version 1.0
934
- */
935
- function is_important(&$value)
936
- {
937
- return (!strcasecmp(substr(str_replace($GLOBALS['csstidy']['whitespace'],'',$value),-10,10),'!important'));
938
- }
939
-
940
- /**
941
- * Returns a value without !important
942
- * @param string $value
943
- * @return string
944
- * @access public
945
- * @version 1.0
946
- */
947
- function gvw_important($value)
948
- {
949
- if(csstidy::is_important($value))
950
- {
951
- $value = trim($value);
952
- $value = substr($value,0,-9);
953
- $value = trim($value);
954
- $value = substr($value,0,-1);
955
- $value = trim($value);
956
- return $value;
957
- }
958
- return $value;
959
- }
960
-
961
- /**
962
- * Checks if the next word in a string from pos is a CSS property
963
- * @param string $istring
964
- * @param integer $pos
965
- * @return bool
966
- * @access private
967
- * @version 1.2
968
- */
969
- function property_is_next($istring, $pos)
970
- {
971
- $all_properties =& $GLOBALS['csstidy']['all_properties'];
972
- $istring = substr($istring,$pos,strlen($istring)-$pos);
973
- $pos = strpos($istring,':');
974
- if($pos === false)
975
- {
976
- return false;
977
- }
978
- $istring = strtolower(trim(substr($istring,0,$pos)));
979
- if(isset($all_properties[$istring]))
980
- {
981
- $this->log('Added semicolon to the end of declaration','Warning');
982
- return true;
983
- }
984
- return false;
985
- }
986
-
987
- /**
988
- * Checks if a property is valid
989
- * @param string $property
990
- * @return bool;
991
- * @access public
992
- * @version 1.0
993
- */
994
- function property_is_valid($property) {
995
- $all_properties =& $GLOBALS['csstidy']['all_properties'];
996
- return (isset($all_properties[$property]) && strpos($all_properties[$property],strtoupper($this->get_cfg('css_level'))) !== false );
997
- }
998
-
999
- }
1000
- }
1001
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/CSSTidy/class.csstidy_optimise.php DELETED
@@ -1,811 +0,0 @@
1
- <?php
2
- /**
3
- * CSSTidy - CSS Parser and Optimiser
4
- *
5
- * CSS Optimising Class
6
- * This class optimises CSS data generated by csstidy.
7
- *
8
- * This file is part of CSSTidy.
9
- *
10
- * CSSTidy is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * CSSTidy is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public License
21
- * along with CSSTidy; if not, write to the Free Software
22
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
- *
24
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
25
- * @package csstidy
26
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
27
- */
28
-
29
- /**
30
- * CSS Optimising Class
31
- *
32
- * This class optimises CSS data generated by csstidy.
33
- *
34
- * @package csstidy
35
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
36
- * @version 1.0
37
- */
38
-
39
- if (!class_exists('csstidy_optimise')){
40
- class csstidy_optimise
41
- {
42
- /**
43
- * Constructor
44
- * @param array $css contains the class csstidy
45
- * @access private
46
- * @version 1.0
47
- */
48
- function __construct(&$css)
49
- {
50
- $this->parser =& $css;
51
- $this->css =& $css->css;
52
- $this->sub_value =& $css->sub_value;
53
- $this->at =& $css->at;
54
- $this->selector =& $css->selector;
55
- $this->property =& $css->property;
56
- $this->value =& $css->value;
57
- }
58
-
59
- /**
60
- * Optimises $css after parsing
61
- * @access public
62
- * @version 1.0
63
- */
64
- function postparse()
65
- {
66
- if ($this->parser->get_cfg('preserve_css')) {
67
- return;
68
- }
69
-
70
- if ($this->parser->get_cfg('merge_selectors') == 2)
71
- {
72
- foreach ($this->css as $medium => $value)
73
- {
74
- $this->merge_selectors($this->css[$medium]);
75
- }
76
- }
77
-
78
- if ($this->parser->get_cfg('optimise_shorthands') > 0)
79
- {
80
- foreach ($this->css as $medium => $value)
81
- {
82
- foreach ($value as $selector => $value1)
83
- {
84
- $this->css[$medium][$selector] = csstidy_optimise::merge_4value_shorthands($this->css[$medium][$selector]);
85
-
86
- if ($this->parser->get_cfg('optimise_shorthands') < 2) {
87
- continue;
88
- }
89
-
90
- $this->css[$medium][$selector] = csstidy_optimise::merge_bg($this->css[$medium][$selector]);
91
- if (empty($this->css[$medium][$selector])) {
92
- unset($this->css[$medium][$selector]);
93
- }
94
- }
95
- }
96
- }
97
- }
98
-
99
- /**
100
- * Optimises values
101
- * @access public
102
- * @version 1.0
103
- */
104
- function value()
105
- {
106
- $shorthands =& $GLOBALS['csstidy']['shorthands'];
107
-
108
- // optimise shorthand properties
109
- if(isset($shorthands[$this->property]))
110
- {
111
- $temp = csstidy_optimise::shorthand($this->value); // FIXME - move
112
- if($temp != $this->value)
113
- {
114
- $this->parser->log('Optimised shorthand notation ('.$this->property.'): Changed "'.$this->value.'" to "'.$temp.'"','Information');
115
- }
116
- $this->value = $temp;
117
- }
118
-
119
- // Remove whitespace at ! important
120
- if($this->value != $this->compress_important($this->value))
121
- {
122
- $this->parser->log('Optimised !important','Information');
123
- }
124
- }
125
-
126
- /**
127
- * Optimises shorthands
128
- * @access public
129
- * @version 1.0
130
- */
131
- function shorthands()
132
- {
133
- $shorthands =& $GLOBALS['csstidy']['shorthands'];
134
-
135
- if(!$this->parser->get_cfg('optimise_shorthands') || $this->parser->get_cfg('preserve_css')) {
136
- return;
137
- }
138
-
139
- if($this->property == 'background' && $this->parser->get_cfg('optimise_shorthands') > 1)
140
- {
141
- unset($this->css[$this->at][$this->selector]['background']);
142
- $this->parser->merge_css_blocks($this->at,$this->selector,csstidy_optimise::dissolve_short_bg($this->value));
143
- }
144
- if(isset($shorthands[$this->property]))
145
- {
146
- $this->parser->merge_css_blocks($this->at,$this->selector,csstidy_optimise::dissolve_4value_shorthands($this->property,$this->value));
147
- if(is_array($shorthands[$this->property]))
148
- {
149
- unset($this->css[$this->at][$this->selector][$this->property]);
150
- }
151
- }
152
- }
153
-
154
- /**
155
- * Optimises a sub-value
156
- * @access public
157
- * @version 1.0
158
- */
159
- function subvalue()
160
- {
161
- $replace_colors =& $GLOBALS['csstidy']['replace_colors'];
162
-
163
- $this->sub_value = trim($this->sub_value);
164
- if($this->sub_value == '') // caution : '0'
165
- {
166
- return;
167
- }
168
-
169
- $important = '';
170
- if((new csstidy)->is_important($this->sub_value))
171
- {
172
- $important = '!important';
173
- }
174
- $this->sub_value = (new csstidy)->gvw_important($this->sub_value);
175
-
176
- // Compress font-weight
177
- if($this->property == 'font-weight' && $this->parser->get_cfg('compress_font-weight'))
178
- {
179
- if($this->sub_value == 'bold')
180
- {
181
- $this->sub_value = '700';
182
- $this->parser->log('Optimised font-weight: Changed "bold" to "700"','Information');
183
- }
184
- else if($this->sub_value == 'normal')
185
- {
186
- $this->sub_value = '400';
187
- $this->parser->log('Optimised font-weight: Changed "normal" to "400"','Information');
188
- }
189
- }
190
-
191
- $temp = $this->compress_numbers($this->sub_value);
192
- if($temp != $this->sub_value)
193
- {
194
- if(strlen($temp) > strlen($this->sub_value)) {
195
- $this->parser->log('Fixed invalid number: Changed "'.$this->sub_value.'" to "'.$temp.'"','Warning');
196
- } else {
197
- $this->parser->log('Optimised number: Changed "'.$this->sub_value.'" to "'.$temp.'"','Information');
198
- }
199
- $this->sub_value = $temp;
200
- }
201
- if($this->parser->get_cfg('compress_colors'))
202
- {
203
- $temp = $this->cut_color($this->sub_value);
204
- if($temp !== $this->sub_value)
205
- {
206
- if(isset($replace_colors[$this->sub_value])) {
207
- $this->parser->log('Fixed invalid color name: Changed "'.$this->sub_value.'" to "'.$temp.'"','Warning');
208
- } else {
209
- $this->parser->log('Optimised color: Changed "'.$this->sub_value.'" to "'.$temp.'"','Information');
210
- }
211
- $this->sub_value = $temp;
212
- }
213
- }
214
- $this->sub_value .= $important;
215
- }
216
-
217
- /**
218
- * Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px
219
- * @param string $value
220
- * @access public
221
- * @return string
222
- * @version 1.0
223
- */
224
- function shorthand($value)
225
- {
226
- $important = '';
227
- if((new csstidy)->is_important($value))
228
- {
229
- $values = (new csstidy)->gvw_important($value);
230
- $important = '!important';
231
- }
232
- else $values = $value;
233
-
234
- $values = explode(' ',$values);
235
- switch(count($values))
236
- {
237
- case 4:
238
- if($values[0] == $values[1] && $values[0] == $values[2] && $values[0] == $values[3])
239
- {
240
- return $values[0].$important;
241
- }
242
- elseif($values[1] == $values[3] && $values[0] == $values[2])
243
- {
244
- return $values[0].' '.$values[1].$important;
245
- }
246
- elseif($values[1] == $values[3])
247
- {
248
- return $values[0].' '.$values[1].' '.$values[2].$important;
249
- }
250
- break;
251
-
252
- case 3:
253
- if($values[0] == $values[1] && $values[0] == $values[2])
254
- {
255
- return $values[0].$important;
256
- }
257
- elseif($values[0] == $values[2])
258
- {
259
- return $values[0].' '.$values[1].$important;
260
- }
261
- break;
262
-
263
- case 2:
264
- if($values[0] == $values[1])
265
- {
266
- return $values[0].$important;
267
- }
268
- break;
269
- }
270
-
271
- return $value;
272
- }
273
-
274
- /**
275
- * Removes unnecessary whitespace in ! important
276
- * @param string $string
277
- * @return string
278
- * @access public
279
- * @version 1.1
280
- */
281
- function compress_important(&$string)
282
- {
283
- if((new csstidy)->is_important($string))
284
- {
285
- $string = csstidy::gvw_important($string) . '!important';
286
- }
287
- return $string;
288
- }
289
-
290
- /**
291
- * Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
292
- * @param string $color
293
- * @return string
294
- * @version 1.1
295
- */
296
- function cut_color($color)
297
- {
298
- $replace_colors =& $GLOBALS['csstidy']['replace_colors'];
299
-
300
- // rgb(0,0,0) -> #000000 (or #000 in this case later)
301
- if(strtolower(substr($color,0,4)) == 'rgb(')
302
- {
303
- $color_tmp = substr($color,4,strlen($color)-5);
304
- $color_tmp = explode(',',$color_tmp);
305
- for ( $i = 0; $i < count($color_tmp); $i++ )
306
- {
307
- $color_tmp[$i] = trim ($color_tmp[$i]);
308
- if(substr($color_tmp[$i],-1) == '%')
309
- {
310
- $color_tmp[$i] = round((255*$color_tmp[$i])/100);
311
- }
312
- if($color_tmp[$i]>255) $color_tmp[$i] = 255;
313
- }
314
- $color = '#';
315
- for ($i = 0; $i < 3; $i++ )
316
- {
317
- if($color_tmp[$i]<16) {
318
- $color .= '0' . dechex($color_tmp[$i]);
319
- } else {
320
- $color .= dechex($color_tmp[$i]);
321
- }
322
- }
323
- }
324
-
325
- // Fix bad color names
326
- if(isset($replace_colors[strtolower($color)]))
327
- {
328
- $color = $replace_colors[strtolower($color)];
329
- }
330
-
331
- // #aabbcc -> #abc
332
- if(strlen($color) == 7)
333
- {
334
- $color_temp = strtolower($color);
335
- if($color_temp{0} == '#' && $color_temp{1} == $color_temp{2} && $color_temp{3} == $color_temp{4} && $color_temp{5} == $color_temp{6})
336
- {
337
- $color = '#'.$color{1}.$color{3}.$color{5};
338
- }
339
- }
340
-
341
- switch(strtolower($color))
342
- {
343
- /* color name -> hex code */
344
- case 'black': return '#000';
345
- case 'fuchsia': return '#F0F';
346
- case 'white': return '#FFF';
347
- case 'yellow': return '#FF0';
348
-
349
- /* hex code -> color name */
350
- case '#800000': return 'maroon';
351
- case '#ffa500': return 'orange';
352
- case '#808000': return 'olive';
353
- case '#800080': return 'purple';
354
- case '#008000': return 'green';
355
- case '#000080': return 'navy';
356
- case '#008080': return 'teal';
357
- case '#c0c0c0': return 'silver';
358
- case '#808080': return 'gray';
359
- case '#f00': return 'red';
360
- }
361
-
362
- return $color;
363
- }
364
-
365
- /**
366
- * Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
367
- * @param string $subvalue
368
- * @return string
369
- * @version 1.2
370
- */
371
- function compress_numbers($subvalue)
372
- {
373
- $units =& $GLOBALS['csstidy']['units'];
374
- $unit_values =& $GLOBALS['csstidy']['unit_values'];
375
- $color_values =& $GLOBALS['csstidy']['color_values'];
376
-
377
- // for font:1em/1em sans-serif...;
378
- if($this->property == 'font')
379
- {
380
- $temp = explode('/',$subvalue);
381
- }
382
- else
383
- {
384
- $temp = array($subvalue);
385
- }
386
- for ($l = 0; $l < count($temp); $l++)
387
- {
388
- // continue if no numeric value
389
- if (!(strlen($temp[$l]) > 0 && ( is_numeric($temp[$l]{0}) || $temp[$l]{0} == '+' || $temp[$l]{0} == '-' ) ))
390
- {
391
- continue;
392
- }
393
-
394
- // Fix bad colors
395
- if (in_array($this->property, $color_values))
396
- {
397
- $temp[$l] = '#'.$temp[$l];
398
- }
399
-
400
- if (floatval($temp[$l]) == 0)
401
- {
402
- $temp[$l] = '0';
403
- }
404
- else
405
- {
406
- $unit_found = FALSE;
407
- for ($m = 0, $size_4 = count($units); $m < $size_4; $m++)
408
- {
409
- if (strpos(strtolower($temp[$l]),$units[$m]) !== FALSE)
410
- {
411
- $temp[$l] = floatval($temp[$l]).$units[$m];
412
- $unit_found = TRUE;
413
- break;
414
- }
415
- }
416
- if (!$unit_found && in_array($this->property,$unit_values,TRUE))
417
- {
418
- $temp[$l] = floatval($temp[$l]).'px';
419
- }
420
- else if (!$unit_found)
421
- {
422
- $temp[$l] = floatval($temp[$l]);
423
- }
424
- // Remove leading zero
425
- if (abs(floatval($temp[$l])) < 1) {
426
- if (floatval($temp[$l]) < 0) {
427
- $temp[$l] = '-' . substr($temp[$l], 2);
428
- } else {
429
- $temp[$l] = substr($temp[$l], 1);
430
- }
431
- }
432
- }
433
- }
434
-
435
- return ((count($temp) > 1) ? $temp[0].'/'.$temp[1] : $temp[0]);
436
- }
437
-
438
- /**
439
- * Merges selectors with same properties. Example: a{color:red} b{color:red} -> a,b{color:red}
440
- * Very basic and has at least one bug. Hopefully there is a replacement soon.
441
- * @param array $array
442
- * @return array
443
- * @access public
444
- * @version 1.2
445
- */
446
- function merge_selectors(&$array)
447
- {
448
- $css = $array;
449
- foreach($css as $key => $value)
450
- {
451
- if(!isset($css[$key]))
452
- {
453
- continue;
454
- }
455
- $newsel = '';
456
-
457
- // Check if properties also exist in another selector
458
- $keys = array();
459
- // PHP bug (?) without $css = $array; here
460
- foreach($css as $selector => $vali)
461
- {
462
- if($selector == $key)
463
- {
464
- continue;
465
- }
466
-
467
- if($css[$key] === $vali)
468
- {
469
- $keys[] = $selector;
470
- }
471
- }
472
-
473
- if(!empty($keys))
474
- {
475
- $newsel = $key;
476
- unset($css[$key]);
477
- foreach($keys as $selector)
478
- {
479
- unset($css[$selector]);
480
- $newsel .= ','.$selector;
481
- }
482
- $css[$newsel] = $value;
483
- }
484
- }
485
- $array = $css;
486
- }
487
-
488
- /**
489
- * Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
490
- * @param string $property
491
- * @param string $value
492
- * @return array
493
- * @version 1.0
494
- * @see merge_4value_shorthands()
495
- */
496
- function dissolve_4value_shorthands($property,$value)
497
- {
498
- $shorthands =& $GLOBALS['csstidy']['shorthands'];
499
- if(!is_array($shorthands[$property]))
500
- {
501
- $return[$property] = $value;
502
- return $return;
503
- }
504
-
505
- $important = '';
506
- if(csstidy::is_important($value))
507
- {
508
- $value = csstidy::gvw_important($value);
509
- $important = '!important';
510
- }
511
- $values = explode(' ',$value);
512
-
513
-
514
- $return = array();
515
- if(count($values) == 4)
516
- {
517
- for($i=0;$i<4;$i++)
518
- {
519
- $return[$shorthands[$property][$i]] = $values[$i].$important;
520
- }
521
- }
522
- elseif(count($values) == 3)
523
- {
524
- $return[$shorthands[$property][0]] = $values[0].$important;
525
- $return[$shorthands[$property][1]] = $values[1].$important;
526
- $return[$shorthands[$property][3]] = $values[1].$important;
527
- $return[$shorthands[$property][2]] = $values[2].$important;
528
- }
529
- elseif(count($values) == 2)
530
- {
531
- for($i=0;$i<4;$i++)
532
- {
533
- $return[$shorthands[$property][$i]] = (($i % 2 != 0)) ? $values[1].$important : $values[0].$important;
534
- }
535
- }
536
- else
537
- {
538
- for($i=0;$i<4;$i++)
539
- {
540
- $return[$shorthands[$property][$i]] = $values[0].$important;
541
- }
542
- }
543
-
544
- return $return;
545
- }
546
-
547
- /**
548
- * Explodes a string as explode() does, however, not if $sep is escaped or within a string.
549
- * @param string $sep seperator
550
- * @param string $string
551
- * @return array
552
- * @version 1.0
553
- */
554
- function explode_ws($sep,$string)
555
- {
556
- $status = 'st';
557
- $to = '';
558
-
559
- $output = array();
560
- $num = 0;
561
- for($i = 0, $len = strlen($string);$i < $len; $i++)
562
- {
563
- switch($status)
564
- {
565
- case 'st':
566
- if($string{$i} == $sep && !csstidy::escaped($string,$i))
567
- {
568
- ++$num;
569
- }
570
- elseif($string{$i} == '"' || $string{$i} == '\'' || $string{$i} == '(' && !csstidy::escaped($string,$i))
571
- {
572
- $status = 'str';
573
- $to = ($string{$i} == '(') ? ')' : $string{$i};
574
- (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
575
- }
576
- else
577
- {
578
- (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
579
- }
580
- break;
581
-
582
- case 'str':
583
- if($string{$i} == $to && !csstidy::escaped($string,$i))
584
- {
585
- $status = 'st';
586
- }
587
- (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
588
- break;
589
- }
590
- }
591
-
592
- if(isset($output[0]))
593
- {
594
- return $output;
595
- }
596
- else
597
- {
598
- return array($output);
599
- }
600
- }
601
-
602
- /**
603
- * Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
604
- * @param array $array
605
- * @return array
606
- * @version 1.2
607
- * @see dissolve_4value_shorthands()
608
- */
609
- function merge_4value_shorthands($array)
610
- {
611
- $return = $array;
612
- $shorthands =& $GLOBALS['csstidy']['shorthands'];
613
-
614
- foreach($shorthands as $key => $value)
615
- {
616
- if(isset($array[$value[0]]) && isset($array[$value[1]])
617
- && isset($array[$value[2]]) && isset($array[$value[3]]) && $value !== 0)
618
- {
619
- $return[$key] = '';
620
-
621
- $important = '';
622
- for($i = 0; $i < 4; $i++)
623
- {
624
- $val = $array[$value[$i]];
625
- if(csstidy::is_important($val))
626
- {
627
- $important = '!important';
628
- $return[$key] .= csstidy::gvw_important($val).' ';
629
- }
630
- else
631
- {
632
- $return[$key] .= $val.' ';
633
- }
634
- unset($return[$value[$i]]);
635
- }
636
- $return[$key] = csstidy_optimise::shorthand(trim($return[$key].$important));
637
- }
638
- }
639
- return $return;
640
- }
641
-
642
- /**
643
- * Dissolve background property
644
- * @param string $str_value
645
- * @return array
646
- * @version 1.0
647
- * @see merge_bg()
648
- * @todo full CSS 3 compliance
649
- */
650
- function dissolve_short_bg($str_value)
651
- {
652
- $background_prop_default =& $GLOBALS['csstidy']['background_prop_default'];
653
- $repeat = array('repeat','repeat-x','repeat-y','no-repeat','space');
654
- $attachment = array('scroll','fixed','local');
655
- $clip = array('border','padding');
656
- $origin = array('border','padding','content');
657
- $pos = array('top','center','bottom','left','right');
658
- $important = '';
659
- $return = array('background-image' => NULL,'background-size' => NULL,'background-repeat' => NULL,'background-position' => NULL,'background-attachment'=>NULL,'background-clip' => NULL,'background-origin' => NULL,'background-color' => NULL);
660
-
661
- if(csstidy::is_important($str_value))
662
- {
663
- $important = ' !important';
664
- $str_value = csstidy::gvw_important($str_value);
665
- }
666
-
667
- $str_value = csstidy_optimise::explode_ws(',',$str_value);
668
- for($i = 0; $i < count($str_value); $i++)
669
- {
670
- $have['clip'] = FALSE; $have['pos'] = FALSE;
671
- $have['color'] = FALSE; $have['bg'] = FALSE;
672
-
673
- $str_value[$i] = csstidy_optimise::explode_ws(' ',trim($str_value[$i]));
674
-
675
- for($j = 0; $j < count($str_value[$i]); $j++)
676
- {
677
- if($have['bg'] === FALSE && (substr($str_value[$i][$j],0,4) == 'url(' || $str_value[$i][$j] === 'none'))
678
- {
679
- $return['background-image'] .= $str_value[$i][$j].',';
680
- $have['bg'] = TRUE;
681
- }
682
- elseif(in_array($str_value[$i][$j],$repeat,TRUE))
683
- {
684
- $return['background-repeat'] .= $str_value[$i][$j].',';
685
- }
686
- elseif(in_array($str_value[$i][$j],$attachment,TRUE))
687
- {
688
- $return['background-attachment'] .= $str_value[$i][$j].',';
689
- }
690
- elseif(in_array($str_value[$i][$j],$clip,TRUE) && !$have['clip'])
691
- {
692
- $return['background-clip'] .= $str_value[$i][$j].',';
693
- $have['clip'] = TRUE;
694
- }
695
- elseif(in_array($str_value[$i][$j],$origin,TRUE))
696
- {
697
- $return['background-origin'] .= $str_value[$i][$j].',';
698
- }
699
- elseif($str_value[$i][$j]{0} == '(')
700
- {
701
- $return['background-size'] .= substr($str_value[$i][$j],1,-1).',';
702
- }
703
- elseif(in_array($str_value[$i][$j],$pos,TRUE) || is_numeric($str_value[$i][$j]{0}) || $str_value[$i][$j]{0} === NULL)
704
- {
705
- $return['background-position'] .= $str_value[$i][$j];
706
- if(!$have['pos']) $return['background-position'] .= ' '; else $return['background-position'].= ',';
707
- $have['pos'] = TRUE;
708
- }
709
- elseif(!$have['color'])
710
- {
711
- $return['background-color'] .= $str_value[$i][$j].',';
712
- $have['color'] = TRUE;
713
- }
714
- }
715
- }
716
-
717
- foreach($background_prop_default as $bg_prop => $default_value)
718
- {
719
- if($return[$bg_prop] !== NULL)
720
- {
721
- $return[$bg_prop] = substr($return[$bg_prop],0,-1).$important;
722
- }
723
- else $return[$bg_prop] = $default_value.$important;
724
- }
725
- return $return;
726
- }
727
-
728
- /**
729
- * Merges all background properties
730
- * @param array $input_css
731
- * @return array
732
- * @version 1.0
733
- * @see dissolve_short_bg()
734
- * @todo full CSS 3 compliance
735
- */
736
- function merge_bg($input_css)
737
- {
738
- $background_prop_default =& $GLOBALS['csstidy']['background_prop_default'];
739
- // Max number of background images. CSS3 not yet fully implemented
740
- $number_of_values = @max(count(csstidy_optimise::explode_ws(',',$input_css['background-image'])),count(csstidy_optimise::explode_ws(',',$input_css['background-color'])),1);
741
- // Array with background images to check if BG image exists
742
- $bg_img_array = @csstidy_optimise::explode_ws(',',csstidy::gvw_important($input_css['background-image']));
743
- $new_bg_value = '';
744
- $important = '';
745
-
746
- for($i = 0; $i < $number_of_values; $i++)
747
- {
748
- foreach($background_prop_default as $bg_property => $default_value)
749
- {
750
- // Skip if property does not exist
751
- if(!isset($input_css[$bg_property]))
752
- {
753
- continue;
754
- }
755
-
756
- $cur_value = $input_css[$bg_property];
757
-
758
- // Skip some properties if there is no background image
759
- if((!isset($bg_img_array[$i]) || $bg_img_array[$i] === 'none')
760
- && ($bg_property === 'background-size' || $bg_property === 'background-position'
761
- || $bg_property === 'background-attachment' || $bg_property === 'background-repeat'))
762
- {
763
- continue;
764
- }
765
-
766
- // Remove !important
767
- if(csstidy::is_important($cur_value))
768
- {
769
- $important = ' !important';
770
- $cur_value = csstidy::gvw_important($cur_value);
771
- }
772
-
773
- // Do not add default values
774
- if($cur_value === $default_value)
775
- {
776
- continue;
777
- }
778
-
779
- $temp = csstidy_optimise::explode_ws(',',$cur_value);
780
-
781
- if(isset($temp[$i]))
782
- {
783
- if($bg_property == 'background-size')
784
- {
785
- $new_bg_value .= '('.$temp[$i].') ';
786
- }
787
- else
788
- {
789
- $new_bg_value .= $temp[$i].' ';
790
- }
791
- }
792
- }
793
-
794
- $new_bg_value = trim($new_bg_value);
795
- if($i != $number_of_values-1) $new_bg_value .= ',';
796
- }
797
-
798
- // Delete all background-properties
799
- foreach($background_prop_default as $bg_property => $default_value)
800
- {
801
- unset($input_css[$bg_property]);
802
- }
803
-
804
- // Add new background property
805
- if($new_bg_value !== '') $input_css['background'] = $new_bg_value.$important;
806
-
807
- return $input_css;
808
- }
809
- }
810
- }
811
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/CSSTidy/class.csstidy_print.php DELETED
@@ -1,350 +0,0 @@
1
- <?php
2
- /**
3
- * CSSTidy - CSS Parser and Optimiser
4
- *
5
- * CSS Printing class
6
- * This class prints CSS data generated by csstidy.
7
- *
8
- * This file is part of CSSTidy.
9
- *
10
- * CSSTidy is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * CSSTidy is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public License
21
- * along with CSSTidy; if not, write to the Free Software
22
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
- *
24
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
25
- * @package csstidy
26
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
27
- */
28
-
29
- /**
30
- * CSS Printing class
31
- *
32
- * This class prints CSS data generated by csstidy.
33
- *
34
- * @package csstidy
35
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
36
- * @version 1.0
37
- */
38
- if (!class_exists('csstidy_print')) {
39
- class csstidy_print
40
- {
41
- /**
42
- * Saves the input CSS string
43
- * @var string
44
- * @access private
45
- */
46
- var $input_css = '';
47
-
48
- /**
49
- * Saves the formatted CSS string
50
- * @var string
51
- * @access public
52
- */
53
- var $output_css = '';
54
-
55
- /**
56
- * Saves the formatted CSS string (plain text)
57
- * @var string
58
- * @access public
59
- */
60
- var $output_css_plain = '';
61
-
62
- /**
63
- * Constructor
64
- * @param array $css contains the class csstidy
65
- * @access private
66
- * @version 1.0
67
- */
68
- function __construct(&$css)
69
- {
70
- $this->parser =& $css;
71
- $this->css =& $css->css;
72
- $this->template =& $css->template;
73
- $this->tokens =& $css->tokens;
74
- $this->charset =& $css->charset;
75
- $this->import =& $css->import;
76
- $this->namespace =& $css->namespace;
77
- }
78
-
79
- /**
80
- * Resets output_css and output_css_plain (new css code)
81
- * @access private
82
- * @version 1.0
83
- */
84
- function _reset()
85
- {
86
- $this->output_css = '';
87
- $this->output_css_plain = '';
88
- }
89
-
90
- /**
91
- * Returns the CSS code as plain text
92
- * @return string
93
- * @access public
94
- * @version 1.0
95
- */
96
- function plain()
97
- {
98
- $this->_print(true);
99
- return $this->output_css_plain;
100
- }
101
-
102
- /**
103
- * Returns the formatted CSS code
104
- * @return string
105
- * @access public
106
- * @version 1.0
107
- */
108
- function formatted()
109
- {
110
- $this->_print(false);
111
- return $this->output_css;
112
- }
113
-
114
- /**
115
- * Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain
116
- * @param bool $plain plain text or not
117
- * @access private
118
- * @version 2.0
119
- */
120
- function _print($plain = false)
121
- {
122
- if ($this->output_css && $this->output_css_plain) {
123
- return;
124
- }
125
-
126
- $output = '';
127
- if (!$this->parser->get_cfg('preserve_css')) {
128
- $this->_convert_raw_css();
129
- }
130
-
131
- $template =& $this->template;
132
-
133
- if ($plain) {
134
- $template = array_map('strip_tags', $template);
135
- }
136
-
137
- if ($this->parser->get_cfg('timestamp')) {
138
- array_unshift($this->tokens, array(COMMENT, ' CSSTidy ' . $this->parser->version . ': ' . date('r') . ' '));
139
- }
140
-
141
- if (!empty($this->charset)) {
142
- $output .= $template[0].'@charset '.$template[5].$this->charset.$template[6];
143
- }
144
-
145
- if (!empty($this->import)) {
146
- for ($i = 0, $size = count($this->import); $i < $size; $i ++) {
147
- $output .= $template[0].'@import '.$template[5].$this->import[$i].$template[6];
148
- }
149
- }
150
-
151
- if (!empty($this->namespace)) {
152
- $output .= $template[0].'@namespace '.$template[5].$this->namespace.$template[6];
153
- }
154
-
155
- $output .= $template[13];
156
- $in_at_out = '';
157
- $out =& $output;
158
-
159
- foreach ($this->tokens as $key => $token)
160
- {
161
- switch ($token[0])
162
- {
163
- case AT_START:
164
- $out .= $template[0].$this->_htmlsp($token[1], $plain).$template[1];
165
- $out =& $in_at_out;
166
- break;
167
-
168
- case SEL_START:
169
- if($this->parser->get_cfg('lowercase_s')) $token[1] = strtolower($token[1]);
170
- $out .= ($token[1]{0} !== '@') ? $template[2].$this->_htmlsp($token[1], $plain) : $template[0].$this->_htmlsp($token[1], $plain);
171
- $out .= $template[3];
172
- break;
173
-
174
- case PROPERTY:
175
- if($this->parser->get_cfg('case_properties') == 2) $token[1] = strtoupper($token[1]);
176
- if($this->parser->get_cfg('case_properties') == 1) $token[1] = strtolower($token[1]);
177
- $out .= $template[4] . $this->_htmlsp($token[1], $plain) . ':' . $template[5];
178
- break;
179
-
180
- case VALUE:
181
- $out .= $this->_htmlsp($token[1], $plain);
182
- if($this->_seeknocomment($key, 1) == SEL_END && $this->parser->get_cfg('remove_last_;')) {
183
- $out .= str_replace(';', '', $template[6]);
184
- } else {
185
- $out .= $template[6];
186
- }
187
- break;
188
-
189
- case SEL_END:
190
- $out .= $template[7];
191
- if($this->_seeknocomment($key, 1) != AT_END) $out .= $template[8];
192
- break;
193
-
194
- case AT_END:
195
- $out =& $output;
196
- $out .= $template[10] . str_replace("\n", "\n" . $template[10], $in_at_out);
197
- $in_at_out = '';
198
- $out .= $template[9];
199
- break;
200
-
201
- case COMMENT:
202
- $out .= $template[11] . '/*' . $this->_htmlsp($token[1], $plain) . '*/' . $template[12];
203
- break;
204
- }
205
- }
206
-
207
- $output = trim($output);
208
-
209
- if (!$plain) {
210
- $this->output_css = $output;
211
- $this->_print(true);
212
- } else {
213
- $this->output_css_plain = $output;
214
- }
215
- }
216
-
217
- /**
218
- * Gets the next token type which is $move away from $key, excluding comments
219
- * @param integer $key current position
220
- * @param integer $move move this far
221
- * @return mixed a token type
222
- * @access private
223
- * @version 1.0
224
- */
225
- function _seeknocomment($key, $move) {
226
- $go = ($move > 0) ? 1 : -1;
227
- for ($i = $key + 1; abs($key-$i)-1 < abs($move); $i += $go) {
228
- if (!isset($this->tokens[$i])) {
229
- return;
230
- }
231
- if ($this->tokens[$i][0] == COMMENT) {
232
- $move += 1;
233
- continue;
234
- }
235
- return $this->tokens[$i][0];
236
- }
237
- }
238
-
239
- /**
240
- * Converts $this->css array to a raw array ($this->tokens)
241
- * @access private
242
- * @version 1.0
243
- */
244
- function _convert_raw_css()
245
- {
246
- $this->tokens = array();
247
-
248
- foreach ($this->css as $medium => $val)
249
- {
250
- if ($this->parser->get_cfg('sort_selectors')) ksort($val);
251
- if ($medium != DEFAULT_AT) {
252
- $this->parser->_add_token(AT_START, $medium, true);
253
- }
254
-
255
- foreach ($val as $selector => $vali)
256
- {
257
- if ($this->parser->get_cfg('sort_properties')) ksort($vali);
258
- $this->parser->_add_token(SEL_START, $selector, true);
259
-
260
- foreach ($vali as $property => $valj)
261
- {
262
- $this->parser->_add_token(PROPERTY, $property, true);
263
- $this->parser->_add_token(VALUE, $valj, true);
264
- }
265
-
266
- $this->parser->_add_token(SEL_END, $selector, true);
267
- }
268
-
269
- if ($medium != DEFAULT_AT) {
270
- $this->parser->_add_token(AT_END, $medium, true);
271
- }
272
- }
273
- }
274
-
275
- /**
276
- * Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes print_code() cleaner.
277
- * @param string $string
278
- * @param bool $plain
279
- * @return string
280
- * @see csstidy_print::_print()
281
- * @access private
282
- * @version 1.0
283
- */
284
- function _htmlsp($string, $plain)
285
- {
286
- if (!$plain) {
287
- return htmlspecialchars($string);
288
- }
289
- return $string;
290
- }
291
-
292
- /**
293
- * Get compression ratio
294
- * @access public
295
- * @return float
296
- * @version 1.2
297
- */
298
- function get_ratio()
299
- {
300
- if (!$this->output_css_plain) {
301
- $this->formatted();
302
- }
303
- return round((strlen($this->input_css) - strlen($this->output_css_plain)) / strlen($this->input_css), 3) * 100;
304
- }
305
-
306
- /**
307
- * Get difference between the old and new code in bytes and prints the code if necessary.
308
- * @access public
309
- * @return string
310
- * @version 1.1
311
- */
312
- function get_diff()
313
- {
314
- if (!$this->output_css_plain) {
315
- $this->formatted();
316
- }
317
-
318
- $diff = strlen($this->output_css_plain) - strlen($this->input_css);
319
-
320
- if ($diff > 0) {
321
- return '+' . $diff;
322
- } elseif ($diff == 0) {
323
- return '+-' . $diff;
324
- }
325
-
326
- return $diff;
327
- }
328
-
329
- /**
330
- * Get the size of either input or output CSS in KB
331
- * @param string $loc default is "output"
332
- * @access public
333
- * @return integer
334
- * @version 1.0
335
- */
336
- function size($loc = 'output')
337
- {
338
- if ($loc == 'output' && !$this->output_css) {
339
- $this->formatted();
340
- }
341
-
342
- if ($loc == 'input') {
343
- return (strlen($this->input_css) / 1000);
344
- } else {
345
- return (strlen($this->output_css_plain) / 1000);
346
- }
347
- }
348
- }
349
- }
350
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/CSSTidy/cssparse.css DELETED
@@ -1,137 +0,0 @@
1
- body {
2
- font:0.8em Verdana,Helvetica,sans-serif;
3
- background:#F8F8F6;
4
- }
5
-
6
- code {
7
- font-size:1.2em;
8
- }
9
-
10
- div#rightcol {
11
- padding-left:32em;
12
- }
13
-
14
- fieldset {
15
- display:block;
16
- margin:0.5em 0;
17
- padding:1em;
18
- border:solid #7284AB 2px;
19
- }
20
-
21
- h1 {
22
- font-size:2em;
23
- }
24
-
25
- small {
26
- font-size:0.7em;
27
- }
28
-
29
- fieldset#field_input {
30
- float:left;
31
- margin:0 0.5em 1em 0;
32
- }
33
-
34
- fieldset#options,fieldset#code_layout {
35
- width:31em;
36
- }
37
-
38
- input#submit {
39
- clear:both;
40
- display:block;
41
- margin:1em;
42
- }
43
-
44
- select {
45
- margin:2px 0 0;
46
- }
47
-
48
- label.block {
49
- display:block;
50
- }
51
-
52
- legend {
53
- background:#c4E1C3;
54
- padding:2px 4px;
55
- border:dashed 1px;
56
- }
57
-
58
- span.at {
59
- color:darkblue;
60
- }
61
-
62
- span.format {
63
- color:gray;
64
- }
65
-
66
- span.property {
67
- color:green;
68
- }
69
-
70
- span.selector {
71
- color:blue;
72
- }
73
-
74
- span.value {
75
- color:red;
76
- }
77
-
78
- span.comment {
79
- color:orange;
80
- }
81
-
82
- textarea#css_text {
83
- width:27em;
84
- height:370px;
85
- display:block;
86
- margin-right:1em;
87
- }
88
-
89
- .help {
90
- cursor:help;
91
- }
92
-
93
- p.important {
94
- border:solid 1px red;
95
- font-weight:bold;
96
- padding:1em;
97
- background:white;
98
- }
99
-
100
- p {
101
- margin:1em 0;
102
- }
103
-
104
- dl {
105
- padding-left:0.5em;
106
- }
107
-
108
- dt {
109
- font-weight:bold;
110
- margin:0;
111
- float:left;
112
- clear:both;
113
- height:1.5em;
114
- }
115
-
116
- dd {
117
- margin:0 0 0 4em;
118
- height:1.5em;
119
- }
120
-
121
- fieldset#messages {
122
- background:white;
123
- padding:0 0 0 1em;
124
- }
125
-
126
- fieldset#messages div {
127
- height:10em;
128
- overflow:auto;
129
- }
130
-
131
- dd.Warning {
132
- color:orange;
133
- }
134
-
135
- dd.Information {
136
- color:green;
137
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/CSSTidy/data.inc.php DELETED
@@ -1,473 +0,0 @@
1
- <?php
2
- /**
3
- * Various CSS Data for CSSTidy
4
- *
5
- * This file is part of CSSTidy.
6
- *
7
- * CSSTidy is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * CSSTidy is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with CSSTidy; if not, write to the Free Software
19
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
- *
21
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
22
- * @package csstidy
23
- * @author Florian Schmitz (floele at gmail dot com) 2005
24
- */
25
-
26
- define('AT_START', 1);
27
- define('AT_END', 2);
28
- define('SEL_START', 3);
29
- define('SEL_END', 4);
30
- define('PROPERTY', 5);
31
- define('VALUE', 6);
32
- define('COMMENT', 7);
33
- define('DEFAULT_AT', 41);
34
-
35
- /**
36
- * All whitespace allowed in CSS
37
- *
38
- * @global array $GLOBALS['csstidy']['whitespace']
39
- * @version 1.0
40
- */
41
- $GLOBALS['csstidy']['whitespace'] = array(' ',"\n","\t","\r","\x0B");
42
-
43
- /**
44
- * All CSS tokens used by csstidy
45
- *
46
- * @global string $GLOBALS['csstidy']['tokens']
47
- * @version 1.0
48
- */
49
- $GLOBALS['csstidy']['tokens'] = '/@}{;:=\'"(,\\!$%&)*+.<>?[]^`|~';
50
-
51
- /**
52
- * All CSS units (CSS 3 units included)
53
- *
54
- * @see compress_numbers()
55
- * @global array $GLOBALS['csstidy']['units']
56
- * @version 1.0
57
- */
58
- $GLOBALS['csstidy']['units'] = array('in','cm','mm','pt','pc','px','rem','em','%','ex','gd','vw','vh','vm','deg','grad','rad','ms','s','khz','hz');
59
-
60
- /**
61
- * Available at-rules
62
- *
63
- * @global array $GLOBALS['csstidy']['at_rules']
64
- * @version 1.0
65
- */
66
- $GLOBALS['csstidy']['at_rules'] = array('page' => 'is','font-face' => 'is','charset' => 'iv', 'import' => 'iv','namespace' => 'iv','media' => 'at');
67
-
68
- /**
69
- * Properties that need a value with unit
70
- *
71
- * @todo CSS3 properties
72
- * @see compress_numbers();
73
- * @global array $GLOBALS['csstidy']['unit_values']
74
- * @version 1.2
75
- */
76
- $GLOBALS['csstidy']['unit_values'] = array ('background', 'background-position', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-width',
77
- 'border-top-width', 'border-right-width', 'border-left-width', 'border-bottom-width', 'bottom', 'border-spacing', 'font-size',
78
- 'height', 'left', 'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', 'max-height', 'max-width',
79
- 'min-height', 'min-width', 'outline-width', 'padding', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left',
80
- 'position', 'right', 'top', 'text-indent', 'letter-spacing', 'word-spacing', 'width');
81
-
82
- /**
83
- * Properties that allow <color> as value
84
- *
85
- * @todo CSS3 properties
86
- * @see compress_numbers();
87
- * @global array $GLOBALS['csstidy']['color_values']
88
- * @version 1.0
89
- */
90
- $GLOBALS['csstidy']['color_values'] = array();
91
- $GLOBALS['csstidy']['color_values'][] = 'background-color';
92
- $GLOBALS['csstidy']['color_values'][] = 'border-color';
93
- $GLOBALS['csstidy']['color_values'][] = 'border-top-color';
94
- $GLOBALS['csstidy']['color_values'][] = 'border-right-color';
95
- $GLOBALS['csstidy']['color_values'][] = 'border-bottom-color';
96
- $GLOBALS['csstidy']['color_values'][] = 'border-left-color';
97
- $GLOBALS['csstidy']['color_values'][] = 'color';
98
- $GLOBALS['csstidy']['color_values'][] = 'outline-color';
99
-
100
-
101
- /**
102
- * Default values for the background properties
103
- *
104
- * @todo Possibly property names will change during CSS3 development
105
- * @global array $GLOBALS['csstidy']['background_prop_default']
106
- * @see dissolve_short_bg()
107
- * @see merge_bg()
108
- * @version 1.0
109
- */
110
- $GLOBALS['csstidy']['background_prop_default'] = array();
111
- $GLOBALS['csstidy']['background_prop_default']['background-image'] = 'none';
112
- $GLOBALS['csstidy']['background_prop_default']['background-size'] = 'auto';
113
- $GLOBALS['csstidy']['background_prop_default']['background-repeat'] = 'repeat';
114
- $GLOBALS['csstidy']['background_prop_default']['background-position'] = '0 0';
115
- $GLOBALS['csstidy']['background_prop_default']['background-attachment'] = 'scroll';
116
- $GLOBALS['csstidy']['background_prop_default']['background-clip'] = 'border';
117
- $GLOBALS['csstidy']['background_prop_default']['background-origin'] = 'padding';
118
- $GLOBALS['csstidy']['background_prop_default']['background-color'] = 'transparent';
119
-
120
- /**
121
- * A list of non-W3C color names which get replaced by their hex-codes
122
- *
123
- * @global array $GLOBALS['csstidy']['replace_colors']
124
- * @see cut_color()
125
- * @version 1.0
126
- */
127
- $GLOBALS['csstidy']['replace_colors'] = array();
128
- $GLOBALS['csstidy']['replace_colors']['aliceblue'] = '#F0F8FF';
129
- $GLOBALS['csstidy']['replace_colors']['antiquewhite'] = '#FAEBD7';
130
- $GLOBALS['csstidy']['replace_colors']['aquamarine'] = '#7FFFD4';
131
- $GLOBALS['csstidy']['replace_colors']['azure'] = '#F0FFFF';
132
- $GLOBALS['csstidy']['replace_colors']['beige'] = '#F5F5DC';
133
- $GLOBALS['csstidy']['replace_colors']['bisque'] = '#FFE4C4';
134
- $GLOBALS['csstidy']['replace_colors']['blanchedalmond'] = '#FFEBCD';
135
- $GLOBALS['csstidy']['replace_colors']['blueviolet'] = '#8A2BE2';
136
- $GLOBALS['csstidy']['replace_colors']['brown'] = '#A52A2A';
137
- $GLOBALS['csstidy']['replace_colors']['burlywood'] = '#DEB887';
138
- $GLOBALS['csstidy']['replace_colors']['cadetblue'] = '#5F9EA0';
139
- $GLOBALS['csstidy']['replace_colors']['chartreuse'] = '#7FFF00';
140
- $GLOBALS['csstidy']['replace_colors']['chocolate'] = '#D2691E';
141
- $GLOBALS['csstidy']['replace_colors']['coral'] = '#FF7F50';
142
- $GLOBALS['csstidy']['replace_colors']['cornflowerblue'] = '#6495ED';
143
- $GLOBALS['csstidy']['replace_colors']['cornsilk'] = '#FFF8DC';
144
- $GLOBALS['csstidy']['replace_colors']['crimson'] = '#DC143C';
145
- $GLOBALS['csstidy']['replace_colors']['cyan'] = '#00FFFF';
146
- $GLOBALS['csstidy']['replace_colors']['darkblue'] = '#00008B';
147
- $GLOBALS['csstidy']['replace_colors']['darkcyan'] = '#008B8B';
148
- $GLOBALS['csstidy']['replace_colors']['darkgoldenrod'] = '#B8860B';
149
- $GLOBALS['csstidy']['replace_colors']['darkgray'] = '#A9A9A9';
150
- $GLOBALS['csstidy']['replace_colors']['darkgreen'] = '#006400';
151
- $GLOBALS['csstidy']['replace_colors']['darkkhaki'] = '#BDB76B';
152
- $GLOBALS['csstidy']['replace_colors']['darkmagenta'] = '#8B008B';
153
- $GLOBALS['csstidy']['replace_colors']['darkolivegreen'] = '#556B2F';
154
- $GLOBALS['csstidy']['replace_colors']['darkorange'] = '#FF8C00';
155
- $GLOBALS['csstidy']['replace_colors']['darkorchid'] = '#9932CC';
156
- $GLOBALS['csstidy']['replace_colors']['darkred'] = '#8B0000';
157
- $GLOBALS['csstidy']['replace_colors']['darksalmon'] = '#E9967A';
158
- $GLOBALS['csstidy']['replace_colors']['darkseagreen'] = '#8FBC8F';
159
- $GLOBALS['csstidy']['replace_colors']['darkslateblue'] = '#483D8B';
160
- $GLOBALS['csstidy']['replace_colors']['darkslategray'] = '#2F4F4F';
161
- $GLOBALS['csstidy']['replace_colors']['darkturquoise'] = '#00CED1';
162
- $GLOBALS['csstidy']['replace_colors']['darkviolet'] = '#9400D3';
163
- $GLOBALS['csstidy']['replace_colors']['deeppink'] = '#FF1493';
164
- $GLOBALS['csstidy']['replace_colors']['deepskyblue'] = '#00BFFF';
165
- $GLOBALS['csstidy']['replace_colors']['dimgray'] = '#696969';
166
- $GLOBALS['csstidy']['replace_colors']['dodgerblue'] = '#1E90FF';
167
- $GLOBALS['csstidy']['replace_colors']['feldspar'] = '#D19275';
168
- $GLOBALS['csstidy']['replace_colors']['firebrick'] = '#B22222';
169
- $GLOBALS['csstidy']['replace_colors']['floralwhite'] = '#FFFAF0';
170
- $GLOBALS['csstidy']['replace_colors']['forestgreen'] = '#228B22';
171
- $GLOBALS['csstidy']['replace_colors']['gainsboro'] = '#DCDCDC';
172
- $GLOBALS['csstidy']['replace_colors']['ghostwhite'] = '#F8F8FF';
173
- $GLOBALS['csstidy']['replace_colors']['gold'] = '#FFD700';
174
- $GLOBALS['csstidy']['replace_colors']['goldenrod'] = '#DAA520';
175
- $GLOBALS['csstidy']['replace_colors']['greenyellow'] = '#ADFF2F';
176
- $GLOBALS['csstidy']['replace_colors']['honeydew'] = '#F0FFF0';
177
- $GLOBALS['csstidy']['replace_colors']['hotpink'] = '#FF69B4';
178
- $GLOBALS['csstidy']['replace_colors']['indianred'] = '#CD5C5C';
179
- $GLOBALS['csstidy']['replace_colors']['indigo'] = '#4B0082';
180
- $GLOBALS['csstidy']['replace_colors']['ivory'] = '#FFFFF0';
181
- $GLOBALS['csstidy']['replace_colors']['khaki'] = '#F0E68C';
182
- $GLOBALS['csstidy']['replace_colors']['lavender'] = '#E6E6FA';
183
- $GLOBALS['csstidy']['replace_colors']['lavenderblush'] = '#FFF0F5';
184
- $GLOBALS['csstidy']['replace_colors']['lawngreen'] = '#7CFC00';
185
- $GLOBALS['csstidy']['replace_colors']['lemonchiffon'] = '#FFFACD';
186
- $GLOBALS['csstidy']['replace_colors']['lightblue'] = '#ADD8E6';
187
- $GLOBALS['csstidy']['replace_colors']['lightcoral'] = '#F08080';
188
- $GLOBALS['csstidy']['replace_colors']['lightcyan'] = '#E0FFFF';
189
- $GLOBALS['csstidy']['replace_colors']['lightgoldenrodyellow'] = '#FAFAD2';
190
- $GLOBALS['csstidy']['replace_colors']['lightgrey'] = '#D3D3D3';
191
- $GLOBALS['csstidy']['replace_colors']['lightgreen'] = '#90EE90';
192
- $GLOBALS['csstidy']['replace_colors']['lightpink'] = '#FFB6C1';
193
- $GLOBALS['csstidy']['replace_colors']['lightsalmon'] = '#FFA07A';
194
- $GLOBALS['csstidy']['replace_colors']['lightseagreen'] = '#20B2AA';
195
- $GLOBALS['csstidy']['replace_colors']['lightskyblue'] = '#87CEFA';
196
- $GLOBALS['csstidy']['replace_colors']['lightslateblue'] = '#8470FF';
197
- $GLOBALS['csstidy']['replace_colors']['lightslategray'] = '#778899';
198
- $GLOBALS['csstidy']['replace_colors']['lightsteelblue'] = '#B0C4DE';
199
- $GLOBALS['csstidy']['replace_colors']['lightyellow'] = '#FFFFE0';
200
- $GLOBALS['csstidy']['replace_colors']['limegreen'] = '#32CD32';
201
- $GLOBALS['csstidy']['replace_colors']['linen'] = '#FAF0E6';
202
- $GLOBALS['csstidy']['replace_colors']['magenta'] = '#FF00FF';
203
- $GLOBALS['csstidy']['replace_colors']['mediumaquamarine'] = '#66CDAA';
204
- $GLOBALS['csstidy']['replace_colors']['mediumblue'] = '#0000CD';
205
- $GLOBALS['csstidy']['replace_colors']['mediumorchid'] = '#BA55D3';
206
- $GLOBALS['csstidy']['replace_colors']['mediumpurple'] = '#9370D8';
207
- $GLOBALS['csstidy']['replace_colors']['mediumseagreen'] = '#3CB371';
208
- $GLOBALS['csstidy']['replace_colors']['mediumslateblue'] = '#7B68EE';
209
- $GLOBALS['csstidy']['replace_colors']['mediumspringgreen'] = '#00FA9A';
210
- $GLOBALS['csstidy']['replace_colors']['mediumturquoise'] = '#48D1CC';
211
- $GLOBALS['csstidy']['replace_colors']['mediumvioletred'] = '#C71585';
212
- $GLOBALS['csstidy']['replace_colors']['midnightblue'] = '#191970';
213
- $GLOBALS['csstidy']['replace_colors']['mintcream'] = '#F5FFFA';
214
- $GLOBALS['csstidy']['replace_colors']['mistyrose'] = '#FFE4E1';
215
- $GLOBALS['csstidy']['replace_colors']['moccasin'] = '#FFE4B5';
216
- $GLOBALS['csstidy']['replace_colors']['navajowhite'] = '#FFDEAD';
217
- $GLOBALS['csstidy']['replace_colors']['oldlace'] = '#FDF5E6';
218
- $GLOBALS['csstidy']['replace_colors']['olivedrab'] = '#6B8E23';
219
- $GLOBALS['csstidy']['replace_colors']['orangered'] = '#FF4500';
220
- $GLOBALS['csstidy']['replace_colors']['orchid'] = '#DA70D6';
221
- $GLOBALS['csstidy']['replace_colors']['palegoldenrod'] = '#EEE8AA';
222
- $GLOBALS['csstidy']['replace_colors']['palegreen'] = '#98FB98';
223
- $GLOBALS['csstidy']['replace_colors']['paleturquoise'] = '#AFEEEE';
224
- $GLOBALS['csstidy']['replace_colors']['palevioletred'] = '#D87093';
225
- $GLOBALS['csstidy']['replace_colors']['papayawhip'] = '#FFEFD5';
226
- $GLOBALS['csstidy']['replace_colors']['peachpuff'] = '#FFDAB9';
227
- $GLOBALS['csstidy']['replace_colors']['peru'] = '#CD853F';
228
- $GLOBALS['csstidy']['replace_colors']['pink'] = '#FFC0CB';
229
- $GLOBALS['csstidy']['replace_colors']['plum'] = '#DDA0DD';
230
- $GLOBALS['csstidy']['replace_colors']['powderblue'] = '#B0E0E6';
231
- $GLOBALS['csstidy']['replace_colors']['rosybrown'] = '#BC8F8F';
232
- $GLOBALS['csstidy']['replace_colors']['royalblue'] = '#4169E1';
233
- $GLOBALS['csstidy']['replace_colors']['saddlebrown'] = '#8B4513';
234
- $GLOBALS['csstidy']['replace_colors']['salmon'] = '#FA8072';
235
- $GLOBALS['csstidy']['replace_colors']['sandybrown'] = '#F4A460';
236
- $GLOBALS['csstidy']['replace_colors']['seagreen'] = '#2E8B57';
237
- $GLOBALS['csstidy']['replace_colors']['seashell'] = '#FFF5EE';
238
- $GLOBALS['csstidy']['replace_colors']['sienna'] = '#A0522D';
239
- $GLOBALS['csstidy']['replace_colors']['skyblue'] = '#87CEEB';
240
- $GLOBALS['csstidy']['replace_colors']['slateblue'] = '#6A5ACD';
241
- $GLOBALS['csstidy']['replace_colors']['slategray'] = '#708090';
242
- $GLOBALS['csstidy']['replace_colors']['snow'] = '#FFFAFA';
243
- $GLOBALS['csstidy']['replace_colors']['springgreen'] = '#00FF7F';
244
- $GLOBALS['csstidy']['replace_colors']['steelblue'] = '#4682B4';
245
- $GLOBALS['csstidy']['replace_colors']['tan'] = '#D2B48C';
246
- $GLOBALS['csstidy']['replace_colors']['thistle'] = '#D8BFD8';
247
- $GLOBALS['csstidy']['replace_colors']['tomato'] = '#FF6347';
248
- $GLOBALS['csstidy']['replace_colors']['turquoise'] = '#40E0D0';
249
- $GLOBALS['csstidy']['replace_colors']['violet'] = '#EE82EE';
250
- $GLOBALS['csstidy']['replace_colors']['violetred'] = '#D02090';
251
- $GLOBALS['csstidy']['replace_colors']['wheat'] = '#F5DEB3';
252
- $GLOBALS['csstidy']['replace_colors']['whitesmoke'] = '#F5F5F5';
253
- $GLOBALS['csstidy']['replace_colors']['yellowgreen'] = '#9ACD32';
254
-
255
-
256
- /**
257
- * A list of all shorthand properties that are devided into four properties and/or have four subvalues
258
- *
259
- * @global array $GLOBALS['csstidy']['shorthands']
260
- * @todo Are there new ones in CSS3?
261
- * @see dissolve_4value_shorthands()
262
- * @see merge_4value_shorthands()
263
- * @version 1.0
264
- */
265
- $GLOBALS['csstidy']['shorthands'] = array();
266
- $GLOBALS['csstidy']['shorthands']['border-color'] = array('border-top-color','border-right-color','border-bottom-color','border-left-color');
267
- $GLOBALS['csstidy']['shorthands']['border-style'] = array('border-top-style','border-right-style','border-bottom-style','border-left-style');
268
- $GLOBALS['csstidy']['shorthands']['border-width'] = array('border-top-width','border-right-width','border-bottom-width','border-left-width');
269
- $GLOBALS['csstidy']['shorthands']['margin'] = array('margin-top','margin-right','margin-bottom','margin-left');
270
- $GLOBALS['csstidy']['shorthands']['padding'] = array('padding-top','padding-right','padding-bottom','padding-left');
271
- $GLOBALS['csstidy']['shorthands']['-moz-border-radius'] = 0;
272
-
273
- /**
274
- * All CSS Properties. Needed for csstidy::property_is_next()
275
- *
276
- * @global array $GLOBALS['csstidy']['all_properties']
277
- * @todo Add CSS3 properties
278
- * @version 1.0
279
- * @see csstidy::property_is_next()
280
- */
281
- $GLOBALS['csstidy']['all_properties'] = array();
282
- $GLOBALS['csstidy']['all_properties']['background'] = 'CSS1.0,CSS2.0,CSS2.1';
283
- $GLOBALS['csstidy']['all_properties']['background-color'] = 'CSS1.0,CSS2.0,CSS2.1';
284
- $GLOBALS['csstidy']['all_properties']['background-image'] = 'CSS1.0,CSS2.0,CSS2.1';
285
- $GLOBALS['csstidy']['all_properties']['background-repeat'] = 'CSS1.0,CSS2.0,CSS2.1';
286
- $GLOBALS['csstidy']['all_properties']['background-attachment'] = 'CSS1.0,CSS2.0,CSS2.1';
287
- $GLOBALS['csstidy']['all_properties']['background-position'] = 'CSS1.0,CSS2.0,CSS2.1';
288
- $GLOBALS['csstidy']['all_properties']['border'] = 'CSS1.0,CSS2.0,CSS2.1';
289
- $GLOBALS['csstidy']['all_properties']['border-top'] = 'CSS1.0,CSS2.0,CSS2.1';
290
- $GLOBALS['csstidy']['all_properties']['border-right'] = 'CSS1.0,CSS2.0,CSS2.1';
291
- $GLOBALS['csstidy']['all_properties']['border-bottom'] = 'CSS1.0,CSS2.0,CSS2.1';
292
- $GLOBALS['csstidy']['all_properties']['border-left'] = 'CSS1.0,CSS2.0,CSS2.1';
293
- $GLOBALS['csstidy']['all_properties']['border-color'] = 'CSS1.0,CSS2.0,CSS2.1';
294
- $GLOBALS['csstidy']['all_properties']['border-top-color'] = 'CSS2.0,CSS2.1';
295
- $GLOBALS['csstidy']['all_properties']['border-bottom-color'] = 'CSS2.0,CSS2.1';
296
- $GLOBALS['csstidy']['all_properties']['border-left-color'] = 'CSS2.0,CSS2.1';
297
- $GLOBALS['csstidy']['all_properties']['border-right-color'] = 'CSS2.0,CSS2.1';
298
- $GLOBALS['csstidy']['all_properties']['border-style'] = 'CSS1.0,CSS2.0,CSS2.1';
299
- $GLOBALS['csstidy']['all_properties']['border-top-style'] = 'CSS2.0,CSS2.1';
300
- $GLOBALS['csstidy']['all_properties']['border-right-style'] = 'CSS2.0,CSS2.1';
301
- $GLOBALS['csstidy']['all_properties']['border-left-style'] = 'CSS2.0,CSS2.1';
302
- $GLOBALS['csstidy']['all_properties']['border-bottom-style'] = 'CSS2.0,CSS2.1';
303
- $GLOBALS['csstidy']['all_properties']['border-width'] = 'CSS1.0,CSS2.0,CSS2.1';
304
- $GLOBALS['csstidy']['all_properties']['border-top-width'] = 'CSS1.0,CSS2.0,CSS2.1';
305
- $GLOBALS['csstidy']['all_properties']['border-right-width'] = 'CSS1.0,CSS2.0,CSS2.1';
306
- $GLOBALS['csstidy']['all_properties']['border-left-width'] = 'CSS1.0,CSS2.0,CSS2.1';
307
- $GLOBALS['csstidy']['all_properties']['border-bottom-width'] = 'CSS1.0,CSS2.0,CSS2.1';
308
- $GLOBALS['csstidy']['all_properties']['border-collapse'] = 'CSS2.0,CSS2.1';
309
- $GLOBALS['csstidy']['all_properties']['border-spacing'] = 'CSS2.0,CSS2.1';
310
- $GLOBALS['csstidy']['all_properties']['bottom'] = 'CSS2.0,CSS2.1';
311
- $GLOBALS['csstidy']['all_properties']['caption-side'] = 'CSS2.0,CSS2.1';
312
- $GLOBALS['csstidy']['all_properties']['content'] = 'CSS2.0,CSS2.1';
313
- $GLOBALS['csstidy']['all_properties']['clear'] = 'CSS1.0,CSS2.0,CSS2.1';
314
- $GLOBALS['csstidy']['all_properties']['clip'] = 'CSS1.0,CSS2.0,CSS2.1';
315
- $GLOBALS['csstidy']['all_properties']['color'] = 'CSS1.0,CSS2.0,CSS2.1';
316
- $GLOBALS['csstidy']['all_properties']['counter-reset'] = 'CSS2.0,CSS2.1';
317
- $GLOBALS['csstidy']['all_properties']['counter-increment'] = 'CSS2.0,CSS2.1';
318
- $GLOBALS['csstidy']['all_properties']['cursor'] = 'CSS2.0,CSS2.1';
319
- $GLOBALS['csstidy']['all_properties']['empty-cells'] = 'CSS2.0,CSS2.1';
320
- $GLOBALS['csstidy']['all_properties']['display'] = 'CSS1.0,CSS2.0,CSS2.1';
321
- $GLOBALS['csstidy']['all_properties']['direction'] = 'CSS2.0,CSS2.1';
322
- $GLOBALS['csstidy']['all_properties']['float'] = 'CSS1.0,CSS2.0,CSS2.1';
323
- $GLOBALS['csstidy']['all_properties']['font'] = 'CSS1.0,CSS2.0,CSS2.1';
324
- $GLOBALS['csstidy']['all_properties']['font-family'] = 'CSS1.0,CSS2.0,CSS2.1';
325
- $GLOBALS['csstidy']['all_properties']['font-style'] = 'CSS1.0,CSS2.0,CSS2.1';
326
- $GLOBALS['csstidy']['all_properties']['font-variant'] = 'CSS1.0,CSS2.0,CSS2.1';
327
- $GLOBALS['csstidy']['all_properties']['font-weight'] = 'CSS1.0,CSS2.0,CSS2.1';
328
- $GLOBALS['csstidy']['all_properties']['font-stretch'] = 'CSS2.0';
329
- $GLOBALS['csstidy']['all_properties']['font-size-adjust'] = 'CSS2.0';
330
- $GLOBALS['csstidy']['all_properties']['font-size'] = 'CSS1.0,CSS2.0,CSS2.1';
331
- $GLOBALS['csstidy']['all_properties']['height'] = 'CSS1.0,CSS2.0,CSS2.1';
332
- $GLOBALS['csstidy']['all_properties']['left'] = 'CSS1.0,CSS2.0,CSS2.1';
333
- $GLOBALS['csstidy']['all_properties']['line-height'] = 'CSS1.0,CSS2.0,CSS2.1';
334
- $GLOBALS['csstidy']['all_properties']['list-style'] = 'CSS1.0,CSS2.0,CSS2.1';
335
- $GLOBALS['csstidy']['all_properties']['list-style-type'] = 'CSS1.0,CSS2.0,CSS2.1';
336
- $GLOBALS['csstidy']['all_properties']['list-style-image'] = 'CSS1.0,CSS2.0,CSS2.1';
337
- $GLOBALS['csstidy']['all_properties']['list-style-position'] = 'CSS1.0,CSS2.0,CSS2.1';
338
- $GLOBALS['csstidy']['all_properties']['margin'] = 'CSS1.0,CSS2.0,CSS2.1';
339
- $GLOBALS['csstidy']['all_properties']['margin-top'] = 'CSS1.0,CSS2.0,CSS2.1';
340
- $GLOBALS['csstidy']['all_properties']['margin-right'] = 'CSS1.0,CSS2.0,CSS2.1';
341
- $GLOBALS['csstidy']['all_properties']['margin-bottom'] = 'CSS1.0,CSS2.0,CSS2.1';
342
- $GLOBALS['csstidy']['all_properties']['margin-left'] = 'CSS1.0,CSS2.0,CSS2.1';
343
- $GLOBALS['csstidy']['all_properties']['marks'] = 'CSS1.0,CSS2.0';
344
- $GLOBALS['csstidy']['all_properties']['marker-offset'] = 'CSS2.0';
345
- $GLOBALS['csstidy']['all_properties']['max-height'] = 'CSS2.0,CSS2.1';
346
- $GLOBALS['csstidy']['all_properties']['max-width'] = 'CSS2.0,CSS2.1';
347
- $GLOBALS['csstidy']['all_properties']['min-height'] = 'CSS2.0,CSS2.1';
348
- $GLOBALS['csstidy']['all_properties']['min-width'] = 'CSS2.0,CSS2.1';
349
- $GLOBALS['csstidy']['all_properties']['overflow'] = 'CSS1.0,CSS2.0,CSS2.1';
350
- $GLOBALS['csstidy']['all_properties']['orphans'] = 'CSS2.0,CSS2.1';
351
- $GLOBALS['csstidy']['all_properties']['outline'] = 'CSS2.0,CSS2.1';
352
- $GLOBALS['csstidy']['all_properties']['outline-width'] = 'CSS2.0,CSS2.1';
353
- $GLOBALS['csstidy']['all_properties']['outline-style'] = 'CSS2.0,CSS2.1';
354
- $GLOBALS['csstidy']['all_properties']['outline-color'] = 'CSS2.0,CSS2.1';
355
- $GLOBALS['csstidy']['all_properties']['padding'] = 'CSS1.0,CSS2.0,CSS2.1';
356
- $GLOBALS['csstidy']['all_properties']['padding-top'] = 'CSS1.0,CSS2.0,CSS2.1';
357
- $GLOBALS['csstidy']['all_properties']['padding-right'] = 'CSS1.0,CSS2.0,CSS2.1';
358
- $GLOBALS['csstidy']['all_properties']['padding-bottom'] = 'CSS1.0,CSS2.0,CSS2.1';
359
- $GLOBALS['csstidy']['all_properties']['padding-left'] = 'CSS1.0,CSS2.0,CSS2.1';
360
- $GLOBALS['csstidy']['all_properties']['page-break-before'] = 'CSS1.0,CSS2.0,CSS2.1';
361
- $GLOBALS['csstidy']['all_properties']['page-break-after'] = 'CSS1.0,CSS2.0,CSS2.1';
362
- $GLOBALS['csstidy']['all_properties']['page-break-inside'] = 'CSS2.0,CSS2.1';
363
- $GLOBALS['csstidy']['all_properties']['page'] = 'CSS2.0';
364
- $GLOBALS['csstidy']['all_properties']['position'] = 'CSS1.0,CSS2.0,CSS2.1';
365
- $GLOBALS['csstidy']['all_properties']['quotes'] = 'CSS2.0,CSS2.1';
366
- $GLOBALS['csstidy']['all_properties']['right'] = 'CSS2.0,CSS2.1';
367
- $GLOBALS['csstidy']['all_properties']['size'] = 'CSS1.0,CSS2.0';
368
- $GLOBALS['csstidy']['all_properties']['speak-header'] = 'CSS2.0,CSS2.1';
369
- $GLOBALS['csstidy']['all_properties']['table-layout'] = 'CSS2.0,CSS2.1';
370
- $GLOBALS['csstidy']['all_properties']['top'] = 'CSS1.0,CSS2.0,CSS2.1';
371
- $GLOBALS['csstidy']['all_properties']['text-indent'] = 'CSS1.0,CSS2.0,CSS2.1';
372
- $GLOBALS['csstidy']['all_properties']['text-align'] = 'CSS1.0,CSS2.0,CSS2.1';
373
- $GLOBALS['csstidy']['all_properties']['text-decoration'] = 'CSS1.0,CSS2.0,CSS2.1';
374
- $GLOBALS['csstidy']['all_properties']['text-shadow'] = 'CSS2.0';
375
- $GLOBALS['csstidy']['all_properties']['letter-spacing'] = 'CSS1.0,CSS2.0,CSS2.1';
376
- $GLOBALS['csstidy']['all_properties']['word-spacing'] = 'CSS1.0,CSS2.0,CSS2.1';
377
- $GLOBALS['csstidy']['all_properties']['text-transform'] = 'CSS1.0,CSS2.0,CSS2.1';
378
- $GLOBALS['csstidy']['all_properties']['white-space'] = 'CSS1.0,CSS2.0,CSS2.1';
379
- $GLOBALS['csstidy']['all_properties']['unicode-bidi'] = 'CSS2.0,CSS2.1';
380
- $GLOBALS['csstidy']['all_properties']['vertical-align'] = 'CSS1.0,CSS2.0,CSS2.1';
381
- $GLOBALS['csstidy']['all_properties']['visibility'] = 'CSS1.0,CSS2.0,CSS2.1';
382
- $GLOBALS['csstidy']['all_properties']['width'] = 'CSS1.0,CSS2.0,CSS2.1';
383
- $GLOBALS['csstidy']['all_properties']['widows'] = 'CSS2.0,CSS2.1';
384
- $GLOBALS['csstidy']['all_properties']['z-index'] = 'CSS1.0,CSS2.0,CSS2.1';
385
- /* Speech */
386
- $GLOBALS['csstidy']['all_properties']['volume'] = 'CSS2.0,CSS2.1';
387
- $GLOBALS['csstidy']['all_properties']['speak'] = 'CSS2.0,CSS2.1';
388
- $GLOBALS['csstidy']['all_properties']['pause'] = 'CSS2.0,CSS2.1';
389
- $GLOBALS['csstidy']['all_properties']['pause-before'] = 'CSS2.0,CSS2.1';
390
- $GLOBALS['csstidy']['all_properties']['pause-after'] = 'CSS2.0,CSS2.1';
391
- $GLOBALS['csstidy']['all_properties']['cue'] = 'CSS2.0,CSS2.1';
392
- $GLOBALS['csstidy']['all_properties']['cue-before'] = 'CSS2.0,CSS2.1';
393
- $GLOBALS['csstidy']['all_properties']['cue-after'] = 'CSS2.0,CSS2.1';
394
- $GLOBALS['csstidy']['all_properties']['play-during'] = 'CSS2.0,CSS2.1';
395
- $GLOBALS['csstidy']['all_properties']['azimuth'] = 'CSS2.0,CSS2.1';
396
- $GLOBALS['csstidy']['all_properties']['elevation'] = 'CSS2.0,CSS2.1';
397
- $GLOBALS['csstidy']['all_properties']['speech-rate'] = 'CSS2.0,CSS2.1';
398
- $GLOBALS['csstidy']['all_properties']['voice-family'] = 'CSS2.0,CSS2.1';
399
- $GLOBALS['csstidy']['all_properties']['pitch'] = 'CSS2.0,CSS2.1';
400
- $GLOBALS['csstidy']['all_properties']['pitch-range'] = 'CSS2.0,CSS2.1';
401
- $GLOBALS['csstidy']['all_properties']['stress'] = 'CSS2.0,CSS2.1';
402
- $GLOBALS['csstidy']['all_properties']['richness'] = 'CSS2.0,CSS2.1';
403
- $GLOBALS['csstidy']['all_properties']['speak-punctuation'] = 'CSS2.0,CSS2.1';
404
- $GLOBALS['csstidy']['all_properties']['speak-numeral'] = 'CSS2.0,CSS2.1';
405
-
406
- /**
407
- * An array containing all predefined templates.
408
- *
409
- * @global array $GLOBALS['csstidy']['predefined_templates']
410
- * @version 1.0
411
- * @see csstidy::load_template()
412
- */
413
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="at">'; //string before @rule
414
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>'."\n"; //bracket after @-rule
415
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="selector">'; //string before selector
416
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>'."\n"; //bracket after selector
417
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="property">'; //string before property
418
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span><span class="value">'; //string after property+before value
419
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span><span class="format">;</span>'."\n"; //string after value
420
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="format">}</span>'; //closing bracket - selector
421
- $GLOBALS['csstidy']['predefined_templates']['default'][] = "\n\n"; //space between blocks {...}
422
- $GLOBALS['csstidy']['predefined_templates']['default'][] = "\n".'<span class="format">}</span>'. "\n\n"; //closing bracket @-rule
423
- $GLOBALS['csstidy']['predefined_templates']['default'][] = ''; //indent in @-rule
424
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="comment">'; // before comment
425
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span>'."\n"; // after comment
426
- $GLOBALS['csstidy']['predefined_templates']['default'][] = "\n"; // after last line @-rule
427
-
428
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="at">';
429
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span> <span class="format">{</span>'."\n";
430
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="selector">';
431
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">{</span>';
432
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="property">';
433
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="value">';
434
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">;</span>';
435
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="format">}</span>';
436
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n";
437
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n". '<span class="format">}'."\n".'</span>';
438
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '';
439
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="comment">'; // before comment
440
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span>'; // after comment
441
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n";
442
-
443
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="at">';
444
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>';
445
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="selector">';
446
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>';
447
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="property">';
448
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="value">';
449
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">;</span>';
450
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>';
451
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
452
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>';
453
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
454
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="comment">'; // before comment
455
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span>'; // after comment
456
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
457
-
458
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="at">';
459
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span> <span class="format">{</span>'."\n";
460
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="selector">';
461
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span>'."\n".'<span class="format">{</span>'."\n";
462
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ' <span class="property">';
463
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="value">';
464
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="format">;</span>'."\n";
465
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="format">}</span>';
466
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n\n";
467
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n".'<span class="format">}</span>'."\n\n";
468
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ' ';
469
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="comment">'; // before comment
470
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span>'."\n"; // after comment
471
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n";
472
-
473
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/CSSTidy/lang.inc.php DELETED
@@ -1,238 +0,0 @@
1
- <?php
2
- if(isset($_GET['lang'])) {
3
- $l = $_GET['lang'];
4
- } else {
5
- $l = getenv('HTTP_ACCEPT_LANGUAGE');
6
- $l = strtolower(substr($l,0,2));
7
- }
8
- $l = ($l == 'de' || $l == 'fr' || $l == 'zh') ? $l : 'en';
9
-
10
- $lang = array();
11
- $lang['en'][0] = 'CSS Formatter and Optimiser/Optimizer (based on CSSTidy ';
12
- $lang['de'][0] = 'CSS Formatierer und Optimierer (basierend auf CSSTidy ';
13
- $lang['en'][1] = 'CSS Formatter and Optimiser';
14
- $lang['de'][1] = 'CSS Formatierer und Optimierer';
15
- $lang['en'][2] = '(based on';
16
- $lang['de'][2] = '(basierend auf';
17
- $lang['en'][3] = '(plaintext)';
18
- $lang['de'][3] = '(Textversion)';
19
- $lang['en'][4] = 'Important Note:';
20
- $lang['de'][4] = 'Wichtiger Hinweis:';
21
- $lang['en'][6] = 'Your code should be well-formed. This is <strong>no validator</strong> which points out errors in your CSS code. To make sure that your code is valid, use the <a href="http://jigsaw.w3.org/css-validator/">W3C Validator</a>.';
22
- $lang['de'][6] = 'Der CSS Code sollte wohlgeformt sein. Der CSS Code wird <strong>nicht auf Gültigkeit überprüft</strong>. Um sicherzugehen dass dein Code valide ist, benutze den <a href="http://jigsaw.w3.org/css-validator/">W3C Validierungsservice</a>.';
23
- $lang['en'][7] = 'all comments are removed';
24
- $lang['de'][7] = 'alle Kommentare werden entfernt';
25
- $lang['en'][8] = 'CSS Input:';
26
- $lang['de'][8] = 'CSS Eingabe:';
27
- $lang['en'][9] = 'CSS-Code:';
28
- $lang['de'][9] = 'CSS-Code:';
29
- $lang['en'][10] = 'CSS from URL:';
30
- $lang['de'][10] = 'CSS von URL:';
31
- $lang['en'][11] = 'Code Layout:';
32
- $lang['de'][11] = 'Code Layout:';
33
- $lang['en'][12] = 'Compression&nbsp;(code&nbsp;layout):';
34
- $lang['de'][12] = 'Komprimierung&nbsp;(Code&nbsp;Layout):';
35
- $lang['en'][13] = 'Highest (no readability, smallest size)';
36
- $lang['de'][13] = 'Höchste (keine Lesbarkeit, niedrigste Größe)';
37
- $lang['en'][14] = 'High (moderate readability, smaller size)';
38
- $lang['de'][14] = 'Hoch (mittelmäßige Lesbarkeit, geringe Größe)';
39
- $lang['en'][15] = 'Standard (balance between readability and size)';
40
- $lang['de'][15] = 'Standard (Kompromiss zwischen Lesbarkeit und Größe)';
41
- $lang['en'][16] = 'Low (higher readability)';
42
- $lang['de'][16] = 'Niedrig (höhere Lesbarkeit)';
43
- $lang['en'][17] = 'Custom (enter below)';
44
- $lang['de'][17] = 'Benutzerdefiniert (unten eingeben)';
45
- $lang['en'][18] = 'Custom <a href="http://csstidy.sourceforge.net/templates.php">template</a>';
46
- $lang['de'][18] = 'Benutzerdefinierte <a href="http://csstidy.sourceforge.net/templates.php">Vorlage</a>';
47
- $lang['en'][19] = 'Options';
48
- $lang['de'][19] = 'Optionen';
49
- $lang['en'][20] = 'Sort Selectors (caution)';
50
- $lang['de'][20] = 'Selektoren sortieren (Vorsicht)';
51
- $lang['en'][21] = 'Sort Properties';
52
- $lang['de'][21] = 'Eigenschaften sortieren';
53
- $lang['en'][22] = 'Regroup selectors';
54
- $lang['de'][22] = 'Selektoren umgruppieren';
55
- $lang['en'][23] = 'Optimise shorthands';
56
- $lang['de'][23] = 'Shorthands optimieren';
57
- $lang['en'][24] = 'Compress colors';
58
- $lang['de'][24] = 'Farben komprimieren';
59
- $lang['en'][25] = 'Lowercase selectors';
60
- $lang['de'][25] = 'Selektoren in Kleinbuchstaben';
61
- $lang['en'][26] = 'Case for properties:';
62
- $lang['de'][26] = 'Groß-/Kleinschreibung für Eigenschaften';
63
- $lang['en'][27] = 'Lowercase';
64
- $lang['de'][27] = 'Kleinbuchstaben';
65
- $lang['en'][28] = 'No or invalid CSS input or wrong URL!';
66
- $lang['de'][28] = 'Keine oder ungültige CSS Eingabe oder falsche URL!';
67
- $lang['en'][29] = 'Uppercase';
68
- $lang['de'][29] = 'Großbuchstaben';
69
- $lang['en'][30] = 'lowercase elementnames needed for XHTML';
70
- $lang['de'][30] = 'kleingeschriebene Elementnamen benötigt für XHTML';
71
- $lang['en'][31] = 'Remove unnecessary backslashes';
72
- $lang['de'][31] = 'Unnötige Backslashes entfernen';
73
- $lang['en'][32] = 'convert !important-hack';
74
- $lang['de'][32] = '!important-Hack konvertieren';
75
- $lang['en'][33] = 'Output as file';
76
- $lang['de'][33] = 'Als Datei ausgeben';
77
- $lang['en'][34] = 'Bigger compression because of smaller newlines (copy &amp; paste doesn\'t work)';
78
- $lang['de'][34] = 'Größere Komprimierung augrund von kleineren Neuezeile-Zeichen';
79
- $lang['en'][35] = 'Process CSS';
80
- $lang['de'][35] = 'CSS verarbeiten';
81
- $lang['en'][36] = 'Compression Ratio';
82
- $lang['de'][36] = 'Komprimierungsrate';
83
- $lang['en'][37] = 'Input';
84
- $lang['de'][37] = 'Eingabe';
85
- $lang['en'][38] = 'Output';
86
- $lang['de'][38] = 'Ausgabe';
87
- $lang['en'][39] = 'Language';
88
- $lang['de'][39] = 'Sprache';
89
- $lang['en'][41] = 'Attention: This may change the behaviour of your CSS Code!';
90
- $lang['de'][41] = 'Achtung: Dies könnte das Verhalten ihres CSS-Codes verändern!';
91
- $lang['en'][42] = 'Remove last ;';
92
- $lang['de'][42] = 'Letztes ; entfernen';
93
- $lang['en'][43] = 'Discard invalid properties';
94
- $lang['de'][43] = 'Ungültige Eigenschaften entfernen';
95
- $lang['en'][44] = 'Only safe optimisations';
96
- $lang['de'][44] = 'Nur sichere Optimierungen';
97
- $lang['en'][45] = 'Compress font-weight';
98
- $lang['de'][45] = 'font-weight komprimieren';
99
- $lang['en'][46] = 'Save comments';
100
- $lang['de'][46] = 'Kommentare beibehalten';
101
- $lang['en'][47] = 'Do not change anything';
102
- $lang['en'][48] = 'Only seperate selectors (split at ,)';
103
- $lang['en'][49] = 'Merge selectors with the same properties (fast)';
104
- $lang['en'][50] = 'Merge selectors intelligently (slow)';
105
- $lang['de'][47] = 'Nichts ändern';
106
- $lang['de'][48] = 'Selektoren nur trennen (am Komma)';
107
- $lang['de'][49] = 'Selektoren mit gleichen Eigenschaften zusammenfassen (schnell)';
108
- $lang['de'][50] = 'Selektoren intelligent zusammenfassen (langsam!)';
109
- $lang['en'][51] = 'Preserve CSS';
110
- $lang['de'][51] = 'CSS erhalten';
111
- $lang['en'][52] = 'Save comments, hacks, etc. Most optimisations can *not* be applied if this is enabled.';
112
- $lang['de'][52] = 'Kommentare, Hacks, etc. speichern. Viele Optimierungen sind dann aber nicht mehr möglich.';
113
- $lang['en'][53] = 'None';
114
- $lang['de'][53] = 'Keine';
115
- $lang['en'][54] = 'Don\'t optimise';
116
- $lang['de'][54] = 'Nicht optimieren';
117
- $lang['en'][55] = 'Safe optimisations';
118
- $lang['de'][55] = 'Sichere Optimierungen';
119
- $lang['en'][56] = 'All optimisations';
120
- $lang['de'][56] = 'Alle Optimierungen';
121
- $lang['en'][57] = 'Add timestamp';
122
- $lang['de'][57] = 'Zeitstempel hinzufügen';
123
-
124
- $lang['fr'][0] = 'CSS Formatteur et Optimiseur (basé sur CSSTidy ';
125
- $lang['fr'][1] = 'CSS Formatteur et Optimiseur';
126
- $lang['fr'][2] = '(basé sur ';
127
- $lang['fr'][3] = '(Version Text)';
128
- $lang['fr'][4] = 'notes Importantes:';
129
- $lang['fr'][5] = 'les mêmes sélecteurs et les propriétés sont automatiquement fusionnés';
130
- $lang['fr'][6] = 'votre code doit être Valide. Ce n\'est <strong>pas un validateur</strong> qui signale des erreurs dans votre code de CSS. Assurez-vous que votre code est correct en utilisant le le validateur : <a href="http://jigsaw.w3.org/css-validator/">W3C Validator</a>';
131
- $lang['fr'][7] = 'tous les commentaires sont enlevés';
132
- $lang['fr'][8] = 'Champ CSS:';
133
- $lang['fr'][9] = 'CSS-Code:';
134
- $lang['fr'][10] = 'CSS en provenance d\'une URL:<br />';
135
- $lang['fr'][11] = 'Mise en page du code:';
136
- $lang['fr'][12] = 'Compression (Mise en page du code):';
137
- $lang['fr'][13] = 'Le plus compact (aucune lisibilité, plus petite taille)';
138
- $lang['fr'][14] = 'Trés compact (lisibilité modérée, plus petite taille)';
139
- $lang['fr'][15] = 'Normale (équilibre entre la lisibilité et la taille)';
140
- $lang['fr'][16] = 'Peu compact (une lisibilité plus élevée)';
141
- $lang['fr'][17] = 'Sur mesure (entrer ci-dessous)';
142
- $lang['fr'][18] = 'Sur mesure <a href="http://csstidy.sourceforge.net/templates.php">Gabarit</a>';
143
- $lang['fr'][19] = 'Options';
144
- $lang['fr'][20] = 'Trier les sélecteurs (attention)';
145
- $lang['fr'][21] = 'Trier les propriétés';
146
- $lang['fr'][22] = 'Fusionner les sélecteurs';
147
- $lang['fr'][23] = 'Optimise shorthands';
148
- $lang['fr'][24] = 'Compresser les couleurs';
149
- $lang['fr'][25] = 'Sélecteurs en minuscules';
150
- $lang['fr'][26] = 'Cases (Minuscules &amp; Majuscule) pour les propriétés:';
151
- $lang['fr'][27] = 'Minuscules';
152
- $lang['fr'][28] = 'CSS non valide ou URL incorrecte!';
153
- $lang['fr'][29] = 'Majuscule';
154
- $lang['fr'][30] = 'les noms des éléments en minuscules (indispensables pour XHTML)';
155
- $lang['fr'][31] = 'enlever les antislashs inutiles';
156
- $lang['fr'][32] = 'convertir !important-hack';
157
- $lang['fr'][33] = 'Sauver en tant que fichier';
158
- $lang['fr'][34] = 'Une plus grande compression en raison de plus petits caractères';
159
- $lang['fr'][35] = 'Compresser le CSS';
160
- $lang['fr'][36] = 'Facteur de Compression';
161
- $lang['fr'][37] = 'Entrée';
162
- $lang['fr'][38] = 'Sortie';
163
- $lang['fr'][39] = 'Language';
164
- $lang['fr'][41] = 'Attention : ceci peut changer le comportement de votre code de CSS !';
165
- $lang['fr'][42] = 'Enlever le dernier ;';
166
- $lang['fr'][43] = 'Supprimer les propriétés non valide';
167
- $lang['fr'][44] = 'Seulement les optimisations sûres';
168
- $lang['fr'][45] = 'Compresser font-weight';
169
- $lang['fr'][46] = 'Sauvegarder les commentaires ';
170
- $lang['fr'][47] = 'Ne changer rien';
171
- $lang['fr'][48] = 'Sépare les sélecteurs (sépare au niveau de ,)';
172
- $lang['fr'][49] = 'Fusionne les sélecteurs avec les mêmes propriétés (rapides)';
173
- $lang['fr'][50] = 'Fusionne les sélecteurs intelligemment (lent)';
174
- $lang['fr'][51] = 'Preserve CSS';
175
- $lang['fr'][52] = 'Save comments, hacks, etc. Most optimisations can *not* be applied if this is enabled.';
176
- $lang['fr'][53] = 'None';
177
- $lang['fr'][54] = 'Don\'t optimise';
178
- $lang['fr'][55] = 'Safe optimisations';
179
- $lang['fr'][56] = 'All optimisations';
180
- $lang['fr'][57] = 'Add timestamp';
181
-
182
- $lang['zh'][0] = 'CSS整形與最佳化工具(使用 CSSTidy ';
183
- $lang['zh'][1] = 'CSS整形與最佳化工具';
184
- $lang['zh'][2] = '(使用';
185
- $lang['zh'][3] = '(純文字)';
186
- $lang['zh'][4] = '重要事項:';
187
- $lang['zh'][6] = '你的原始碼必須是良構的(well-formed). 這個工具<strong>沒有內建驗證器(validator)</strong>. 驗證器能夠指出你CSS原始碼裡的錯誤. 請使用 <a href="http://jigsaw.w3.org/css-validator/">W3C 驗證器</a>, 確保你的原始碼合乎規範.';
188
- $lang['zh'][7] = '所有註解都移除了';
189
- $lang['zh'][8] = 'CSS 輸入:';
190
- $lang['zh'][9] = 'CSS 原始碼:';
191
- $lang['zh'][10] = 'CSS 檔案網址(URL):';
192
- $lang['zh'][11] = '原始碼規劃:';
193
- $lang['zh'][12] = '壓縮程度(原始碼規劃):';
194
- $lang['zh'][13] = '最高 (沒有辦法讀, 檔案最小)';
195
- $lang['zh'][14] = '高 (適度的可讀性, 檔案小)';
196
- $lang['zh'][15] = '標準 (兼顧可讀性與檔案大小)';
197
- $lang['zh'][16] = '低 (注重可讀性)';
198
- $lang['zh'][17] = '自訂 (在下方設定)';
199
- $lang['zh'][18] = '自訂<a href="http://csstidy.sourceforge.net/templates.php">樣板</a>';
200
- $lang['zh'][19] = '選項';
201
- $lang['zh'][20] = '整理選擇符(請謹慎使用)';
202
- $lang['zh'][21] = '整理屬性';
203
- $lang['zh'][22] = '重組選擇符';
204
- $lang['zh'][23] = '速記法(shorthand)最佳化';
205
- $lang['zh'][24] = '壓縮色彩語法';
206
- $lang['zh'][25] = '改用小寫選擇符';
207
- $lang['zh'][26] = '屬性的字形:';
208
- $lang['zh'][27] = '小寫';
209
- $lang['zh'][28] = '沒有輸入CSS, 語法不符合規定, 或是網址錯誤!';
210
- $lang['zh'][29] = '大寫';
211
- $lang['zh'][30] = 'XHTML必須使用小寫的元素名稱';
212
- $lang['zh'][31] = '移除不必要的反斜線';
213
- $lang['zh'][32] = '轉換 !important-hack';
214
- $lang['zh'][33] = '輸出成檔案形式';
215
- $lang['zh'][34] = '由於比較少換行字元, 會有更大的壓縮比率(複製&amp;貼上沒有用)';
216
- $lang['zh'][35] = '執行';
217
- $lang['zh'][36] = '壓縮比率';
218
- $lang['zh'][37] = '輸入';
219
- $lang['zh'][38] = '輸出';
220
- $lang['zh'][39] = '語言';
221
- $lang['zh'][41] = '注意: 這或許會變更你CSS原始碼的行為!';
222
- $lang['zh'][42] = '除去最後一個分號';
223
- $lang['zh'][43] = '拋棄不符合規定的屬性';
224
- $lang['zh'][44] = '只安全地最佳化';
225
- $lang['zh'][45] = '壓縮 font-weight';
226
- $lang['zh'][46] = '保留註解';
227
- $lang['zh'][47] = '什麼都不要改';
228
- $lang['zh'][48] = '只分開原本用逗號分隔的選擇符';
229
- $lang['zh'][49] = '合併有相同屬性的選擇符(快速)';
230
- $lang['zh'][50] = '聰明地合併選擇符(慢速)';
231
- $lang['zh'][51] = '保護CSS';
232
- $lang['zh'][52] = '保留註解與 hack 等等. 如果啟用這個選項, 大多數的最佳化程序都不會執行.';
233
- $lang['zh'][53] = '不改變';
234
- $lang['zh'][54] = '不做最佳化';
235
- $lang['zh'][55] = '安全地最佳化';
236
- $lang['zh'][56] = '全部最佳化';
237
- $lang['zh'][57] = '加上時間戳記';
238
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/ewd-ufaq-post-edit-styles.css DELETED
@@ -1,30 +0,0 @@
1
- /*********************************
2
- NEED HELP BOX ON FAQ EDIT SCREEN
3
- *********************************/
4
- .ewd-ufaq-need-help-text {
5
- margin: 24px 0 22px;
6
- text-align: center;
7
- color: #888;
8
- font-size: 15px;
9
- line-height: 1.5;
10
- }
11
- .ewd-ufaq-need-help-button {
12
- display: inherit;
13
- width: 70%;
14
- padding: 8px 0;
15
- margin: 0 15% 16px;
16
- text-align: center;
17
- background: #f2b52f;
18
- color: #fff;
19
- font-size: 16px;
20
- font-weight: bold;
21
- text-decoration: none;
22
- }
23
- .ewd-ufaq-need-help-button:hover {
24
- background: #d7a73f;
25
- color: #fff;
26
- text-decoration: none;
27
- }
28
-
29
-
30
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ewd-ufaq-templates/faq-answer.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <div class='ewd-ufaq-post-margin ewd-ufaq-faq-post'>
2
+ <?php echo $this->faq_answer; ?>
3
+ </div>
ewd-ufaq-templates/faq-author-date.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-author-date'>
2
+
3
+ <?php echo esc_html( $this->get_label( 'label-posted' ) ); ?>
4
+
5
+ <?php $this->maybe_print_author(); ?>
6
+
7
+ <?php $this->maybe_print_date(); ?>
8
+
9
+ </div>
ewd-ufaq-templates/faq-author.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php echo esc_html( $this->get_label( 'label-by' ) ); ?>
2
+
3
+ <span class='ewd-ufaq-author'>
4
+ <?php echo $this->faq_author; ?>
5
+ </span>
ewd-ufaq-templates/faq-back-to-top.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-back-to-top'>
2
+
3
+ <a class='ewd-ufaq-back-to-top-link'>
4
+ <?php echo esc_html( $this->get_label( 'label-back-to-top' ) ); ?>
5
+ </a>
6
+
7
+ </div>
ewd-ufaq-templates/faq-categories.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-faq-categories'>
2
+
3
+ <?php echo esc_html( $this->get_categories_label() ); ?>
4
+
5
+ <?php foreach( $this->categories as $key => $category ) { ?>
6
+
7
+ <?php echo $this->get_category_value( $category ) . ( $key != sizeOf( $this->categories ) - 1 ? ', ' : '' ); ?>
8
+
9
+ <?php } ?>
10
+
11
+ </div>
ewd-ufaq-templates/faq-custom-fields.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-faq-custom-fields'>
2
+
3
+ <?php foreach ( $this->get_custom_fields() as $custom_field ) {?>
4
+
5
+ <?php $value = $this->get_custom_field_value( $custom_field ); ?>
6
+
7
+ <?php if ( $this->get_option( 'hide-blank-fields' ) and ! $value ) { continue; } ?>
8
+
9
+ <div class='ewd-ufaq-custom-field-label'>
10
+ <?php echo esc_html( $custom_field->name ); ?>:
11
+ </div>
12
+
13
+ <div class='ewd-ufaq-custom-field-value'>
14
+ <?php echo esc_html( is_array( $value ) ? implode( ', ', $value ) : $value ); ?>
15
+ </div>
16
+
17
+ <div class='ewd-ufaq-clear'></div>
18
+
19
+ <?php } ?>
20
+
21
+ </div>
ewd-ufaq-templates/faq-date.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php echo esc_html( $this->get_label( 'label-on' ) ); ?>
2
+
3
+ <span class='ewd-ufaq-date'>
4
+ <?php echo $this->date; ?>
5
+ </span>
ewd-ufaq-templates/faq-permalink.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-permalink'>
2
+
3
+ <a href='<?php echo esc_attr( $this->permalink ); ?>'>
4
+
5
+ <?php if ( $this->get_option( 'include-permalink' ) == 'both' or $this->get_option( 'include-permalink' ) == 'text' ) { echo $this->get_label( 'label-permalink' ); } ?>
6
+ <?php if ( $this->get_option( 'include-permalink' ) == 'both' or $this->get_option( 'include-permalink' ) == 'icon' ) { ?> <div class='ewd-ufaq-permalink-image'></div> <?php } ?>
7
+
8
+ </a>
9
+
10
+ </div>
ewd-ufaq-templates/faq-preview.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <div class='ewd-ufaq-faq-excerpt'>
2
+ <?php echo $this->faq_preview; ?>
3
+ </div>
ewd-ufaq-templates/faq-ratings.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-ratings'>
2
+
3
+ <div class='ewd-ufaq-ratings-label'>
4
+ <?php echo esc_html( $this->get_label( 'label-find-faq-helpful' ) ); ?>
5
+ </div>
6
+
7
+ <div class='ewd-ufaq-rating-button ewd-ufaq-up-vote <?php echo ( ( $ewd_ufaq_controller->settings->get_setting( 'thumbs-up-image' ) and $ewd_ufaq_controller->settings->get_setting( 'thumbs-up-image' ) != 'http://' ) ? 'ewd-ufaq-ratings-custom-image' : 'ewd-ufaq-ratings-default-image' ); ?>' data-faq_id='<?php echo $this->post->ID; ?>'>
8
+ <?php echo $this->get_thumbs_up_image(); ?>
9
+ <span><?php echo $this->get_up_votes(); ?></span>
10
+ </div>
11
+
12
+ <div class='ewd-ufaq-rating-button ewd-ufaq-down-vote <?php echo ( ( $ewd_ufaq_controller->settings->get_setting( 'thumbs-down-image' ) and $ewd_ufaq_controller->settings->get_setting( 'thumbs-down-image' ) != 'http://' ) ? 'ewd-ufaq-ratings-custom-image' : 'ewd-ufaq-ratings-default-image' ); ?>' data-faq_id='<?php echo $this->post->ID; ?>'>
13
+ <?php echo $this->get_thumbs_down_image(); ?>
14
+ <span><?php echo $this->get_down_votes(); ?></span>
15
+ </div>
16
+ </div>
17
+
18
+ <div class='ewd-ufaq-clear'></div>
ewd-ufaq-templates/faq-social-media-email.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <li class='rrssb-email'>
2
+
3
+ <a href='<?php echo esc_attr( $this->get_social_email_mailto_link() ); ?>'>
4
+
5
+ <span class='rrssb-icon'>
6
+
7
+ <svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'>
8
+ <path d='M20.11 26.147c-2.335 1.05-4.36 1.4-7.124 1.4C6.524 27.548.84 22.916.84 15.284.84 7.343 6.602.45 15.4.45c6.854 0 11.8 4.7 11.8 11.252 0 5.684-3.193 9.265-7.398 9.3-1.83 0-3.153-.934-3.347-2.997h-.077c-1.208 1.986-2.96 2.997-5.023 2.997-2.532 0-4.36-1.868-4.36-5.062 0-4.75 3.503-9.07 9.11-9.07 1.713 0 3.7.4 4.6.972l-1.17 7.203c-.387 2.298-.115 3.3 1 3.4 1.674 0 3.774-2.102 3.774-6.58 0-5.06-3.27-8.994-9.304-8.994C9.05 2.87 3.83 7.545 3.83 14.97c0 6.5 4.2 10.2 10 10.202 1.987 0 4.09-.43 5.647-1.245l.634 2.22zM16.647 10.1c-.31-.078-.7-.155-1.207-.155-2.572 0-4.596 2.53-4.596 5.53 0 1.5.7 2.4 1.9 2.4 1.44 0 2.96-1.83 3.31-4.088l.592-3.72z' />
9
+ </svg>
10
+
11
+ </span>
12
+
13
+ <span class='rrssb-text'>email</span>
14
+
15
+ </a>
16
+
17
+ </li>
ewd-ufaq-templates/faq-social-media-facebook.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <li class='rrssb-facebook'>
2
+
3
+ <a href='https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode( $this->permalink ); ?>' class='popup'>
4
+
5
+ <span class='rrssb-icon'>
6
+
7
+ <svg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='xMidYMid' width='29' height='29' viewBox='0 0 29 29'>
8
+ <path d='M26.4 0H2.6C1.714 0 0 1.715 0 2.6v23.8c0 .884 1.715 2.6 2.6 2.6h12.393V17.988h-3.996v-3.98h3.997v-3.062c0-3.746 2.835-5.97 6.177-5.97 1.6 0 2.444.173 2.845.226v3.792H21.18c-1.817 0-2.156.9-2.156 2.168v2.847h5.045l-.66 3.978h-4.386V29H26.4c.884 0 2.6-1.716 2.6-2.6V2.6c0-.885-1.716-2.6-2.6-2.6z' class='cls-2' fill-rule='evenodd' />
9
+ </svg>
10
+
11
+ </span>
12
+
13
+ <span class='rrssb-text'>facebook</span>
14
+
15
+ </a>
16
+
17
+ </li>
ewd-ufaq-templates/faq-social-media-linkedin.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <li class='rrssb-linkedin'>
2
+
3
+ <a href='<?php echo esc_attr( $this->get_social_linkedin_link() ) ?>' class='popup'>
4
+
5
+ <span class='rrssb-icon'>
6
+
7
+ <svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'>
8
+ <path d='M25.424 15.887v8.447h-4.896v-7.882c0-1.98-.71-3.33-2.48-3.33-1.354 0-2.158.91-2.514 1.802-.13.315-.162.753-.162 1.194v8.216h-4.9s.067-13.35 0-14.73h4.9v2.087c-.01.017-.023.033-.033.05h.032v-.05c.65-1.002 1.812-2.435 4.414-2.435 3.222 0 5.638 2.106 5.638 6.632zM5.348 2.5c-1.676 0-2.772 1.093-2.772 2.54 0 1.42 1.066 2.538 2.717 2.546h.032c1.71 0 2.77-1.132 2.77-2.546C8.056 3.593 7.02 2.5 5.344 2.5h.005zm-2.48 21.834h4.896V9.604H2.867v14.73z' />
9
+ </svg>
10
+
11
+ </span>
12
+
13
+ <span class='rrssb-text'>linkedin</span>
14
+
15
+ </a>
16
+
17
+ </li>
ewd-ufaq-templates/faq-social-media-pinterest.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <li class='rrssb-pinterest'>
2
+
3
+ <a href='<?php echo esc_attr( $this->get_social_pinterest_link() ) ?>' class='popup'>
4
+
5
+ <span class='rrssb-icon'>
6
+
7
+ <svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'>
8
+ <path d='M14.02 1.57c-7.06 0-12.784 5.723-12.784 12.785S6.96 27.14 14.02 27.14c7.062 0 12.786-5.725 12.786-12.785 0-7.06-5.724-12.785-12.785-12.785zm1.24 17.085c-1.16-.09-1.648-.666-2.558-1.22-.5 2.627-1.113 5.146-2.925 6.46-.56-3.972.822-6.952 1.462-10.117-1.094-1.84.13-5.545 2.437-4.632 2.837 1.123-2.458 6.842 1.1 7.557 3.71.744 5.226-6.44 2.924-8.775-3.324-3.374-9.677-.077-8.896 4.754.19 1.178 1.408 1.538.49 3.168-2.13-.472-2.764-2.15-2.683-4.388.132-3.662 3.292-6.227 6.46-6.582 4.008-.448 7.772 1.474 8.29 5.24.58 4.254-1.815 8.864-6.1 8.532v.003z' />
9
+ </svg>
10
+
11
+ </span>
12
+
13
+ <span class='rrssb-text'>pinterest</span>
14
+
15
+ </a>
16
+
17
+ </li>
ewd-ufaq-templates/faq-social-media-twitter.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <li class='rrssb-twitter'>
2
+
3
+ <a href='<?php echo esc_attr( $this->get_social_twitter_link() ) ?>' class='popup'>
4
+
5
+ <span class='rrssb-icon'>
6
+
7
+ <svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'>
8
+ <path d='M24.253 8.756C24.69 17.08 18.297 24.182 9.97 24.62c-3.122.162-6.22-.646-8.86-2.32 2.702.18 5.375-.648 7.507-2.32-2.072-.248-3.818-1.662-4.49-3.64.802.13 1.62.077 2.4-.154-2.482-.466-4.312-2.586-4.412-5.11.688.276 1.426.408 2.168.387-2.135-1.65-2.73-4.62-1.394-6.965C5.574 7.816 9.54 9.84 13.802 10.07c-.842-2.738.694-5.64 3.434-6.48 2.018-.624 4.212.043 5.546 1.682 1.186-.213 2.318-.662 3.33-1.317-.386 1.256-1.248 2.312-2.4 2.942 1.048-.106 2.07-.394 3.02-.85-.458 1.182-1.343 2.15-2.48 2.71z' />
9
+ </svg>
10
+
11
+ </span>
12
+
13
+ <span class='rrssb-text'>twitter</span>
14
+
15
+ </a>
16
+
17
+ </li>
ewd-ufaq-templates/faq-social-media.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-social-links'>
2
+
3
+ <span class='ewd-ufaq-social-links-label'>
4
+ <?php echo esc_html( $this->get_label( 'label-share-faq' ) ); ?>
5
+ </span>
6
+
7
+ <ul class='rrssb-buttons'>
8
+ <?php $this->print_social_media_buttons(); ?>
9
+ </ul>
10
+
11
+ </div>
ewd-ufaq-templates/faq-tags.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-faq-tags'>
2
+
3
+ <?php echo esc_html( $this->get_tags_label() ); ?>
4
+
5
+ <?php foreach( $this->tags as $key => $tag ) { ?>
6
+
7
+ <?php echo $this->get_tag_value( $tag ) . ( $key != sizeOf( $this->tags ) - 1 ? ', ' : '' ); ?>
8
+
9
+ <?php } ?>
10
+
11
+ </div>
ewd-ufaq-templates/faq-title.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-faq-title <?php echo ( ! $this->get_option( 'disable-faq-toggle' ) ? 'ewd-ufaq-faq-toggle' : '' ) ?>'>
2
+
3
+ <a class='ewd-ufaq-post-margin' href='<?php echo esc_attr( get_permalink( $this->post->ID ) ); ?>'>
4
+
5
+ <div class='ewd-ufaq-post-margin-symbol <?php echo $this->get_color_block_shape(); ?>'>
6
+ <span ><?php echo $this->get_toggle_symbol(); ?></span>
7
+ </div>
8
+
9
+ <div class='ewd-ufaq-faq-title-text'>
10
+
11
+ <<?php echo $this->get_option( 'styling-faq-heading-type' ); ?>>
12
+ <?php echo $this->faq_title; ?>
13
+ </<?php echo $this->get_option( 'styling-faq-heading-type' ); ?>>
14
+
15
+ </div>
16
+
17
+ <div class='ewd-ufaq-clear'></div>
18
+
19
+ </a>
20
+
21
+ </div>
ewd-ufaq-templates/faq.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div <?php echo ewd_format_classes( $this->classes ); ?> id='<?php echo $this->get_id(); ?>' data-post_id='<?php echo $this->post->ID; ?>'>
2
+
3
+ <?php $this->print_faq_title(); ?>
4
+
5
+ <?php $this->maybe_print_faq_preview(); ?>
6
+
7
+ <div class='ewd-ufaq-faq-body <?php echo ( ! $this->display_all_answers ? 'ewd-ufaq-hidden' : '' ); ?>' >
8
+
9
+ <?php foreach ( $this->get_order_elements() as $element => $label ) { ?>
10
+
11
+ <?php $this->maybe_print_element( $element ); ?>
12
+
13
+ <?php } ?>
14
+
15
+ </div>
16
+
17
+ </div>
ewd-ufaq-templates/faqs-category-footer.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ </div>
2
+
3
+ </div>
ewd-ufaq-templates/faqs-category-header.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-faq-category'>
2
+
3
+ <div class='ewd-ufaq-faq-category-title <?php echo ( $this->get_option( 'faq-category-toggle' ) ? 'ewd-ufaq-faq-category-title-toggle' : '' ); ?>' >
4
+
5
+ <<?php echo $this->get_option( 'styling-category-heading-type' ); ?>>
6
+ <?php echo esc_html( $this->get_category_name() ); ?>
7
+ <?php if ( $this->get_option( 'group-by-category-count' ) ) { ?> <span>(<?php echo $this->get_category_count(); ?>)</span><?php } ?>
8
+ </<?php echo $this->get_option( 'styling-category-heading-type' ); ?>>
9
+
10
+ </div>
11
+
12
+ <div class='ewd-ufaq-faq-category-inner <?php echo ( $this->get_option( 'faq-category-toggle' ) ? 'ewd-ufaq-faq-category-body-hidden' : '' ); ?>' >
ewd-ufaq-templates/faqs-category-list-header.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-faq-header'>
2
+
3
+ <?php $faq_count = 0; ?>
4
+
5
+ <?php foreach ( $this->category_faqs as $term_id => $category_faqs ) { ?>
6
+
7
+ <?php if ( $faq_count < $this->faqs_per_page * ( $this->faq_page - 1) or $faq_count >= $this->faqs_per_page * ( $this->faq_page ) ) { continue; } ?>
8
+
9
+ <?php $category = get_term( $term_id, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY ); ?>
10
+
11
+ <div class='ewd-ufaq-faq-header-category'>
12
+
13
+ <div class='ewd-ufaq-faq-header-category-title' data-categoryid='<?php echo esc_attr( $category->term_id ); ?>'>
14
+ <<?php echo $this->get_option( 'styling-category-heading-type' ) ?>><?php echo esc_html( $category->name ); ?></<?php echo $this->get_option( 'styling-category-heading-type' ) ?>>
15
+ </div>
16
+
17
+ <?php foreach ( $category_faqs as $faq ) { ?>
18
+
19
+ <?php if ( ! in_array( $faq->post->ID, $this->displayed_faqs ) ) { continue; } ?>
20
+
21
+ <div class='ewd-ufaq-faq-header-title'>
22
+
23
+ <a class='ewd-ufaq-faq-header-link' data-postid='<?php echo esc_attr( $faq->unique_id ); ?>'>
24
+ <?php echo esc_html( $faq->question ); ?>
25
+ </a>
26
+
27
+ </div>
28
+
29
+ <?php $faq_count++; ?>
30
+
31
+ <?php } ?>
32
+
33
+ </div>
34
+
35
+ <?php } ?>
36
+
37
+ </div>
ewd-ufaq-templates/faqs-expand-collapse-all.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-expand-collapse-div'>
2
+
3
+ <span class='ewd-ufaq-expand-all'>
4
+ <span class='ewd-ufaq-toggle-all-symbol'>c</span>
5
+ <?php echo esc_html( $this->get_label( 'label-expand-all' ) ); ?>
6
+ </span>
7
+
8
+ <span class='ewd-ufaq-collapse-all ewd-ufaq-hidden'>
9
+ <span class='ewd-ufaq-toggle-all-symbol'>C</span>
10
+ <?php echo esc_html( $this->get_label( 'label-collapse-all' ) ); ?>
11
+ </span>
12
+
13
+ </div>
ewd-ufaq-templates/faqs-list-header.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-faq-header'>
2
+
3
+ <?php foreach ( $this->faqs as $faq_count => $faq ) { ?>
4
+
5
+ <?php if ( $faq_count < $this->faqs_per_page * ( $this->faq_page - 1) or $faq_count >= $this->faqs_per_page * ( $this->faq_page ) ) { continue; } ?>
6
+
7
+ <?php if ( ! in_array( $faq->post->ID, $this->displayed_faqs ) ) { continue; } ?>
8
+
9
+ <div class='ewd-ufaq-faq-header-title'>
10
+
11
+ <a class='ewd-ufaq-faq-header-link' data-postid='<?php echo esc_attr( $faq->unique_id ); ?>'>
12
+ <?php echo esc_html( $faq->question ); ?>
13
+ </a>
14
+
15
+ </div>
16
+
17
+
18
+ <?php } ?>
19
+
20
+ </div>
ewd-ufaq-templates/faqs-pagination.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-bottom ewd-ufaq-pagination-<?php echo esc_attr( $this->get_option( 'page-type' ) ); ?>' data-current_page='<?php echo esc_attr( $this->faq_page ); ?>' data-max_page='<?php echo esc_attr( $this->max_page ); ?>'>
2
+
3
+ <?php if ( $this->get_option( 'page-type' ) == 'distinct' ) { ?>
4
+
5
+ <div class='ewd-ufaq-previous-faqs <?php echo ( $this->faq_page <= 1 ? 'ewd-ufaq-hidden' : '' ); ?>'>
6
+ <h4><?php echo esc_html( $this->get_label( 'label-previous' ) ); ?></h4>
7
+ </div>
8
+
9
+ <div class='ewd-ufaq-next-faqs <?php echo ( $this->faq_page >= $this->max_page ? 'ewd-ufaq-hidden' : '' ); ?>'>
10
+ <h4><?php echo esc_html( $this->get_label( 'label-next' ) ); ?></h4>
11
+ </div>
12
+ <?php } ?>
13
+
14
+ <?php if ( $this->get_option( 'page-type' ) == 'load_more' ) { ?>
15
+
16
+ <div class='ewd-ufaq-load-more <?php echo ( $this->faq_page >= $this->max_page ? 'ewd-ufaq-hidden' : '' ); ?>'>
17
+ <h4><?php echo esc_html( $this->get_label( 'label-load-more' ) ); ?></h4>
18
+ </div>
19
+ <?php } ?>
20
+
21
+ </div>
ewd-ufaq-templates/faqs-search-submit.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <label for='ewd-ufaq-search-submit'></label>
2
+
3
+ <input type='button' id='ewd-ufaq-ajax-search-submit' name='Search' value='<?php echo esc_html( $this->get_label( 'label-search' ) ); ?>'>
ewd-ufaq-templates/faqs-search.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id='ewd-ufaq-jquery-ajax-search'>
2
+
3
+ <label class='ewd-ufaq-field-label'>
4
+ <?php echo esc_html( $this->get_label( 'label-enter-question' ) ); ?>:
5
+ </label>
6
+
7
+ <?php $this->maybe_print_shortcode_args(); ?>
8
+
9
+ <input type='text' class='ewd-ufaq-text-input <?php echo ( $this->get_option( 'auto-complete-titles' ) ? 'ewd-ufaq-text-auto-complete' : '' ); ?>' placeholder='<?php echo esc_attr( $this->get_label( 'label-search-placeholder' ) ); ?>' value='<?php echo ( isset( $_GET['faq_search_term'] ) ? esc_attr( $_GET['faq_search_term'] ) : '' ); ?>' />
10
+
11
+ <?php $this->maybe_print_search_submit(); ?>
12
+
13
+ </div>
ewd-ufaq-templates/faqs-shortcode-args.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <input type='hidden' name='include_category' value='<?php echo esc_attr( $this->include_category ); ?>' id='ewd-ufaq-include-category' />
2
+ <input type='hidden' name='exclude_category' value='<?php echo esc_attr( $this->exclude_category ); ?>' id='ewd-ufaq-exclude-category' />
3
+ <input type='hidden' name='orderby' value='<?php echo esc_attr( $this->orderby ); ?>' id='ewd-ufaq-orderby' />
4
+ <input type='hidden' name='order' value='<?php echo esc_attr( $this->order ); ?>' id='ewd-ufaq-order' />
5
+ <input type='hidden' name='post_count' value='<?php echo esc_attr( $this->post_count ); ?>' id='ewd-ufaq-post-count' />
6
+ <input type='hidden' name='current_url' value='<?php echo esc_attr( $_SERVER['REQUEST_URI'] ); ?>' id='ewd-ufaq-current-url' />
ewd-ufaq-templates/faqs.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div <?php echo ewd_format_classes( $this->classes ); ?> id='ewd-ufaq-faq-list'>
2
+
3
+ <?php $this->print_shortcode_args(); ?>
4
+
5
+ <?php $this->maybe_print_expand_collapse_all(); ?>
6
+
7
+ <?php $this->maybe_print_header(); ?>
8
+
9
+ <div class='ewd-ufaq-faqs'>
10
+
11
+ <?php $this->print_faqs(); ?>
12
+
13
+ </div>
14
+
15
+ <?php $this->maybe_print_pagination(); ?>
16
+
17
+ </div>
ewd-ufaq-templates/submit-faq-captcha.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-captcha-div'>
2
+
3
+ <label for='captcha_image'></label>
4
+ <img src='data:image/png;base64,<?php echo $this->create_captcha_image(); ?>' alt='captcha' />
5
+ <input type='hidden' name='ewd_ufaq_modified_captcha' value='<?php echo esc_attr( $this->captcha_form_code ); ?>' />
6
+
7
+ </div>
8
+
9
+ <div class='ewd-ufaq-captcha-response'><label for='captcha_text'><?php echo $this->get_label( 'label-captcha-image-number' ); ?>: </label>
10
+ <input type='text' name='ewd_ufaq_captcha' value='' />
11
+ </div>
ewd-ufaq-templates/submit-faq-custom-field-checkbox.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-meta-field'>
2
+
3
+ <label for='<?php echo esc_attr( $this->get_custom_field_name() ); ?>' class='ewd-ufaq-submit-faq-label'>
4
+ <?php echo esc_html( $this->get_custom_field_name() ); ?>
5
+ </label>
6
+
7
+ <div class='ewd-ufaq-submit-faq-radio-checkbox-container'>
8
+
9
+ <?php $input_name = $this->get_custom_field_input_name(); ?>
10
+
11
+ <?php foreach ( $this->get_custom_field_options() as $option ) { ?>
12
+
13
+ <div class='ewd-ufaq-submit-faq-radio-checkbox-each'>
14
+ <input type='checkbox' name='<?php echo esc_attr( $input_name ); ?>[]' value='<?php echo $option; ?>' <?php echo ( ( ! empty( $_POST[ $input_name ] ) and is_array( $_POST[ $input_name ] ) and in_array( $option, $_POST[ $input_name ] ) ) ? 'checked' : '' ); ?>/><?php echo $option; ?>
15
+ </div>
16
+
17
+ <?php } ?>
18
+
19
+ </div>
20
+
21
+ </div>
ewd-ufaq-templates/submit-faq-custom-field-date.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-meta-field'>
2
+
3
+ <label for='<?php echo esc_attr( $this->get_custom_field_name() ); ?>' class='ewd-ufaq-submit-faq-label'>
4
+ <?php echo esc_html( $this->get_custom_field_name() ); ?>
5
+ </label>
6
+
7
+ <?php $input_name = $this->get_custom_field_input_name(); ?>
8
+
9
+ <input type='text' class='ewd-ufaq-jquery-datepicker' id='ewd-ufaq-<?php echo esc_attr( $this->get_custom_field_name() ); ?>' name='<?php echo esc_attr( $input_name ); ?>' value='<?php echo ( ! empty( $_POST[ $input_name ] ) ? esc_attr( $_POST[ $input_name ] ) : '' ); ?>'/>
10
+
11
+ </div>
ewd-ufaq-templates/submit-faq-custom-field-datetime.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-meta-field'>
2
+
3
+ <label for='<?php echo esc_attr( $this->get_custom_field_name() ); ?>' class='ewd-ufaq-submit-faq-label'>
4
+ <?php echo esc_html( $this->get_custom_field_name() ); ?>
5
+ </label>
6
+
7
+ <?php $input_name = $this->get_custom_field_input_name(); ?>
8
+
9
+ <input type='datetime-local' id='ewd-ufaq-<?php echo esc_attr( $this->get_custom_field_name() ); ?>' name='<?php echo esc_attr( $input_name ); ?>' value='<?php echo ( ! empty( $_POST[ $input_name ] ) ? esc_attr( $_POST[ $input_name ] ) : '' ); ?>' />
10
+
11
+ </div>
ewd-ufaq-templates/submit-faq-custom-field-radio.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-meta-field'>
2
+
3
+ <label for='<?php echo esc_attr( $this->get_custom_field_name() ); ?>' class='ewd-ufaq-submit-faq-label'>
4
+ <?php echo esc_html( $this->get_custom_field_name() ); ?>
5
+ </label>
6
+
7
+ <div class='ewd-ufaq-submit-faq-radio-checkbox-container'>
8
+
9
+ <?php $input_name = $this->get_custom_field_input_name(); ?>
10
+
11
+ <?php foreach ( $this->get_custom_field_options() as $option ) { ?>
12
+
13
+ <div class='ewd-ufaq-submit-faq-radio-checkbox-each'>
14
+ <input type='radio' name='<?php echo esc_attr( $input_name ); ?>' value='<?php echo $option; ?>' <?php echo ( ! empty( $_POST[ $input_name ] ) and $option == $_POST[ $input_name ] ? 'checked' : '' ); ?>/><?php echo $option; ?>
15
+ </div>
16
+
17
+ <?php } ?>
18
+
19
+ </div>
20
+
21
+ </div>
ewd-ufaq-templates/submit-faq-custom-field-select.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-meta-field'>
2
+
3
+ <label for='<?php echo esc_attr( $this->get_custom_field_name() ); ?>' class='ewd-ufaq-submit-faq-label'>
4
+ <?php echo esc_html( $this->get_custom_field_name() ); ?>
5
+ </label>
6
+
7
+ <?php $input_name = $this->get_custom_field_input_name(); ?>
8
+
9
+ <select name='<?php echo esc_attr( $input_name ); ?>' >
10
+
11
+ <?php foreach ( $this->get_custom_field_options() as $option ) { ?>
12
+ <option value='<?php echo $option; ?>' <?php echo ( ! empty( $_POST[ $input_name ] ) and $option == $_POST[ $input_name ] ? 'selected' : '' ); ?>><?php echo $option; ?></option>
13
+ <?php } ?>
14
+
15
+ </select>
16
+ </div>
ewd-ufaq-templates/submit-faq-custom-field-text.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-meta-field'>
2
+
3
+ <label for='<?php echo esc_attr( $this->get_custom_field_name() ); ?>' class='ewd-ufaq-submit-faq-label'>
4
+ <?php echo esc_html( $this->get_custom_field_name() ); ?>
5
+ </label>
6
+
7
+ <?php $input_name = $this->get_custom_field_input_name(); ?>
8
+
9
+ <input type='text' name='<?php echo esc_attr( $input_name ); ?>' class='ewd-ufaq-text-input' value='<?php echo ( ! empty( $_POST[ $input_name ] ) ? esc_attr( $_POST[ $input_name ] ) : '' ); ?>'/>
10
+
11
+ </div>
ewd-ufaq-templates/submit-faq-custom-field-textarea.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-meta-field'>
2
+
3
+ <label for='<?php echo esc_attr( $this->get_custom_field_name() ); ?>' class='ewd-ufaq-submit-faq-label'>
4
+ <?php echo esc_html( $this->get_custom_field_name() ); ?>
5
+ </label>
6
+
7
+ <?php $input_name = $this->get_custom_field_input_name(); ?>
8
+
9
+ <textarea name='<?php echo esc_attr( $input_name ); ?>' class='ewd-ufaq-faq-textarea'><?php echo ( ! empty( $_POST[ $input_name ] ) ? esc_attr( $_POST[ $input_name ] ) : '' ); ?></textarea>
10
+
11
+ </div>
ewd-ufaq-templates/submit-faq-field-author-email.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='form-field'>
2
+
3
+ <label id='ewd-ufaq-faq-author-email' class='ewd-ufaq-faq-label'>
4
+ <?php echo esc_html( $this->get_label( 'label-question-author-email' ) ); ?>:
5
+ </label>
6
+
7
+ <input type='text' name='post_author_email' id='post_author_email' value='<?php echo ( ! empty( $_POST['post_author_email'] ) ? esc_attr( $_POST['post_author_email'] ) : ''); ?>' />
8
+
9
+ <div id='ewd-ufaq-author-email-explanation' class='ewd-ufaq-field-explanation'>
10
+
11
+ <label for='explanation'></label>
12
+
13
+ <span>
14
+ <?php echo esc_html( $this->get_label( 'label-question-author-email-explanation' ) ); ?>
15
+ </span>
16
+
17
+ </div>
18
+
19
+ </div>
ewd-ufaq-templates/submit-faq-field-author.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='form-field'>
2
+
3
+ <label id='ewd-ufaq-faq-author' class='ewd-ufaq-faq-label'>
4
+ <?php echo esc_html( $this->get_label( 'label-question-author' ) ); ?>:
5
+ </label>
6
+
7
+ <input type='text' name='post_author' id='post_author' value='<?php echo ( ! empty( $_POST['post_author'] ) ? esc_attr( $_POST['post_author'] ) : ''); ?>' />
8
+
9
+ <div id='ewd-ufaq-author-explanation' class='ewd-ufaq-field-explanation'>
10
+
11
+ <label for='explanation'></label>
12
+
13
+ <span>
14
+ <?php echo esc_html( $this->get_label( 'label-question-author-explanation' ) ); ?>
15
+ </span>
16
+
17
+ </div>
18
+
19
+ </div>
ewd-ufaq-templates/submit-faq-field-faq-answer.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-meta-field'>
2
+
3
+ <label for='faq_answer'>
4
+ <?php echo esc_html( $this->get_label( 'label-proposed-answer' ) ); ?>:
5
+ </label>
6
+
7
+ <textarea name='faq_answer' class='ewd-ufaq-faq-textarea' required>
8
+ <?php echo ( ! empty( $_POST['faq_answer'] ) ? esc_html( $_POST['faq_answer'] ) : '' ); ?>
9
+ </textarea>
10
+
11
+ <div id='ewd-ufaq-answer-explanation' class='ewd-ufaq-field-explanation'>
12
+
13
+ <label for='explanation'></label>
14
+
15
+ <span>
16
+ <?php echo esc_html( $this->get_label( 'label-proposed-answer-explanation' ) ); ?>
17
+ </span>
18
+
19
+ </div>
20
+
21
+ </div>
ewd-ufaq-templates/submit-faq-field-faq-question.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='form-field'>
2
+
3
+ <label id='ewd-ufaq-submit-faq-question' class='ewd-ufaq-submit-faq-label'>
4
+ <?php echo esc_html( $this->get_label( 'label-question-title' ) ); ?>:
5
+ </label>
6
+
7
+ <input type='text' name='faq_question' id='faq_question' value='<?php echo ( ! empty( $_POST['faq_question'] ) ? esc_attr( $_POST['faq_question'] ) : '' ); ?>' />
8
+
9
+ <div id='ewd-ufaq-faq-question' class='ewd-ufaq-field-explanation'>
10
+
11
+ <label for='explanation'></label>
12
+
13
+ <span>
14
+ <?php echo esc_html( $this->get_label( 'label-question-title-explanation' ) ); ?>
15
+ </span>
16
+
17
+ </div>
18
+
19
+ </div>
ewd-ufaq-templates/submit-faq-submitted-faq-message.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <div class='ewd-ufaq-update'>
2
+ <?php echo $this->update_message; ?>
3
+ </div>
ewd-ufaq-templates/submit-faq.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='ewd-ufaq-question-form'>
2
+
3
+ <?php $this->maybe_print_submitted_faq_message(); ?>
4
+
5
+ <form id='question_form' method='post' action='#'>
6
+
7
+ <?php $this->print_nonce_field(); ?>
8
+
9
+ <?php $this->print_referer_field(); ?>
10
+
11
+ <?php $this->print_question_title_field(); ?>
12
+
13
+ <?php $this->maybe_print_answer_field(); ?>
14
+
15
+ <?php $this->maybe_print_custom_fields(); ?>
16
+
17
+ <?php $this->print_author_field(); ?>
18
+
19
+ <?php $this->maybe_print_author_email_field(); ?>
20
+
21
+ <?php $this->maybe_print_captcha_field(); ?>
22
+
23
+ <p class='submit'>
24
+
25
+ <input type='submit' name='submit_question' id='submit' class='button-primary' value='<?php echo esc_attr( $this->submit_text ); ?>' />
26
+
27
+ </p>
28
+
29
+ </form>
30
+
31
+ </div>
html/AdminFooter.php DELETED
@@ -1 +0,0 @@
1
- </div>
 
html/AdminHeader.php DELETED
@@ -1,23 +0,0 @@
1
- <div class="wrap">
2
- <div class="Header"><h2><?php _e("Ultimate FAQ Options", 'ultimate-faqs') ?></h2></div>
3
-
4
-
5
- <?php if ($UFAQ_Full_Version != "Yes" or get_option("EWD_UFAQ_Trial_Happening") == "Yes") { ?>
6
- <div class="ewd-ufaq-dashboard-new-upgrade-banner">
7
- <div class="ewd-ufaq-dashboard-banner-icon"></div>
8
- <div class="ewd-ufaq-dashboard-banner-buttons">
9
- <a class="ewd-ufaq-dashboard-new-upgrade-button" href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" target="_blank">UPGRADE NOW</a>
10
- </div>
11
- <div class="ewd-ufaq-dashboard-banner-text">
12
- <div class="ewd-ufaq-dashboard-banner-title">
13
- GET FULL ACCESS WITH OUR PREMIUM VERSION
14
- </div>
15
- <div class="ewd-ufaq-dashboard-banner-brief">
16
- Easily customize, administer and share your FAQs
17
- </div>
18
- </div>
19
- </div>
20
- <?php } ?>
21
-
22
- <?php EWD_UFAQ_Add_Header_Bar("Yes"); ?>
23
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
html/DashboardPage.php DELETED
@@ -1,269 +0,0 @@
1
- <!-- Upgrade to pro link box -->
2
- <!-- TOP BOX-->
3
-
4
- <?php
5
- global $wpdb;
6
- $Slug_Base = get_option("EWD_UFAQ_Slug_Base");
7
-
8
- //start review box
9
- if (isset($_POST['hide_ufaq_review_box_hidden'])) {update_option('EWD_UFAQ_Hide_Dash_Review_Ask', sanitize_text_field($_POST['hide_ufaq_review_box_hidden']));}
10
- $hideReview = get_option('EWD_UFAQ_Hide_Dash_Review_Ask');
11
- $Ask_Review_Date = get_option('EWD_UFAQ_Ask_Review_Date');
12
- if ($Ask_Review_Date == "") {$Ask_Review_Date = get_option("EWD_UFAQ_Install_Time") + 3600*24*4;}
13
-
14
- //end review box
15
- ?>
16
-
17
-
18
-
19
-
20
-
21
- <!-- START NEW DASHBOARD -->
22
-
23
- <div id="ewd-ufaq-dashboard-content-area">
24
-
25
- <div id="ewd-ufaq-dashboard-content-left">
26
-
27
- <?php if ($UFAQ_Full_Version != "Yes" or get_option("EWD_UFAQ_Trial_Happening") == "Yes") {
28
- $premium_info = '<div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full">';
29
- $premium_info .= '<div class="ewd-ufaq-dashboard-new-widget-box-top">';
30
- $premium_info .= sprintf( __( '<a href="%s" target="_blank">Visit our website</a> to learn how to upgrade to premium.'), 'https://www.etoilewebdesign.com/premium-upgrade-instructions/' );
31
- $premium_info .= '</div>';
32
- $premium_info .= '</div>';
33
-
34
- echo apply_filters( 'ewd_dashboard_top', $premium_info, 'UFAQ', 'http://www.etoilewebdesign.com/plugins/ultimate-faq/#buy' );
35
- } ?>
36
-
37
- <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-support-widget-box">
38
- <div class="ewd-ufaq-dashboard-new-widget-box-top">Get Support<span id="ewd-ufaq-dash-mobile-support-down-caret">&nbsp;&nbsp;&#9660;</span><span id="ewd-ufaq-dash-mobile-support-up-caret">&nbsp;&nbsp;&#9650;</span></div>
39
- <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
40
- <ul class="ewd-ufaq-dashboard-support-widgets">
41
- <li>
42
- <a href="https://www.youtube.com/playlist?list=PLEndQUuhlvSrNdfu5FKa1uGHsaKZxgdWt" target="_blank">
43
- <img src="<?php echo plugins_url( '../images/ewd-support-icon-youtube.png', __FILE__ ); ?>">
44
- <div class="ewd-ufaq-dashboard-support-widgets-text">YouTube Tutorials</div>
45
- </a>
46
- </li>
47
- <li>
48
- <a href="https://wordpress.org/plugins/ultimate-faqs/#faq" target="_blank">
49
- <img src="<?php echo plugins_url( '../images/ewd-support-icon-faqs.png', __FILE__ ); ?>">
50
- <div class="ewd-ufaq-dashboard-support-widgets-text">Plugin FAQs</div>
51
- </a>
52
- </li>
53
- <li>
54
- <a href="https://www.etoilewebdesign.com/support-center/?Plugin=UFAQ&Type=FAQs" target="_blank">
55
- <img src="<?php echo plugins_url( '../images/ewd-support-icon-documentation.png', __FILE__ ); ?>">
56
- <div class="ewd-ufaq-dashboard-support-widgets-text">Documentation</div>
57
- </a>
58
- </li>
59
- <li>
60
- <a href="https://www.etoilewebdesign.com/support-center/" target="_blank">
61
- <img src="<?php echo plugins_url( '../images/ewd-support-icon-forum.png', __FILE__ ); ?>">
62
- <div class="ewd-ufaq-dashboard-support-widgets-text">Get Support</div>
63
- </a>
64
- </li>
65
- </ul>
66
- </div>
67
- </div>
68
-
69
- <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-optional-table">
70
- <div class="ewd-ufaq-dashboard-new-widget-box-top">FAQ Summary<span id="ewd-ufaq-dash-optional-table-down-caret">&nbsp;&nbsp;&#9660;</span><span id="ewd-ufaq-dash-optional-table-up-caret">&nbsp;&nbsp;&#9650;</span></div>
71
- <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
72
- <table class='ewd-ufaq-overview-table wp-list-table widefat fixed striped posts'>
73
- <thead>
74
- <tr>
75
- <th><?php _e("Title", 'EWD_ABCO'); ?></th>
76
- <th><?php _e("Views", 'EWD_ABCO'); ?></th>
77
- <th><?php _e("Categories", 'EWD_ABCO'); ?></th>
78
- </tr>
79
- </thead>
80
- <tbody>
81
- <?php
82
- $args = array(
83
- 'post_type' => 'ufaq',
84
- 'orderby' => 'meta_value_num',
85
- 'meta_key' => 'ufaq_view_count',
86
- 'posts_per_page' => 10
87
- );
88
-
89
- $Dashboard_FAQs_Query = new WP_Query($args);
90
- $Dashboard_FAQs = $Dashboard_FAQs_Query->get_posts();
91
-
92
- if (sizeOf($Dashboard_FAQs) == 0) {echo "<tr><td colspan='3'>" . __("No FAQs to display yet. Create an FAQ and then view it for it to be displayed here.", 'ultimate-faqs') . "</td></tr>";}
93
- else {
94
- foreach ($Dashboard_FAQs as $Dashboard_FAQ) { ?>
95
- <tr>
96
- <td><a href='post.php?post=<?php echo $Dashboard_FAQ->ID;?>&action=edit'><?php echo $Dashboard_FAQ->post_title; ?></a></td>
97
- <td><?php echo get_post_meta($Dashboard_FAQ->ID, 'ufaq_view_count', true); ?></td>
98
- <td><?php echo EWD_UFAQ_Get_Categories($Dashboard_FAQ->ID); ?></td>
99
- </tr>
100
- <?php }
101
- }
102
- ?>
103
- </tbody>
104
- </table>
105
- </div>
106
- </div>
107
-
108
- <div class="ewd-ufaq-dashboard-new-widget-box <?php echo ( ($hideReview != 'Yes' and $Ask_Review_Date < time()) ? 'ewd-widget-box-two-thirds' : 'ewd-widget-box-full' ); ?>">
109
- <div class="ewd-ufaq-dashboard-new-widget-box-top">What People Are Saying</div>
110
- <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
111
- <ul class="ewd-ufaq-dashboard-testimonials">
112
- <?php $randomTestimonial = rand(0,2);
113
- if($randomTestimonial == 0){ ?>
114
- <li id="ewd-ufaq-dashboard-testimonial-one">
115
- <img src="<?php echo plugins_url( '../images/dash-asset-stars.png', __FILE__ ); ?>">
116
- <div class="ewd-ufaq-dashboard-testimonial-title">"Awesome. Just Awesome."</div>
117
- <div class="ewd-ufaq-dashboard-testimonial-author">- @shizart</div>
118
- <div class="ewd-ufaq-dashboard-testimonial-text">Thanks for this very well-made plugin. This works so well out of the box, I barely had to do ANYTHING to create an amazing FAQ accordion display... <a href="https://wordpress.org/support/topic/awesome-just-awesome-11/" target="_blank">read more</a></div>
119
- </li>
120
- <?php }
121
- if($randomTestimonial == 1){ ?>
122
- <li id="ewd-ufaq-dashboard-testimonial-two">
123
- <img src="<?php echo plugins_url( '../images/dash-asset-stars.png', __FILE__ ); ?>">
124
- <div class="ewd-ufaq-dashboard-testimonial-title">"Absolutely perfect with great support"</div>
125
- <div class="ewd-ufaq-dashboard-testimonial-author">- @isaac85</div>
126
- <div class="ewd-ufaq-dashboard-testimonial-text">I tried several different FAQ plugins and this is by far the prettiest and easiest to use... <a href="https://wordpress.org/support/topic/absolutely-perfect-with-great-support/" target="_blank">read more</a></div>
127
- </li>
128
- <?php }
129
- if($randomTestimonial == 2){ ?>
130
- <li id="ewd-ufaq-dashboard-testimonial-three">
131
- <img src="<?php echo plugins_url( '../images/dash-asset-stars.png', __FILE__ ); ?>">
132
- <div class="ewd-ufaq-dashboard-testimonial-title">"Perfect FAQ Plugin"</div>
133
- <div class="ewd-ufaq-dashboard-testimonial-author">- @muti-wp</div>
134
- <div class="ewd-ufaq-dashboard-testimonial-text">Works great! Easy to configure and to use. Thanks! <a href="https://wordpress.org/support/topic/perfect-faq-plugin/" target="_blank">read more</a></div>
135
- </li>
136
- <?php } ?>
137
- </ul>
138
- </div>
139
- </div>
140
-
141
- <?php if($hideReview != 'Yes' and $Ask_Review_Date < time()){ ?>
142
- <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-one-third">
143
- <div class="ewd-ufaq-dashboard-new-widget-box-top">Leave a review</div>
144
- <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
145
- <div class="ewd-ufaq-dashboard-review-ask">
146
- <img src="<?php echo plugins_url( '../images/dash-asset-stars.png', __FILE__ ); ?>">
147
- <div class="ewd-ufaq-dashboard-review-ask-text">If you enjoy this plugin and have a minute, please consider leaving a 5-star review. Thank you!</div>
148
- <a href="https://wordpress.org/plugins/ultimate-faqs/#reviews" class="ewd-ufaq-dashboard-review-ask-button">LEAVE A REVIEW</a>
149
- <form action="admin.php?page=EWD-UFAQ-Options" method="post">
150
- <input type="hidden" name="hide_ufaq_review_box_hidden" value="Yes">
151
- <input type="submit" name="hide_ufaq_review_box_submit" class="ewd-ufaq-dashboard-review-ask-dismiss" value="I've already left a review">
152
- </form>
153
- </div>
154
- </div>
155
- </div>
156
- <?php } ?>
157
-
158
- <?php if ($UFAQ_Full_Version != "Yes" or get_option("EWD_UFAQ_Trial_Happening") == "Yes") { ?>
159
- <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-guarantee-widget-box">
160
- <div class="ewd-ufaq-dashboard-new-widget-box-top">
161
- <div class="ewd-ufaq-dashboard-guarantee">
162
- <div class="ewd-ufaq-dashboard-guarantee-title">14-Day 100% Money-Back Guarantee</div>
163
- <div class="ewd-ufaq-dashboard-guarantee-text">If you're not 100% satisfied with the premium version of our plugin - no problem. You have 14 days to receive a FULL REFUND. We're certain you won't need it, though.</div>
164
- </div>
165
- </div>
166
- </div>
167
- <?php } ?>
168
-
169
- </div> <!-- left -->
170
-
171
- <div id="ewd-ufaq-dashboard-content-right">
172
-
173
- <?php if ($UFAQ_Full_Version != "Yes" or get_option("EWD_UFAQ_Trial_Happening") == "Yes") { ?>
174
- <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-get-premium-widget-box">
175
- <div class="ewd-ufaq-dashboard-new-widget-box-top">Get Premium</div>
176
-
177
- <?php if ( get_option("EWD_UFAQ_Trial_Happening") == "Yes" ) { do_action( 'ewd_trial_happening', 'UFAQ' ); } ?>
178
-
179
- <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
180
- <div class="ewd-ufaq-dashboard-get-premium-widget-features-title"<?php echo ( get_option("EWD_UFAQ_Trial_Happening") == "Yes" ? "style='padding-top: 20px;'" : ""); ?>>GET FULL ACCESS WITH OUR PREMIUM VERSION AND GET:</div>
181
- <ul class="ewd-ufaq-dashboard-get-premium-widget-features">
182
- <li>Unlimited FAQs</li>
183
- <li>Advanced Styling Options</li>
184
- <li>Social Sharing</li>
185
- <li>SEO-Friendly Permalinks</li>
186
- <li>+ More</li>
187
- </ul>
188
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
189
- <?php if ( ! get_option( "EWD_UFAQ_Trial_Happening" ) ) {
190
- $trial_info = sprintf( __( '<a href="%s" target="_blank">Visit our website</a> to learn how to get a free 7-day trial of the premium plugin.'), 'https://www.etoilewebdesign.com/premium-upgrade-instructions/' );
191
-
192
- echo apply_filters( 'ewd_trial_button', $trial_info, 'UFAQ' );
193
- } ?>
194
- </div>
195
- </div>
196
- <?php } ?>
197
-
198
- <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full">
199
- <div class="ewd-ufaq-dashboard-new-widget-box-top">Other Plugins by Etoile</div>
200
- <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
201
- <ul class="ewd-ufaq-dashboard-other-plugins">
202
- <li>
203
- <a href="https://wordpress.org/plugins/ultimate-product-catalogue/" target="_blank"><img src="<?php echo plugins_url( '../images/ewd-upcp-icon.png', __FILE__ ); ?>"></a>
204
- <div class="ewd-ufaq-dashboard-other-plugins-text">
205
- <div class="ewd-ufaq-dashboard-other-plugins-title">Product Catalog</div>
206
- <div class="ewd-ufaq-dashboard-other-plugins-blurb">Enables you to display your business's products in a clean and efficient manner.</div>
207
- </div>
208
- </li>
209
- <li>
210
- <a href="https://wordpress.org/plugins/ultimate-reviews/" target="_blank"><img src="<?php echo plugins_url( '../images/ewd-urp-icon.png', __FILE__ ); ?>"></a>
211
- <div class="ewd-ufaq-dashboard-other-plugins-text">
212
- <div class="ewd-ufaq-dashboard-other-plugins-title">Ultimate Reviews</div>
213
- <div class="ewd-ufaq-dashboard-other-plugins-blurb">Let visitors submit reviews and display them right in the tabbed page layout!</div>
214
- </div>
215
- </li>
216
- </ul>
217
- </div>
218
- </div>
219
-
220
- </div> <!-- right -->
221
-
222
- </div> <!-- ewd-ufaq-dashboard-content-area -->
223
-
224
- <?php if ($UFAQ_Full_Version != "Yes" or get_option("EWD_UFAQ_Trial_Happening") == "Yes") { ?>
225
- <div id="ewd-ufaq-dashboard-new-footer-one">
226
- <div class="ewd-ufaq-dashboard-new-footer-one-inside">
227
- <div class="ewd-ufaq-dashboard-new-footer-one-left">
228
- <div class="ewd-ufaq-dashboard-new-footer-one-title">What's Included in Our Premium Version?</div>
229
- <ul class="ewd-ufaq-dashboard-new-footer-one-benefits">
230
- <li>Unlimited FAQs</li>
231
- <li>FAQ Search</li>
232
- <li>Custom Fields</li>
233
- <li>WooCommerce FAQs</li>
234
- <li>15 Different Icon Sets</li>
235
- <li>Import/Export FAQs</li>
236
- <li>Advanced Styling Options</li>
237
- <li>Social Sharing</li>
238
- <li>Email Support</li>
239
- </ul>
240
- </div>
241
- <div class="ewd-ufaq-dashboard-new-footer-one-buttons">
242
- <a class="ewd-ufaq-dashboard-new-upgrade-button" href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" target="_blank">UPGRADE NOW</a>
243
- </div>
244
- </div>
245
- </div> <!-- ewd-ufaq-dashboard-new-footer-one -->
246
- <?php } ?>
247
- <div id="ewd-ufaq-dashboard-new-footer-two">
248
- <div class="ewd-ufaq-dashboard-new-footer-two-inside">
249
- <img src="<?php echo plugins_url( '../images/ewd-logo-white.png', __FILE__ ); ?>" class="ewd-ufaq-dashboard-new-footer-two-icon">
250
- <div class="ewd-ufaq-dashboard-new-footer-two-blurb">
251
- At Etoile Web Design, we build reliable, easy-to-use WordPress plugins with a modern look. Rich in features, highly customizable and responsive, plugins by Etoile Web Design can be used as out-of-the-box solutions and can also be adapted to your specific requirements.
252
- </div>
253
- <ul class="ewd-ufaq-dashboard-new-footer-two-menu">
254
- <li>SOCIAL</li>
255
- <li><a href="https://www.facebook.com/EtoileWebDesign/" target="_blank">Facebook</a></li>
256
- <li><a href="https://twitter.com/EtoileWebDesign" target="_blank">Twitter</a></li>
257
- <li><a href="https://www.etoilewebdesign.com/blog/" target="_blank">Blog</a></li>
258
- </ul>
259
- <ul class="ewd-ufaq-dashboard-new-footer-two-menu">
260
- <li>SUPPORT</li>
261
- <li><a href="https://www.youtube.com/playlist?list=PLEndQUuhlvSrNdfu5FKa1uGHsaKZxgdWt" target="_blank">YouTube Tutorials</a></li>
262
- <li><a href="https://www.etoilewebdesign.com/support-center/?Plugin=UFAQ&Type=FAQs" target="_blank">Documentation</a></li>
263
- <li><a href="https://www.etoilewebdesign.com/support-center/" target="_blank">Get Support</a></li>
264
- <li><a href="https://wordpress.org/plugins/ultimate-faqs/#faq" target="_blank">FAQs</a></li>
265
- </ul>
266
- </div>
267
- </div> <!-- ewd-ufaq-dashboard-new-footer-two -->
268
-
269
- <!-- END NEW DASHBOARD -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
html/ExportPage.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
- $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
3
- ?>
4
- <div class="wrap">
5
-
6
- <div class="ewd-ufaq-import-export-container">
7
-
8
- <div id="icon-options-general" class="icon32"><br /></div><h2>Export</h2>
9
-
10
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
11
- <div class='ewd-ufaq-upgrade'>Upgrade to the premium version to use these features</div>
12
- <?php } ?>
13
-
14
- <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=Export&Action=EWD_UFAQ_ExportToPDF">
15
-
16
- <?php wp_nonce_field( 'EWD_UFAQ_Export_PDF', 'EWD_UFAQ_Export_PDF_Nonce' ); ?>
17
-
18
- <table class="form-table">
19
- </table>
20
-
21
-
22
- <p class="submit"><input type="submit" name="Export_Submit" id="submit" class="button button-primary" value="Export to PDF" <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /></p></form>
23
-
24
- <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=Export&Action=EWD_UFAQ_ExportToSpreadsheet">
25
- <?php wp_nonce_field( 'EWD_UFAQ_Export', 'EWD_UFAQ_Export_Nonce' ); ?>
26
- <table class="form-table">
27
- </table>
28
-
29
-
30
- <p class="submit"><input type="submit" name="Export_Submit" id="submit" class="button button-primary" value="Export to Spreadsheet" <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /></p></form>
31
-
32
- </div> <!--ewd-ufaq-import-export-container-->
33
-
34
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
html/ImportPage.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
3
- ?>
4
- <div class="wrap">
5
-
6
- <div class="ewd-ufaq-import-export-container">
7
-
8
- <div id="icon-options-general" class="icon32"><br /></div><h2>Import</h2>
9
-
10
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
11
- <div class='ewd-ufaq-upgrade notice'>Upgrade to the premium version to use some of these features</div>
12
- <?php } ?>
13
-
14
- <h4>Import FAQs from a spreadsheet</h4>
15
- <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=ImportPosts&Action=EWD_UFAQ_ImportFaqsFromSpreadsheet" enctype="multipart/form-data">
16
-
17
- <?php wp_nonce_field( 'EWD_UFAQ_Import', 'EWD_UFAQ_Import_Nonce' ); ?>
18
-
19
- <div class="form-field form-required">
20
- <label for="FAQs_Spreadsheet"><?php _e("Spreadsheet Containing FAQs", 'ultimate-faqs') ?></label><br />
21
- <input name="FAQs_Spreadsheet" id="FAQs_Spreadsheet" type="file" value=""/>
22
- </div>
23
-
24
-
25
- <p class="submit"><input type="submit" name="Export_Submit" id="submit" class="button button-primary" value="Import Spreadsheet FAQs" <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/></p></form>
26
-
27
- </div> <!--ewd-ufaq-import-export-container-->
28
-
29
- </div> <!--wrap-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
html/MainScreen.php DELETED
@@ -1,32 +0,0 @@
1
- <div class="EWD_OTP_Menu">
2
- <h2 class="nav-tab-wrapper">
3
- <a id="Dashboard_Menu" class="MenuTab nav-tab <?php if ($Display_Page == '' or $Display_Page == 'Dashboard') {echo 'nav-tab-active';}?>" onclick="ShowTab('Dashboard');"><?php _e("Dashboard", "EWD_OTP"); ?></a>
4
- <a id="Orders_Menu" class="MenuTab nav-tab <?php if ($Display_Page == 'Orders') {echo 'nav-tab-active';}?>" onclick="ShowTab('Orders');"><?php _e("Orders", "EWD_OTP"); ?></a>
5
- <a id="Statuses_Menu" class="MenuTab nav-tab <?php if ($Display_Page == 'Statuses') {echo 'nav-tab-active';}?>" onclick="ShowTab('Statuses');"><?php _e("Statuses", "EWD_OTP"); ?></a>
6
- <a id="Emails_Menu" class="MenuTab nav-tab <?php if ($Display_Page == 'Emails') {echo 'nav-tab-active';}?>" onclick="ShowTab('Emails');"><?php _e("Emails", "EWD_OTP"); ?></a>
7
- <a id="Options_Menu" class="MenuTab nav-tab <?php if ($Display_Page == 'Options') {echo 'nav-tab-active';}?>" onclick="ShowTab('Options');"><?php _e("Options", "EWD_OTP"); ?></a>
8
- </h2>
9
- </div>
10
-
11
- <div class="clear"></div>
12
-
13
- <!-- Add the individual pages to the admin area, and create the active tab based on the selected page -->
14
- <div class="OptionTab <?php if ($Display_Page == "" or $Display_Page == 'Dashboard') {echo 'ActiveTab';} else {echo 'HiddenTab';} ?>" id="Dashboard">
15
- <?php include( plugin_dir_path( __FILE__ ) . 'DashboardPage.php'); ?>
16
- </div>
17
-
18
- <div class="OptionTab <?php if ($Display_Page == 'Orders' or $Display_Page == 'Order') {echo 'ActiveTab';} else {echo 'HiddenTab';} ?>" id="Orders">
19
- <?php include( plugin_dir_path( __FILE__ ) . 'OrdersPage.php'); ?>
20
- </div>
21
-
22
- <div class="OptionTab <?php if ($Display_Page == 'Statuses'or $Display_Page == 'Status') {echo 'ActiveTab';} else {echo 'HiddenTab';} ?>" id="Statuses">
23
- <?php include( plugin_dir_path( __FILE__ ) . 'StatusesPage.php'); ?>
24
- </div>
25
-
26
- <div class="OptionTab <?php if ($Display_Page == 'Emails'or $Display_Page == 'Email') {echo 'ActiveTab';} else {echo 'HiddenTab';} ?>" id="Emails">
27
- <?php include( plugin_dir_path( __FILE__ ) . 'EmailsPage.php'); ?>
28
- </div>
29
-
30
- <div class="OptionTab <?php if ($Display_Page == 'Options' or $Display_Page == 'Option') {echo 'ActiveTab';} else {echo 'HiddenTab';} ?>" id="Options">
31
- <?php include( plugin_dir_path( __FILE__ ) . 'OptionsPage.php'); ?>
32
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
html/OptionsPage.php DELETED
@@ -1,1793 +0,0 @@
1
- <?php
2
- $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
3
- $FAQ_Toggle = get_option("EWD_UFAQ_Toggle");
4
- $FAQ_Category_Toggle = get_option("EWD_UFAQ_Category_Toggle");
5
- $FAQ_Category_Accordion = get_option("EWD_UFAQ_Category_Accordion");
6
- $Expand_Collapse_All = get_option("EWD_UFAQ_Expand_Collapse_All");
7
- $FAQ_Accordion = get_option("EWD_UFAQ_FAQ_Accordion");
8
- $Hide_Categories = get_option("EWD_UFAQ_Hide_Categories");
9
- $Hide_Tags = get_option("EWD_UFAQ_Hide_Tags");
10
- $Scroll_To_Top = get_option("EWD_UFAQ_Scroll_To_Top");
11
- $Display_All_Answers = get_option("EWD_UFAQ_Display_All_Answers");
12
- $Display_Author = get_option("EWD_UFAQ_Display_Author");
13
- $Display_Date = get_option("EWD_UFAQ_Display_Date");
14
- $Display_Back_To_Top = get_option("EWD_UFAQ_Display_Back_To_Top");
15
- $Include_Permalink = get_option("EWD_UFAQ_Include_Permalink");
16
- $Permalink_Type = get_option("EWD_UFAQ_Permalink_Type");
17
- $Show_TinyMCE = get_option("EWD_UFAQ_Show_TinyMCE");
18
- $Comments_On = get_option("EWD_UFAQ_Comments_On");
19
- $Disable_Microdata = get_option("EWD_UFAQ_Disable_Microdata");
20
- $Access_Role = get_option("EWD_UFAQ_Access_Role");
21
-
22
- $Display_Style = get_option("EWD_UFAQ_Display_Style");
23
- $FAQ_Number_Of_Columns = get_option("EWD_UFAQ_FAQ_Number_Of_Columns");
24
- $Responsive_Columns = get_option("EWD_UFAQ_Responsive_Columns");
25
- $Color_Block_Shape = get_option("EWD_UFAQ_Color_Block_Shape");
26
- $FAQs_Per_Page = get_option("EWD_UFAQ_FAQs_Per_Page");
27
- $Page_Type = get_option("EWD_UFAQ_Page_Type");
28
- $FAQ_Ratings = get_option("EWD_UFAQ_FAQ_Ratings");
29
- $Thumbs_Up_Image = get_option("EWD_UFAQ_Thumbs_Up_Image");
30
- $Thumbs_Down_Image = get_option("EWD_UFAQ_Thumbs_Down_Image");
31
- $WooCommerce_FAQs = get_option("EWD_UFAQ_WooCommerce_FAQs");
32
- $Use_Product = get_option("EWD_UFAQ_Use_Product");
33
- $WPForms_Integration = get_option("EWD_UFAQ_WPForms_Integration");
34
- $WPForms_Post_Count = get_option("EWD_UFAQ_WPForms_Post_Count");
35
- $WPForms_FAQ_Location = get_option("EWD_UFAQ_WPForms_FAQ_Location");
36
- $Reveal_Effect = get_option("EWD_UFAQ_Reveal_Effect");
37
- $Pretty_Permalinks = get_option("EWD_UFAQ_Pretty_Permalinks");
38
- $Allow_Proposed_Answer = get_option("EWD_UFAQ_Allow_Proposed_Answer");
39
- $Submit_Custom_Fields = get_option("EWD_UFAQ_Submit_Custom_Fields");
40
- $Submit_Question_Captcha = get_option("EWD_UFAQ_Submit_Question_Captcha");
41
- $Submitted_Default_Category = get_option("EWD_UFAQ_Submitted_Default_Category");
42
- $Admin_Question_Notification = get_option("EWD_UFAQ_Admin_Question_Notification");
43
- $Admin_Notification_Email = get_option("EWD_UFAQ_Admin_Notification_Email");
44
- $Submit_FAQ_Email = get_option("EWD_UFAQ_Submit_FAQ_Email");
45
- $FAQ_Auto_Complete_Titles = get_option("EWD_UFAQ_Auto_Complete_Titles");
46
- $Highlight_Search_Term = get_option("EWD_UFAQ_Highlight_Search_Term");
47
- $Slug_Base = get_option("EWD_UFAQ_Slug_Base");
48
- $Socialmedia_String = get_option("EWD_UFAQ_Social_Media");
49
- $Socialmedia = explode(",", $Socialmedia_String);
50
- $FAQ_Elements = get_option("EWD_UFAQ_FAQ_Elements");
51
-
52
- $Group_By_Category = get_option("EWD_UFAQ_Group_By_Category");
53
- $Group_By_Category_Count = get_option("EWD_UFAQ_Group_By_Category_Count");
54
- $Group_By_Order_By = get_option("EWD_UFAQ_Group_By_Order_By");
55
- $Group_By_Order = get_option("EWD_UFAQ_Group_By_Order");
56
- $Order_By_Setting = get_option("EWD_UFAQ_Order_By");
57
- $Order_Setting = get_option("EWD_UFAQ_Order");
58
-
59
- $FAQ_Fields_Array = get_option("EWD_UFAQ_FAQ_Fields");
60
- $Hide_Blank_Fields = get_option("EWD_UFAQ_Hide_Blank_Fields");
61
-
62
- $Posted_Label = get_option("EWD_UFAQ_Posted_Label");
63
- $By_Label = get_option("EWD_UFAQ_By_Label");
64
- $On_Label = get_option("EWD_UFAQ_On_Label");
65
- $Category_Label = get_option("EWD_UFAQ_Category_Label");
66
- $Tag_Label = get_option("EWD_UFAQ_Tag_Label");
67
- $Enter_Question_Label = get_option("EWD_UFAQ_Enter_Question_Label");
68
- $Search_Label = get_option("EWD_UFAQ_Search_Label");
69
- $Permalink_Label = get_option("EWD_UFAQ_Permalink_Label");
70
- $Back_To_Top_Label = get_option("EWD_UFAQ_Back_To_Top_Label");
71
- $WooCommerce_Tab_Label = get_option("EWD_UFAQ_WooCommerce_Tab_Label");
72
- $Share_FAQ_Label = get_option("EWD_UFAQ_Share_FAQ_Label");
73
- $Find_FAQ_Helpful_Label = get_option("EWD_UFAQ_Find_FAQ_Helpful_Label");
74
- $Search_Placeholder_Label = get_option("EWD_UFAQ_Search_Placeholder_Label");
75
-
76
- $Thank_You_Submit_Label = get_option("EWD_UFAQ_Thank_You_Submit_Label");
77
- $Submit_Question_Label = get_option("EWD_UFAQ_Submit_Question_Label");
78
- $Please_Fill_Form_Below_Label = get_option("EWD_UFAQ_Please_Fill_Form_Below_Label");
79
- $Send_Question_Label = get_option("EWD_UFAQ_Send_Question_Label");
80
- $Question_Title_Label = get_option("EWD_UFAQ_Question_Title_Label");
81
- $What_Question_Being_Answered_Label = get_option("EWD_UFAQ_What_Question_Being_Answered_Label");
82
- $Proposed_Answer_Label = get_option("EWD_UFAQ_Proposed_Answer_Label");
83
- $Review_Author_Label = get_option("EWD_UFAQ_Review_Author_Label");
84
- $What_Name_With_Review_Label = get_option("EWD_UFAQ_What_Name_With_Review_Label");
85
- $Captcha_Image_Number_Label = get_option("EWD_UFAQ_Captcha_Image_Number_Label");
86
- $Retrieving_Results = get_option("EWD_UFAQ_Retrieving_Results");
87
- $No_Results_Found_Text = get_option("EWD_UFAQ_No_Results_Found_Text");
88
-
89
- $UFAQ_Styling_Default_Bg_Color = get_option("EWD_UFAQ_Styling_Default_Bg_Color");
90
- $UFAQ_Styling_Default_Font_Color = get_option("EWD_UFAQ_Styling_Default_Font_Color");
91
- $UFAQ_Styling_Default_Border_Size = get_option("EWD_UFAQ_Styling_Default_Border_Size");
92
- $UFAQ_Styling_Default_Border_Color = get_option("EWD_UFAQ_Styling_Default_Border_Color");
93
- $UFAQ_Styling_Default_Border_Radius = get_option("EWD_UFAQ_Styling_Default_Border_Radius");
94
- $UFAQ_Styling_Toggle_Symbol_Size = get_option("EWD_UFAQ_Styling_Toggle_Symbol_Size");
95
- $UFAQ_Styling_Block_Bg_Color = get_option("EWD_UFAQ_Styling_Block_Bg_Color");
96
- $UFAQ_Styling_Block_Font_Color = get_option("EWD_UFAQ_Styling_Block_Font_Color");
97
- $UFAQ_Styling_List_Font = get_option("EWD_UFAQ_Styling_List_Font");
98
- $UFAQ_Styling_List_Font_Size = get_option("EWD_UFAQ_Styling_List_Font_Size");
99
- $UFAQ_Styling_List_Font_Color = get_option("EWD_UFAQ_Styling_List_Font_Color");
100
- $UFAQ_Styling_List_Margin = get_option("EWD_UFAQ_Styling_List_Margin");
101
- $UFAQ_Styling_List_Padding = get_option("EWD_UFAQ_Styling_List_Padding");
102
-
103
- $UFAQ_Styling_Question_Font = get_option("EWD_UFAQ_Styling_Question_Font");
104
- $UFAQ_Styling_Question_Font_Size = get_option("EWD_UFAQ_Styling_Question_Font_Size");
105
- $UFAQ_Styling_Question_Font_Color = get_option("EWD_UFAQ_Styling_Question_Font_Color");
106
- $UFAQ_Styling_Question_Margin = get_option("EWD_UFAQ_Styling_Question_Margin");
107
- $UFAQ_Styling_Question_Padding = get_option("EWD_UFAQ_Styling_Question_Padding");
108
- $UFAQ_Styling_Question_Icon_Top_Margin = get_option("EWD_UFAQ_Styling_Question_Icon_Top_Margin");
109
- $UFAQ_Styling_Answer_Font = get_option("EWD_UFAQ_Styling_Answer_Font");
110
- $UFAQ_Styling_Answer_Font_Size = get_option("EWD_UFAQ_Styling_Answer_Font_Size");
111
- $UFAQ_Styling_Answer_Font_Color = get_option("EWD_UFAQ_Styling_Answer_Font_Color");
112
- $UFAQ_Styling_Answer_Margin = get_option("EWD_UFAQ_Styling_Answer_Margin");
113
- $UFAQ_Styling_Answer_Padding = get_option("EWD_UFAQ_Styling_Answer_Padding");
114
- $UFAQ_Styling_Postdate_Font = get_option("EWD_UFAQ_Styling_Postdate_Font");
115
- $UFAQ_Styling_Postdate_Font_Size = get_option("EWD_UFAQ_Styling_Postdate_Font_Size");
116
- $UFAQ_Styling_Postdate_Font_Color = get_option("EWD_UFAQ_Styling_Postdate_Font_Color");
117
- $UFAQ_Styling_Postdate_Margin = get_option("EWD_UFAQ_Styling_Postdate_Margin");
118
- $UFAQ_Styling_Postdate_Padding = get_option("EWD_UFAQ_Styling_Postdate_Padding");
119
- $UFAQ_Styling_Category_Heading_Font = get_option("EWD_UFAQ_Styling_Category_Heading_Font");
120
- $UFAQ_Styling_Category_Heading_Font_Size = get_option("EWD_UFAQ_Styling_Category_Heading_Font_Size");
121
- $UFAQ_Styling_Category_Heading_Font_Color = get_option("EWD_UFAQ_Styling_Category_Heading_Font_Color");
122
- $UFAQ_Styling_Category_Font = get_option("EWD_UFAQ_Styling_Category_Font");
123
- $UFAQ_Styling_Category_Font_Size = get_option("EWD_UFAQ_Styling_Category_Font_Size");
124
- $UFAQ_Styling_Category_Font_Color = get_option("EWD_UFAQ_Styling_Category_Font_Color");
125
- $UFAQ_Styling_Category_Margin = get_option("EWD_UFAQ_Styling_Category_Margin");
126
- $UFAQ_Styling_Category_Padding = get_option("EWD_UFAQ_Styling_Category_Padding");
127
-
128
- $UFAQ_Styling_Category_Heading_Type = get_option("EWD_UFAQ_Styling_Category_Heading_Type");
129
- $UFAQ_Styling_FAQ_Heading_Type = get_option("EWD_UFAQ_Styling_FAQ_Heading_Type");
130
- $Toggle_Symbol = get_option("EWD_UFAQ_Toggle_Symbol");
131
-
132
- if (isset($_POST['Display_Tab'])) {$Display_Tab = sanitize_text_field( $_POST['Display_Tab'] );}
133
- else {$Display_Tab = "";}
134
- ?>
135
- <div class="wrap ufaq-options-page-tabbed">
136
- <div class="ufaq-options-submenu-div">
137
- <ul class="ufaq-options-submenu ufaq-options-page-tabbed-nav">
138
- <li><a id="Basic_Menu" class="MenuTab options-subnav-tab <?php if ($Display_Tab == '' or $Display_Tab == 'Basic') {echo 'options-subnav-tab-active';}?>" onclick="ShowOptionTab('Basic');">Basic</a></li>
139
- <li><a id="Premium_Menu" class="MenuTab options-subnav-tab <?php if ($Display_Tab == 'Premium') {echo 'options-subnav-tab-active';}?>" onclick="ShowOptionTab('Premium');">Premium</a></li>
140
- <li><a id="Order_Menu" class="MenuTab options-subnav-tab <?php if ($Display_Tab == 'Order') {echo 'options-subnav-tab-active';}?>" onclick="ShowOptionTab('Order');">Ordering</a></li>
141
- <li><a id="Fields_Menu" class="MenuTab options-subnav-tab <?php if ($Display_Tab == 'Fields') {echo 'options-subnav-tab-active';}?>" onclick="ShowOptionTab('Fields');">Fields</a></li>
142
- <li><a id="Labelling_Menu" class="MenuTab options-subnav-tab <?php if ($Display_Tab == 'Labelling') {echo 'options-subnav-tab-active';}?>" onclick="ShowOptionTab('Labelling');">Labelling</a></li>
143
- <li><a id="Styling_Menu" class="MenuTab options-subnav-tab <?php if ($Display_Tab == 'Styling') {echo 'options-subnav-tab-active';}?>" onclick="ShowOptionTab('Styling');">Styling</a></li>
144
- </ul>
145
- </div>
146
-
147
-
148
- <div class="ufaq-options-page-tabbed-content">
149
-
150
- <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=Options&Action=EWD_UFAQ_UpdateOptions">
151
- <?php wp_nonce_field( 'EWD_UFAQ_Save_Options', 'EWD_UFAQ_Save_Options_Nonce' ); ?>
152
-
153
- <input type='hidden' name='Display_Tab' value='<?php echo esc_attr( $Display_Tab ); ?>' />
154
-
155
- <div id='Basic' class='ufaq-option-set<?php echo ( ($Display_Tab == '' or $Display_Tab == 'Basic') ? '' : ' ufaq-hidden' ); ?>'>
156
- <h2 id='label-basic-options' class='ufaq-options-page-tab-title'>Basic Options</h2>
157
- <br />
158
-
159
- <div class="ewd-ufaq-shortcode-reminder">
160
- <?php _e('<strong>REMINDER:</strong> To display FAQs, place the <strong>[ultimate-faqs]</strong> shortcode on a page', 'ultimate-faqs'); ?>
161
- </div>
162
-
163
- <br />
164
-
165
- <div class="ewd-ufaq-admin-section-heading"><?php _e('General', 'ultimate-faqs'); ?></div>
166
-
167
- <table class="form-table">
168
- <tr>
169
- <th scope="row">Custom CSS</th>
170
- <td>
171
- <fieldset><legend class="screen-reader-text"><span>Custom CSS</span></legend>
172
- <label title='Custom CSS'><textarea class='ewd-ufaq-textarea' name='custom_css'> <?php echo $Custom_CSS; ?></textarea></label><br />
173
- <p>You can add custom CSS styles for your FAQs in the box above.</p>
174
- </fieldset>
175
- </td>
176
- </tr>
177
- <tr>
178
- <th scope="row">Scroll To Top</th>
179
- <td>
180
- <fieldset><legend class="screen-reader-text"><span>Scroll To Top</span></legend>
181
- <div class="ewd-ufaq-admin-hide-radios">
182
- <label title='Yes' class='ewd-ufaq-admin-input-container'><input type='radio' name='scroll_to_top' value='Yes' <?php if($Scroll_To_Top == "Yes") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>Yes</span></label><br />
183
- <label title='No' class='ewd-ufaq-admin-input-container'><input type='radio' name='scroll_to_top' value='No' <?php if($Scroll_To_Top == "No") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>No</span></label><br />
184
- </div>
185
- <label class="ewd-ufaq-admin-switch">
186
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="scroll_to_top" <?php if($Scroll_To_Top == "Yes") {echo "checked='checked'";} ?>>
187
- <span class="ewd-ufaq-admin-switch-slider round"></span>
188
- </label>
189
- <p>Should the browser scroll to the top of the FAQ when it's opened?</p>
190
- </fieldset>
191
- </td>
192
- </tr>
193
- <tr>
194
- <th scope="row">Show Editor Helper</th>
195
- <td>
196
- <fieldset><legend class="screen-reader-text"><span>Show Editor Helper</span></legend>
197
- <div class="ewd-ufaq-admin-hide-radios">
198
- <label title='Yes' class='ewd-ufaq-admin-input-container'><input type='radio' name='show_tinymce' value='Yes' <?php if($Show_TinyMCE == "Yes") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>Yes</span></label><br />
199
- <label title='No' class='ewd-ufaq-admin-input-container'><input type='radio' name='show_tinymce' value='No' <?php if($Show_TinyMCE == "No") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>No</span></label><br />
200
- </div>
201
- <label class="ewd-ufaq-admin-switch">
202
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="show_tinymce" <?php if($Show_TinyMCE == "Yes") {echo "checked='checked'";} ?>>
203
- <span class="ewd-ufaq-admin-switch-slider round"></span>
204
- </label>
205
- <p>Should the shortcode builder be shown above the WordPress page/post editor, in the toolbar buttons?</p>
206
- </fieldset>
207
- </td>
208
- </tr>
209
- <tr>
210
- <th scope="row">Turn On Comment Support</th>
211
- <td>
212
- <fieldset><legend class="screen-reader-text"><span>Turn On Comment Support</span></legend>
213
- <div class="ewd-ufaq-admin-hide-radios">
214
- <label title='Yes'><input type='radio' name='comments_on' value='Yes' <?php if($Comments_On == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
215
- <label title='No'><input type='radio' name='comments_on' value='No' <?php if($Comments_On == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
216
- </div>
217
- <label class="ewd-ufaq-admin-switch">
218
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="comments_on" <?php if($Comments_On == "Yes") {echo "checked='checked'";} ?>>
219
- <span class="ewd-ufaq-admin-switch-slider round"></span>
220
- </label>
221
- <p>Should comment support be turned on, so that if the "Allow Comments" checkbox is selected for a given FAQ, comments are shown in the FAQ list?</p>
222
- </fieldset>
223
- </td>
224
- </tr>
225
- <tr>
226
- <th scope="row">Disable Microdata</th>
227
- <td>
228
- <fieldset><legend class="screen-reader-text"><span>Disable Microdata</span></legend>
229
- <div class="ewd-ufaq-admin-hide-radios">
230
- <label title='Yes'><input type='radio' name='disable_microdata' value='Yes' <?php if($Disable_Microdata == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
231
- <label title='No'><input type='radio' name='disable_microdata' value='No' <?php if($Disable_Microdata == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
232
- </div>
233
- <label class="ewd-ufaq-admin-switch">
234
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="disable_microdata" <?php if($Disable_Microdata == "Yes") {echo "checked='checked'";} ?>>
235
- <span class="ewd-ufaq-admin-switch-slider round"></span>
236
- </label>
237
- <p>By default, the plugin adds FAQ page scheme when the shortcode is used. Select this option to disable this behaviour.</p>
238
- </fieldset>
239
- </td>
240
- </tr>
241
- <tr>
242
- <th scope="row">Include Permalink</th>
243
- <td>
244
- <fieldset><legend class="screen-reader-text"><span>Include Permalink</span></legend>
245
- <label title='No' class='ewd-ufaq-admin-input-container'><input type='radio' name='include_permalink' value='No' <?php if($Include_Permalink == "No") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>None</span></label><br />
246
- <label title='Text' class='ewd-ufaq-admin-input-container'><input type='radio' name='include_permalink' value='Text' <?php if($Include_Permalink == "Text") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>Just Text</span></label><br />
247
- <label title='Icon' class='ewd-ufaq-admin-input-container'><input type='radio' name='include_permalink' value='Icon' <?php if($Include_Permalink == "Icon") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>Just Icon</span></label><br />
248
- <label title='Yes' class='ewd-ufaq-admin-input-container'><input type='radio' name='include_permalink' value='Yes' <?php if($Include_Permalink == "Yes") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>Both Text and Icon</span></label><br />
249
- <p>Display permalink to each question? If so, text, icon or both?</p>
250
- </fieldset>
251
- </td>
252
- </tr>
253
- <tr>
254
- <th scope="row">Permalink Destination</th>
255
- <td>
256
- <fieldset><legend class="screen-reader-text"><span>Permalink Destination/span></legend>
257
- <label title='SamePage' class='ewd-ufaq-admin-input-container'><input type='radio' name='permalink_type' value='SamePage' <?php if($Permalink_Type == "SamePage") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>Main FAQ Page</span></label><br />
258
- <label title='IndividualPage' class='ewd-ufaq-admin-input-container'><input type='radio' name='permalink_type' value='IndividualPage' <?php if($Permalink_Type == "IndividualPage") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>Individual FAQ Page</span></label><br />
259
- <p>Should the permalink link to the main FAQ page or the individual FAQ page?</p>
260
- </fieldset>
261
- </td>
262
- </tr>
263
- <tr>
264
- <th scope="row"><?php _e("Set Access Role", 'ultimate-faqs')?> <br/>
265
- </th>
266
- <td>
267
- <fieldset><legend class="screen-reader-text"><span>Set Access Role</span></legend>
268
- <label title='Access Role'>
269
- <select name='access_role'>
270
- <option value="administrator"<?php if($Access_Role == "administrator") {echo " selected=selected";} ?>>Administrator</option>
271
- <option value="delete_others_pages"<?php if($Access_Role == "delete_others_pages") {echo " selected=selected";} ?>>Editor</option>
272
- <option value="delete_published_posts"<?php if($Access_Role == "delete_published_posts") {echo " selected=selected";} ?>>Author</option>
273
- <option value="delete_posts"<?php if($Access_Role == "edit_posts") {echo " selected=selected";} ?>>Contributor</option>
274
- <option value="read"<?php if($Access_Role == "read") {echo " selected=selected";} ?>>Subscriber</option>
275
- </select>
276
- </label>
277
- <p><?php _e("Which level of user should have access to FAQs, Settings, etc.?", 'ultimate-faqs')?></p>
278
- </fieldset>
279
- </td>
280
- </tr>
281
- </table>
282
-
283
- <br />
284
-
285
- <div class="ewd-ufaq-admin-section-heading"><?php _e('Functionality', 'ultimate-faqs'); ?></div>
286
-
287
- <table class="form-table">
288
- <tr>
289
- <th scope="row">FAQ Toggle</th>
290
- <td>
291
- <fieldset><legend class="screen-reader-text"><span>FAQ Toggle</span></legend>
292
- <div class="ewd-ufaq-admin-hide-radios">
293
- <label title='Yes'><input type='radio' name='faq_toggle' value='Yes' <?php if($FAQ_Toggle == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
294
- <label title='No'><input type='radio' name='faq_toggle' value='No' <?php if($FAQ_Toggle == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
295
- </div>
296
- <label class="ewd-ufaq-admin-switch">
297
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="faq_toggle" <?php if($FAQ_Toggle == "Yes") {echo "checked='checked'";} ?>>
298
- <span class="ewd-ufaq-admin-switch-slider round"></span>
299
- </label>
300
- <p>Should the FAQs hide/open when they are clicked? </p>
301
- </fieldset>
302
- </td>
303
- </tr>
304
- <tr>
305
- <th scope="row">FAQ Accordion</th>
306
- <td>
307
- <fieldset><legend class="screen-reader-text"><span>FAQ Accordion</span></legend>
308
- <div class="ewd-ufaq-admin-hide-radios">
309
- <label title='Yes'><input type='radio' name='faq_accordion' value='Yes' <?php if($FAQ_Accordion == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
310
- <label title='No'><input type='radio' name='faq_accordion' value='No' <?php if($FAQ_Accordion == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
311
- </div>
312
- <label class="ewd-ufaq-admin-switch">
313
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="faq_accordion" <?php if($FAQ_Accordion == "Yes") {echo "checked='checked'";} ?>>
314
- <span class="ewd-ufaq-admin-switch-slider round"></span>
315
- </label>
316
- <p>Should the FAQs accordion? (Only one FAQ is open at a time, requires FAQ Toggle)</p>
317
- </fieldset>
318
- </td>
319
- </tr>
320
- <tr>
321
- <th scope="row">FAQ Category Toggle</th>
322
- <td>
323
- <fieldset><legend class="screen-reader-text"><span>FAQ Category Toggle</span></legend>
324
- <div class="ewd-ufaq-admin-hide-radios">
325
- <label title='Yes'><input type='radio' name='faq_category_toggle' value='Yes' <?php if($FAQ_Category_Toggle == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
326
- <label title='No'><input type='radio' name='faq_category_toggle' value='No' <?php if($FAQ_Category_Toggle == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
327
- </div>
328
- <label class="ewd-ufaq-admin-switch">
329
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="faq_category_toggle" <?php if($FAQ_Category_Toggle == "Yes") {echo "checked='checked'";} ?>>
330
- <span class="ewd-ufaq-admin-switch-slider round"></span>
331
- </label>
332
- <p>Should the FAQ categories hide/open when they are clicked, if FAQs are being grouped by category ("Group FAQs by Category" in the "Ordering" area)? </p>
333
- </fieldset>
334
- </td>
335
- </tr>
336
- <tr>
337
- <th scope="row">FAQ Category Accordion</th>
338
- <td>
339
- <fieldset><legend class="screen-reader-text"><span>FAQ Category Accordion</span></legend>
340
- <div class="ewd-ufaq-admin-hide-radios">
341
- <label title='Yes'><input type='radio' name='faq_category_accordion' value='Yes' <?php if($FAQ_Category_Accordion == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
342
- <label title='No'><input type='radio' name='faq_category_accordion' value='No' <?php if($FAQ_Category_Accordion == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
343
- </div>
344
- <label class="ewd-ufaq-admin-switch">
345
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="faq_category_accordion" <?php if($FAQ_Category_Accordion == "Yes") {echo "checked='checked'";} ?>>
346
- <span class="ewd-ufaq-admin-switch-slider round"></span>
347
- </label>
348
- <p>Should it only be possible to open one FAQ category at a time, if FAQ categories are being toggled ("FAQ Category Toggle" must be set to "Yes" above)? </p>
349
- </fieldset>
350
- </td>
351
- </tr>
352
- <tr>
353
- <th scope="row">FAQ Expand/Collapse All</th>
354
- <td>
355
- <fieldset><legend class="screen-reader-text"><span>FAQ Expand/Collapse All</span></legend>
356
- <div class="ewd-ufaq-admin-hide-radios">
357
- <label title='Yes'><input type='radio' name='expand_collapse_all' value='Yes' <?php if($Expand_Collapse_All == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
358
- <label title='No'><input type='radio' name='expand_collapse_all' value='No' <?php if($Expand_Collapse_All == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
359
- </div>
360
- <label class="ewd-ufaq-admin-switch">
361
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="expand_collapse_all" <?php if($Expand_Collapse_All == "Yes") {echo "checked='checked'";} ?>>
362
- <span class="ewd-ufaq-admin-switch-slider round"></span>
363
- </label>
364
- <p>Should there be a control to open and close all FAQs simultaneously?</p>
365
- </fieldset>
366
- </td>
367
- </tr>
368
- </table>
369
-
370
- <br />
371
-
372
- <div class="ewd-ufaq-admin-section-heading"><?php _e('Display', 'ultimate-faqs'); ?></div>
373
-
374
- <table class="form-table">
375
- <tr>
376
- <th scope="row">Hide Categories</th>
377
- <td>
378
- <fieldset><legend class="screen-reader-text"><span>Hide Categories</span></legend>
379
- <div class="ewd-ufaq-admin-hide-radios">
380
- <label title='Yes'><input type='radio' name='hide_categories' value='Yes' <?php if($Hide_Categories == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
381
- <label title='No'><input type='radio' name='hide_categories' value='No' <?php if($Hide_Categories == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
382
- </div>
383
- <label class="ewd-ufaq-admin-switch">
384
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="hide_categories" <?php if($Hide_Categories == "Yes") {echo "checked='checked'";} ?>>
385
- <span class="ewd-ufaq-admin-switch-slider round"></span>
386
- </label>
387
- <p>Should the categories for each FAQ be hidden?</p>
388
- </fieldset>
389
- </td>
390
- </tr>
391
-
392
- <tr>
393
- <th scope="row">Hide Tags</th>
394
- <td>
395
- <fieldset><legend class="screen-reader-text"><span>Hide Tags</span></legend>
396
- <div class="ewd-ufaq-admin-hide-radios">
397
- <label title='Yes'><input type='radio' name='hide_tags' value='Yes' <?php if($Hide_Tags == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
398
- <label title='No'><input type='radio' name='hide_tags' value='No' <?php if($Hide_Tags == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
399
- </div>
400
- <label class="ewd-ufaq-admin-switch">
401
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="hide_tags" <?php if($Hide_Tags == "Yes") {echo "checked='checked'";} ?>>
402
- <span class="ewd-ufaq-admin-switch-slider round"></span>
403
- </label>
404
- <p>Should the tags for each FAQ be hidden?</p>
405
- </fieldset>
406
- </td>
407
- </tr>
408
- <tr>
409
- <th scope="row">Display All Answers</th>
410
- <td>
411
- <fieldset><legend class="screen-reader-text"><span>Display All Answers</span></legend>
412
- <div class="ewd-ufaq-admin-hide-radios">
413
- <label title='Yes'><input type='radio' name='display_all_answers' value='Yes' <?php if($Display_All_Answers == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
414
- <label title='No'><input type='radio' name='display_all_answers' value='No' <?php if($Display_All_Answers == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
415
- </div>
416
- <label class="ewd-ufaq-admin-switch">
417
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="display_all_answers" <?php if($Display_All_Answers == "Yes") {echo "checked='checked'";} ?>>
418
- <span class="ewd-ufaq-admin-switch-slider round"></span>
419
- </label>
420
- <p>Should all answers be displayed when the page loads? (Careful if FAQ Accordion is on)</p>
421
- </fieldset>
422
- </td>
423
- </tr>
424
- <tr>
425
- <th scope="row">Display Post Author</th>
426
- <td>
427
- <fieldset><legend class="screen-reader-text"><span>Display Post Author</span></legend>
428
- <div class="ewd-ufaq-admin-hide-radios">
429
- <label title='Yes'><input type='radio' name='display_author' value='Yes' <?php if($Display_Author == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
430
- <label title='No'><input type='radio' name='display_author' value='No' <?php if($Display_Author == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
431
- </div>
432
- <label class="ewd-ufaq-admin-switch">
433
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="display_author" <?php if($Display_Author == "Yes") {echo "checked='checked'";} ?>>
434
- <span class="ewd-ufaq-admin-switch-slider round"></span>
435
- </label>
436
- <p>Should the display name of the post's author be displayed beneath the FAQ title?</p>
437
- </fieldset>
438
- </td>
439
- </tr>
440
- <tr>
441
- <th scope="row">Display Post Date</th>
442
- <td>
443
- <fieldset><legend class="screen-reader-text"><span>Display Post Date</span></legend>
444
- <div class="ewd-ufaq-admin-hide-radios">
445
- <label title='Yes'><input type='radio' name='display_date' value='Yes' <?php if($Display_Date == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
446
- <label title='No'><input type='radio' name='display_date' value='No' <?php if($Display_Date == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
447
- </div>
448
- <label class="ewd-ufaq-admin-switch">
449
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="display_date" <?php if($Display_Date == "Yes") {echo "checked='checked'";} ?>>
450
- <span class="ewd-ufaq-admin-switch-slider round"></span>
451
- </label>
452
- <p>Should the date the post was created be displayed beneath the FAQ title?</p>
453
- </fieldset>
454
- </td>
455
- </tr>
456
- <tr>
457
- <th scope="row">Display 'Back to Top'</th>
458
- <td>
459
- <fieldset><legend class="screen-reader-text"><span>Display 'Back to Top'</span></legend>
460
- <div class="ewd-ufaq-admin-hide-radios">
461
- <label title='Yes'><input type='radio' name='display_back_to_top' value='Yes' <?php if($Display_Back_To_Top == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
462
- <label title='No'><input type='radio' name='display_back_to_top' value='No' <?php if($Display_Back_To_Top == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
463
- </div>
464
- <label class="ewd-ufaq-admin-switch">
465
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="display_back_to_top" <?php if($Display_Back_To_Top == "Yes") {echo "checked='checked'";} ?>>
466
- <span class="ewd-ufaq-admin-switch-slider round"></span>
467
- </label>
468
- <p>Should a link to return to the top of the page be added to each FAQ post?</p>
469
- </fieldset>
470
- </td>
471
- </tr>
472
- </table>
473
- </div>
474
-
475
- <div id='Premium' class='ufaq-option-set<?php echo ( $Display_Tab == 'Premium' ? '' : ' ufaq-hidden' ); ?>'>
476
- <h2 id='label-premium-options' class='ufaq-options-page-tab-title'>Premium Options</h2>
477
-
478
- <br />
479
-
480
- <div class="ewd-ufaq-admin-section-heading"><?php _e('Display', 'ultimate-faqs'); ?></div>
481
-
482
- <table class="form-table ewd-ufaq-premium-options-table">
483
- <tr>
484
- <th scope="row">FAQ Display Style</th>
485
- <td>
486
- <fieldset><legend class="screen-reader-text"><span>FAQ Display Style</span></legend>
487
- <label title='Default Style' class='ewd-ufaq-admin-input-container'><input type='radio' name='display_style' value='Default' <?php if($Display_Style == "Default") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/><span class='ewd-ufaq-admin-radio-button'></span> <span>Default</span></label><br />
488
- <label title='Block Style' class='ewd-ufaq-admin-input-container'><input type='radio' name='display_style' value='Block' <?php if($Display_Style == "Block") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/><span class='ewd-ufaq-admin-radio-button'></span> <span>Block</span></label><br />
489
- <label title='Border Block Style' class='ewd-ufaq-admin-input-container'><input type='radio' name='display_style' value='Border_Block' <?php if($Display_Style == "Border_Block") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/><span class='ewd-ufaq-admin-radio-button'></span> <span>Border Block</span></label><br />
490
- <label title='Contemporary Style' class='ewd-ufaq-admin-input-container'><input type='radio' name='display_style' value='Contemporary' <?php if($Display_Style == "Contemporary") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/><span class='ewd-ufaq-admin-radio-button'></span> <span>Contemporary</span></label><br />
491
- <label title='List Style' class='ewd-ufaq-admin-input-container'><input type='radio' name='display_style' value='List' <?php if($Display_Style == "List") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/><span class='ewd-ufaq-admin-radio-button'></span> <span>List</span></label><br />
492
- <label title='Minimalist Style' class='ewd-ufaq-admin-input-container'><input type='radio' name='display_style' value='Minimalist' <?php if($Display_Style == "Minimalist") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/><span class='ewd-ufaq-admin-radio-button'></span> <span>Minimalist</span></label><br />
493
- <p>Which theme should be used to display the FAQ's?</p>
494
- </fieldset>
495
- </td>
496
- </tr>
497
- <tr>
498
- <th scope="row">Number of Columns</th>
499
- <td>
500
- <fieldset><legend class="screen-reader-text"><span>Number of Columns</span></legend>
501
- <label title='One' class='ewd-ufaq-admin-input-container'><input type='radio' name='faq_number_of_columns' value='One' <?php if($FAQ_Number_Of_Columns == "One") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span><?php _e('One', 'ultimate-faqs'); ?></span></label><br />
502
- <label title='Two' class='ewd-ufaq-admin-input-container'><input type='radio' name='faq_number_of_columns' value='Two' <?php if($FAQ_Number_Of_Columns == "Two") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span><?php _e('Two', 'ultimate-faqs'); ?></span></label><br />
503
- <label title='Three' class='ewd-ufaq-admin-input-container'><input type='radio' name='faq_number_of_columns' value='Three' <?php if($FAQ_Number_Of_Columns == "Three") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span><?php _e('Three', 'ultimate-faqs'); ?></span></label><br />
504
- <label title='Four' class='ewd-ufaq-admin-input-container'><input type='radio' name='faq_number_of_columns' value='Four' <?php if($FAQ_Number_Of_Columns == "Four") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span><?php _e('Four', 'ultimate-faqs'); ?></span></label><br />
505
- <p>In how many columns would you like your FAQs to display?</p>
506
- </fieldset>
507
- </td>
508
- </tr>
509
- <tr>
510
- <th scope="row">Responsive Columns</th>
511
- <td>
512
- <fieldset><legend class="screen-reader-text"><span>Responsive Columns</span></legend>
513
- <div class="ewd-ufaq-admin-hide-radios">
514
- <label title='Yes'><input type='radio' name='responsive_columns' value='Yes' <?php if($Responsive_Columns == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
515
- <label title='No'><input type='radio' name='responsive_columns' value='No' <?php if($Responsive_Columns == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
516
- </div>
517
- <label class="ewd-ufaq-admin-switch">
518
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="responsive_columns" <?php if($Responsive_Columns == "Yes") {echo "checked='checked'";} ?>>
519
- <span class="ewd-ufaq-admin-switch-slider round"></span>
520
- </label>
521
- <p>If you have more than one column, would you like them to be responsive? If this option is disabled, the number of columns will remain the same on all screen sizes.</p>
522
- </fieldset>
523
- </td>
524
- </tr>
525
- <tr>
526
- <th scope="row">Reveal Effect</th>
527
- <td>
528
- <fieldset><legend class="screen-reader-text"><span>Reveal Effect</span></legend>
529
- <label title='Reveal Effect'>
530
- <select name="reveal_effect" <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> >
531
- <option value="none" <?php if($Reveal_Effect == "none") {echo "selected=selected";} ?> >None</option>
532
- <option value="blind" <?php if($Reveal_Effect == "blind") {echo "selected=selected";} ?> >Blind</option>
533
- <option value="bounce" <?php if($Reveal_Effect == "bounce") {echo "selected=selected";} ?> >Bounce</option>
534
- <option value="clip" <?php if($Reveal_Effect == "clip") {echo "selected=selected";} ?> >Clip</option>
535
- <option value="drop" <?php if($Reveal_Effect == "drop") {echo "selected=selected";} ?> >Drop</option>
536
- <option value="explode" <?php if($Reveal_Effect == "explode") {echo "selected=selected";} ?> >Explode</option>
537
- <option value="fade" <?php if($Reveal_Effect == "fade") {echo "selected=selected";} ?> >Fade</option>
538
- <option value="fold" <?php if($Reveal_Effect == "fold") {echo "selected=selected";} ?> >Fold</option>
539
- <option value="highlight" <?php if($Reveal_Effect == "highlight") {echo "selected=selected";} ?> >Highlight</option>
540
- <option value="puff" <?php if($Reveal_Effect == "puff") {echo "selected=selected";} ?> >Puff</option>
541
- <option value="pulsate" <?php if($Reveal_Effect == "pulsate") {echo "selected=selected";} ?> >Pulsate</option>
542
- <option value="shake" <?php if($Reveal_Effect == "shake") {echo "selected=selected";} ?> >Shake</option>
543
- <option value="size" <?php if($Reveal_Effect == "size") {echo "selected=selected";} ?> >Size</option>
544
- <option value="slide" <?php if($Reveal_Effect == "slide") {echo "selected=selected";} ?> >Slide</option>
545
- </select>
546
- </label>
547
- <p>How should FAQ's be displayed when their titles are clicked?</p>
548
- </fieldset>
549
- </td>
550
- </tr>
551
- <tr>
552
- <th scope="row">FAQs Per Page</th>
553
- <td>
554
- <fieldset><legend class="screen-reader-text"><span>FAQs Per Page</span></legend>
555
- <input type='text' name='faqs_per_page' value='<?php echo $FAQs_Per_Page; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> size='60'/>
556
- <p>How many FAQs should be displayed on each page? (Leave blank to display all FAQs)</p>
557
- </fieldset>
558
- </td>
559
- </tr>
560
- <tr>
561
- <th scope="row">FAQ Page Type</th>
562
- <td>
563
- <fieldset><legend class="screen-reader-text"><span>FAQ Page Type</span></legend>
564
- <label title='Distinct' class='ewd-ufaq-admin-input-container'><input type='radio' name='page_type' value='Distinct' <?php if($Page_Type == "Distinct") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/><span class='ewd-ufaq-admin-radio-button'></span> <span>Distinct Pages</span></label><br />
565
- <label title='Load More' class='ewd-ufaq-admin-input-container'><input type='radio' name='page_type' value='Load_More' <?php if($Page_Type == "Load_More") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/><span class='ewd-ufaq-admin-radio-button'></span> <span>Load More Button</span></label><br />
566
- <label title='Infinite Scroll' class='ewd-ufaq-admin-input-container'><input type='radio' name='page_type' value='Infinite_Scroll' <?php if($Page_Type == "Infinite_Scroll") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/><span class='ewd-ufaq-admin-radio-button'></span> <span>Infinite Scroll</span></label><br />
567
- <p>If FAQs are in pages, how should pages load?</p>
568
- </fieldset>
569
- </td>
570
- </tr>
571
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
572
- <tr class="ewd-ufaq-premium-options-table-overlay">
573
- <th colspan="2">
574
- <div class="ewd-ufaq-unlock-premium">
575
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
576
- <p>Access this section by by upgrading to premium</p>
577
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
578
- </div>
579
- </th>
580
- </tr>
581
- <?php } ?>
582
- </table>
583
-
584
- <br />
585
-
586
- <div class="ewd-ufaq-admin-section-heading"><?php _e('General', 'ultimate-faqs'); ?></div>
587
-
588
- <table class="form-table ewd-ufaq-premium-options-table">
589
- <tr>
590
- <th scope="row">FAQ Ratings</th>
591
- <td>
592
- <fieldset><legend class="screen-reader-text"><span>FAQ Ratings</span></legend>
593
- <div class="ewd-ufaq-admin-hide-radios">
594
- <label title='Yes'><input type='radio' name='faq_ratings' value='Yes' <?php if($FAQ_Ratings == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
595
- <label title='No'><input type='radio' name='faq_ratings' value='No' <?php if($FAQ_Ratings == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
596
- </div>
597
- <label class="ewd-ufaq-admin-switch">
598
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="faq_ratings" <?php if($FAQ_Ratings == "Yes") {echo "checked='checked'";} ?>>
599
- <span class="ewd-ufaq-admin-switch-slider round"></span>
600
- </label>
601
- <p>Should visitors be able to up or down vote FAQs to let others know if they found them helpful?</p>
602
- </fieldset>
603
- </td>
604
- </tr>
605
- <tr id="ewd-ufaq-thumbs-up-upload"<?php echo ($FAQ_Ratings == 'No' ? ' class="ufaq-hidden"' : ''); ?>>
606
- <th scope="row">FAQ Ratings 'Thumbs Up' Image</th>
607
- <td>
608
- <fieldset><legend class="screen-reader-text"><span>FAQ Ratings 'Thumbs Up' Image</span></legend>
609
- <label>
610
- <input id='Thumbs_Up_Image' type='text' size='36' name='Thumbs_Up_Image' value='<?php if ($Thumbs_Up_Image == "") {echo "http://";} else {echo $Thumbs_Up_Image;} ?>' />
611
- <input id='Thumbs_Up_Image_button' class='button' type='button' value='Upload Image' />
612
- </label>
613
- <p>You can use this to upload your own image to replace the default "thumbs up" image.</p>
614
- </fieldset>
615
- </td>
616
- </tr>
617
- <tr id="ewd-ufaq-thumbs-down-upload"<?php echo ($FAQ_Ratings == 'No' ? ' class="ufaq-hidden"' : ''); ?>>
618
- <th scope="row">FAQ Ratings 'Thumbs Down' Image</th>
619
- <td>
620
- <fieldset><legend class="screen-reader-text"><span>FAQ Ratings 'Thumbs Down' Image</span></legend>
621
- <label>
622
- <input id='Thumbs_Down_Image' type='text' size='36' name='Thumbs_Down_Image' value='<?php if ($Thumbs_Down_Image == "") {echo "http://";} else {echo $Thumbs_Down_Image;} ?>' />
623
- <input id='Thumbs_Down_Image_button' class='button' type='button' value='Upload Image' />
624
- </label>
625
- <p>You can use this to upload your own image to replace the default "thumbs down" image.</p>
626
- </fieldset>
627
- </td>
628
- </tr>
629
- <tr>
630
- <th scope="row">Pretty Permalinks</th>
631
- <td>
632
- <fieldset><legend class="screen-reader-text"><span>Pretty Permalinks</span></legend>
633
- <div class="ewd-ufaq-admin-hide-radios">
634
- <label title='Yes'><input type='radio' name='pretty_permalinks' value='Yes' <?php if($Pretty_Permalinks == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
635
- <label title='No'><input type='radio' name='pretty_permalinks' value='No' <?php if($Pretty_Permalinks == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
636
- </div>
637
- <label class="ewd-ufaq-admin-switch">
638
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="pretty_permalinks" <?php if($Pretty_Permalinks == "Yes") {echo "checked='checked'";} ?>>
639
- <span class="ewd-ufaq-admin-switch-slider round"></span>
640
- </label>
641
- <p>Should an SEO friendly permalink structure be used for the link to the FAQ?</p>
642
- </fieldset>
643
- </td>
644
- </tr>
645
- <tr>
646
- <th scope="row">FAQ Auto Complete Titles</th>
647
- <td>
648
- <fieldset><legend class="screen-reader-text"><span>FAQ Auto Complete Titles</span></legend>
649
- <div class="ewd-ufaq-admin-hide-radios">
650
- <label title='Yes'><input type='radio' name='faq_auto_complete_titles' value='Yes' <?php if($FAQ_Auto_Complete_Titles == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
651
- <label title='No'><input type='radio' name='faq_auto_complete_titles' value='No' <?php if($FAQ_Auto_Complete_Titles == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
652
- </div>
653
- <label class="ewd-ufaq-admin-switch">
654
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="faq_auto_complete_titles" <?php if($FAQ_Auto_Complete_Titles == "Yes") {echo "checked='checked'";} ?>>
655
- <span class="ewd-ufaq-admin-switch-slider round"></span>
656
- </label>
657
- <p>Should the FAQ Titles auto complete when using the FAQ search shortcode?</p>
658
- </fieldset>
659
- </td>
660
- </tr>
661
- <tr>
662
- <th scope="row">FAQ Slug Base</th>
663
- <td>
664
- <fieldset><legend class="screen-reader-text"><span>FAQ Slug Base</span></legend>
665
- <label><input type='text' name='slug_base' value='<?php echo $Slug_Base; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> size='60'/></label>
666
- <p>This option can be used to change the slug base for all FAQ posts. Be sure to go to "Settings" -> "Permalinks" in the WordPress sidebar and hit "Save Changes" to avoid 404 errors.</p>
667
- </fieldset>
668
- </td>
669
- </tr>
670
- <tr>
671
- <th scope="row">Social Media Option</th>
672
- <td>
673
- <fieldset><legend class="screen-reader-text"><span>Social Media Option</span></legend>
674
- <label title='Facebook' class='ewd-ufaq-admin-input-container'><input type='checkbox' name='Socialmedia[]' value='Facebook' <?php if(in_array("Facebook", $Socialmedia)) {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-checkbox'></span> <span>Facebook</span></label><br />
675
- <label title='Name' class='ewd-ufaq-admin-input-container'><input type='checkbox' name='Socialmedia[]' value='Google' <?php if(in_array("Google", $Socialmedia)) {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-checkbox'></span> <span>Google</span></label><br />
676
- <label title='Twitter' class='ewd-ufaq-admin-input-container'><input type='checkbox' name='Socialmedia[]' value='Twitter' <?php if(in_array("Twitter", $Socialmedia)) {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-checkbox'></span> <span>Twitter</span></label><br />
677
- <label title='Linkedin' class='ewd-ufaq-admin-input-container'><input type='checkbox' name='Socialmedia[]' value='Linkedin' <?php if(in_array("Linkedin", $Socialmedia)) {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-checkbox'></span> <span>Linkedin</span></label><br />
678
- <label title='Pinterest' class='ewd-ufaq-admin-input-container'><input type='checkbox' name='Socialmedia[]' value='Pinterest' <?php if(in_array("Pinterest", $Socialmedia)) {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-checkbox'></span> <span>Pinterest</span></label><br />
679
- <label title='Email' class='ewd-ufaq-admin-input-container'><input type='checkbox' name='Socialmedia[]' value='Email' <?php if(in_array("Email", $Socialmedia)) {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-checkbox'></span> <span>Email</span></label><br />
680
- <div style='display:none;'><label title='Blank'><input type='checkbox' name='Socialmedia[]' value='Blank' checked='checked'/> <span>Blank</span></label></div>
681
- </fieldset>
682
- </td>
683
- </tr>
684
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
685
- <tr class="ewd-ufaq-premium-options-table-overlay">
686
- <th colspan="2">
687
- <div class="ewd-ufaq-unlock-premium">
688
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
689
- <p>Access this section by by upgrading to premium</p>
690
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
691
- </div>
692
- </th>
693
- </tr>
694
- <?php } ?>
695
- </table>
696
-
697
- <br />
698
-
699
- <div class="ewd-ufaq-admin-section-heading"><?php _e('WooCommerce', 'ultimate-faqs'); ?></div>
700
-
701
- <table class="form-table ewd-ufaq-premium-options-table <?php echo $UFAQ_Full_Version; ?>">
702
- <tr>
703
- <th scope="row">WooCommerce FAQs</th>
704
- <td>
705
- <fieldset><legend class="screen-reader-text"><span>WooCommerce FAQs</span></legend>
706
- <div class="ewd-ufaq-admin-hide-radios">
707
- <label title='Yes'><input type='radio' name='woocommerce_faqs' value='Yes' <?php if($WooCommerce_FAQs == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
708
- <label title='No'><input type='radio' name='woocommerce_faqs' value='No' <?php if($WooCommerce_FAQs == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
709
- </div>
710
- <label class="ewd-ufaq-admin-switch">
711
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="woocommerce_faqs" <?php if($WooCommerce_FAQs == "Yes") {echo "checked='checked'";} ?>>
712
- <span class="ewd-ufaq-admin-switch-slider round"></span>
713
- </label>
714
- <p>Should FAQs for a given product be displayed as an extra tab on the WooCommerce product page?<br/> For this to work correctly, an FAQ category needs to be created with the same name as a given WooCommerce product.</p>
715
- </fieldset>
716
- </td>
717
- </tr>
718
- <tr>
719
- <th scope="row">Use WooCommerce Product Object</th>
720
- <td>
721
- <fieldset><legend class="screen-reader-text"><span>Use WooCommerce Product Object</span></legend>
722
- <div class="ewd-ufaq-admin-hide-radios">
723
- <label title='Yes'><input type='radio' name='use_product' value='Yes' <?php if($Use_Product == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
724
- <label title='No'><input type='radio' name='use_product' value='No' <?php if($Use_Product == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
725
- </div>
726
- <label class="ewd-ufaq-admin-switch">
727
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="use_product" <?php if($Use_Product == "Yes") {echo "checked='checked'";} ?>>
728
- <span class="ewd-ufaq-admin-switch-slider round"></span>
729
- </label>
730
- <p>Should the FAQ tab be set up using the WooCommerce product object, as in the WC documentation, or just using the ID of the page?</p>
731
- </fieldset>
732
- </td>
733
- </tr>
734
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
735
- <tr class="ewd-ufaq-premium-options-table-overlay">
736
- <th colspan="2">
737
- <div class="ewd-ufaq-unlock-premium">
738
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
739
- <p>Access this section by by upgrading to premium</p>
740
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
741
- </div>
742
- </th>
743
- </tr>
744
- <?php } ?>
745
- </table>
746
-
747
- <br />
748
-
749
- <div class="ewd-ufaq-admin-section-heading"><?php _e('WP Forms', 'ultimate-faqs'); ?></div>
750
-
751
- <table class="form-table ewd-ufaq-premium-options-table <?php echo $UFAQ_Full_Version; ?>">
752
- <tr>
753
- <th scope="row">WP Forms Integration</th>
754
- <td>
755
- <fieldset><legend class="screen-reader-text"><span>WP Forms Integration</span></legend>
756
- <div class="ewd-ufaq-admin-hide-radios">
757
- <label title='Yes'><input type='radio' name='wpforms_integration' value='Yes' <?php if($WPForms_Integration == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
758
- <label title='No'><input type='radio' name='wpforms_integration' value='No' <?php if($WPForms_Integration == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
759
- </div>
760
- <label class="ewd-ufaq-admin-switch">
761
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="wpforms_integration" <?php if($WPForms_Integration == "Yes") {echo "checked='checked'";} ?>>
762
- <span class="ewd-ufaq-admin-switch-slider round"></span>
763
- </label>
764
- <p>Should FAQs be displayed when a visitor starts typing a message into a paragraph text field in WP Forms? This can be turned off for specific forms via the form's settings panel.</p>
765
- </fieldset>
766
- </td>
767
- </tr>
768
- <tr>
769
- <th scope="row">WP Forms Post Count</th>
770
- <td>
771
- <fieldset><legend class="screen-reader-text"><span>WP Forms Post Count</span></legend>
772
- <label><input type='text' name='wpforms_post_count' value='<?php echo $WPForms_Post_Count; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> size='60'/></label>
773
- <p>How many posts should be displayed below paragraph text fields, if WP Forms Integration has been turned on?</p>
774
- </fieldset>
775
- </td>
776
- </tr>
777
- <tr>
778
- <th scope="row">WP Forms FAQ Location</th>
779
- <td>
780
- <fieldset><legend class="screen-reader-text"><span>WP Forms FAQ Location</span></legend>
781
- <label title='Above' class='ewd-ufaq-admin-input-container'><input type='radio' name='wpforms_faq_location' value='Above' <?php if($WPForms_FAQ_Location == "Above") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/><span class='ewd-ufaq-admin-radio-button'></span> <span>Above</span></label><br />
782
- <label title='Below' class='ewd-ufaq-admin-input-container'><input type='radio' name='wpforms_faq_location' value='Below' <?php if($WPForms_FAQ_Location == "Below") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/><span class='ewd-ufaq-admin-radio-button'></span> <span>Below</span></label><br />
783
- <p>If WP Forms Integration has been turned on, where should the FAQs be displayed?</p>
784
- </fieldset>
785
- </td>
786
- </tr>
787
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
788
- <tr class="ewd-ufaq-premium-options-table-overlay">
789
- <th colspan="2">
790
- <div class="ewd-ufaq-unlock-premium">
791
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
792
- <p>Access this section by by upgrading to premium</p>
793
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
794
- </div>
795
- </th>
796
- </tr>
797
- <?php } ?>
798
- </table>
799
-
800
- <br />
801
-
802
- <div class="ewd-ufaq-admin-section-heading"><?php _e('Submit FAQ', 'ultimate-faqs'); ?></div>
803
-
804
- <table class="form-table ewd-ufaq-premium-options-table">
805
- <tr>
806
- <th scope="row">Allow Proposed Answer</th>
807
- <td>
808
- <fieldset><legend class="screen-reader-text"><span>Allow Proposed Answer</span></legend>
809
- <div class="ewd-ufaq-admin-hide-radios">
810
- <label title='Yes'><input type='radio' name='allow_proposed_answer' value='Yes' <?php if($Allow_Proposed_Answer == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
811
- <label title='No'><input type='radio' name='allow_proposed_answer' value='No' <?php if($Allow_Proposed_Answer == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
812
- </div>
813
- <label class="ewd-ufaq-admin-switch">
814
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="allow_proposed_answer" <?php if($Allow_Proposed_Answer == "Yes") {echo "checked='checked'";} ?>>
815
- <span class="ewd-ufaq-admin-switch-slider round"></span>
816
- </label>
817
- <p>When using the user-submitted question shortcode, should users be able to propose an answer to the question they're submitting?</p>
818
- </fieldset>
819
- </td>
820
- </tr>
821
- <tr>
822
- <th scope="row">Submit Custom Fields</th>
823
- <td>
824
- <fieldset><legend class="screen-reader-text"><span>Submit Custom Fields</span></legend>
825
- <div class="ewd-ufaq-admin-hide-radios">
826
- <label title='Yes'><input type='radio' name='submit_custom_fields' value='Yes' <?php if($Submit_Custom_Fields == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
827
- <label title='No'><input type='radio' name='submit_custom_fields' value='No' <?php if($Submit_Custom_Fields == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
828
- </div>
829
- <label class="ewd-ufaq-admin-switch">
830
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="submit_custom_fields" <?php if($Submit_Custom_Fields == "Yes") {echo "checked='checked'";} ?>>
831
- <span class="ewd-ufaq-admin-switch-slider round"></span>
832
- </label>
833
- <p>When using the user-submitted question shortcode, should users be able to fill in custom fields for the question they're submitting? File type custom fields cannot be submitted for security reasons.</p>
834
- </fieldset>
835
- </td>
836
- </tr>
837
- <tr>
838
- <th scope="row">Submit Question Captcha</th>
839
- <td>
840
- <fieldset><legend class="screen-reader-text"><span>Submit Question Captcha</span></legend>
841
- <div class="ewd-ufaq-admin-hide-radios">
842
- <label title='Yes'><input type='radio' name='submit_question_captcha' value='Yes' <?php if($Submit_Question_Captcha == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
843
- <label title='No'><input type='radio' name='submit_question_captcha' value='No' <?php if($Submit_Question_Captcha == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
844
- </div>
845
- <label class="ewd-ufaq-admin-switch">
846
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="submit_question_captcha" <?php if($Submit_Question_Captcha == "Yes") {echo "checked='checked'";} ?>>
847
- <span class="ewd-ufaq-admin-switch-slider round"></span>
848
- </label>
849
- <p>When using the user-submitted question shortcode, should a captcha field be added to the form to reduce the volume of spam FAQs?</p>
850
- </fieldset>
851
- </td>
852
- </tr>
853
- <tr>
854
- <th scope="row">Default Category</th>
855
- <td>
856
- <fieldset><legend class="screen-reader-text"><span>Default Category</span></legend>
857
- <label title='Default Category'>
858
- <select name="submitted_default_category" <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> >
859
- <option value="none" <?php if($Submitted_Default_Category == "none") {echo "selected=selected";} ?> >None</option>
860
- <?php
861
- $faqCategories = get_terms([
862
- 'taxonomy' => 'ufaq-category',
863
- 'hide_empty' => false,
864
- ]);
865
- foreach($faqCategories as $faqCategory){
866
- ?>
867
- <option value="<?php echo $faqCategory->slug; ?>" <?php if($Submitted_Default_Category == $faqCategory->slug) {echo "selected=selected";} ?> ><?php echo $faqCategory->name; ?></option>
868
- <?php
869
- }
870
- ?>
871
- </select>
872
- </label>
873
- <p>Which category should submitted questions default to?</p>
874
- </fieldset>
875
- </td>
876
- </tr>
877
- <tr>
878
- <th scope="row">Admin Question Notification</th>
879
- <td>
880
- <fieldset><legend class="screen-reader-text"><span>Admin Question Notification</span></legend>
881
- <div class="ewd-ufaq-admin-hide-radios">
882
- <label title='Yes'><input type='radio' name='admin_question_notification' value='Yes' <?php if($Admin_Question_Notification == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
883
- <label title='No'><input type='radio' name='admin_question_notification' value='No' <?php if($Admin_Question_Notification == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
884
- </div>
885
- <label class="ewd-ufaq-admin-switch">
886
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="admin_question_notification" <?php if($Admin_Question_Notification == "Yes") {echo "checked='checked'";} ?>>
887
- <span class="ewd-ufaq-admin-switch-slider round"></span>
888
- </label>
889
- <p>Should an email be sent to the site administrator when a question is submitted?</p>
890
- </fieldset>
891
- </td>
892
- </tr>
893
- <tr>
894
- <th scope="row">Admin Notification Email</th>
895
- <td>
896
- <fieldset><legend class="screen-reader-text"><span>Admin Notification Email</span></legend>
897
- <label><input type='text' name='admin_notification_email' value='<?php echo $Admin_Notification_Email; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> size='60'/></label>
898
- <p>What email address should the notifications be sent to if "Admin Question Notifications" are set to "Yes" above? If blank, the default WordPress admin email will be used.</p>
899
- </fieldset>
900
- </td>
901
- </tr>
902
- <tr>
903
- <th scope="row">FAQ Submitted Thank You E-mail</th>
904
- <td>
905
- <fieldset><legend class="screen-reader-text"><span>FAQ Submitted Thank You E-mail</span></legend>
906
- <?php
907
- $plugin = "ultimate-wp-mail/Main.php";
908
- $UWPM_Installed = is_plugin_active($plugin);
909
- if ($UWPM_Installed) {
910
- $UWPM_Emails = get_posts(array('post_type' => 'uwpm_mail_template', 'posts_per_page' => -1));
911
- echo "<label>";
912
- echo "<select name='submit_faq_email'>";
913
- echo "<option value='0'>" . __("None", 'ultimate-faqs') . "</option>";
914
- foreach ($UWPM_Emails as $Email) {
915
- echo "<option value='" . $Email->ID . "' " . ($Submit_FAQ_Email == $Email->ID ? 'selected' : '') . ">" . $Email->post_title . "</option>";
916
- }
917
- echo "</select>";
918
- echo "</label>";
919
- echo "<p>What email should be sent out when an FAQ is submitted?</p>";
920
- }
921
- else {
922
- echo "<p>You can use the <a href='https://wordpress.org/plugins/ultimate-wp-mail/' target='_blank'>Ultimate WP Mail plugin</a> to create a custom email that is sent whenever an FAQ is submitted.</p>";
923
- }
924
- ?>
925
- </fieldset>
926
- </td>
927
- </tr>
928
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
929
- <tr class="ewd-ufaq-premium-options-table-overlay">
930
- <th colspan="2">
931
- <div class="ewd-ufaq-unlock-premium">
932
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
933
- <p>Access this section by by upgrading to premium</p>
934
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
935
- </div>
936
- </th>
937
- </tr>
938
- <?php } ?>
939
- </table>
940
-
941
- <br />
942
-
943
- <div class="ewd-ufaq-admin-section-heading"><?php _e('FAQ Elements Order (if toggled on)', 'ultimate-faqs'); ?></div>
944
-
945
- <table class='ewd-ufaq-elements-table ewd-ufaq-premium-options-table'>
946
- <!-- <thead>
947
- <tr>
948
- <th><?php _e("Element (if toggled on)", 'ultimate-faqs'); ?></th>
949
- </tr>
950
- </thead> -->
951
- <tbody>
952
- <?php foreach ($FAQ_Elements as $Order => $FAQ_Element) { ?>
953
- <tr class='ewd-ufaq-element'>
954
- <td><input type='hidden' name='Element_<?php echo $Order; ?>' value='<?php echo $FAQ_Element; ?>' /><span class='ewd-ufaq-element-name'><?php echo $FAQ_Element; ?></span></td>
955
- </tr>
956
- <?php } ?>
957
- </tbody>
958
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
959
- <tr class="ewd-ufaq-premium-options-table-overlay">
960
- <th colspan="2">
961
- <div class="ewd-ufaq-unlock-premium">
962
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
963
- <p>Access this section by by upgrading to premium</p>
964
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
965
- </div>
966
- </th>
967
- </tr>
968
- <?php } ?>
969
- </table>
970
- </div>
971
-
972
- <div id='Order' class='ufaq-option-set<?php echo ( $Display_Tab == 'Order' ? '' : ' ufaq-hidden' ); ?>'>
973
- <h2 id='label-order-options' class='ufaq-options-page-tab-title'>Ordering Options</h2>
974
-
975
- <br />
976
-
977
- <div class="ewd-ufaq-admin-section-heading"><?php _e('Settings', 'ultimate-faqs'); ?></div>
978
-
979
- <table class="form-table">
980
- <tr>
981
- <th scope="row">Group FAQs by Category</th>
982
- <td>
983
- <fieldset><legend class="screen-reader-text"><span>Group FAQs by Category</span></legend>
984
- <div class="ewd-ufaq-admin-hide-radios">
985
- <label title='Yes'><input type='radio' name='group_by_category' value='Yes' <?php if($Group_By_Category == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
986
- <label title='No'><input type='radio' name='group_by_category' value='No' <?php if($Group_By_Category == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
987
- </div>
988
- <label class="ewd-ufaq-admin-switch">
989
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="group_by_category" <?php if($Group_By_Category == "Yes") {echo "checked='checked'";} ?>>
990
- <span class="ewd-ufaq-admin-switch-slider round"></span>
991
- </label>
992
- <p>Should FAQs be grouped by category, or should all categories be mixed together?</p>
993
- </fieldset>
994
- </td>
995
- </tr>
996
- <tr>
997
- <th scope="row">Display FAQ Category Count</th>
998
- <td>
999
- <fieldset><legend class="screen-reader-text"><span>Display FAQ Category Count</span></legend>
1000
- <div class="ewd-ufaq-admin-hide-radios">
1001
- <label title='Yes'><input type='radio' name='group_by_category_count' value='Yes' <?php if($Group_By_Category_Count == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
1002
- <label title='No'><input type='radio' name='group_by_category_count' value='No' <?php if($Group_By_Category_Count == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
1003
- </div>
1004
- <label class="ewd-ufaq-admin-switch">
1005
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="group_by_category_count" <?php if($Group_By_Category_Count == "Yes") {echo "checked='checked'";} ?>>
1006
- <span class="ewd-ufaq-admin-switch-slider round"></span>
1007
- </label>
1008
- <p>If FAQs are grouped by category, should the number of FAQs in a category be displayed beside the category name?</p>
1009
- </fieldset>
1010
- </td>
1011
- </tr>
1012
- <tr>
1013
- <th scope="row">Sort Categories</th>
1014
- <td>
1015
- <fieldset><legend class="screen-reader-text"><span>Sort Categories</span></legend>
1016
- <label title='Group By Order By'></label>
1017
-
1018
- <select name="group_by_order_by" <?php if ($UFAQ_Full_Version != "Yes" and get_option("EWD_UFAQ_Install_Version") < 1.6) {echo "disabled";} ?> >
1019
- <option value="name" <?php if($Group_By_Order_By == "name") {echo "selected=selected";} ?> >Name</option>
1020
- <option value="count" <?php if($Group_By_Order_By == "count") {echo "selected=selected";} ?> >FAQ Count</option>
1021
- <option value="slug" <?php if($Group_By_Order_By == "slug") {echo "selected=selected";} ?> >Slug</option>
1022
- </select>
1023
-
1024
- <p>How should FAQ categories be ordered? (Only used if "Group FAQs by Category" above is set to "Yes"). Please note, this is a premium feature.</p>
1025
- </fieldset>
1026
- </td>
1027
- </tr>
1028
- <tr>
1029
- <th scope="row">Sort Categories Ordering</th>
1030
- <td>
1031
- <fieldset><legend class="screen-reader-text"><span>Sort Categories Ordering</span></legend>
1032
- <label title='Ascending' class='ewd-ufaq-admin-input-container'><input type='radio' name='group_by_order' value='ASC' <?php if($Group_By_Order == "ASC") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>Ascending</span></label><br />
1033
- <label title='Descending' class='ewd-ufaq-admin-input-container'><input type='radio' name='group_by_order' value='DESC' <?php if($Group_By_Order == "DESC") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>Descending</span></label><br />
1034
- <p>How should FAQ categories be ordered? (Only used if "Group FAQs by Category" above is set to "Yes")</p>
1035
- </fieldset>
1036
- </td>
1037
- </tr>
1038
- <tr>
1039
- <th scope="row">FAQ Ordering</th>
1040
- <td>
1041
- <fieldset><legend class="screen-reader-text"><span>FAQ Ordering</span></legend>
1042
- <label title='FAQ Ordering'></label>
1043
-
1044
- <select name="order_by_setting" <?php if ($UFAQ_Full_Version != "Yes" and get_option("EWD_UFAQ_Install_Version") < 1.6) {echo "disabled";} ?> >
1045
- <option value="date" <?php if($Order_By_Setting == "date") {echo "selected=selected";} ?> >Created Date</option>
1046
- <option value="title" <?php if($Order_By_Setting == "title") {echo "selected=selected";} ?> >Title</option>
1047
- <option value="modified" <?php if($Order_By_Setting == "modified") {echo "selected=selected";} ?> >Modified Date</option>
1048
- <option value="set_order" <?php if($Order_By_Setting == "set_order") {echo "selected=selected";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> >Selected Order (using Order table)</option>
1049
- </select>
1050
-
1051
- <p>How should individual FAQs be ordered? <?php if (get_option("EWD_UFAQ_Install_Version") >= 1.6) {?> Please note, this is a premium feature. <?php } ?></p>
1052
- </fieldset>
1053
- </td>
1054
- </tr>
1055
- <tr>
1056
- <th scope="row">FAQ Order Setting</th>
1057
- <td>
1058
- <fieldset><legend class="screen-reader-text"><span>Sort Categories Ordering</span></legend>
1059
- <label title='Yes' class='ewd-ufaq-admin-input-container'><input type='radio' name='order_setting' value='ASC' <?php if($Order_Setting == "ASC") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>Ascending</span></label><br />
1060
- <label title='No' class='ewd-ufaq-admin-input-container'><input type='radio' name='order_setting' value='DESC' <?php if($Order_Setting == "DESC") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>Descending</span></label><br />
1061
- <p>Should FAQ be ascending or descending order, based on the ordering criteria above?</p>
1062
- </fieldset>
1063
- </td>
1064
- </tr>
1065
- </table>
1066
-
1067
- <br />
1068
-
1069
- <div class="ewd-ufaq-admin-section-heading"><?php _e('Order Table', 'ultimate-faqs'); ?></div>
1070
-
1071
- <div class="ewd-ufaq-admin-styling-section">
1072
- <div class="ewd-ufaq-admin-styling-subsection">
1073
-
1074
- <div class='ufaq-order-table'>
1075
- <p><?php _e("Drag and drop the posts below to reorder them, if you have 'Selected Order' set for the 'FAQ Ordering' option", 'ultimate-faqs'); ?></p>
1076
- <!--<div id="col-right">
1077
- <div class="col-wrap">
1078
- <div id="add-page" class="postbox metabox-holder" >
1079
- <div class="inside">
1080
- <div id="posttype-page" class="posttypediv">-->
1081
- <div id="tabs-panel-posttype-page-most-recent" class="tabs-panel tabs-panel-active">
1082
-
1083
- <table class="wp-list-table widefat tags sorttable ewd-ufaq-list">
1084
- <thead>
1085
- <tr>
1086
- <th><?php _e("Question", 'ultimate-faqs') ?></th>
1087
- <th><?php _e("Views", 'ultimate-faqs') ?></th>
1088
- <th><?php _e("Categories", 'ultimate-faqs') ?></th>
1089
- <th><?php _e("Tags", 'ultimate-faqs') ?></th>
1090
- </tr>
1091
- </thead>
1092
- <tbody>
1093
- <?php
1094
- $params = array(
1095
- 'post_type' => 'ufaq',
1096
- 'posts_per_page' => -1,
1097
- 'meta_key' => 'ufaq_order',
1098
- 'orderby' => 'meta_value_num',
1099
- 'order' => 'ASC'
1100
- );
1101
- $FAQs = get_posts($params);
1102
- if (empty($FAQs)) { echo "<div class='ewd-ufaq-row list-item'><p>No FAQs have been created<p/></div>"; }
1103
- else {
1104
- foreach ($FAQs as $FAQ) {
1105
- $FAQ_Views = get_post_meta($FAQ->ID, 'ufaq_view_count', true);
1106
- $FAQ_Categories = get_the_term_list($FAQ->ID, 'ufaq-category', '', ', ', '');
1107
- $FAQ_Tags = get_the_term_list($FAQ->ID, 'ufaq-tag', '', ', ', '');
1108
- echo "<tr id='ewd-ufaq-item-" . $FAQ->ID . "' class='ewd-ufaq-item'>";
1109
- echo "<td class='ufaq-title'>" . $FAQ->post_title . "</td>";
1110
- echo "<td class='ufaq-title'>" . $FAQ_Views . "</td>";
1111
- echo "<td class='ufaq-title'>" . $FAQ_Categories . "</td>";
1112
- echo "<td class='ufaq-title'>" . $FAQ_Tags . "</td>";
1113
- echo "</tr>";
1114
- }
1115
- }?>
1116
- </tbody>
1117
- <tfoot>
1118
- <tr>
1119
- <th><?php _e("Question", 'ultimate-faqs') ?></th>
1120
- <th><?php _e("Views", 'ultimate-faqs') ?></th>
1121
- <th><?php _e("Categories", 'ultimate-faqs') ?></th>
1122
- <th><?php _e("Tags", 'ultimate-faqs') ?></th>
1123
- </tr>
1124
- </tfoot>
1125
- </table>
1126
- </div>
1127
- </div>
1128
-
1129
- </div> <!-- ewd-ufaq-admin-styling-subsection -->
1130
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
1131
- <div class="ewd-ufaq-premium-options-table-overlay">
1132
- <div class="ewd-ufaq-unlock-premium">
1133
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
1134
- <p>Access this section by by upgrading to premium</p>
1135
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
1136
- </div>
1137
- </div>
1138
- <?php } ?>
1139
- </div> <!-- ewd-ufaq-admin-styling-section -->
1140
-
1141
- </div>
1142
-
1143
- <div id='Fields' class='ufaq-option-set<?php echo ( $Display_Tab == 'Fields' ? '' : ' ufaq-hidden' ); ?>'>
1144
- <h2 id='label-order-options' class='ufaq-options-page-tab-title'>Fields Options (Premium)</h2>
1145
-
1146
- <br />
1147
-
1148
- <div class="ewd-ufaq-admin-section-heading"><?php _e('Settings', 'ultimate-faqs'); ?></div>
1149
-
1150
- <table class="form-table ewd-ufaq-premium-options-table">
1151
- <tr>
1152
- <th scope="row">FAQ Custom Fields</th>
1153
- <td>
1154
- <fieldset><legend class="screen-reader-text"><span>FAQ Custom Fields</span></legend>
1155
- <table id='ewd-ufaq-custom-fields-table'>
1156
- <tr>
1157
- <th class="ewd-ufaq-admin-no-info-button"></th>
1158
- <th class="ewd-ufaq-admin-no-info-button">Field Name</th>
1159
- <th class="ewd-ufaq-admin-no-info-button">Field Type</th>
1160
- <th class="ewd-ufaq-admin-no-info-button">Field Values</th>
1161
- </tr>
1162
- <?php
1163
- $Counter = 0;
1164
- $Max_ID = 0;
1165
- if (!is_array($FAQ_Fields_Array)) {$FAQ_Fields_Array = array();}
1166
- foreach ($FAQ_Fields_Array as $FAQ_Field_Item) {
1167
- echo "<tr id='ewd-ufaq-custom-field-row-" . $Counter . "'>";
1168
- echo "<td><input type='hidden' name='Custom_Field_" . $Counter . "_ID' value='" . $FAQ_Field_Item['FieldID'] . "' /><a class='ewd-ufaq-delete-custom-field' data-fieldid='" . $Counter . "'>Delete</a></td>";
1169
- echo "<td><input type='text' name='Custom_Field_" . $Counter . "_Name' value='" . $FAQ_Field_Item['FieldName'] . "'/></td>";
1170
- echo "<td><select name='Custom_Field_" . $Counter . "_Type'>"; ?>
1171
- <option value='text' <?php if ($FAQ_Field_Item['FieldType'] == "text") {echo "selected='selected'";} ?>>Text</option>
1172
- <option value='textarea' <?php if ($FAQ_Field_Item['FieldType'] == "textarea") {echo "selected='selected'";} ?>>Text Area</option>
1173
- <option value='select' <?php if ($FAQ_Field_Item['FieldType'] == "select") {echo "selected='selected'";} ?>>Select Box</option>
1174
- <option value='radio' <?php if ($FAQ_Field_Item['FieldType'] == "radio") {echo "selected='selected'";} ?>>Radio Buttons</option>
1175
- <option value='checkbox' <?php if ($FAQ_Field_Item['FieldType'] == "checkbox") {echo "selected='selected'";} ?>>Checkbox</option>
1176
- <option value='file' <?php if ($FAQ_Field_Item['FieldType'] == "file") {echo "selected='selected'";} ?>>File</option>
1177
- <option value='link' <?php if ($FAQ_Field_Item['FieldType'] == "link") {echo "selected='selected'";} ?>>Link</option>
1178
- <option value='date' <?php if ($FAQ_Field_Item['FieldType'] == "date") {echo "selected='selected'";} ?>>Date</option>
1179
- <option value='datetime' <?php if ($FAQ_Field_Item['FieldType'] == "datetime") {echo "selected='selected'";} ?>>Date/Time</option>
1180
- <?php echo "</select></td>";
1181
- echo "<td><input type='text' name='Custom_Field_" . $Counter . "_Values' value='" . $FAQ_Field_Item['FieldValues'] . "'/></td>";
1182
- echo "</tr>";
1183
- $Counter++;
1184
- $Max_ID = max($Max_ID, $FAQ_Field_Item['FieldID']);
1185
- }
1186
- $Max_ID++;
1187
- echo "<tr><td colspan='4'><a class='ewd-ufaq-add-custom-field' data-nextid='" . $Counter . "' data-maxid='" . $Max_ID . "'>Add</a></td></tr>";
1188
- ?>
1189
- </table>
1190
- <p>Should any extra fields be added to the FAQs?<br />
1191
- The "Field Values" should be a comma-separated list of values for the select, radio or checkbox field types (no extra spaces after the comma)<br />
1192
- For security reasons, file fields cannot be included in the submit FAQ form.</p>
1193
- </fieldset>
1194
- </td>
1195
- </tr>
1196
- <tr>
1197
- <th scope="row">Hide Blank Fields</th>
1198
- <td>
1199
- <fieldset><legend class="screen-reader-text"><span>Hide Blank Fields</span></legend>
1200
- <div class="ewd-ufaq-admin-hide-radios">
1201
- <label title='Yes' class='ewd-ufaq-admin-input-container'><input type='radio' name='hide_blank_fields' value='Yes' <?php if($Hide_Blank_Fields == "Yes") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>Yes</span></label><br />
1202
- <label title='No' class='ewd-ufaq-admin-input-container'><input type='radio' name='hide_blank_fields' value='No' <?php if($Hide_Blank_Fields == "No") {echo "checked='checked'";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span>No</span></label><br />
1203
- </div>
1204
- <label class="ewd-ufaq-admin-switch">
1205
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="hide_blank_fields" <?php if($Hide_Blank_Fields == "Yes") {echo "checked='checked'";} ?>>
1206
- <span class="ewd-ufaq-admin-switch-slider round"></span>
1207
- </label>
1208
- <p>Should field labels be hidden if a field hasn't been filled out for a particular FAQ?</p>
1209
- </fieldset>
1210
- </td>
1211
- </tr>
1212
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
1213
- <tr class="ewd-ufaq-premium-options-table-overlay">
1214
- <th colspan="2">
1215
- <div class="ewd-ufaq-unlock-premium">
1216
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
1217
- <p>Access this section by by upgrading to premium</p>
1218
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
1219
- </div>
1220
- </th>
1221
- </tr>
1222
- <?php } ?>
1223
- </table>
1224
- </div>
1225
-
1226
-
1227
- <div id='Labelling' class='ufaq-option-set<?php echo ( $Display_Tab == 'Labelling' ? '' : ' ufaq-hidden' ); ?>'>
1228
- <h2 id='label-order-options' class='ufaq-options-page-tab-title'>Labelling Options</h2>
1229
-
1230
- <br />
1231
-
1232
- <div class="ewd-ufaq-admin-section-heading"><?php _e('FAQ Page and Search', 'ultimate-faqs'); ?></div>
1233
-
1234
- <div class="ewd-ufaq-admin-styling-section">
1235
- <div class="ewd-ufaq-admin-styling-subsection">
1236
- <p>Replace the default text on the FAQ page and FAQ search page</p>
1237
- <div class="ewd-admin-labelling-section">
1238
- <label>
1239
- <p><?php _e("Posted", 'ultimate-faqs')?></p>
1240
- <input type='text' name='posted_label' value='<?php echo $Posted_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1241
- </label>
1242
- <label>
1243
- <p><?php _e("By", 'ultimate-faqs')?></p>
1244
- <input type='text' name='by_label' value='<?php echo $By_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1245
- </label>
1246
- <label>
1247
- <p><?php _e("On", 'ultimate-faqs')?></p>
1248
- <input type='text' name='on_label' value='<?php echo $On_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1249
- </label>
1250
- <label>
1251
- <p><?php _e("Categories", 'ultimate-faqs')?></p>
1252
- <input type='text' name='category_label' value='<?php echo $Category_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1253
- </label>
1254
- <label>
1255
- <p><?php _e("Tags", 'ultimate-faqs')?></p>
1256
- <input type='text' name='tag_label' value='<?php echo $Tag_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1257
- </label>
1258
- <label>
1259
- <p><?php _e("Permalink", 'ultimate-faqs')?></p>
1260
- <input type='text' name='permalink_label' value='<?php echo $Permalink_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1261
- </label>
1262
- <label>
1263
- <p><?php _e("Back To Top", 'ultimate-faqs')?></p>
1264
- <input type='text' name='back_to_top_label' value='<?php echo $Back_To_Top_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1265
- </label>
1266
- <label>
1267
- <p><?php _e("WooCommerce Tab Label", 'ultimate-faqs')?></p>
1268
- <input type='text' name='woocommerce_tab_label' value='<?php echo $WooCommerce_Tab_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1269
- </label>
1270
- <label>
1271
- <p><?php _e("Share Label", 'ultimate-faqs')?></p>
1272
- <input type='text' name='share_faq_label' value='<?php echo $Share_FAQ_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1273
- </label>
1274
- <label>
1275
- <p><?php _e("Did you find this FAQ helpful?", 'ultimate-faqs')?></p>
1276
- <input type='text' name='find_faq_helpful_label' value='<?php echo $Find_FAQ_Helpful_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1277
- </label>
1278
- <label>
1279
- <p><?php _e("Enter your question", 'ultimate-faqs')?></p>
1280
- <input type='text' name='enter_question_label' value='<?php echo $Enter_Question_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1281
- </label>
1282
- <label>
1283
- <p><?php _e("Search Placeholder", 'ultimate-faqs')?></p>
1284
- <input type='text' name='search_placeholder_label' value='<?php echo $Search_Placeholder_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1285
- </label>
1286
- <label>
1287
- <p><?php _e("Search Button", 'ultimate-faqs')?></p>
1288
- <input type='text' name='search_label' value='<?php echo $Search_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1289
- </label>
1290
- <label>
1291
- <p><?php _e("Retrieving Results", 'ultimate-faqs')?></p>
1292
- <input type='text' name='retrieving_results' value='<?php echo $Retrieving_Results; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1293
- </label>
1294
- <label>
1295
- <p><?php _e("No results FAQ's contained the term '%s'", 'ultimate-faqs')?></p>
1296
- <input type='text' name='no_results_found_text' value='<?php echo $No_Results_Found_Text; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1297
- </label>
1298
- </div>
1299
- </div>
1300
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
1301
- <div class="ewd-ufaq-premium-options-table-overlay">
1302
- <div class="ewd-ufaq-unlock-premium">
1303
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
1304
- <p>Access this section by by upgrading to premium</p>
1305
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
1306
- </div>
1307
- </div>
1308
- <?php } ?>
1309
- </div>
1310
-
1311
- <br />
1312
-
1313
- <div class="ewd-ufaq-admin-section-heading"><?php _e('FAQ Submit Page', 'ultimate-faqs'); ?></div>
1314
-
1315
- <div class="ewd-ufaq-admin-styling-section">
1316
- <div class="ewd-ufaq-admin-styling-subsection">
1317
- <p>Replace the default text on the FAQ submit page</p>
1318
- <div class="ewd-admin-labelling-section">
1319
- <label>
1320
- <p><?php _e("Thank you for submitting an FAQ", 'ultimate-faqs')?></p>
1321
- <input type='text' name='thank_you_submit_label' value='<?php echo $Thank_You_Submit_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1322
- </label>
1323
- <label>
1324
- <p><?php _e("Submit a Question", 'ultimate-faqs')?></p>
1325
- <input type='text' name='submit_question_label' value='<?php echo $Submit_Question_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1326
- </label>
1327
- <label>
1328
- <p><?php _e("Please fill out the form below to submit a question.", 'ultimate-faqs')?></p>
1329
- <input type='text' name='please_fill_form_below_label' value='<?php echo $Please_Fill_Form_Below_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1330
- </label>
1331
- <label>
1332
- <p><?php _e("Send Question", 'ultimate-faqs')?></p>
1333
- <input type='text' name='send_question_label' value='<?php echo $Send_Question_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1334
- </label>
1335
- <label>
1336
- <p><?php _e("Question Title", 'ultimate-faqs')?></p>
1337
- <input type='text' name='question_title_label' value='<?php echo $Question_Title_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1338
- </label>
1339
- <label>
1340
- <p><?php _e("What question is being answered?", 'ultimate-faqs')?></p>
1341
- <input type='text' name='what_question_being_answered_label' value='<?php echo $What_Question_Being_Answered_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1342
- </label>
1343
- <label>
1344
- <p><?php _e("Proposed Answer", 'ultimate-faqs')?></p>
1345
- <input type='text' name='proposed_answer_label' value='<?php echo $Proposed_Answer_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1346
- </label>
1347
- <label>
1348
- <p><?php _e("Question Author", 'ultimate-faqs')?></p>
1349
- <input type='text' name='review_author_label' value='<?php echo $Review_Author_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1350
- </label>
1351
- <label>
1352
- <p><?php _e("What name should be displayed with your question?", 'ultimate-faqs')?></p>
1353
- <input type='text' name='what_name_with_review_label' value='<?php echo $What_Name_With_Review_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1354
- </label>
1355
- <label>
1356
- <p><?php _e("Image Number", 'ultimate-faqs')?></p>
1357
- <input type='text' name='captcha_image_number_label' value='<?php echo $Captcha_Image_Number_Label; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?>/>
1358
- </label>
1359
- </div>
1360
- </div>
1361
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
1362
- <div class="ewd-ufaq-premium-options-table-overlay">
1363
- <div class="ewd-ufaq-unlock-premium">
1364
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
1365
- <p>Access this section by by upgrading to premium</p>
1366
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
1367
- </div>
1368
- </div>
1369
- <?php } ?>
1370
- </div>
1371
-
1372
- </div>
1373
- <div id='Styling' class='ufaq-option-set<?php echo ( $Display_Tab == 'Styling' ? '' : ' ufaq-hidden' ); ?>'>
1374
- <h2 id='label-order-options' class='ufaq-options-page-tab-title'>Styling Options (Premium)</h2>
1375
-
1376
- <br />
1377
-
1378
- <div class="ewd-ufaq-admin-section-heading"><?php _e('Toggle Symbol', 'ultimate-faqs'); ?></div>
1379
-
1380
- <div class="ewd-ufaq-admin-styling-section">
1381
- <div class="ewd-ufaq-admin-styling-subsection">
1382
- <div class="ewd-ufaq-admin-styling-subsection-label"><?php _e('Choose Font Icon', 'ultimate-faqs'); ?></div>
1383
- <div class="ewd-ufaq-admin-styling-subsection-content">
1384
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1385
- <fieldset class="ewdAdminIconChoice">
1386
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='A' <?php if ($Toggle_Symbol == "A") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>a A</span></label>
1387
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='B' <?php if ($Toggle_Symbol == "B") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>b B</span></label>
1388
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='C' <?php if ($Toggle_Symbol == "C") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>c C</span></label>
1389
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='D' <?php if ($Toggle_Symbol == "D") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>d D</span></label>
1390
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='E' <?php if ($Toggle_Symbol == "E") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>e E</span></label>
1391
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='F' <?php if ($Toggle_Symbol == "F") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>f F</span></label>
1392
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='G' <?php if ($Toggle_Symbol == "G") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>g G</span></label>
1393
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='H' <?php if ($Toggle_Symbol == "H") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>h H</span></label>
1394
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='I' <?php if ($Toggle_Symbol == "I") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>i I</span></label>
1395
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='J' <?php if ($Toggle_Symbol == "J") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>j J</span></label>
1396
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='K' <?php if ($Toggle_Symbol == "K") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>k K</span></label>
1397
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='L' <?php if ($Toggle_Symbol == "L") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>l L</span></label>
1398
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='M' <?php if ($Toggle_Symbol == "M") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>m M</span></label>
1399
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='N' <?php if ($Toggle_Symbol == "N") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>n N</span></label>
1400
- <label class='ewd-ufaq-admin-input-container'><input type='radio' name='toggle_symbol' value='O' <?php if ($Toggle_Symbol == "O") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /><span class='ewd-ufaq-admin-radio-button'></span> <span class='ufaq-toggle-symbol'>o O</span></label>
1401
- </fieldset>
1402
- </div>
1403
- </div>
1404
- </div>
1405
- <div class="ewd-ufaq-admin-styling-subsection">
1406
- <div class="ewd-ufaq-admin-styling-subsection-label"><?php _e('Styling', 'ultimate-faqs'); ?></div>
1407
- <div class="ewd-ufaq-admin-styling-subsection-content">
1408
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1409
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Colors', 'ultimate-faqs'); ?></div>
1410
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1411
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker">
1412
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker-label"><?php _e('Icon Background', 'ultimate-faqs'); ?></div>
1413
- <input type='text' class='ewd-ufaq-spectrum' name='ufaq_styling_default_bg_color' value='<?php echo $UFAQ_Styling_Default_Bg_Color; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1414
- </div>
1415
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker">
1416
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker-label"><?php _e('Icon', 'ultimate-faqs'); ?></div>
1417
- <input type='text' class='ewd-ufaq-spectrum' name='ufaq_styling_default_font_color' value='<?php echo $UFAQ_Styling_Default_Font_Color; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1418
- </div>
1419
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker">
1420
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker-label"><?php _e('Icon Border', 'ultimate-faqs'); ?></div>
1421
- <input type='text' class='ewd-ufaq-spectrum' name='ufaq_styling_default_border_color' value='<?php echo $UFAQ_Styling_Default_Border_Color; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1422
- </div>
1423
- </div>
1424
- </div>
1425
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1426
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Icon Font Size', 'ultimate-faqs'); ?></div>
1427
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1428
- <input type='text' name='ufaq_styling_toggle_symbol_size' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Toggle_Symbol_Size; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1429
- </div>
1430
- </div>
1431
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1432
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Border Size', 'ultimate-faqs'); ?></div>
1433
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1434
- <input type='text' name='ufaq_styling_default_border_size' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Default_Border_Size; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1435
- </div>
1436
- </div>
1437
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1438
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Border Radius', 'ultimate-faqs'); ?></div>
1439
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1440
- <input type='text' name='ufaq_styling_default_border_radius' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Default_Border_Radius; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1441
- </div>
1442
- </div>
1443
- </div>
1444
- </div>
1445
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
1446
- <div class="ewd-ufaq-premium-options-table-overlay">
1447
- <div class="ewd-ufaq-unlock-premium">
1448
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
1449
- <p>Access this section by by upgrading to premium</p>
1450
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
1451
- </div>
1452
- </div>
1453
- <?php } ?>
1454
- </div>
1455
-
1456
- <br />
1457
-
1458
- <div class="ewd-ufaq-admin-section-heading"><?php _e('Themes', 'ultimate-faqs'); ?></div>
1459
-
1460
- <div class="ewd-ufaq-admin-styling-section">
1461
- <div class="ewd-ufaq-admin-styling-subsection">
1462
- <div class="ewd-ufaq-admin-styling-subsection-label"><?php _e('Block &amp; Border Block Themes', 'ultimate-faqs'); ?></div>
1463
- <div class="ewd-ufaq-admin-styling-subsection-content">
1464
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1465
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Colors', 'ultimate-faqs'); ?></div>
1466
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1467
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker">
1468
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker-label"><?php _e('Background Color', 'ultimate-faqs'); ?></div>
1469
- <input type='text' class='ewd-ufaq-spectrum' name='ufaq_styling_block_bg_color' value='<?php echo $UFAQ_Styling_Block_Bg_Color; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1470
- </div>
1471
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker">
1472
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker-label"><?php _e('Hover Font Color', 'ultimate-faqs'); ?></div>
1473
- <input type='text' class='ewd-ufaq-spectrum' name='ufaq_styling_block_font_color' value='<?php echo $UFAQ_Styling_Block_Font_Color; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1474
- </div>
1475
- </div>
1476
- </div>
1477
- </div>
1478
- </div>
1479
- <div class="ewd-ufaq-admin-styling-subsection">
1480
- <div class="ewd-ufaq-admin-styling-subsection-label"><?php _e('List Theme Anchors', 'ultimate-faqs'); ?></div>
1481
- <div class="ewd-ufaq-admin-styling-subsection-content">
1482
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1483
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Color', 'ultimate-faqs'); ?></div>
1484
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1485
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker">
1486
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker-label"></div>
1487
- <input type='text' class='ewd-ufaq-spectrum' name='ufaq_styling_list_font_color' value='<?php echo $UFAQ_Styling_List_Font_Color; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1488
- </div>
1489
- </div>
1490
- </div>
1491
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1492
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Family', 'ultimate-faqs'); ?></div>
1493
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1494
- <input type='text' name='ufaq_styling_list_font' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_List_Font; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1495
- </div>
1496
- </div>
1497
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1498
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Size', 'ultimate-faqs'); ?></div>
1499
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1500
- <input type='text' name='ufaq_styling_list_font_size' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_List_Font_Size; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1501
- </div>
1502
- </div>
1503
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1504
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Margin', 'ultimate-faqs'); ?></div>
1505
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1506
- <input type='text' name='ufaq_styling_list_margin' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_List_Margin; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1507
- </div>
1508
- </div>
1509
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1510
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Padding', 'ultimate-faqs'); ?></div>
1511
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1512
- <input type='text' name='ufaq_styling_list_padding' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_List_Padding; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1513
- </div>
1514
- </div>
1515
- </div>
1516
- </div>
1517
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
1518
- <div class="ewd-ufaq-premium-options-table-overlay">
1519
- <div class="ewd-ufaq-unlock-premium">
1520
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
1521
- <p>Access this section by by upgrading to premium</p>
1522
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
1523
- </div>
1524
- </div>
1525
- <?php } ?>
1526
- </div>
1527
-
1528
- <br />
1529
-
1530
- <div class="ewd-ufaq-admin-section-heading"><?php _e('FAQ Elements', 'ultimate-faqs'); ?></div>
1531
-
1532
- <div class="ewd-ufaq-admin-styling-section">
1533
- <div class="ewd-ufaq-admin-styling-subsection">
1534
- <div class="ewd-ufaq-admin-styling-subsection-label"><?php _e('FAQ Question', 'ultimate-faqs'); ?></div>
1535
- <div class="ewd-ufaq-admin-styling-subsection-content">
1536
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1537
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Color', 'ultimate-faqs'); ?></div>
1538
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1539
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker">
1540
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker-label"></div>
1541
- <input type='text' class='ewd-ufaq-spectrum' name='ufaq_styling_question_font_color' value='<?php echo $UFAQ_Styling_Question_Font_Color; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1542
- </div>
1543
- </div>
1544
- </div>
1545
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1546
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Family', 'ultimate-faqs'); ?></div>
1547
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1548
- <input type='text' name='ufaq_styling_question_font' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Question_Font; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1549
- </div>
1550
- </div>
1551
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1552
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Size', 'ultimate-faqs'); ?></div>
1553
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1554
- <input type='text' name='ufaq_styling_question_font_size' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Question_Font_Size; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1555
- </div>
1556
- </div>
1557
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1558
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Margin', 'ultimate-faqs'); ?></div>
1559
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1560
- <input type='text' name='ufaq_styling_question_margin' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Question_Margin; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1561
- </div>
1562
- </div>
1563
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1564
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Padding', 'ultimate-faqs'); ?></div>
1565
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1566
- <input type='text' name='ufaq_styling_question_padding' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Question_Padding; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1567
- </div>
1568
- </div>
1569
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1570
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Toggle Symbol Top Margin', 'ultimate-faqs'); ?></div>
1571
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1572
- <input type='text' name='ufaq_styling_question_icon_top_margin' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Question_Icon_Top_Margin; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1573
- </div>
1574
- </div>
1575
- </div>
1576
- </div>
1577
- <div class="ewd-ufaq-admin-styling-subsection">
1578
- <div class="ewd-ufaq-admin-styling-subsection-label"><?php _e('FAQ Answer', 'ultimate-faqs'); ?></div>
1579
- <div class="ewd-ufaq-admin-styling-subsection-content">
1580
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1581
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Color', 'ultimate-faqs'); ?></div>
1582
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1583
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker">
1584
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker-label"></div>
1585
- <input type='text' class='ewd-ufaq-spectrum' name='ufaq_styling_answer_font_color' value='<?php echo $UFAQ_Styling_Answer_Font_Color; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1586
- </div>
1587
- </div>
1588
- </div>
1589
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1590
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Family', 'ultimate-faqs'); ?></div>
1591
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1592
- <input type='text' name='ufaq_styling_answer_font' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Answer_Font; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1593
- </div>
1594
- </div>
1595
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1596
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Size', 'ultimate-faqs'); ?></div>
1597
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1598
- <input type='text' name='ufaq_styling_answer_font_size' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Answer_Font_Size; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1599
- </div>
1600
- </div>
1601
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1602
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Margin', 'ultimate-faqs'); ?></div>
1603
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1604
- <input type='text' name='ufaq_styling_answer_margin' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Answer_Margin; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1605
- </div>
1606
- </div>
1607
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1608
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Padding', 'ultimate-faqs'); ?></div>
1609
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1610
- <input type='text' name='ufaq_styling_answer_padding' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Answer_Padding; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1611
- </div>
1612
- </div>
1613
- </div>
1614
- </div>
1615
- <div class="ewd-ufaq-admin-styling-subsection">
1616
- <div class="ewd-ufaq-admin-styling-subsection-label"><?php _e('FAQ Category, Tags', 'ultimate-faqs'); ?></div>
1617
- <div class="ewd-ufaq-admin-styling-subsection-content">
1618
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1619
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Color', 'ultimate-faqs'); ?></div>
1620
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1621
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker">
1622
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker-label"></div>
1623
- <input type='text' class='ewd-ufaq-spectrum' name='ufaq_styling_category_font_color' value='<?php echo $UFAQ_Styling_Category_Font_Color; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1624
- </div>
1625
- </div>
1626
- </div>
1627
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1628
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Family', 'ultimate-faqs'); ?></div>
1629
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1630
- <input type='text' name='ufaq_styling_category_font' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Category_Font; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1631
- </div>
1632
- </div>
1633
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1634
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Size', 'ultimate-faqs'); ?></div>
1635
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1636
- <input type='text' name='ufaq_styling_category_font_size' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Category_Font_Size; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1637
- </div>
1638
- </div>
1639
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1640
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Margin', 'ultimate-faqs'); ?></div>
1641
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1642
- <input type='text' name='ufaq_styling_category_margin' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Category_Margin; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1643
- </div>
1644
- </div>
1645
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1646
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Padding', 'ultimate-faqs'); ?></div>
1647
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1648
- <input type='text' name='ufaq_styling_category_padding' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Category_Padding; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1649
- </div>
1650
- </div>
1651
- </div>
1652
- </div>
1653
- <div class="ewd-ufaq-admin-styling-subsection">
1654
- <div class="ewd-ufaq-admin-styling-subsection-label"><?php _e('FAQ Post Date', 'ultimate-faqs'); ?></div>
1655
- <div class="ewd-ufaq-admin-styling-subsection-content">
1656
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1657
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Color', 'ultimate-faqs'); ?></div>
1658
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1659
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker">
1660
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker-label"></div>
1661
- <input type='text' class='ewd-ufaq-spectrum' name='ufaq_styling_postdate_font_color' value='<?php echo $UFAQ_Styling_Postdate_Font_Color; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1662
- </div>
1663
- </div>
1664
- </div>
1665
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1666
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Family', 'ultimate-faqs'); ?></div>
1667
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1668
- <input type='text' name='ufaq_styling_postdate_font' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Postdate_Font; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1669
- </div>
1670
- </div>
1671
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1672
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Size', 'ultimate-faqs'); ?></div>
1673
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1674
- <input type='text' name='ufaq_styling_postdate_font_size' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Postdate_Font_Size; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1675
- </div>
1676
- </div>
1677
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1678
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Margin', 'ultimate-faqs'); ?></div>
1679
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1680
- <input type='text' name='ufaq_styling_postdate_margin' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Postdate_Margin; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1681
- </div>
1682
- </div>
1683
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1684
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Padding', 'ultimate-faqs'); ?></div>
1685
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1686
- <input type='text' name='ufaq_styling_postdate_padding' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Postdate_Padding; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1687
- </div>
1688
- </div>
1689
- </div>
1690
- </div>
1691
- <div class="ewd-ufaq-admin-styling-subsection">
1692
- <div class="ewd-ufaq-admin-styling-subsection-label"><?php _e('Category Headings<br /><span class="notBold">(when "Group FAQs by Category" is enabled)</span>', 'ultimate-faqs'); ?></div>
1693
- <div class="ewd-ufaq-admin-styling-subsection-content">
1694
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1695
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Color', 'ultimate-faqs'); ?></div>
1696
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1697
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker">
1698
- <div class="ewd-ufaq-admin-styling-subsection-content-color-picker-label"></div>
1699
- <input type='text' class='ewd-ufaq-spectrum' name='ufaq_styling_category_heading_font_color' value='<?php echo $UFAQ_Styling_Category_Heading_Font_Color; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1700
- </div>
1701
- </div>
1702
- </div>
1703
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1704
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Family', 'ultimate-faqs'); ?></div>
1705
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1706
- <input type='text' name='ufaq_styling_category_heading_font' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Category_Heading_Font; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1707
- </div>
1708
- </div>
1709
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1710
- <div class="ewd-ufaq-admin-styling-subsection-content-label"><?php _e('Font Size', 'ultimate-faqs'); ?></div>
1711
- <div class="ewd-ufaq-admin-styling-subsection-content-right">
1712
- <input type='text' name='ufaq_styling_category_heading_font_size' class='ewd-ufaq-admin-font-size' value='<?php echo $UFAQ_Styling_Category_Heading_Font_Size; ?>' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> />
1713
- </div>
1714
- </div>
1715
- </div>
1716
- </div>
1717
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
1718
- <div class="ewd-ufaq-premium-options-table-overlay">
1719
- <div class="ewd-ufaq-unlock-premium">
1720
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
1721
- <p>Access this section by by upgrading to premium</p>
1722
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
1723
- </div>
1724
- </div>
1725
- <?php } ?>
1726
- </div>
1727
-
1728
- <br />
1729
-
1730
- <div class="ewd-ufaq-admin-section-heading"><?php _e('FAQ Heading Types', 'ultimate-faqs'); ?></div>
1731
-
1732
- <div class="ewd-ufaq-admin-styling-section <?php echo $UFAQ_Full_Version; ?>">
1733
- <div class="ewd-ufaq-admin-styling-subsection">
1734
- <div class="ewd-ufaq-admin-styling-subsection-label"><?php _e('Category Heading Type', 'ultimate-faqs'); ?></div>
1735
- <div class="ewd-ufaq-admin-styling-subsection-content">
1736
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1737
- <label>
1738
- <select name='ufaq_styling_category_heading_type' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> >
1739
- <option value='h1' <?php if ($UFAQ_Styling_Category_Heading_Type == 'h1') {echo "selected='selected'";} ?>>H1</option>
1740
- <option value='h2' <?php if ($UFAQ_Styling_Category_Heading_Type == 'h2') {echo "selected='selected'";} ?>>H2</option>
1741
- <option value='h3' <?php if ($UFAQ_Styling_Category_Heading_Type == 'h3') {echo "selected='selected'";} ?>>H3</option>
1742
- <option value='h4' <?php if ($UFAQ_Styling_Category_Heading_Type == 'h4') {echo "selected='selected'";} ?>>H4</option>
1743
- <option value='h5' <?php if ($UFAQ_Styling_Category_Heading_Type == 'h5') {echo "selected='selected'";} ?>>H5</option>
1744
- <option value='h6' <?php if ($UFAQ_Styling_Category_Heading_Type == 'h6') {echo "selected='selected'";} ?>>H6</option>
1745
- </select>
1746
- </label>
1747
- </div>
1748
- </div>
1749
- </div>
1750
- <div class="ewd-ufaq-admin-styling-subsection">
1751
- <div class="ewd-ufaq-admin-styling-subsection-label"><?php _e('FAQ Heading Type', 'ultimate-faqs'); ?></div>
1752
- <div class="ewd-ufaq-admin-styling-subsection-content">
1753
- <div class="ewd-ufaq-admin-styling-subsection-content-each">
1754
- <label>
1755
- <select name='ufaq_styling_faq_heading_type' <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> >
1756
- <option value='h1' <?php if ($UFAQ_Styling_FAQ_Heading_Type == 'h1') {echo "selected='selected'";} ?>>H1</option>
1757
- <option value='h2' <?php if ($UFAQ_Styling_FAQ_Heading_Type == 'h2') {echo "selected='selected'";} ?>>H2</option>
1758
- <option value='h3' <?php if ($UFAQ_Styling_FAQ_Heading_Type == 'h3') {echo "selected='selected'";} ?>>H3</option>
1759
- <option value='h4' <?php if ($UFAQ_Styling_FAQ_Heading_Type == 'h4') {echo "selected='selected'";} ?>>H4</option>
1760
- <option value='h5' <?php if ($UFAQ_Styling_FAQ_Heading_Type == 'h5') {echo "selected='selected'";} ?>>H5</option>
1761
- <option value='h6' <?php if ($UFAQ_Styling_FAQ_Heading_Type == 'h6') {echo "selected='selected'";} ?>>H6</option>
1762
- </select>
1763
- </label>
1764
- </div>
1765
- </div>
1766
- </div>
1767
- <?php if ($UFAQ_Full_Version != "Yes") { ?>
1768
- <div class="ewd-ufaq-premium-options-table-overlay">
1769
- <div class="ewd-ufaq-unlock-premium">
1770
- <img src="<?php echo plugins_url( '../images/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Ultimate FAQ Premium">
1771
- <p>Access this section by by upgrading to premium</p>
1772
- <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
1773
- </div>
1774
- </div>
1775
- <?php } ?>
1776
- </div>
1777
-
1778
-
1779
-
1780
- </div>
1781
-
1782
- </div>
1783
-
1784
- <p class="submit"><input type="submit" name="Options_Submit" id="submit" class="button button-primary" value="Save Changes" /></p></form>
1785
-
1786
- <?php /* </div><!-- /.tabs-panel -->
1787
- </div><!-- /.posttypediv -->
1788
- </div>
1789
- </div>
1790
- </div>
1791
- </div><!-- col-right --> */ ?>
1792
- </div>
1793
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
html/StatisticsPage.php DELETED
@@ -1,62 +0,0 @@
1
- <?php
2
- $Custom_CSS = get_option("EWD_UFAQ_Custom_CSS");
3
- ?>
4
- <div class="wrap">
5
- <div id="icon-options-general" class="icon32"><br /></div><h2>Settings</h2>
6
-
7
- <form method="post" action="edit.php?post_type=ufaq&page=options&Action=EWD_UFAQ_UpdateOptions">
8
- <table class="form-table">
9
- <tr>
10
- <th scope="row">Custom CSS</th>
11
- <td>
12
- <fieldset><legend class="screen-reader-text"><span>Custom CSS</span></legend>
13
- <label title='Custom CSS'></label><textarea class='ewd-ufaq-textarea' name='custom_css'> <?php echo $Custom_CSS; ?></textarea><br />
14
- <p>You can add custom CSS styles for your FAQs in the box above.</p>
15
- </fieldset>
16
- </td>
17
- </tr>
18
-
19
- <tr>
20
- <th scope="row">FAQ Accordion</th>
21
- <td>
22
- <fieldset><legend class="screen-reader-text"><span>FAQ Accordion</span></legend>
23
- <label title='Yes'><input type='radio' name='faq_accordion' value='Yes' <?php if($FAQ_Accordion == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
24
- <label title='No'><input type='radio' name='faq_accordion' value='No' <?php if($FAQ_Accordion == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
25
- <p>Should the FAQs accordion? (Close old open FAQ when a new one is clicked)</p>
26
- </fieldset>
27
- </td>
28
- </tr>
29
-
30
- <tr>
31
- <th scope="row">Reveal Effect</th>
32
- <td>
33
- <fieldset><legend class="screen-reader-text"><span>Reveal Effect</span></legend>
34
- <label title='Reveal Effect'></label>
35
-
36
- <select name="reveal_effect">
37
- <option value="none" <?php if($Reveal_Effect == "none") {echo "selected=selected";} ?> >None</option>
38
- <option value="blind" <?php if($Reveal_Effect == "blind") {echo "selected=selected";} ?> >Blind</option>
39
- <option value="bounce" <?php if($Reveal_Effect == "bounce") {echo "selected=selected";} ?> >Bounce</option>
40
- <option value="clip" <?php if($Reveal_Effect == "clip") {echo "selected=selected";} ?> >Clip</option>
41
- <option value="drop" <?php if($Reveal_Effect == "drop") {echo "selected=selected";} ?> >Drop</option>
42
- <option value="explode" <?php if($Reveal_Effect == "explode") {echo "selected=selected";} ?> >Explode</option>
43
- <option value="fade" <?php if($Reveal_Effect == "fade") {echo "selected=selected";} ?> >Fade</option>
44
- <option value="fold" <?php if($Reveal_Effect == "fold") {echo "selected=selected";} ?> >Fold</option>
45
- <option value="highlight" <?php if($Reveal_Effect == "highlight") {echo "selected=selected";} ?> >Highlight</option>
46
- <option value="puff" <?php if($Reveal_Effect == "puff") {echo "selected=selected";} ?> >Puff</option>
47
- <option value="pulsate" <?php if($Reveal_Effect == "pulsate") {echo "selected=selected";} ?> >Pulsate</option>
48
- <option value="shake" <?php if($Reveal_Effect == "shake") {echo "selected=selected";} ?> >Shake</option>
49
- <option value="size" <?php if($Reveal_Effect == "size") {echo "selected=selected";} ?> >Size</option>
50
- <option value="slide" <?php if($Reveal_Effect == "slide") {echo "selected=selected";} ?> >Slide</option>
51
- </select>
52
-
53
- <p>How should FAQ's be displayed when their titles are clicked?</p>
54
- </fieldset>
55
- </td>
56
- </tr>
57
- </table>
58
-
59
-
60
- <p class="submit"><input type="submit" name="Options_Submit" id="submit" class="button button-primary" value="Save Changes" /></p></form>
61
-
62
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
html/WelcomeScreen.php DELETED
@@ -1,166 +0,0 @@
1
- <?php
2
- $FAQ_Accordion = get_option("EWD_UFAQ_FAQ_Accordion");
3
- $FAQ_Toggle = get_option("EWD_UFAQ_Toggle");
4
- $Group_By_Category = get_option("EWD_UFAQ_Group_By_Category");
5
- $Order_By_Setting = get_option("EWD_UFAQ_Order_By");
6
- ?>
7
- <div class='ewd-ufaq-welcome-screen'>
8
- <div class='ewd-ufaq-welcome-screen-header'>
9
- <h1><?php _e('Welcome to Ultimate FAQs', 'ultimate-faqs'); ?></h1>
10
- <p><?php _e('Thanks for choosing Ultimate FAQs! The following will help you get started with the setup by creating your first FAQ and category, as well as adding your FAQs to a page and configuring a few key options.', 'ultimate-faqs'); ?></p>
11
- </div>
12
-
13
- <div class='ewd-ufaq-welcome-screen-box ewd-ufaq-welcome-screen-categories ewd-ufaq-welcome-screen-open' data-screen='categories'>
14
- <h2><?php _e('1. Create Categories', 'ultimate-faqs'); ?></h2>
15
- <div class='ewd-ufaq-welcome-screen-box-content'>
16
- <p><?php _e('Categories let you organize your FAQs in a way that\'s easy for you - and your customers - to find.', 'ultimate-faqs'); ?></p>
17
- <div class='ewd-ufaq-welcome-screen-created-categories'>
18
- <div class='ewd-ufaq-welcome-screen-add-category-name ewd-ufaq-welcome-screen-box-content-divs'><label><?php _e('Category Name:', 'ultimate-faqs'); ?></label><input type='text' /></div>
19
- <div class='ewd-ufaq-welcome-screen-add-category-description ewd-ufaq-welcome-screen-box-content-divs'><label><?php _e('Category Description:', 'ultimate-faqs'); ?></label><textarea></textarea></div>
20
- <div class='ewd-ufaq-welcome-screen-add-category-button'><?php _e('Add Category', 'ultimate-faqs'); ?></div>
21
- <div class="ewd-ufaq-welcome-clear"></div>
22
- <div class="ewd-ufaq-welcome-screen-show-created-categories">
23
- <h3><?php _e('Created Categories:', 'ultimate-faqs'); ?></h3>
24
- <div class="ewd-ufaq-welcome-screen-show-created-categories-name"><?php _e('Name', 'ultimate-faqs'); ?></div>
25
- <div class="ewd-ufaq-welcome-screen-show-created-categories-description"><?php _e('Description', 'ultimate-faqs'); ?></div>
26
- </div>
27
- </div>
28
- <div class='ewd-ufaq-welcome-screen-next-button' data-nextaction='questions'><?php _e('Next', 'ultimate-faqs'); ?></div>
29
- <div class='ewd-ufaq-clear'></div>
30
- </div>
31
- </div>
32
-
33
- <div class='ewd-ufaq-welcome-screen-box ewd-ufaq-welcome-screen-questions' data-screen='questions'>
34
- <h2><?php _e('2. Questions & Answers', 'ultimate-faqs'); ?></h2>
35
- <div class='ewd-ufaq-welcome-screen-box-content'>
36
- <p><?php _e('Create your first set of questions and answers. Don\'t worry, you can always add more later.', 'ultimate-faqs'); ?></p>
37
- <div class='ewd-ufaq-welcome-screen-created-faqs'>
38
- <div class='ewd-ufaq-welcome-screen-add-faq-question ewd-ufaq-welcome-screen-box-content-divs'><label><?php _e('Questions:', 'ultimate-faqs'); ?></label><input type='text' /></div>
39
- <div class='ewd-ufaq-welcome-screen-add-faq-answer ewd-ufaq-welcome-screen-box-content-divs'><label><?php _e('Answer:', 'ultimate-faqs'); ?></label><textarea></textarea></div>
40
- <div class='ewd-ufaq-welcome-screen-add-faq-category ewd-ufaq-welcome-screen-box-content-divs'><label><?php _e('FAQ Category:', 'ultimate-faqs'); ?></label><select><option></option></select></div>
41
- <div class='ewd-ufaq-welcome-screen-add-faq-button'><?php _e('Add FAQ', 'ultimate-faqs'); ?></div>
42
- <div class="ewd-ufaq-welcome-clear"></div>
43
- <div class="ewd-ufaq-welcome-screen-show-created-faqs">
44
- <h3><?php _e('Created FAQs:', 'ultimate-faqs'); ?></h3>
45
- <div class="ewd-ufaq-welcome-screen-show-created-faq-question"><?php _e('Question', 'ultimate-faqs'); ?></div>
46
- <div class="ewd-ufaq-welcome-screen-show-created-faq-answer"><?php _e('Answer', 'ultimate-faqs'); ?></div>
47
- <div class="ewd-ufaq-welcome-screen-show-created-faq-category"><?php _e('Category', 'ultimate-faqs'); ?></div>
48
- </div>
49
- </div>
50
- <div class='ewd-ufaq-welcome-screen-previous-button' data-previousaction='categories'><?php _e('Previous', 'ultimate-faqs'); ?></div>
51
- <?php if (isset($_GET['exclude'])) { ?><div class='ewd-ufaq-welcome-screen-finish-button'><a href='admin.php?page=EWD-UFAQ-Options'><?php _e('Finish', 'ultimate-faqs'); ?></a></div>
52
- <?php } else { ?><div class='ewd-ufaq-welcome-screen-next-button' data-nextaction='faq-page'><?php _e('Next', 'ultimate-faqs'); ?></div><?php } ?>
53
- <div class='ewd-ufaq-clear'></div>
54
- </div>
55
- </div>
56
- <?php if (!isset($_GET['exclude'])) { ?>
57
- <div class='ewd-ufaq-welcome-screen-box ewd-ufaq-welcome-screen-faq-page' data-screen='faq-page'>
58
- <h2><?php _e('3. Add an FAQ Page', 'ultimate-faqs'); ?></h2>
59
- <div class='ewd-ufaq-welcome-screen-box-content'>
60
- <p><?php _e('You can create a dedicated FAQ page below, or skip this step and add your FAQs to a page you\'ve already created manually.', 'ultimate-faqs'); ?></p>
61
- <div class='ewd-ufaq-welcome-screen-faq-page'>
62
- <div class='ewd-ufaq-welcome-screen-add-faq-page-name ewd-ufaq-welcome-screen-box-content-divs'><label><?php _e('Page Title:', 'ultimate-faqs'); ?></label><input type='text' value='FAQs' /></div>
63
- <div class='ewd-ufaq-welcome-screen-add-faq-page-button'><?php _e('Create Page', 'ultimate-faqs'); ?></div>
64
- </div>
65
- <div class="ewd-ufaq-welcome-clear"></div>
66
- <div class='ewd-ufaq-welcome-screen-next-button' data-nextaction='options'><?php _e('Next', 'ultimate-faqs'); ?></div>
67
- <div class='ewd-ufaq-welcome-screen-previous-button' data-previousaction='questions'><?php _e('Previous', 'ultimate-faqs'); ?></div>
68
- <div class='ewd-ufaq-clear'></div>
69
- </div>
70
- </div>
71
-
72
- <div class='ewd-ufaq-welcome-screen-box ewd-ufaq-welcome-screen-options' data-screen='options'>
73
- <h2><?php _e('4. Set Key Options', 'ultimate-faqs'); ?></h2>
74
- <div class='ewd-ufaq-welcome-screen-box-content'>
75
- <p><?php _e('Options can always be changed later, but here are a few that a lot of users want to set for themselves.', 'ultimate-faqs'); ?></p>
76
- <table class="form-table">
77
- <tr>
78
- <th><?php _e('FAQ Accordion', 'ultimate-faqs'); ?></th>
79
- <td>
80
- <div class='ewd-ufaq-welcome-screen-option'>
81
- <fieldset>
82
- <legend class="screen-reader-text"><span>FAQ Accordion</span></legend>
83
- <div class="ewd-ufaq-admin-hide-radios">
84
- <label title='Yes'><input type='radio' name='faq_accordion' value='Yes' <?php if($FAQ_Accordion == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
85
- <label title='No'><input type='radio' name='faq_accordion' value='No' <?php if($FAQ_Accordion == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
86
- </div>
87
- <label class="ewd-ufaq-admin-switch">
88
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="faq_accordion" <?php if($FAQ_Accordion == "Yes") {echo "checked='checked'";} ?>>
89
- <span class="ewd-ufaq-admin-switch-slider round"></span>
90
- </label>
91
- <p>Should the FAQs accordion? (Only one FAQ is open at a time, requires FAQ Toggle)</p>
92
- </fieldset>
93
- </div>
94
- </td>
95
- </tr>
96
- <tr>
97
- <th><?php _e('FAQ Toggle', 'ultimate-faqs'); ?></th>
98
- <td>
99
- <div class='ewd-ufaq-welcome-screen-option'>
100
- <fieldset>
101
- <legend class="screen-reader-text"><span>FAQ Toggle</span></legend>
102
- <div class="ewd-ufaq-admin-hide-radios">
103
- <label title='Yes'><input type='radio' name='faq_toggle' value='Yes' <?php if($FAQ_Toggle == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
104
- <label title='No'><input type='radio' name='faq_toggle' value='No' <?php if($FAQ_Toggle == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
105
- </div>
106
- <label class="ewd-ufaq-admin-switch">
107
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="faq_toggle" <?php if($FAQ_Toggle == "Yes") {echo "checked='checked'";} ?>>
108
- <span class="ewd-ufaq-admin-switch-slider round"></span>
109
- </label>
110
- <p>Should the FAQs hide/open when they are clicked? </p>
111
- </fieldset>
112
- </div>
113
- </td>
114
- </tr>
115
- <tr>
116
- <th><?php _e('Group FAQs by Category', 'ultimate-faqs'); ?></th>
117
- <td>
118
- <div class='ewd-ufaq-welcome-screen-option'>
119
- <fieldset>
120
- <legend class="screen-reader-text"><span>Group FAQs by Category</span></legend>
121
- <div class="ewd-ufaq-admin-hide-radios">
122
- <label title='Yes'><input type='radio' name='group_by_category' value='Yes' <?php if($Group_By_Category == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
123
- <label title='No'><input type='radio' name='group_by_category' value='No' <?php if($Group_By_Category == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
124
- </div>
125
- <label class="ewd-ufaq-admin-switch">
126
- <input type="checkbox" class="ewd-ufaq-admin-option-toggle" data-inputname="group_by_category" <?php if($Group_By_Category == "Yes") {echo "checked='checked'";} ?>>
127
- <span class="ewd-ufaq-admin-switch-slider round"></span>
128
- </label>
129
- <p>Should FAQs be grouped by category, or should all categories be mixed together?</p>
130
- </fieldset>
131
- </div>
132
- </td>
133
- </tr>
134
- <tr>
135
- <th><?php _e('FAQ Ordering', 'ultimate-faqs'); ?></th>
136
- <td>
137
- <div class='ewd-ufaq-welcome-screen-option'>
138
- <fieldset>
139
- <legend class="screen-reader-text"><span>FAQ Ordering</span></legend>
140
- <label title='FAQ Ordering'></label>
141
-
142
- <select name="order_by_setting">
143
- <option value="date" <?php if($Order_By_Setting == "date") {echo "selected=selected";} ?> >Created Date</option>
144
- <option value="title" <?php if($Order_By_Setting == "title") {echo "selected=selected";} ?> >Title</option>
145
- <option value="modified" <?php if($Order_By_Setting == "modified") {echo "selected=selected";} ?> >Modified Date</option>
146
- </select>
147
-
148
- <p>How should individual FAQs be ordered?</p>
149
- </fieldset>
150
- </div>
151
- </td>
152
- </tr>
153
- </table>
154
-
155
- <div class='ewd-ufaq-welcome-screen-save-options-button'><?php _e('Save Options', 'ultimate-faqs'); ?></div>
156
- <div class="ewd-ufaq-welcome-clear"></div>
157
- <div class='ewd-ufaq-welcome-screen-previous-button' data-previousaction='faq-page'><?php _e('Previous', 'ultimate-faqs'); ?></div>
158
- <div class='ewd-ufaq-welcome-screen-finish-button'><a href='admin.php?page=EWD-UFAQ-Options'><?php _e('Finish', 'ultimate-faqs'); ?></a></div>
159
- <div class='ewd-ufaq-clear'></div>
160
- </div>
161
- </div>
162
- <?php } ?>
163
- <div class='ewd-ufaq-welcome-screen-skip-container'>
164
- <a href='admin.php?page=EWD-UFAQ-Options'><div class='ewd-ufaq-welcome-screen-skip-button'><?php _e('Skip Setup', 'ultimate-faqs'); ?></div></a>
165
- </div>
166
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/Ajax.class.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'ABSPATH' ) ) exit;
3
+
4
+ if ( !class_exists( 'ewdufaqAJAX' ) ) {
5
+ /**
6
+ * Class to handle AJAX interactions for Ultimate FAQs
7
+ *
8
+ * @since 2.0.0
9
+ */
10
+ class ewdufaqAJAX {
11
+
12
+ public function __construct() {
13
+
14
+ add_action( 'wp_ajax_ewd_ufaq_search', array( $this, 'return_search_results' ) );
15
+ add_action( 'wp_ajax_nopriv_ewd_ufaq_search', array( $this, 'return_search_results' ) );
16
+
17
+ add_action( 'wp_ajax_ewd_ufaq_record_view', array( $this, 'record_view' ) );
18
+ add_action( 'wp_ajax_nopriv_ewd_ufaq_record_view', array( $this, 'record_view' ) );
19
+
20
+ add_action( 'wp_ajax_ewd_ufaq_update_rating', array( $this, 'update_rating' ) );
21
+ add_action( 'wp_ajax_nopriv_ewd_ufaq_update_rating', array( $this, 'update_rating' ) );
22
+
23
+ add_action( 'wp_ajax_ewd_ufaq_update_order', array( $this, 'update_order' ) );
24
+ }
25
+
26
+ /**
27
+ * Get the results of the FAQ search
28
+ * @since 2.0.0
29
+ */
30
+ public function return_search_results() {
31
+ global $ewd_ufaq_controller;
32
+
33
+ $faq_atts = array(
34
+ 'search_string' => '',
35
+ 'post__in' => '',
36
+ 'post__in_string' => '',
37
+ 'include_tag' => '',
38
+ 'include_category' => '',
39
+ 'exclude_category' => '',
40
+ 'include_category_ids' => '',
41
+ 'exclude_category_ids' => '',
42
+ 'include_category_children' => '',
43
+ 'no_comments' => '',
44
+ 'orderby' => '',
45
+ 'order' => '',
46
+ 'display_all_answers' => '',
47
+ 'faq_page' => 1,
48
+ 'post_count' => -1
49
+ );
50
+
51
+ $query = new ewdufaqQuery( $faq_atts );
52
+
53
+ $query->parse_request_args();
54
+ $query->prepare_args();
55
+
56
+ $faqs = new ewdufaqViewFAQs( $faq_atts );
57
+
58
+ $faqs->set_faqs( $query->get_faqs() );
59
+
60
+ $faqs->set_faqs_options();
61
+
62
+ $faqs->set_request_parameters();
63
+
64
+ $faqs->create_faq_data();
65
+
66
+ ob_start();
67
+
68
+ $ewd_ufaq_controller->shortcode_printing = true;
69
+
70
+ $faqs->print_faqs();
71
+
72
+ $ewd_ufaq_controller->shortcode_printing = false;
73
+
74
+ $output = ob_get_clean();
75
+
76
+ $output = $output ? $output : sprintf( $ewd_ufaq_controller->settings->get_setting( 'label-no-results-found' ), $query->args['search_string'] );
77
+
78
+ wp_send_json_success(
79
+ array(
80
+ 'output' => $output,
81
+ 'faq_count' => $faqs->faq_count,
82
+ 'max_page' => $faqs->max_page,
83
+ 'request_count' => intval( $_POST['request_count'] )
84
+ )
85
+ );
86
+
87
+ die();
88
+ }
89
+
90
+ /**
91
+ * Records the number of time an FAQ post is opened
92
+ * @since 2.0.0
93
+ */
94
+ public function record_view() {
95
+ global $wpdb;
96
+
97
+ $post_id = intval( $_POST['post_id'] );
98
+
99
+ $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id=%d AND meta_key='ufaq_view_count'", $post_id ) );
100
+
101
+ if ( $meta_id != '' and $meta_id != 0 ) { $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->postmeta SET meta_value=meta_value+1 WHERE post_id=%d AND meta_key='ufaq_view_count'", $post_id ) ); }
102
+ else { $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->postmeta (post_id,meta_key,meta_value) VALUES (%d,'ufaq_view_count','1')", $post_id ) ); }
103
+
104
+ die();
105
+ }
106
+
107
+ /**
108
+ * Update the up or down rating for an FAQ
109
+ * @since 2.0.0
110
+ */
111
+ public function update_rating() {
112
+
113
+ $faq_id = is_numeric( $_POST['faq_id'] ) ? intval( $_POST['faq_id'] ) : 0;
114
+ $vote_type = sanitize_text_field( $_POST['vote_type'] );
115
+
116
+ if ( $vote_type == 'up' ) {
117
+
118
+ $up_votes = get_post_meta( $faq_id, 'FAQ_Up_Votes', true );
119
+ update_post_meta( $faq_id, 'FAQ_Up_Votes', $up_votes + 1 );
120
+
121
+ $total_score = get_post_meta( $faq_id, 'FAQ_Total_Score', true );
122
+ update_post_meta( $faq_id, 'FAQ_Total_Score', $total_score + 1 );
123
+ }
124
+ if ( $vote_type == 'down' ) {
125
+
126
+ $down_votes = get_post_meta( $faq_id, 'FAQ_Down_Votes', true );
127
+ update_post_meta( $faq_id, 'FAQ_Down_Votes', $down_votes + 1 );
128
+
129
+ $total_score = get_post_meta( $faq_id, 'FAQ_Total_Score', true );
130
+ update_post_meta( $faq_id, 'FAQ_Total_Score', $total_score - 1 );
131
+ }
132
+
133
+ die();
134
+ }
135
+
136
+ /**
137
+ * Updates the order of the FAQ, based on the ordering table
138
+ * @since 2.0.0
139
+ */
140
+ public function update_order() {
141
+ global $ewd_ufaq_controller;
142
+
143
+ if ( ! is_array( $_POST['ewd-ufaq-item'] ) or ! $ewd_ufaq_controller->permissions->check_permission( 'ordering' ) ) { return; }
144
+
145
+ foreach ( $_POST['ewd-ufaq-item'] as $key => $id ) {
146
+
147
+ update_post_meta( intval( $id ), 'ufaq_order', intval( $key ) );
148
+ }
149
+
150
+ die();
151
+ }
152
+ }
153
+ }
includes/BackwardsCompatibility.class.php ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+
4
+ if ( ! class_exists( 'ewdufaqBackwardsCompatibility' ) ) {
5
+ /**
6
+ * Class to handle transforming the plugin settings from the
7
+ * previous style (individual options) to the new one (options array)
8
+ *
9
+ * @since 2.0.0
10
+ */
11
+ class ewdufaqBackwardsCompatibility {
12
+
13
+ public function __construct() {
14
+
15
+ if ( empty( get_option( 'ewd-ufaq-settings' ) ) and get_option( 'EWD_UFAQ_Full_Version' ) ) { $this->run_backwards_compat(); }
16
+ elseif ( ! get_option( 'ewd-ufaq-permission-level' ) ) { update_option( 'ewd-ufaq-permission-level', 1 ); }
17
+ }
18
+
19
+ public function run_backwards_compat() {
20
+
21
+ $settings = array(
22
+ 'custom-css' => get_option( 'EWD_UFAQ_Custom_CSS' ),
23
+ 'disable-faq-toggle' => get_option( 'EWD_UFAQ_Toggle' ) == 'Yes' ? false : true,
24
+ 'faq-category-toggle' => get_option( 'EWD_UFAQ_Category_Toggle' ) == 'Yes' ? true : false,
25
+ 'faq-category-accordion' => get_option( 'EWD_UFAQ_Category_Accordion' ) == 'Yes' ? true : false,
26
+ 'expand-collapse-all' => get_option( 'EWD_UFAQ_Expand_Collapse_All' ) == 'Yes' ? true : false,
27
+ 'faq-accordion' => get_option( 'EWD_UFAQ_FAQ_Accordion' ) == 'Yes' ? true : false,
28
+ 'hide-categories' => get_option( 'EWD_UFAQ_Hide_Categories' ) == 'Yes' ? true : false,
29
+ 'hide-tags' => get_option( 'EWD_UFAQ_Hide_Tags' ) == 'Yes' ? true : false,
30
+ 'scroll-to-top' => get_option( 'EWD_UFAQ_Scroll_To_Top' ) == 'Yes' ? true : false,
31
+ 'display-all-answers' => get_option( 'EWD_UFAQ_Display_All_Answers' ) == 'Yes' ? true : false,
32
+ 'display-author' => get_option( 'EWD_UFAQ_Display_Author' ) == 'Yes' ? true : false,
33
+ 'display-date' => get_option( 'EWD_UFAQ_Display_Date' ) == 'Yes' ? true : false,
34
+ 'display-back-to-top' => get_option( 'EWD_UFAQ_Display_Back_To_Top' ) == 'Yes' ? true : false,
35
+ 'include-permalink' => get_option( 'EWD_UFAQ_Include_Permalink' ) == 'Yes' ? 'both' : ( get_option( 'EWD_UFAQ_Include_Permalink' ) == 'No' ? 'none' : strtolower( get_option( 'EWD_UFAQ_Include_Permalink' ) ) ),
36
+ 'permalink-type' => get_option( 'EWD_UFAQ_Permalink_Type' ) == 'SamePage' ? 'same_page' : 'individual_page',
37
+ 'comments-on' => get_option( 'EWD_UFAQ_Comments_On' ) == 'Yes' ? true : false,
38
+ 'disable-microdata' => get_option( 'EWD_UFAQ_Disable_Microdata' ) == 'Yes' ? true : false,
39
+ 'access-role' => get_option( 'EWD_UFAQ_Access_Role' ),
40
+ 'display-style' => strtolower( get_option( 'EWD_UFAQ_Display_Style' ) ),
41
+ 'number-of-columns' => strtolower( get_option( 'EWD_UFAQ_FAQ_Number_Of_Columns' ) ),
42
+ 'responsive-columns' => get_option( 'EWD_UFAQ_Responsive_Columns' ) == 'Yes' ? true : false,
43
+ 'color-block-shape' => strtolower( get_option( 'EWD_UFAQ_Color_Block_Shape' ) ),
44
+ 'faqs-per-page' => get_option( 'EWD_UFAQ_FAQs_Per_Page' ),
45
+ 'page-type' => strtolower( get_option( 'EWD_UFAQ_Page_Type' ) ),
46
+ 'faq-ratings' => get_option( 'EWD_UFAQ_FAQ_Ratings' ) == 'Yes' ? true : false,
47
+ 'thumbs-up-image' => get_option( 'EWD_UFAQ_Thumbs_Up_Image' ),
48
+ 'thumbs-down-image' => get_option( 'EWD_UFAQ_Thumbs_Down_Image' ),
49
+ 'woocommerce-integration' => get_option( 'EWD_UFAQ_WooCommerce_FAQs' ) == 'Yes' ? true : false,
50
+ 'woocommerce-use-product' => get_option( 'EWD_UFAQ_Use_Product' ) == 'Yes' ? true : false,
51
+ 'wpforms-integration' => get_option( 'EWD_UFAQ_WPForms_Integration' ) == 'Yes' ? true : false,
52
+ 'wpforms-post-count' => get_option( 'EWD_UFAQ_WPForms_Post_Count' ),
53
+ 'wpforms-faq-location' => strtolower( get_option( 'EWD_UFAQ_WPForms_FAQ_Location' ) ),
54
+ 'reveal-effect' => strtolower( get_option( 'EWD_UFAQ_Reveal_Effect' ) ),
55
+ 'pretty-permalinks' => get_option( 'EWD_UFAQ_Pretty_Permalinks' ) == 'Yes' ? true : false,
56
+ 'allow-proposed-answer' => get_option( 'EWD_UFAQ_Allow_Proposed_Answer' ) == 'Yes' ? true : false,
57
+ 'submit-custom-fields' => get_option( 'EWD_UFAQ_Submit_Custom_Fields' ) == 'Yes' ? true : false,
58
+ 'submit-question-captcha' => get_option( 'EWD_UFAQ_Submit_Question_Captcha' ) == 'Yes' ? true : false,
59
+ 'submitted-default-category' => get_option( 'EWD_UFAQ_Submitted_Default_Category' ),
60
+ 'admin-question-notification' => get_option( 'EWD_UFAQ_Admin_Question_Notification' ) == 'Yes' ? true : false,
61
+ 'admin-notification-email' => get_option( 'EWD_UFAQ_Admin_Notification_Email' ),
62
+ 'submit-faq-email' => get_option( 'EWD_UFAQ_Submit_FAQ_Email' ),
63
+ 'auto-complete-titles' => get_option( 'EWD_UFAQ_Auto_Complete_Titles' ) == 'Yes' ? true : false,
64
+ 'highlight-search-term' => get_option( 'EWD_UFAQ_Highlight_Search_Term' ) == 'Yes' ? true : false,
65
+ 'slug-base' => get_option( 'EWD_UFAQ_Slug_Base' ),
66
+ 'social-media' => array_diff( explode( ',', strtolower( get_option( 'EWD_UFAQ_Social_Media' ) ) ), array( 'blank' ) ),
67
+ 'faq-elements-order' => $this->convert_elements_order(),
68
+ 'slug-base' => get_option( 'EWD_UFAQ_Slug_Base' ),
69
+ 'group-by-category' => get_option( 'EWD_UFAQ_Group_By_Category' ) == 'Yes' ? true : false,
70
+ 'group-by-category-count' => get_option( 'EWD_UFAQ_Group_By_Category_Count' ) == 'Yes' ? true : false,
71
+ 'category-order-by' => strtolower( get_option( 'EWD_UFAQ_Group_By_Order_By' ) ),
72
+ 'category-order' => strtolower( get_option( 'EWD_UFAQ_Group_By_Order' ) ),
73
+ 'faq-order-by' => strtolower( get_option( 'EWD_UFAQ_Order_By' ) ),
74
+ 'faq-order' => strtolower( get_option( 'EWD_UFAQ_Order' ) ),
75
+ 'faq-fields' => $this->convert_field_array(),
76
+ 'hide-blank-fields' => get_option( 'EWD_UFAQ_Hide_Blank_Fields' ) == 'Yes' ? true : false,
77
+ 'label-posted' => get_option( 'EWD_UFAQ_Posted_Label' ),
78
+ 'label-by' => get_option( 'EWD_UFAQ_By_Label' ),
79
+ 'label-on' => get_option( 'EWD_UFAQ_On_Label' ),
80
+ 'label-categories' => get_option( 'EWD_UFAQ_Category_Label' ),
81
+ 'label-tags' => get_option( 'EWD_UFAQ_Tag_Label' ),
82
+ 'label-enter-question' => get_option( 'EWD_UFAQ_Enter_Question_Label' ),
83
+ 'label-search' => get_option( 'EWD_UFAQ_Search_Label' ),
84
+ 'label-permalink' => get_option( 'EWD_UFAQ_Permalink_Label' ),
85
+ 'label-back-to-top' => get_option( 'EWD_UFAQ_Back_To_Top_Label' ),
86
+ 'label-woocommerce-tab' => get_option( 'EWD_UFAQ_WooCommerce_Tab_Label' ),
87
+ 'label-share-faq' => get_option( 'EWD_UFAQ_Share_FAQ_Label' ),
88
+ 'label-ratings' => get_option( 'EWD_UFAQ_Find_FAQ_Helpful_Label' ),
89
+ 'label-search-placeholder' => get_option( 'EWD_UFAQ_Search_Placeholder_Label' ),
90
+ 'label-thank-you-submit' => get_option( 'EWD_UFAQ_Thank_You_Submit_Label' ),
91
+ 'label-submit-question' => get_option( 'EWD_UFAQ_Submit_Question_Label' ),
92
+ 'label-please-fill-form-below' => get_option( 'EWD_UFAQ_Please_Fill_Form_Below_Label' ),
93
+ 'label-send-question' => get_option( 'EWD_UFAQ_Send_Question_Label' ),
94
+ 'label-question-title' => get_option( 'EWD_UFAQ_Question_Title_Label' ),
95
+ 'label-question-title-explanation' => get_option( 'EWD_UFAQ_What_Question_Being_Answered_Label' ),
96
+ 'label-proposed-answer' => get_option( 'EWD_UFAQ_Proposed_Answer_Label' ),
97
+ 'label-question-author' => get_option( 'EWD_UFAQ_Review_Author_Label' ),
98
+ 'label-question-author-explanation' => get_option( 'EWD_UFAQ_What_Name_With_Review_Label' ),
99
+ 'label-captcha-image-number' => get_option( 'EWD_UFAQ_Captcha_Image_Number_Label' ),
100
+ 'label-retrieving-results' => get_option( 'EWD_UFAQ_Retrieving_Results' ),
101
+ 'label-no-results-found' => get_option( 'EWD_UFAQ_No_Results_Found_Text' ),
102
+ 'styling-toggle-background-color' => get_option( 'EWD_UFAQ_Styling_Default_Bg_Color' ),
103
+ 'styling-toggle-font-color' => get_option( 'EWD_UFAQ_Styling_Default_Font_Color' ),
104
+ 'styling-toggle-border-size' => get_option( 'EWD_UFAQ_Styling_Default_Border_Size' ),
105
+ 'styling-toggle-border-color' => get_option( 'EWD_UFAQ_Styling_Default_Border_Color' ),
106
+ 'styling-toggle-border-radius' => get_option( 'EWD_UFAQ_Styling_Default_Border_Radius' ),
107
+ 'styling-toggle-symbol-size' => get_option( 'EWD_UFAQ_Styling_Toggle_Symbol_Size' ),
108
+ 'styling-block-background-color' => get_option( 'EWD_UFAQ_Styling_Block_Bg_Color' ),
109
+ 'styling-block-font-color' => get_option( 'EWD_UFAQ_Styling_Block_Font_Color' ),
110
+ 'styling-list-font' => get_option( 'EWD_UFAQ_Styling_List_Font' ),
111
+ 'styling-list-font-size' => get_option( 'EWD_UFAQ_Styling_List_Font_Size' ),
112
+ 'styling-list-font-color' => get_option( 'EWD_UFAQ_Styling_List_Font_Color' ),
113
+ 'styling-list-margin' => get_option( 'EWD_UFAQ_Styling_List_Margin' ),
114
+ 'styling-list-padding' => get_option( 'EWD_UFAQ_Styling_List_Padding' ),
115
+ 'styling-question-font' => get_option( 'EWD_UFAQ_Styling_Question_Font' ),
116
+ 'styling-question-font-size' => get_option( 'EWD_UFAQ_Styling_Question_Font_Size' ),
117
+ 'styling-question-font-color' => get_option( 'EWD_UFAQ_Styling_Question_Font_Color' ),
118
+ 'styling-question-margin' => get_option( 'EWD_UFAQ_Styling_Question_Margin' ),
119
+ 'styling-question-padding' => get_option( 'EWD_UFAQ_Styling_Question_Padding' ),
120
+ 'styling-question-icon-top-margin' => get_option( 'EWD_UFAQ_Styling_Question_Icon_Top_Margin' ),
121
+ 'styling-answer-font' => get_option( 'EWD_UFAQ_Styling_Answer_Font' ),
122
+ 'styling-answer-font-size' => get_option( 'EWD_UFAQ_Styling_Answer_Font_Size' ),
123
+ 'styling-answer-font-color' => get_option( 'EWD_UFAQ_Styling_Answer_Font_Color' ),
124
+ 'styling-answer-margin' => get_option( 'EWD_UFAQ_Styling_Answer_Margin' ),
125
+ 'styling-answer-padding' => get_option( 'EWD_UFAQ_Styling_Answer_Padding' ),
126
+ 'styling-postdate-font' => get_option( 'EWD_UFAQ_Styling_Postdate_Font' ),
127
+ 'styling-postdate-font-size' => get_option( 'EWD_UFAQ_Styling_Postdate_Font_Size' ),
128
+ 'styling-postdate-font-color' => get_option( 'EWD_UFAQ_Styling_Postdate_Font_Color' ),
129
+ 'styling-postdate-margin' => get_option( 'EWD_UFAQ_Styling_Postdate_Margin' ),
130
+ 'styling-postdate-padding' => get_option( 'EWD_UFAQ_Styling_Postdate_Padding' ),
131
+ 'styling-category-heading-font' => get_option( 'EWD_UFAQ_Styling_Category_Heading_Font' ),
132
+ 'styling-category-heading-font-size' => get_option( 'EWD_UFAQ_Styling_Category_Heading_Font_Size' ),
133
+ 'styling-category-heading-font-color' => get_option( 'EWD_UFAQ_Styling_Category_Heading_Font_Color' ),
134
+ 'styling-category-font' => get_option( 'EWD_UFAQ_Styling_Category_Font' ),
135
+ 'styling-category-font-size' => get_option( 'EWD_UFAQ_Styling_Category_Font_Size' ),
136
+ 'styling-category-font-color' => get_option( 'EWD_UFAQ_Styling_Category_Font_Color' ),
137
+ 'styling-category-margin' => get_option( 'EWD_UFAQ_Styling_Category_Margin' ),
138
+ 'styling-category-padding' => get_option( 'EWD_UFAQ_Styling_Category_Padding' ),
139
+ 'styling-category-heading-type' => get_option( 'EWD_UFAQ_Styling_Category_Heading_Type' ),
140
+ 'styling-faq-heading-type' => get_option( 'EWD_UFAQ_Styling_FAQ_Heading_Type' ),
141
+ 'styling-toggle-symbol' => get_option( 'EWD_UFAQ_Toggle_Symbol' ),
142
+ );
143
+
144
+ add_option( 'ewd-ufaq-review-ask-time', get_option( 'EWD_UFAQ_Ask_Review_Date' ) );
145
+ add_option( 'ewd-ufaq-installation-time', get_option( 'EWD_UFAQ_Install_Time' ) );
146
+
147
+ update_option( 'ewd-ufaq-permission-level', get_option( 'EWD_UFAQ_Full_Version' ) == 'Yes' ? 2 : 1 );
148
+
149
+ update_option( 'ewd-ufaq-settings', $settings );
150
+ }
151
+
152
+ public function convert_elements_order() {
153
+
154
+ $elements_order = array();
155
+
156
+ $old_elements = get_option( 'EWD_UFAQ_FAQ_Elements' );
157
+
158
+ foreach ( $old_elements as $old_element ) {
159
+
160
+ $elements_order[ strtolower( $old_element ) ] = $this->get_element_label( $old_element );
161
+ }
162
+
163
+ return json_encode( $elements_order );
164
+ }
165
+
166
+ public function convert_field_array() {
167
+
168
+ $old_faq_fields = get_option( 'EWD_UFAQ_FAQ_Fields' );
169
+ $new_faq_fields = array();
170
+
171
+ foreach ( $old_faq_fields as $old_faq_field ) {
172
+
173
+ $new_field = array(
174
+ 'id' => $old_faq_field['FieldID'],
175
+ 'name' => $old_faq_field['FieldName'],
176
+ 'type' => $old_faq_field['FieldType'],
177
+ 'options' => ! empty( $old_faq_field['FieldValues'] ) ? $old_faq_field['FieldValues'] : '',
178
+ );
179
+
180
+ $new_faq_fields[] = $new_field;
181
+ }
182
+
183
+ return json_encode( $new_faq_fields );
184
+ }
185
+
186
+ public function get_element_label( $element ) {
187
+
188
+ if ( $element == 'Author_Date' ) { return 'Author/Date'; }
189
+ elseif ( $element == 'Custom_Fields' ) { return 'Custom Fields'; }
190
+ elseif ( $element == 'Social_Media' ) { return 'Social Media'; }
191
+ elseif ( $element == 'Back_To_Top' ) { return 'Back to Top'; }
192
+
193
+ return $element;
194
+ }
195
+ }
196
+
197
+ }
includes/Blocks.class.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+
4
+ if ( ! class_exists( 'ewdufaqBlocks' ) ) {
5
+ /**
6
+ * Class to handle plugin Gutenberg blocks
7
+ *
8
+ * @since 2.0.0
9
+ */
10
+ class ewdufaqBlocks {
11
+
12
+ public function __construct() {
13
+
14
+ add_action( 'init', array( $this, 'add_faq_blocks' ) );
15
+
16
+ add_filter( 'block_categories', array( $this, 'add_block_category' ) );
17
+ }
18
+
19
+ /**
20
+ * Add the Gutenberg block to the list of available blocks
21
+ * @since 2.0.0
22
+ */
23
+ public function add_faq_blocks() {
24
+
25
+ if ( ! function_exists( 'render_block_core_block' ) ) { return; }
26
+
27
+ $this->enqueue_assets();
28
+
29
+ $args = array(
30
+ 'attributes' => array(
31
+ 'post_count' => array(
32
+ 'type' => 'integer',
33
+ ),
34
+ 'include_category' => array(
35
+ 'type' => 'string',
36
+ ),
37
+ 'exclude_category' => array(
38
+ 'type' => 'string',
39
+ ),
40
+ ),
41
+ 'editor_script' => 'ewd-ufaq-blocks-js',
42
+ 'editor_style' => 'ewd-ufaq-blocks-css',
43
+ 'render_callback' => 'ewd_ufaq_faqs_shortcode',
44
+ );
45
+
46
+ register_block_type( 'ultimate-faqs/ewd-ufaq-display-faq-block', $args );
47
+
48
+ $args = array(
49
+ 'attributes' => array(
50
+ 'post_count' => array(
51
+ 'type' => 'integer',
52
+ ),
53
+ ),
54
+ 'editor_script' => 'ewd-ufaq-blocks-js',
55
+ 'editor_style' => 'ewd-ufaq-blocks-css',
56
+ 'render_callback' => 'ewd_ufaq_recent_faqs_shortcode',
57
+ );
58
+
59
+ register_block_type( 'ultimate-faqs/ewd-ufaq-recent-faqs-block', $args );
60
+
61
+ $args = array(
62
+ 'attributes' => array(
63
+ 'post_count' => array(
64
+ 'type' => 'integer',
65
+ ),
66
+ ),
67
+ 'editor_script' => 'ewd-ufaq-blocks-js',
68
+ 'editor_style' => 'ewd-ufaq-blocks-css',
69
+ 'render_callback' => 'ewd_ufaq_popular_faqs_shortcode',
70
+ );
71
+
72
+ register_block_type( 'ultimate-faqs/ewd-ufaq-popular-faqs-block', $args );
73
+
74
+ $args = array(
75
+ 'attributes' => array(
76
+ 'post_count' => array(
77
+ 'type' => 'integer',
78
+ ),
79
+ 'include_category' => array(
80
+ 'type' => 'string',
81
+ ),
82
+ 'exclude_category' => array(
83
+ 'type' => 'string',
84
+ ),
85
+ ),
86
+ 'editor_script' => 'ewd-ufaq-blocks-js',
87
+ 'editor_style' => 'ewd-ufaq-blocks-css',
88
+ 'render_callback' => 'ewd_ufaq_search_faqs_shortcode',
89
+ );
90
+
91
+ register_block_type( 'ultimate-faqs/ewd-ufaq-search-block', $args );
92
+
93
+ $args = array(
94
+ 'editor_script' => 'ewd-ufaq-blocks-js',
95
+ 'editor_style' => 'ewd-ufaq-blocks-css',
96
+ 'render_callback' => 'ewd_ufaq_submit_faq_shortcode',
97
+ );
98
+
99
+ register_block_type( 'ultimate-faqs/ewd-ufaq-submit-faq-block', $args );
100
+ }
101
+
102
+ /**
103
+ * Create a new category of blocks to hold our block
104
+ * @since 2.0.0
105
+ */
106
+ public function add_block_category( $categories ) {
107
+
108
+ $categories[] = array(
109
+ 'slug' => 'ewd-ufaq-blocks',
110
+ 'title' => __( 'Ultimate FAQs', 'ultimate-faqs' ),
111
+ );
112
+
113
+ return $categories;
114
+ }
115
+
116
+ /**
117
+ * Register the necessary JS and CSS to display the block in the editor
118
+ * @since 2.0.0
119
+ */
120
+ public function enqueue_assets() {
121
+
122
+ wp_register_script( 'ewd-ufaq-blocks-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-blocks.js', array( 'wp-blocks', 'wp-element', 'wp-components', 'wp-editor' ), EWD_UFAQ_VERSION );
123
+ wp_register_style( 'ewd-ufaq-blocks-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-blocks.css', array( 'wp-edit-blocks' ), EWD_UFAQ_VERSION );
124
+ }
125
+ }
126
+
127
+ }
includes/CustomPostTypes.class.php ADDED
@@ -0,0 +1,577 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class to handle all custom post type definitions for Ultimate FAQs
4
+ */
5
+
6
+ if ( !defined( 'ABSPATH' ) )
7
+ exit;
8
+
9
+ if ( !class_exists( 'ewdufaqCustomPostTypes' ) ) {
10
+ class ewdufaqCustomPostTypes {
11
+
12
+ public function __construct() {
13
+
14
+ // Call when plugin is initialized on every page load
15
+ add_action( 'admin_init', array( $this, 'create_nonce' ) );
16
+ add_action( 'init', array( $this, 'load_cpts' ) );
17
+
18
+ // Handle metaboxes
19
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
20
+ add_action( 'save_post', array( $this, 'save_meta' ) );
21
+ add_action( 'post_edit_form_tag', array( $this, 'add_multipart_form_encoding' ) );
22
+
23
+ // Add columns and filters to the admin list of FAQs
24
+ add_filter( 'manage_ufaq_posts_columns', array( $this, 'register_faq_table_columns' ) );
25
+ add_action( 'manage_ufaq_posts_custom_column', array( $this, 'display_faq_columns_content' ), 10, 2 );
26
+ add_filter( 'manage_edit-ufaq_sortable_columns', array( $this, 'register_post_column_sortables' ) );
27
+ add_filter( 'request', array( $this, 'orderby_custom_columns' ) );
28
+ add_filter( 'parse_query', array( $this, 'convert_to_taxonomy_term' ) );
29
+ add_filter( 'restrict_manage_posts', array( $this, 'add_categories_dropdown' ) );
30
+ add_filter( 'posts_clauses', array( $this, 'sort_by_category' ), 10, 2 );
31
+
32
+ // Add the option to bulk reset views from FAQs
33
+ add_filter( 'bulk_actions-edit-ufaq', array( $this, 'add_reset_view_count_bulk_action' ) );
34
+ add_filter( 'handle_bulk_actions-edit-ufaq', array( $this, 'handle_reset_view_count_bulk_action' ), 10, 3 );
35
+ }
36
+
37
+ /**
38
+ * Initialize custom post types
39
+ * @since 2.0.0
40
+ */
41
+ public function load_cpts() {
42
+ global $ewd_ufaq_controller;
43
+
44
+ // Define the faq custom post type
45
+ $args = array(
46
+ 'labels' => array(
47
+ 'name' => __( 'FAQs', 'ultimate-faqs' ),
48
+ 'singular_name' => __( 'FAQ', 'ultimate-faqs' ),
49
+ 'menu_name' => __( 'FAQs', 'ultimate-faqs' ),
50
+ 'name_admin_bar' => __( 'FAQs', 'ultimate-faqs' ),
51
+ 'add_new' => __( 'Add New', 'ultimate-faqs' ),
52
+ 'add_new_item' => __( 'Add New FAQ', 'ultimate-faqs' ),
53
+ 'edit_item' => __( 'Edit FAQ', 'ultimate-faqs' ),
54
+ 'new_item' => __( 'New FAQ', 'ultimate-faqs' ),
55
+ 'view_item' => __( 'View FAQ', 'ultimate-faqs' ),
56
+ 'search_items' => __( 'Search FAQs', 'ultimate-faqs' ),
57
+ 'not_found' => __( 'No FAQs found', 'ultimate-faqs' ),
58
+ 'not_found_in_trash' => __( 'No FAQs found in trash', 'ultimate-faqs' ),
59
+ 'all_items' => __( 'All FAQs', 'ultimate-faqs' ),
60
+ ),
61
+ 'public' => true,
62
+ 'has_archive' => true,
63
+ 'menu_icon' => 'dashicons-format-chat',
64
+ 'rewrite' => array(
65
+ 'slug' => $ewd_ufaq_controller->settings->get_setting( 'slug-base' )
66
+ ),
67
+ 'supports' => array(
68
+ 'title',
69
+ 'editor',
70
+ 'author',
71
+ 'excerpt',
72
+ 'comments'
73
+ ),
74
+ 'show_in_rest' => true,
75
+ );
76
+
77
+ // Create filter so addons can modify the arguments
78
+ $args = apply_filters( 'ewd_ufaq_faqs_args', $args );
79
+
80
+ // Add an action so addons can hook in before the post type is registered
81
+ do_action( 'ewd_ufaq_faqs_pre_register' );
82
+
83
+ // Register the post type
84
+ register_post_type( EWD_UFAQ_FAQ_POST_TYPE, $args );
85
+
86
+ // Add an action so addons can hook in after the post type is registered
87
+ do_action( 'ewd_ufaq_faqs_post_register' );
88
+
89
+ // Define the review category taxonomy
90
+ $args = array(
91
+ 'labels' => array(
92
+ 'name' => __( 'FAQ Categories', 'ultimate-faqs' ),
93
+ 'singular_name' => __( 'FAQ Category', 'ultimate-faqs' ),
94
+ 'search_items' => __( 'Search FAQ Categories', 'ultimate-faqs' ),
95
+ 'all_items' => __( 'All FAQ Categories', 'ultimate-faqs' ),
96
+ 'parent_item' => __( 'Parent FAQ Category', 'ultimate-faqs' ),
97
+ 'parent_item_colon' => __( 'Parent FAQ Category:', 'ultimate-faqs' ),
98
+ 'edit_item' => __( 'Edit FAQ Category', 'ultimate-faqs' ),
99
+ 'update_item' => __( 'Update FAQ Category', 'ultimate-faqs' ),
100
+ 'add_new_item' => __( 'Add New FAQ Category', 'ultimate-faqs' ),
101
+ 'new_item_name' => __( 'New FAQ Category Name', 'ultimate-faqs' ),
102
+ 'menu_name' => __( 'FAQ Categories', 'ultimate-faqs' ),
103
+ ),
104
+ 'public' => true,
105
+ 'query_var' => true,
106
+ 'hierarchical' => true,
107
+ 'show_in_rest' => true,
108
+ );
109
+
110
+ // Create filter so addons can modify the arguments
111
+ $args = apply_filters( 'ewd_ufaq_category_args', $args );
112
+
113
+ register_taxonomy( EWD_UFAQ_FAQ_CATEGORY_TAXONOMY, EWD_UFAQ_FAQ_POST_TYPE, $args );
114
+
115
+ // Define the review category taxonomy
116
+ $args = array(
117
+ 'labels' => array(
118
+ 'name' => __( 'FAQ Tags', 'ultimate-faqs' ),
119
+ 'singular_name' => __( 'FAQ Tag', 'ultimate-faqs' ),
120
+ 'search_items' => __( 'Search FAQ Tags', 'ultimate-faqs' ),
121
+ 'all_items' => __( 'All FAQ Tags', 'ultimate-faqs' ),
122
+ 'parent_item' => __( 'Parent FAQ Tag', 'ultimate-faqs' ),
123
+ 'parent_item_colon' => __( 'Parent FAQ Tag:', 'ultimate-faqs' ),
124
+ 'edit_item' => __( 'Edit FAQ Tag', 'ultimate-faqs' ),
125
+ 'update_item' => __( 'Update FAQ Tag', 'ultimate-faqs' ),
126
+ 'add_new_item' => __( 'Add New FAQ Tag', 'ultimate-faqs' ),
127
+ 'new_item_name' => __( 'New FAQ Tag Name', 'ultimate-faqs' ),
128
+ 'menu_name' => __( 'FAQ Tags', 'ultimate-faqs' ),
129
+ ),
130
+ 'public' => true,
131
+ 'hierarchical' => false,
132
+ 'show_in_rest' => true,
133
+ );
134
+
135
+ // Create filter so addons can modify the arguments
136
+ $args = apply_filters( 'ewd_ufaq_tag_args', $args );
137
+
138
+ register_taxonomy( EWD_UFAQ_FAQ_TAG_TAXONOMY, EWD_UFAQ_FAQ_POST_TYPE, $args );
139
+ }
140
+
141
+ /**
142
+ * Generate a nonce for secure saving of metadata
143
+ * @since 2.0.0
144
+ */
145
+ public function create_nonce() {
146
+
147
+ $this->nonce = wp_create_nonce( basename( __FILE__ ) );
148
+ }
149
+
150
+ /**
151
+ * Add in new columns for the ufaq type
152
+ * @since 2.0.0
153
+ */
154
+ public function add_meta_boxes() {
155
+
156
+ $meta_boxes = array(
157
+
158
+ // Add in the FAQ meta information
159
+ 'review_meta' => array (
160
+ 'id' => 'ufaq',
161
+ 'title' => esc_html__( 'FAQ Details', 'ultimate-faqs' ),
162
+ 'callback' => array( $this, 'show_faq_meta' ),
163
+ 'post_type' => EWD_UFAQ_FAQ_POST_TYPE,
164
+ 'context' => 'normal',
165
+ 'priority' => 'high'
166
+ ),
167
+
168
+ // Add in a link to the documentation for the plugin
169
+ 'us_meta_need_help' => array (
170
+ 'id' => 'ewd_ufaq_meta_need_help',
171
+ 'title' => esc_html__( 'Need Help?', 'ultimate-faqs' ),
172
+ 'callback' => array( $this, 'show_need_help_meta' ),
173
+ 'post_type' => EWD_UFAQ_FAQ_POST_TYPE,
174
+ 'context' => 'side',
175
+ 'priority' => 'high'
176
+ ),
177
+ );
178
+
179
+ // Create filter so addons can modify the metaboxes
180
+ $meta_boxes = apply_filters( 'ewd_ufaq_meta_boxes', $meta_boxes );
181
+
182
+ // Create the metaboxes
183
+ foreach ( $meta_boxes as $meta_box ) {
184
+ add_meta_box(
185
+ $meta_box['id'],
186
+ $meta_box['title'],
187
+ $meta_box['callback'],
188
+ $meta_box['post_type'],
189
+ $meta_box['context'],
190
+ $meta_box['priority']
191
+ );
192
+ }
193
+ }
194
+
195
+ /**
196
+ * Add in a link to the plugin documentation
197
+ * @since 2.0.0
198
+ */
199
+ public function show_faq_meta( $post ) {
200
+ global $ewd_ufaq_controller;
201
+
202
+ $faq_author = get_post_meta( $post->ID, 'EWD_UFAQ_Post_Author', true );
203
+
204
+ $user = wp_get_current_user();
205
+ $faq_author = $faq_author ? $faq_author : $user->display_name;
206
+
207
+
208
+ $up_votes = get_post_meta( $post->ID, 'FAQ_Up_Votes', true );
209
+ $down_votes = get_post_meta( $post->ID, 'FAQ_Down_Votes', true );
210
+
211
+ ?>
212
+
213
+ <input type="hidden" name="ewd_ufaq_nonce" value="<?php echo $this->nonce; ?>">
214
+
215
+ <div class='ewd-ufaq-meta-field'>
216
+ <label for='Post_Author'>
217
+ <?php _e( 'Author Display Name:', 'ultimate-faqs' ); ?>
218
+ </label>
219
+ <input type='text' id='ewd-ufaq-post-author' name='faq_author' value='<?php echo esc_attr( $faq_author ); ?>' size='25' />
220
+ </div>
221
+
222
+ <?php if ( $ewd_ufaq_controller->settings->get_setting( 'faq-ratings' ) ) { ?>
223
+
224
+ <div class='ewd-ufaq-meta-field'>
225
+ <label class='ewd-ufaq-meta-label' for='review_karma'>
226
+ <?php _e( 'Up Votes:', 'ultimate-faqs' ); ?>
227
+ </label>
228
+ <input type='text' id='ewd-ufaq-review-karma' name='up_votes' value='<?php echo esc_attr( $up_votes ); ?>' size='25' />
229
+ <label class='ewd-ufaq-meta-label' for='review_karma'>
230
+ <?php _e( 'Down Votes:', 'ultimate-faqs' ); ?>
231
+ </label>
232
+ <input type='text' id='ewd-ufaq-review-karma' name='down_votes' value='<?php echo esc_attr( $down_votes ); ?>' size='25' />
233
+ </div>
234
+
235
+ <?php } ?>
236
+
237
+ <?php $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) ); ?>
238
+
239
+ <?php foreach ( $custom_fields as $faq_field ) { ?>
240
+
241
+ <?php $field_value = get_post_meta( $post->ID, "Custom_Field_" . $faq_field->id, true ); ?>
242
+
243
+ <div class='ewd-ufaq-meta-field'>
244
+ <label class='ewd-ufaq-score-label' for='<?php echo esc_attr( $faq_field->name ); ?>'>
245
+ <?php echo esc_html( $faq_field->name ) ?>
246
+ </label>
247
+
248
+ <?php $options = explode( ',', $faq_field->options ); ?>
249
+
250
+ <?php if ( $faq_field->type == 'textarea' ) { ?>
251
+
252
+ <textarea id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>'>
253
+ <?php echo esc_html( $field_value ); ?>
254
+ </textarea>
255
+
256
+ <?php } elseif ( $faq_field->type == 'dropdown' ) { ?>
257
+ <?php if ( ! empty( $options ) ) { ?>
258
+
259
+ <select name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>'>
260
+ <?php foreach ( $options as $option ) { ?>
261
+
262
+ <option value='<?php echo esc_attr( $option ); ?>' <?php echo ( $option == $field_value ? 'selected' : '' ); ?> >
263
+ <?php echo esc_html( $option ); ?>
264
+ </option>
265
+ <?php } ?>
266
+ </select>
267
+
268
+ <?php } ?>
269
+ <?php } elseif ( $faq_field->type == 'checkbox' ) { ?>
270
+ <?php $field_value = is_array( $field_value ) ? $field_value : array(); ?>
271
+ <?php if ( ! empty( $options ) ) { ?>
272
+
273
+ <div class='ewd-ufaq-fields-page-radio-checkbox-container'>
274
+ <?php foreach ( $options as $option ) { ?>
275
+
276
+ <div class='ewd-ufaq-fields-page-radio-checkbox-each'>
277
+ <input type='checkbox' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>[]' value='<?php echo esc_attr( $option ); ?>' <?php echo ( in_array( $option, $field_value ) ? 'checked' : '' ); ?> />
278
+ <?php echo esc_html( $option ); ?>
279
+ </div>
280
+ <?php } ?>
281
+ </div>
282
+
283
+ <?php } ?>
284
+ <?php } elseif ( $faq_field->type == 'radio' ) { ?>
285
+ <?php if ( ! empty( $options ) ) { ?>
286
+
287
+ <div class='ewd-ufaq-fields-page-radio-checkbox-container'>
288
+ <?php foreach ( $options as $option ) { ?>
289
+
290
+ <div class='ewd-ufaq-fields-page-radio-checkbox-each'>
291
+ <input type='radio' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' value='<?php echo esc_attr( $option ); ?>' <?php echo ( $option == $field_value ? 'checked' : '' ); ?> />
292
+ <?php echo esc_html( $option ); ?>
293
+ </div>
294
+ <?php } ?>
295
+ </div>
296
+
297
+ <?php } ?>
298
+ <?php } elseif ( $faq_field->type == 'date' ) { ?>
299
+
300
+ <input type='text' class='ewd-ufaq-jquery-datepicker' id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' value='<?php echo esc_attr( $field_value ); ?>' />
301
+
302
+ <?php } elseif ( $faq_field->type == 'DateTime' ) { ?>
303
+
304
+ <input type='datetime-local' id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' value='<?php echo esc_attr( $field_value ); ?>' />
305
+
306
+ <?php } else { ?>
307
+
308
+ <input type='text' id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' value='<?php echo esc_attr( $field_value ); ?>' size='25' />
309
+
310
+ <?php } ?>
311
+
312
+ </div>
313
+
314
+ <?php
315
+ }
316
+ }
317
+
318
+ /**
319
+ * Add in a link to the plugin documentation
320
+ * @since 2.0.0
321
+ */
322
+ public function show_need_help_meta() { ?>
323
+
324
+ <div class='ewd-ufaq-need-help-box'>
325
+ <div class='ewd-ufaq-need-help-text'>Visit our Support Center for documentation and tutorials</div>
326
+ <a class='ewd-ufaq-need-help-button' href='https://www.etoilewebdesign.com/support-center/?Plugin=UFAQ' target='_blank'>GET SUPPORT</a>
327
+ </div>
328
+
329
+ <?php }
330
+
331
+ /**
332
+ * Save the metabox data for each review
333
+ * @since 2.0.0
334
+ */
335
+ public function save_meta( $post_id ) {
336
+ global $ewd_ufaq_controller;
337
+
338
+ // Verify nonce
339
+ if ( ! isset( $_POST['ewd_ufaq_nonce'] ) || ! wp_verify_nonce( $_POST['ewd_ufaq_nonce'], basename( __FILE__ ) ) ) {
340
+
341
+ return $post_id;
342
+ }
343
+
344
+ // Check autosave
345
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
346
+
347
+ return $post_id;
348
+ }
349
+
350
+ // Check permissions
351
+ if ( ! current_user_can( 'edit_page', $post_id ) ) {
352
+ return $post_id;
353
+ } elseif ( ! current_user_can( 'edit_post', $post_id ) ) {
354
+ return $post_id;
355
+ }
356
+
357
+ if ( isset( $_POST['faq_author'] ) ) { update_post_meta( $post_id, 'EWD_UFAQ_Post_Author', sanitize_text_field( $_POST['faq_author'] ) ); }
358
+ if ( isset( $_POST['up_votes'] ) ) { update_post_meta( $post_id, 'FAQ_Up_Votes', sanitize_text_field( $_POST['up_votes'] ) ); }
359
+ if ( isset( $_POST['down_votes'] ) ) { update_post_meta( $post_id, 'FAQ_Down_Votes', sanitize_text_field( $_POST['down_votes'] ) ); }
360
+
361
+ $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
362
+
363
+ foreach ( $custom_fields as $faq_field ) {
364
+
365
+ $input_name = 'EWD_UFAQ_Custom_Field_' . $faq_field->id;
366
+
367
+ if ( $faq_field->type == 'file' ) {
368
+
369
+ $uploaded_file = wp_handle_upload( $_FILES[ $input_name ], array( 'test_form' => false ) );
370
+ $field_value = $uploaded_file['url'];
371
+ }
372
+ elseif ( $faq_field->type == 'checkbox' ) {
373
+
374
+ $field_value = ( isset( $_POST[ $input_name ] ) and is_array( $_POST[ $input_name ] ) ) ? array_map( 'sanitize_text_field', $_POST[ $input_name ] ) : array();
375
+ update_post_meta( $post_id, 'Custom_Field_' . $faq_field->id, $field_value );
376
+ }
377
+ else {
378
+
379
+ $field_value = sanitize_text_field( $_POST[ $input_name ] );
380
+ update_post_meta( $post_id, 'Custom_Field_' . $faq_field->id, $field_value );
381
+ }
382
+ }
383
+ }
384
+
385
+ /**
386
+ * Add in multi-part encoding to handle file uploading in custom fields
387
+ * @since 2.0.0
388
+ */
389
+ public function add_multipart_form_encoding() {
390
+ global $post;
391
+
392
+ if ( ! $post ) { return; }
393
+
394
+ if ( get_post_type( $post->ID ) != EWD_UFAQ_FAQ_POST_TYPE ) { return; }
395
+
396
+ echo ' enctype="multipart/form-data"';
397
+ }
398
+
399
+ /**
400
+ * Add in new columns for the ufaq type
401
+ * @since 2.0.0
402
+ */
403
+ public function register_faq_table_columns( $defaults ) {
404
+ global $ewd_ufaq_controller;
405
+
406
+ $defaults['ewd_ufaq_views'] = __( '# of Views', 'ultimate-faqs' );
407
+ $defaults['ewd_ufaq_categories'] = __( 'Categories', 'ultimate-faqs' );
408
+ $defaults['ewd_ufaq_id'] = __( 'Post ID', 'ultimate-faqs' );
409
+
410
+ return $defaults;
411
+ }
412
+
413
+
414
+ /**
415
+ * Set the content for the custom columns
416
+ * @since 2.0.0
417
+ */
418
+ public function display_faq_columns_content ( $column_name, $post_id ) {
419
+
420
+ if ( $column_name == 'ewd_ufaq_views' ) {
421
+
422
+ echo ( get_post_meta( $post_id, 'ufaq_view_count', true ) ? get_post_meta( $post_id, 'ufaq_view_count', true ) : 0 );
423
+ }
424
+
425
+ if ( $column_name == 'ewd_ufaq_categories' ) {
426
+
427
+ echo get_the_term_list($post_id, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY, '', ', ', '');
428
+ }
429
+
430
+ if ( $column_name == 'ewd_ufaq_id' ) {
431
+
432
+ echo $post_id;
433
+ }
434
+ }
435
+
436
+ /**
437
+ * Register the sortable columns
438
+ * @since 2.0.0
439
+ */
440
+ public function register_post_column_sortables( $column ) {
441
+ global $ewd_ufaq_controller;
442
+
443
+ $column['ewd_ufaq_views'] = 'ewd_ufaq_views';
444
+ $column['ewd_ufaq_categories'] = 'ewd_ufaq_product';
445
+
446
+ return $column;
447
+ }
448
+
449
+ /**
450
+ * Adjust the wp_query if the orderby clause is one of the custom ones
451
+ * @since 2.0.0
452
+ */
453
+ public function orderby_custom_columns( $vars ) {
454
+ global $wpdb;
455
+
456
+ if ( ! isset( $vars['orderby'] ) ) { return $vars; }
457
+
458
+ if ( $vars['orderby'] == 'ewd_ufaq_views' ) {
459
+
460
+ $vars = array_merge(
461
+ $vars,
462
+ array(
463
+ 'meta_key' => 'ufaq_view_count',
464
+ 'orderby' => 'meta_value_num'
465
+ )
466
+ );
467
+ }
468
+
469
+ return $vars;
470
+ }
471
+
472
+ /**
473
+ * Converts the UFAQ category to a taxonomy term
474
+ * @since 2.0.0
475
+ */
476
+ public function convert_to_taxonomy_term( $query ) {
477
+ global $typenow;
478
+ global $pagenow;
479
+
480
+ $taxonomy = EWD_UFAQ_FAQ_CATEGORY_TAXONOMY;
481
+
482
+ $q_vars = &$query->query_vars;
483
+
484
+ if ( empty( $typenow ) or $typenow != EWD_UFAQ_FAQ_POST_TYPE ) { return $query; }
485
+
486
+ if ( ! isset( $q_vars[$taxonomy] ) or ! is_numeric( $q_vars[$taxonomy] )or $q_vars[$taxonomy] == 0 ) { return $query; }
487
+
488
+ $term = get_term_by( 'id', $q_vars[$taxonomy], $taxonomy );
489
+ $q_vars[$taxonomy] = $term->slug;
490
+ }
491
+
492
+ /**
493
+ * Add a select box for the FAQ's category for UFAQ posts
494
+ * @since 2.0.0
495
+ */
496
+ public function add_categories_dropdown() {
497
+ global $typenow;
498
+ global $wp_query;
499
+
500
+ if ( $typenow != EWD_UFAQ_FAQ_POST_TYPE ) { return; }
501
+
502
+ $faq_taxonomy = get_taxonomy( EWD_UFAQ_FAQ_CATEGORY_TAXONOMY );
503
+
504
+ $args = array(
505
+ 'show_option_all' => __("Show All {$faq_taxonomy->label}"),
506
+ 'taxonomy' => EWD_UFAQ_FAQ_CATEGORY_TAXONOMY,
507
+ 'name' => EWD_UFAQ_FAQ_CATEGORY_TAXONOMY,
508
+ 'orderby' => 'name',
509
+ 'selected' => isset( $wp_query->query['term'] ) ? $wp_query->query['term'] : '',
510
+ 'hierarchical' => true,
511
+ 'depth' => 3,
512
+ 'show_count' => true, // Show # listings in parens
513
+ 'hide_empty' => true,
514
+ );
515
+
516
+ wp_dropdown_categories( $args );
517
+ }
518
+
519
+ /**
520
+ * Sort the FAQs by the category they've been assigned to
521
+ * @since 2.0.0
522
+ */
523
+ public function sort_by_category( $clauses, $wp_query ) {
524
+ global $wpdb;
525
+
526
+ if ( ! isset( $wp_query->query['orderby'] ) or $wp_query->query['orderby'] != EWD_UFAQ_FAQ_CATEGORY_TAXONOMY ) { return $clauses; }
527
+
528
+ $clauses['join'] .= <<<SQL
529
+ LEFT OUTER JOIN {$wpdb->term_relationships} ON {$wpdb->posts}.ID={$wpdb->term_relationships}.object_id
530
+ LEFT OUTER JOIN {$wpdb->term_taxonomy} USING (term_taxonomy_id)
531
+ LEFT OUTER JOIN {$wpdb->terms} USING (term_id)
532
+ SQL;
533
+
534
+ $clauses['where'] .= "AND (taxonomy = 'ufaq-category' OR taxonomy IS NULL)";
535
+ $clauses['groupby'] = "object_id";
536
+ $clauses['orderby'] = "GROUP_CONCAT({$wpdb->terms}.name ORDER BY name ASC)";
537
+
538
+ if ( strtoupper( $wp_query->get( 'order' ) ) == 'ASC' ) {
539
+
540
+ $clauses['orderby'] .= 'ASC';
541
+ }
542
+ else {
543
+
544
+ $clauses['orderby'] .= 'DESC';
545
+ }
546
+
547
+ return $clauses;
548
+ }
549
+
550
+ /**
551
+ * Adds in a bulk action to reset the FAQ view count
552
+ * @since 2.0.0
553
+ */
554
+ public function add_reset_view_count_bulk_action( $actions ) {
555
+
556
+ $actions['reset_view_count'] = __( 'Reset View Count', 'ultimate-faqs' );
557
+
558
+ return $actions;
559
+ }
560
+
561
+ /**
562
+ * Handles the bulk action to reset the FAQ view count
563
+ * @since 2.0.0
564
+ */
565
+ public function handle_reset_view_count_bulk_action( $redirect_to, $doaction, $post_ids ) {
566
+
567
+ if ( $doaction != 'reset_view_count' ) { return $redirect_to; }
568
+
569
+ foreach ( $post_ids as $post_id ) {
570
+
571
+ update_post_meta( $post_id, 'ufaq_view_count', 0 );
572
+ }
573
+
574
+ return $redirect_to;
575
+ }
576
+ }
577
+ } // endif;
includes/Dashboard.class.php ADDED
@@ -0,0 +1,320 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'ABSPATH' ) ) exit;
3
+
4
+ if ( !class_exists( 'ewdufaqDashboard' ) ) {
5
+ /**
6
+ * Class to handle plugin dashboard
7
+ *
8
+ * @since 2.0.0
9
+ */
10
+ class ewdufaqDashboard {
11
+
12
+ public $message;
13
+ public $status = true;
14
+
15
+ public function __construct() {
16
+ add_action( 'admin_menu', array( $this, 'add_dashboard_to_menu' ), 99 );
17
+
18
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
19
+
20
+ add_action( 'wp_ajax_ewd_ufaq_hide_upgrade_box', array($this, 'hide_upgrade_box') );
21
+ add_action( 'wp_ajax_ewd_ufaq_display_upgrade_box', array($this, 'display_upgrade_box') );
22
+ }
23
+
24
+ public function add_dashboard_to_menu() {
25
+ global $ewd_ufaq_controller;
26
+ global $submenu;
27
+
28
+ add_submenu_page(
29
+ 'edit.php?post_type=ufaq',
30
+ 'Dashboard',
31
+ 'Dashboard',
32
+ 'manage_options',
33
+ 'ewd-ufaq-dashboard',
34
+ array($this, 'display_dashboard_screen')
35
+ );
36
+
37
+ // Create a new sub-menu in the order that we want
38
+ $new_submenu = array();
39
+ $menu_item_count = 3;
40
+
41
+ if ( ! isset( $submenu['edit.php?post_type=ufaq'] ) or ! is_array($submenu['edit.php?post_type=ufaq']) ) { return; }
42
+
43
+ foreach ( $submenu['edit.php?post_type=ufaq'] as $key => $sub_item ) {
44
+
45
+ if ( $sub_item[0] == 'Dashboard' ) { $new_submenu[0] = $sub_item; }
46
+ elseif ( $sub_item[0] == 'Settings' ) { $new_submenu[ sizeof($submenu) ] = $sub_item; }
47
+ else {
48
+
49
+ $new_submenu[$menu_item_count] = $sub_item;
50
+ $menu_item_count++;
51
+ }
52
+ }
53
+
54
+ ksort($new_submenu);
55
+
56
+ $submenu['edit.php?post_type=ufaq'] = $new_submenu;
57
+ }
58
+
59
+ // Enqueues the admin script so that our hacky sub-menu opening function can run
60
+ public function enqueue_scripts() {
61
+ global $admin_page_hooks;
62
+
63
+ $currentScreen = get_current_screen();
64
+ if ( $currentScreen->id == $admin_page_hooks['edit.php?post_type=ufaq'] . '_page_ewd-ufaq-dashboard' ) {
65
+ wp_enqueue_style( 'ewd-ufaq-admin-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-admin.css', array(), EWD_UFAQ_VERSION );
66
+ wp_enqueue_script( 'ewd-ufaq-admin-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-admin.js', array( 'jquery' ), EWD_UFAQ_VERSION, true );
67
+ }
68
+ }
69
+
70
+ public function display_dashboard_screen() {
71
+ global $ewd_ufaq_controller;
72
+
73
+ $permission = $ewd_ufaq_controller->permissions->check_permission( 'styling' );
74
+
75
+ $args = array(
76
+ 'post_type' => EWD_UFAQ_FAQ_POST_TYPE,
77
+ 'orderby' => 'meta_value_num',
78
+ 'meta_key' => 'ufaq_view_count',
79
+ 'posts_per_page' => 10
80
+ );
81
+
82
+ $query = new WP_Query( $args );
83
+ $faqs = $query->get_posts();
84
+
85
+ ?>
86
+
87
+ <div id="ewd-ufaq-dashboard-content-area">
88
+
89
+ <div id="ewd-ufaq-dashboard-content-left">
90
+
91
+ <?php if ( ! $permission or get_option("EWD_UFAQ_Trial_Happening") == "Yes" ) {
92
+ $premium_info = '<div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full">';
93
+ $premium_info .= '<div class="ewd-ufaq-dashboard-new-widget-box-top">';
94
+ $premium_info .= sprintf( __( '<a href="%s" target="_blank">Visit our website</a> to learn how to upgrade to premium.'), 'https://www.etoilewebdesign.com/premium-upgrade-instructions/' );
95
+ $premium_info .= '</div>';
96
+ $premium_info .= '</div>';
97
+
98
+ $premium_info = apply_filters( 'ewd_dashboard_top', $premium_info, 'UFAQ', 'https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1' );
99
+
100
+ echo $premium_info;
101
+ } ?>
102
+
103
+ <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-support-widget-box">
104
+ <div class="ewd-ufaq-dashboard-new-widget-box-top"><?php _e('Get Support', 'ultimate-faqs'); ?><span id="ewd-ufaq-dash-mobile-support-down-caret">&nbsp;&nbsp;&#9660;</span><span id="ewd-ufaq-dash-mobile-support-up-caret">&nbsp;&nbsp;&#9650;</span></div>
105
+ <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
106
+ <ul class="ewd-ufaq-dashboard-support-widgets">
107
+ <li>
108
+ <a href="https://www.youtube.com/watch?v=zf-tYLqHpRs&list=PLEndQUuhlvSrNdfu5FKa1uGHsaKZxgdWt&index=2&ab_channel=%C3%89toileWebDesign" target="_blank">
109
+ <img src="<?php echo plugins_url( '../assets/img/ewd-support-icon-youtube.png', __FILE__ ); ?>">
110
+ <div class="ewd-ufaq-dashboard-support-widgets-text"><?php _e('YouTube Tutorials', 'ultimate-faqs'); ?></div>
111
+ </a>
112
+ </li>
113
+ <li>
114
+ <a href="https://wordpress.org/plugins/ultimate-faqs/#faq" target="_blank">
115
+ <img src="<?php echo plugins_url( '../assets/img/ewd-support-icon-faqs.png', __FILE__ ); ?>">
116
+ <div class="ewd-ufaq-dashboard-support-widgets-text"><?php _e('Plugin FAQs', 'ultimate-faqs'); ?></div>
117
+ </a>
118
+ </li>
119
+ <li>
120
+ <a href="https://www.etoilewebdesign.com/support-center/?Plugin=UFAQ&Type=FAQs" target="_blank">
121
+ <img src="<?php echo plugins_url( '../assets/img/ewd-support-icon-documentation.png', __FILE__ ); ?>">
122
+ <div class="ewd-ufaq-dashboard-support-widgets-text"><?php _e('Documentation', 'ultimate-faqs'); ?></div>
123
+ </a>
124
+ </li>
125
+ <li>
126
+ <a href="https://www.etoilewebdesign.com/support-center/" target="_blank">
127
+ <img src="<?php echo plugins_url( '../assets/img/ewd-support-icon-forum.png', __FILE__ ); ?>">
128
+ <div class="ewd-ufaq-dashboard-support-widgets-text"><?php _e('Get Support', 'ultimate-faqs'); ?></div>
129
+ </a>
130
+ </li>
131
+ </ul>
132
+ </div>
133
+ </div>
134
+
135
+ <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-optional-table">
136
+ <div class="ewd-ufaq-dashboard-new-widget-box-top"><?php _e('FAQ Summary', 'ultimate-faqs'); ?><span id="ewd-ufaq-dash-optional-table-down-caret">&nbsp;&nbsp;&#9660;</span><span id="ewd-ufaq-dash-optional-table-up-caret">&nbsp;&nbsp;&#9650;</span></div>
137
+ <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
138
+ <table class='ewd-ufaq-overview-table wp-list-table widefat fixed striped posts'>
139
+ <thead>
140
+ <tr>
141
+ <th><?php _e("Title", 'ultimate-faqs'); ?></th>
142
+ <th><?php _e("Views", 'ultimate-faqs'); ?></th>
143
+ <th><?php _e("Categories", 'ultimate-faqs'); ?></th>
144
+ </tr>
145
+ </thead>
146
+ <tbody>
147
+ <?php
148
+ if ( empty( $faqs ) ) {echo "<tr><td colspan='3'>" . __("No faqs to display yet. Create an faq and then view it for it to be displayed here.", 'ultimate-faqs') . "</td></tr>";}
149
+ else {
150
+ foreach ( $faqs as $faq ) { ?>
151
+ <tr>
152
+ <td><a href='post.php?post=<?php echo $faq->ID;?>&action=edit'><?php echo $faq->post_title; ?></a></td>
153
+ <td><?php echo get_post_meta( $faq->ID, 'ufaq_view_count', true ); ?></td>
154
+ <td><?php echo get_the_term_list( $faq->ID, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY ); ?></td>
155
+ </tr>
156
+ <?php }
157
+ }
158
+ ?>
159
+ </tbody>
160
+ </table>
161
+ </div>
162
+ </div>
163
+
164
+ <div class="ewd-ufaq-dashboard-new-widget-box <?php echo ( ($hideReview != 'Yes' and $Ask_Review_Date < time()) ? 'ewd-widget-box-two-thirds' : 'ewd-widget-box-full' ); ?>">
165
+ <div class="ewd-ufaq-dashboard-new-widget-box-top">What People Are Saying</div>
166
+ <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
167
+ <ul class="ewd-ufaq-dashboard-testimonials">
168
+ <?php $randomTestimonial = rand(0,2);
169
+ if($randomTestimonial == 0){ ?>
170
+ <li id="ewd-ufaq-dashboard-testimonial-one">
171
+ <img src="<?php echo plugins_url( '../assets/img/dash-asset-stars.png', __FILE__ ); ?>">
172
+ <div class="ewd-ufaq-dashboard-testimonial-title">"Awesome. Just Awesome."</div>
173
+ <div class="ewd-ufaq-dashboard-testimonial-author">- @shizart</div>
174
+ <div class="ewd-ufaq-dashboard-testimonial-text">Thanks for this very well-made plugin. This works so well out of the box, I barely had to do ANYTHING to create an amazing FAQ accordion display... <a href="https://wordpress.org/support/topic/awesome-just-awesome-11/" target="_blank">read more</a></div>
175
+ </li>
176
+ <?php }
177
+ if($randomTestimonial == 1){ ?>
178
+ <li id="ewd-ufaq-dashboard-testimonial-two">
179
+ <img src="<?php echo plugins_url( '../assets/img/dash-asset-stars.png', __FILE__ ); ?>">
180
+ <div class="ewd-ufaq-dashboard-testimonial-title">"Absolutely perfect with great support"</div>
181
+ <div class="ewd-ufaq-dashboard-testimonial-author">- @isaac85</div>
182
+ <div class="ewd-ufaq-dashboard-testimonial-text">I tried several different FAQ plugins and this is by far the prettiest and easiest to use... <a href="https://wordpress.org/support/topic/absolutely-perfect-with-great-support/" target="_blank">read more</a></div>
183
+ </li>
184
+ <?php }
185
+ if($randomTestimonial == 2){ ?>
186
+ <li id="ewd-ufaq-dashboard-testimonial-three">
187
+ <img src="<?php echo plugins_url( '../assets/img/dash-asset-stars.png', __FILE__ ); ?>">
188
+ <div class="ewd-ufaq-dashboard-testimonial-title">"Perfect FAQ Plugin"</div>
189
+ <div class="ewd-ufaq-dashboard-testimonial-author">- @muti-wp</div>
190
+ <div class="ewd-ufaq-dashboard-testimonial-text">Works great! Easy to configure and to use. Thanks! <a href="https://wordpress.org/support/topic/perfect-faq-plugin/" target="_blank">read more</a></div>
191
+ </li>
192
+ <?php } ?>
193
+ </ul>
194
+ </div>
195
+ </div>
196
+
197
+ <?php if ( ! $permission or get_option("EWD_UFAQ_Trial_Happening") == "Yes" ) { ?>
198
+ <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-guarantee-widget-box">
199
+ <div class="ewd-ufaq-dashboard-new-widget-box-top">
200
+ <div class="ewd-ufaq-dashboard-guarantee">
201
+ <div class="ewd-ufaq-dashboard-guarantee-title">14-Day 100% Money-Back Guarantee</div>
202
+ <div class="ewd-ufaq-dashboard-guarantee-text">If you're not 100% satisfied with the premium version of our plugin - no problem. You have 14 days to receive a FULL REFUND. We're certain you won't need it, though.</div>
203
+ </div>
204
+ </div>
205
+ </div>
206
+ <?php } ?>
207
+
208
+ </div> <!-- left -->
209
+
210
+ <div id="ewd-ufaq-dashboard-content-right">
211
+
212
+ <?php if ( ! $permission or get_option("EWD_UFAQ_Trial_Happening") == "Yes" ) { ?>
213
+ <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-get-premium-widget-box">
214
+ <div class="ewd-ufaq-dashboard-new-widget-box-top">Get Premium</div>
215
+
216
+ <?php if ( get_option( "EWD_UFAQ_Trial_Happening" ) == "Yes" ) { do_action( 'ewd_trial_happening', 'UFAQ' ); } ?>
217
+
218
+ <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
219
+ <div class="ewd-ufaq-dashboard-get-premium-widget-features-title"<?php echo ( ( get_option("EWD_UFAQ_Trial_Happening") == "Yes" ) ? "style='padding-top: 20px;'" : ""); ?>>GET FULL ACCESS WITH OUR PREMIUM VERSION AND GET:</div>
220
+ <ul class="ewd-ufaq-dashboard-get-premium-widget-features">
221
+ <li>Unlimited FAQs</li>
222
+ <li>Advanced Styling Options</li>
223
+ <li>Social Sharing</li>
224
+ <li>SEO-Friendly Permalinks</li>
225
+ <li>+ More</li>
226
+ </ul>
227
+ <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
228
+
229
+ <?php if ( ! get_option("EWD_UFAQ_Trial_Happening") ) {
230
+ $trial_info = sprintf( __( '<a href="%s" target="_blank">Visit our website</a> to learn how to get a free 7-day trial of the premium plugin.'), 'https://www.etoilewebdesign.com/premium-upgrade-instructions/' );
231
+
232
+ echo apply_filters( 'ewd_trial_button', $trial_info, 'UFAQ' );
233
+ } ?>
234
+ </div>
235
+ </div>
236
+ <?php } ?>
237
+
238
+ <!-- <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full">
239
+ <div class="ewd-ufaq-dashboard-new-widget-box-top">Other Plugins by Etoile</div>
240
+ <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
241
+ <ul class="ewd-ufaq-dashboard-other-plugins">
242
+ <li>
243
+ <a href="https://wordpress.org/plugins/ultimate-product-catalogue/" target="_blank"><img src="<?php echo plugins_url( '../images/ewd-ufaq-icon.png', __FILE__ ); ?>"></a>
244
+ <div class="ewd-ufaq-dashboard-other-plugins-text">
245
+ <div class="ewd-ufaq-dashboard-other-plugins-title">Product Catalog</div>
246
+ <div class="ewd-ufaq-dashboard-other-plugins-blurb">Enables you to display your business's products in a clean and efficient manner.</div>
247
+ </div>
248
+ </li>
249
+ <li>
250
+ <a href="https://wordpress.org/plugins/ultimate-faqs/" target="_blank"><img src="<?php echo plugins_url( '../images/ewd-ufaq-icon.png', __FILE__ ); ?>"></a>
251
+ <div class="ewd-ufaq-dashboard-other-plugins-text">
252
+ <div class="ewd-ufaq-dashboard-other-plugins-title">Ultimate FAQs</div>
253
+ <div class="ewd-ufaq-dashboard-other-plugins-blurb">Let visitors submit reviews and display them right in the tabbed page layout!</div>
254
+ </div>
255
+ </li>
256
+ </ul>
257
+ </div>
258
+ </div> -->
259
+
260
+ </div> <!-- right -->
261
+
262
+ </div> <!-- us-dashboard-content-area -->
263
+
264
+ <?php if ( ! $permission or get_option("EWD_UFAQ_Trial_Happening") == "Yes" ) { ?>
265
+ <div id="ewd-ufaq-dashboard-new-footer-one">
266
+ <div class="ewd-ufaq-dashboard-new-footer-one-inside">
267
+ <div class="ewd-ufaq-dashboard-new-footer-one-left">
268
+ <div class="ewd-ufaq-dashboard-new-footer-one-title">What's Included in Our Premium Version?</div>
269
+ <ul class="ewd-ufaq-dashboard-new-footer-one-benefits">
270
+ <li>Unlimited FAQs</li>
271
+ <li>FAQ Search</li>
272
+ <li>Custom Fields</li>
273
+ <li>WooCommerce FAQs</li>
274
+ <li>15 Different Icon Sets</li>
275
+ <li>Import/Export FAQs</li>
276
+ <li>Advanced Styling Options</li>
277
+ <li>Social Sharing</li>
278
+ <li>Email Support</li>
279
+ </ul>
280
+ </div>
281
+ <div class="ewd-ufaq-dashboard-new-footer-one-buttons">
282
+ <a class="ewd-ufaq-dashboard-new-upgrade-button" href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" target="_blank">UPGRADE NOW</a>
283
+ </div>
284
+ </div>
285
+ </div> <!-- us-dashboard-new-footer-one -->
286
+ <?php } ?>
287
+ <div id="ewd-ufaq-dashboard-new-footer-two">
288
+ <div class="ewd-ufaq-dashboard-new-footer-two-inside">
289
+ <img src="<?php echo plugins_url( '../assets/img/ewd-logo-white.png', __FILE__ ); ?>" class="ewd-ufaq-dashboard-new-footer-two-icon">
290
+ <div class="ewd-ufaq-dashboard-new-footer-two-blurb">
291
+ At Etoile Web Design, we build reliable, easy-to-use WordPress plugins with a modern look. Rich in features, highly customizable and responsive, plugins by Etoile Web Design can be used as out-of-the-box solutions and can also be adapted to your specific requirements.
292
+ </div>
293
+ <ul class="ewd-ufaq-dashboard-new-footer-two-menu">
294
+ <li>SOCIAL</li>
295
+ <li><a href="https://www.facebook.com/EtoileWebDesign/" target="_blank">Facebook</a></li>
296
+ <li><a href="https://twitter.com/EtoileWebDesign" target="_blank">Twitter</a></li>
297
+ <li><a href="https://www.etoilewebdesign.com/blog/" target="_blank">Blog</a></li>
298
+ </ul>
299
+ <ul class="ewd-ufaq-dashboard-new-footer-two-menu">
300
+ <li>SUPPORT</li>
301
+ <li><a href="https://www.youtube.com/watch?v=zf-tYLqHpRs&list=PLEndQUuhlvSrNdfu5FKa1uGHsaKZxgdWt&index=2&ab_channel=%C3%89toileWebDesign" target="_blank">YouTube Tutorials</a></li>
302
+ <li><a href="https://www.etoilewebdesign.com/support-center/?Plugin=UFAQ&Type=FAQs" target="_blank">Documentation</a></li>
303
+ <li><a href="https://www.etoilewebdesign.com/support-center/" target="_blank">Get Support</a></li>
304
+ <li><a href="https://wordpress.org/plugins/ultimate-faqs/#faq" target="_blank">FAQs</a></li>
305
+ </ul>
306
+ </div>
307
+ </div> <!-- ewd-ufaq-dashboard-new-footer-two -->
308
+
309
+ <?php }
310
+
311
+ public function display_notice() {
312
+ if ( $this->status ) {
313
+ echo "<div class='updated'><p>" . $this->message . "</p></div>";
314
+ }
315
+ else {
316
+ echo "<div class='error'><p>" . $this->message . "</p></div>";
317
+ }
318
+ }
319
+ }
320
+ } // endif
includes/DeactivationSurvey.class.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+
4
+ if ( ! class_exists( 'ewdufaqDeactivationSurvey' ) ) {
5
+ /**
6
+ * Class to handle plugin deactivation survey
7
+ *
8
+ * @since 2.0.0
9
+ */
10
+ class ewdufaqDeactivationSurvey {
11
+
12
+ public function __construct() {
13
+ add_action( 'current_screen', array( $this, 'maybe_add_survey' ) );
14
+ }
15
+
16
+ public function maybe_add_survey() {
17
+ if ( in_array( get_current_screen()->id, array( 'plugins', 'plugins-network' ), true) ) {
18
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_deactivation_scripts') );
19
+ add_action( 'admin_footer', array( $this, 'add_deactivation_html') );
20
+ }
21
+ }
22
+
23
+ public function enqueue_deactivation_scripts() {
24
+ wp_enqueue_style( 'ewd-ufaq-deactivation-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/plugin-deactivation.css' );
25
+ wp_enqueue_script( 'ewd-ufaq-deactivation-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/plugin-deactivation.js', array( 'jquery' ) );
26
+
27
+ wp_localize_script( 'ewd-ufaq-deactivation-js', 'ewd_ufaq_deactivation_data', array( 'site_url' => site_url() ) );
28
+ }
29
+
30
+ public function add_deactivation_html() {
31
+
32
+ $install_time = get_option( 'ewd-ufaq-installation-time' );
33
+
34
+ $options = array(
35
+ 1 => array(
36
+ 'title' => esc_html__( 'I no longer need the plugin', 'ultimate-faqs' ),
37
+ ),
38
+ 2 => array(
39
+ 'title' => esc_html__( 'I\'m switching to a different plugin', 'ultimate-faqs' ),
40
+ 'details' => esc_html__( 'Please share which plugin', 'ultimate-faqs' ),
41
+ ),
42
+ 3 => array(
43
+ 'title' => esc_html__( 'I couldn\'t get the plugin to work', 'ultimate-faqs' ),
44
+ 'details' => esc_html__( 'Please share what wasn\'t working', 'ultimate-faqs' ),
45
+ ),
46
+ 4 => array(
47
+ 'title' => esc_html__( 'It\'s a temporary deactivation', 'ultimate-faqs' ),
48
+ ),
49
+ 5 => array(
50
+ 'title' => esc_html__( 'Other', 'ultimate-faqs' ),
51
+ 'details' => esc_html__( 'Please share the reason', 'ultimate-faqs' ),
52
+ ),
53
+ );
54
+ ?>
55
+ <div class="ewd-ufaq-deactivate-survey-modal" id="ewd-ufaq-deactivate-survey-ultimate-faqs">
56
+ <div class="ewd-ufaq-deactivate-survey-wrap">
57
+ <form class="ewd-ufaq-deactivate-survey" method="post" data-installtime="<?php echo $install_time; ?>">
58
+ <span class="ewd-ufaq-deactivate-survey-title"><span class="dashicons dashicons-testimonial"></span><?php echo ' ' . __( 'Quick Feedback', 'ultimate-faqs' ); ?></span>
59
+ <span class="ewd-ufaq-deactivate-survey-desc"><?php echo __('If you have a moment, please share why you are deactivating Ultimate FAQs:', 'ultimate-faqs' ); ?></span>
60
+ <div class="ewd-ufaq-deactivate-survey-options">
61
+ <?php foreach ( $options as $id => $option ) : ?>
62
+ <div class="ewd-ufaq-deactivate-survey-option">
63
+ <label for="ewd-ufaq-deactivate-survey-option-ultimate-faqs-<?php echo $id; ?>" class="ewd-ufaq-deactivate-survey-option-label">
64
+ <input id="ewd-ufaq-deactivate-survey-option-ultimate-faqs-<?php echo $id; ?>" class="ewd-ufaq-deactivate-survey-option-input" type="radio" name="code" value="<?php echo $id; ?>" />
65
+ <span class="ewd-ufaq-deactivate-survey-option-reason"><?php echo $option['title']; ?></span>
66
+ </label>
67
+ <?php if ( ! empty( $option['details'] ) ) : ?>
68
+ <input class="ewd-ufaq-deactivate-survey-option-details" type="text" placeholder="<?php echo $option['details']; ?>" />
69
+ <?php endif; ?>
70
+ </div>
71
+ <?php endforeach; ?>
72
+ </div>
73
+ <div class="ewd-ufaq-deactivate-survey-footer">
74
+ <button type="submit" class="ewd-ufaq-deactivate-survey-submit button button-primary button-large"><?php _e('Submit and Deactivate', 'ultimate-faqs' ); ?></button>
75
+ <a href="#" class="ewd-ufaq-deactivate-survey-deactivate"><?php _e('Skip and Deactivate', 'ultimate-faqs' ); ?></a>
76
+ </div>
77
+ </form>
78
+ </div>
79
+ </div>
80
+ <?php
81
+ }
82
+ }
83
+
84
+ }
includes/Export.class.php ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class to export reviews created by the plugin
5
+ */
6
+
7
+ if ( !defined( 'ABSPATH' ) )
8
+ exit;
9
+
10
+ if (!class_exists('ComposerAutoloaderInit4618f5c41cf5e27cc7908556f031e4d4')) { require_once EWD_UFAQ_PLUGIN_DIR . '/lib/PHPSpreadsheet/vendor/autoload.php'; }
11
+ use PhpOffice\PhpSpreadsheet\Spreadsheet;
12
+ use PhpOffice\PhpSpreadsheet\Writer\Xls;
13
+ use PhpOffice\PhpSpreadsheet\Writer\Csv;
14
+ class ewdufaqExport {
15
+
16
+ public function __construct() {
17
+ add_action( 'admin_menu', array($this, 'register_install_screen' ));
18
+
19
+ if ( isset( $_POST['ewd_ufaq_export'] ) ) { add_action( 'admin_menu', array($this, 'export_faqs' )); }
20
+ if ( isset( $_POST['ewd_ufaq_export_pdf'] ) ) { add_action( 'admin_menu', array($this, 'export_faqs_pdf' )); }
21
+
22
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_export_scripts' ) );
23
+ }
24
+
25
+ public function register_install_screen() {
26
+ global $ewd_ufaq_controller;
27
+
28
+ add_submenu_page(
29
+ 'edit.php?post_type=ufaq',
30
+ 'Export Menu',
31
+ 'Export',
32
+ $ewd_ufaq_controller->settings->get_setting( 'access-role' ),
33
+ 'ewd-ufaq-export',
34
+ array($this, 'display_export_screen')
35
+ );
36
+ }
37
+
38
+ public function display_export_screen() {
39
+ global $ewd_ufaq_controller;
40
+
41
+ $export_permission = $ewd_ufaq_controller->permissions->check_permission( 'export' );
42
+
43
+ ?>
44
+ <div class='wrap'>
45
+ <h2>Export</h2>
46
+ <?php if ( $export_permission ) { ?>
47
+ <form method='post'>
48
+ <?php wp_nonce_field( 'EWD_UFAQ_Export_PDF', 'EWD_UFAQ_Export_PDF_Nonce' ); ?>
49
+ <input type='submit' name='ewd_ufaq_export' value='Export to Spreadsheet' class='button button-primary' />
50
+ </form>
51
+ <form method='post'>
52
+ <?php wp_nonce_field( 'EWD_UFAQ_Export_PDF', 'EWD_UFAQ_Export_PDF_Nonce' ); ?>
53
+ <input type='submit' name='ewd_ufaq_export_pdf' value='Export to PDF' class='button button-primary' />
54
+ </form>
55
+ <?php } else { ?>
56
+ <div class='ewd-ufaq-premium-locked'>
57
+ <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" target="_blank">Upgrade</a> to the premium version to use this feature
58
+ </div>
59
+ <?php } ?>
60
+ </div>
61
+ <?php }
62
+
63
+ public function export_faqs() {
64
+ global $ewd_ufaq_controller;
65
+
66
+ if ( ! isset( $_POST['EWD_UFAQ_Export_PDF_Nonce'] ) ) { return; }
67
+
68
+ if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Export_PDF_Nonce'], 'EWD_UFAQ_Export_PDF' ) ) { return; }
69
+
70
+ $faq_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
71
+
72
+ // Instantiate a new PHPExcel object
73
+ $spreadsheet = new Spreadsheet();
74
+ // Set the active Excel worksheet to sheet 0
75
+ $spreadsheet->setActiveSheetIndex(0);
76
+
77
+ // Print out the regular review field labels
78
+ $spreadsheet->getActiveSheet()->setCellValue( 'A1', 'ID' );
79
+ $spreadsheet->getActiveSheet()->setCellValue( 'B1', 'Question' );
80
+ $spreadsheet->getActiveSheet()->setCellValue( 'C1', 'Answer' );
81
+ $spreadsheet->getActiveSheet()->setCellValue( 'D1', 'Categories' );
82
+ $spreadsheet->getActiveSheet()->setCellValue( 'E1', 'Tags' );
83
+ $spreadsheet->getActiveSheet()->setCellValue( 'F1', 'Post Date' );
84
+
85
+ $column = 'G';
86
+ foreach ( $faq_fields as $faq_field ) {
87
+
88
+ $spreadsheet->getActiveSheet()->setCellValue( $column . '1', $faq_field->name );
89
+ $column++;
90
+ }
91
+
92
+ //start while loop to get data
93
+ $row_count = 2;
94
+
95
+ $params = array(
96
+ 'posts_per_page' => -1,
97
+ 'post_type' => EWD_UFAQ_FAQ_POST_TYPE
98
+ );
99
+
100
+ $faqs = get_posts( $params );
101
+
102
+ foreach ( $faqs as $faq ) {
103
+
104
+ $categories = strip_tags( get_the_term_list( $faq->ID, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY, '', ',' ) );
105
+ $tags = strip_tags( get_the_term_list( $faq->ID, EWD_UFAQ_FAQ_TAG_TAXONOMY, '', ',' ) );
106
+
107
+ $spreadsheet->getActiveSheet()->setCellValue( 'A' . $row_count, $faq->ID );
108
+ $spreadsheet->getActiveSheet()->setCellValue( 'B' . $row_count, $faq->post_title );
109
+ $spreadsheet->getActiveSheet()->setCellValue( 'C' . $row_count, $faq->post_content );
110
+ $spreadsheet->getActiveSheet()->setCellValue( 'D' . $row_count, $categories );
111
+ $spreadsheet->getActiveSheet()->setCellValue( 'E' . $row_count, $tags );
112
+ $spreadsheet->getActiveSheet()->setCellValue( 'F' . $row_count, $faq->post_date );
113
+
114
+ $column = 'G';
115
+ foreach ( $faq_fields as $faq_field ) {
116
+
117
+ $spreadsheet->getActiveSheet()->setCellValue( $column . $row_count, get_post_meta( $faq->ID, "Custom_Field_" . $faq_field->id, true ) );
118
+ $column++;
119
+ }
120
+
121
+ $row_count++;
122
+ }
123
+
124
+ // Redirect output to a client’s web browser (Excel5)
125
+ if (!isset($format_type) == "csv") {
126
+
127
+ header('Content-Type: application/vnd.ms-excel');
128
+ header('Content-Disposition: attachment;filename="faqs_export.csv"');
129
+ header('Cache-Control: max-age=0');
130
+ $objWriter = new Csv($spreadsheet);
131
+ $objWriter->save('php://output');
132
+ die();
133
+ }
134
+ else {
135
+
136
+ header('Content-Type: application/vnd.ms-excel');
137
+ header('Content-Disposition: attachment;filename="faqs_export.xls"');
138
+ header('Cache-Control: max-age=0');
139
+ $objWriter = new Xls($spreadsheet);
140
+ $objWriter->save('php://output');
141
+ die();
142
+ }
143
+ }
144
+
145
+ public function export_faqs_pdf() {
146
+ global $ewd_ufaq_controller;
147
+
148
+ if ( ! isset( $_POST['EWD_UFAQ_Export_PDF_Nonce'] ) ) { return; }
149
+
150
+ if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Export_PDF_Nonce'], 'EWD_UFAQ_Export_PDF' ) ) { return; }
151
+
152
+ $faq_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
153
+
154
+ require_once EWD_UFAQ_PLUGIN_DIR . '/lib/FPDF/fpdf.php' ;
155
+
156
+ $params = array(
157
+ 'posts_per_page' => -1,
158
+ 'post_type' => EWD_UFAQ_FAQ_POST_TYPE
159
+ );
160
+
161
+ $faqs = get_posts( $params );
162
+
163
+ $pdf_passes = array(
164
+ 'first_page_run',
165
+ 'second_page_run',
166
+ 'final'
167
+ );
168
+
169
+ $table_of_contents = array();
170
+
171
+ foreach ( $pdf_passes as $pdf_pass ) {
172
+
173
+ $pdf = new FPDF();
174
+ $pdf->AddPage();
175
+
176
+ if ( $pdf_pass == 'second_page_run' or $pdf_pass == 'final' ) {
177
+
178
+ $pdf->SetFont( 'Arial', 'B', 14 );
179
+ $pdf->Cell( 20, 10, 'Page #' );
180
+ $pdf->Cell( 20, 10, 'Article Title' );
181
+ $pdf->Ln();
182
+ $pdf->SetFont( 'Arial', '', 12 );
183
+
184
+ foreach ( $table_of_contents as $entry ) {
185
+ $pdf->Cell(20, 5, " " . $entry['page']);
186
+ $pdf->MultiCell(0, 5, $entry['title']);
187
+ $pdf->Ln();
188
+ }
189
+
190
+ unset( $table_of_contents );
191
+ }
192
+
193
+ foreach ($faqs as $faq) {
194
+
195
+ $question = utf8_decode( strip_tags( html_entity_decode( $faq->post_title ) ) );
196
+
197
+ $answer = utf8_decode( strip_tags( html_entity_decode( $faq->post_content ) ) );
198
+ $answer = str_replace( '&#91;', '[', $answer );
199
+ $answer = str_replace( '&#93;', ']', $answer );
200
+
201
+ $pdf->AddPage();
202
+
203
+ $entry = array(
204
+ 'page' => $pdf->GetPage(),
205
+ 'title' => $question
206
+ );
207
+
208
+ $pdf->SetFont( 'Arial', 'B', 15 );
209
+ $pdf->MultiCell( 0, 10, $question );
210
+ $pdf->Ln();
211
+ $pdf->SetFont( 'Arial', '', 12 );
212
+ $pdf->MultiCell( 0, 10, $answer );
213
+
214
+ $table_of_contents[] = $entry;
215
+ }
216
+
217
+ if ( $pdf_pass == 'first_page_run' or $pdf_pass == 'second_page_run' ) {
218
+
219
+ $pdf->Close();
220
+ }
221
+
222
+ if ( $pdf_pass == 'final' ) {
223
+
224
+ $pdf->Output( 'Ultimate-FAQ-Manual.pdf', 'D' );
225
+ }
226
+ }
227
+ }
228
+
229
+ public function enqueue_export_scripts() {
230
+
231
+ $screen = get_current_screen();
232
+
233
+ if ( $screen->id == 'urp_review_page_fdm-export' ) {
234
+
235
+ wp_enqueue_style( 'ewd-ufaq-admin', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-admin.css', array(), EWD_UFAQ_VERSION );
236
+ wp_enqueue_script( 'ewd-ufaq-admin-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-admin.js', array( 'jquery' ), EWD_UFAQ_VERSION, true );
237
+ }
238
+ }
239
+
240
+ }
241
+
242
+
includes/FAQ.class.php ADDED
@@ -0,0 +1,373 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'ABSPATH' ) ) exit;
3
+
4
+ if ( !class_exists( 'ewdufaqReview' ) ) {
5
+ /**
6
+ * Class to handle an FAQ for Ultimate FAQs
7
+ *
8
+ * @since 2.0.0
9
+ */
10
+ class ewdufaqFAQ {
11
+
12
+ /**
13
+ * Whether or not this request has been processed. Used to prevent
14
+ * duplicate forms on one page from processing an FAQ form more than
15
+ * once.
16
+ * @since 2.0.0
17
+ */
18
+ public $faq_processed = false;
19
+
20
+ /**
21
+ * Whether or not this request was successfully saved to the database.
22
+ * @since 2.0.0
23
+ */
24
+ public $FAQ_inserted = false;
25
+
26
+ public $custom_fields = array();
27
+
28
+ public function __construct() {}
29
+
30
+ /**
31
+ * Load the FAQ information from a WP_Post object or an ID
32
+ *
33
+ * @uses load_wp_post()
34
+ * @since 2.0.0
35
+ */
36
+ public function load_post( $post ) {
37
+
38
+ if ( is_int( $post ) || is_string( $post ) ) {
39
+ $post = get_post( $post );
40
+ }
41
+
42
+ if ( get_class( $post ) == 'WP_Post' && $post->post_type == EWD_UFAQ_FAQ_POST_TYPE ) {
43
+ $this->load_wp_post( $post );
44
+ return true;
45
+ } else {
46
+ return false;
47
+ }
48
+
49
+ }
50
+
51
+ /**
52
+ * Load data from WP post object and retrieve metadata
53
+ *
54
+ * @uses load_post_metadata()
55
+ * @since 2.0.0
56
+ */
57
+ public function load_wp_post( $post ) {
58
+
59
+ // Store post for access to other data if needed by extensions
60
+ $this->post = $post;
61
+
62
+ $this->ID = $post->ID;
63
+ $this->question = $post->post_title;
64
+ $this->date = $post->post_date;
65
+ $this->answer = $post->post_content;
66
+ $this->post_status = $post->post_status;
67
+
68
+ $this->categories = get_the_terms( $post, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY );
69
+ if ( ! is_array( $this->categories ) ) { $this->categories = array(); }
70
+
71
+ $this->tags = get_the_terms( $post, EWD_UFAQ_FAQ_TAG_TAXONOMY );
72
+ if ( ! is_array( $this->tags ) ) { $this->tags = array(); }
73
+
74
+ $this->load_custom_fields();
75
+ $this->load_post_metadata();
76
+
77
+ do_action( 'ewd_ufaq_faq_load_post_data', $this, $post );
78
+ }
79
+
80
+ /**
81
+ * Store custom field information for post
82
+ * @since 2.0.0
83
+ */
84
+ public function load_custom_fields() {
85
+ global $ewd_ufaq_controller;
86
+
87
+ $this->score = get_post_meta( $this->ID, 'EWD_UFAQ_Overall_Score', true );
88
+
89
+ $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
90
+
91
+ foreach ( $custom_fields as $custom_field ) {
92
+
93
+ if ( ! $custom_field->id ) { continue; }
94
+
95
+ $this->custom_fields[ $custom_field->id ] = get_post_meta( $this->ID, 'Custom_Field_' . $custom_field->id, true );
96
+ }
97
+ }
98
+
99
+ /**
100
+ * Store metadata for post
101
+ * @since 2.0.0
102
+ */
103
+ public function load_post_metadata() {
104
+
105
+ $faq_author = get_post_meta( $this->ID, 'EWD_UFAQ_Post_Author', true );
106
+
107
+ $user = wp_get_current_user();
108
+ $this->faq_author = $faq_author ? $faq_author : $user->display_name;
109
+ $this->faq_author_email = get_post_meta( $this->ID, 'EWD_UFAQ_Post_Author_Email', true );
110
+
111
+
112
+ $this->up_votes = get_post_meta( $this->ID, 'FAQ_Up_Votes', true );
113
+ $this->down_votes = get_post_meta( $this->ID, 'FAQ_Down_Votes', true );
114
+ }
115
+
116
+ /**
117
+ * Insert a new FAQ submission into the database
118
+ *
119
+ * Validates the data, adds it to the database and executes notifications
120
+ * @since 2.0.0
121
+ */
122
+ public function insert_faq() {
123
+
124
+ // Check if this request has already been processed. If multiple forms
125
+ // exist on the same page, this prevents a single submission from
126
+ // being added twice.
127
+ if ( $this->faq_processed === true ) {
128
+ return true;
129
+ }
130
+
131
+ $this->faq_processed = true;
132
+
133
+ if ( empty( $this->ID ) ) {
134
+ $action = 'insert';
135
+ } else {
136
+ $action = 'update';
137
+ }
138
+
139
+ $this->validate_submission();
140
+ if ( $this->is_valid_submission() === false ) {
141
+ return false;
142
+ }
143
+
144
+ if ( $this->insert_post_data() === false ) {
145
+ return false;
146
+ } else {
147
+ $this->faq_inserted = true;
148
+ }
149
+
150
+ do_action( 'ewd_ufaq_' . $action . '_faq', $this );
151
+
152
+ return true;
153
+ }
154
+
155
+ /**
156
+ * Validate submission data. Expects to find data in $_POST.
157
+ * @since 2.0.0
158
+ */
159
+ public function validate_submission() {
160
+ global $ewd_ufaq_controller;
161
+
162
+ $this->validation_errors = array();
163
+
164
+ // CAPTCHA
165
+ if ( $ewd_ufaq_controller->settings->get_setting( 'submit-question-captcha' ) ) {
166
+
167
+ $modified_code = intval( $_POST['ewd_ufaq_modified_captcha'] );
168
+ $user_code = intval( $_POST['ewd_ufaq_captcha'] );
169
+
170
+ if ( $user_code != $this->decrypt_modified_code( $modified_code ) ) {
171
+
172
+ $this->validation_errors[] = array(
173
+ 'field' => 'captcha',
174
+ 'error_msg' => 'Captcha incorrect',
175
+ 'message' => __( 'The number you entered for the image was incorrect.', 'ultimate-faqs' ),
176
+ );
177
+ }
178
+ }
179
+
180
+ // QUESTION
181
+ $this->question = empty( $_POST['faq_question'] ) ? false : sanitize_text_field( $_POST['faq_question'] );
182
+
183
+ if ( ! $this->question ) {
184
+
185
+ $this->validation_errors[] = array(
186
+ 'field' => 'faq_question',
187
+ 'error_msg' => 'Question is blank',
188
+ 'message' => __( 'Please make sure that there is a question that you are submitting as an FAQ', 'ultimate-faqs' ),
189
+ );
190
+ }
191
+
192
+ // AUTHOR
193
+ $this->faq_author = empty( $_POST['post_author'] ) ? false : sanitize_text_field( $_POST['post_author'] );
194
+
195
+ // AUTHOR EMAIL
196
+ $this->faq_author_email = empty( $_POST['post_author_email'] ) ? false : sanitize_text_field( $_POST['post_author_email'] );
197
+
198
+ // ANSWER
199
+ if ( $ewd_ufaq_controller->settings->get_setting( 'allow-proposed-answer' ) ) {
200
+
201
+ $this->answer = empty( $_POST['faq_answer'] ) ? false : sanitize_textarea_field( $_POST['faq_answer'] );
202
+ }
203
+
204
+ // CATEGORY
205
+ if ( $ewd_ufaq_controller->settings->get_setting( 'submitted-default-category' ) ) {
206
+
207
+ $args = array(
208
+ 'taxonomy' => EWD_UFAQ_FAQ_CATEGORY_TAXONOMY,
209
+ 'hide_empty' => false,
210
+ 'slug' => $ewd_ufaq_controller->settings->get_setting( 'submitted-default-category' )
211
+ );
212
+
213
+ $this->categories = get_terms( $args );
214
+ }
215
+
216
+ // CUSTOM FIELDS
217
+ $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
218
+
219
+ foreach ( $custom_fields as $custom_field ) {
220
+
221
+ if ( ! $custom_field->id ) { continue; }
222
+
223
+ $input_name = 'ewd_ufaq_custom_field_' . $custom_field->id;
224
+
225
+ if ( $custom_field->type == 'checkbox' ) {
226
+
227
+ $checkbox_values = ( empty( $_POST[ $input_name ] ) or ! is_array( $_POST[ $input_name ] ) ) ? array() : $_POST[ $input_name ];
228
+
229
+ $this->custom_fields[ $custom_field->id ] = array_map( 'sanitize_text_field', $checkbox_values );
230
+ }
231
+ else { $this->custom_fields[ $custom_field->id ] = empty( $_POST[ $input_name ] ) ? false : sanitize_text_field( $_POST[ $input_name ] ); }
232
+ }
233
+
234
+
235
+ $this->post_status = 'draft';
236
+
237
+ do_action( 'ewd_ufaq_validate_faq_submission', $this );
238
+ }
239
+
240
+ /**
241
+ * Returns the decrypted version of the captcha code
242
+ * @since 2.0.0
243
+ */
244
+ public function decrypt_modified_code( $user_code ) {
245
+
246
+ $decrypted_code = ($user_code / 3) - 5;
247
+
248
+ return $decrypted_code;
249
+ }
250
+
251
+ /**
252
+ * Check if submission is valid
253
+ *
254
+ * @since 2.0.0
255
+ */
256
+ public function is_valid_submission() {
257
+
258
+ if ( !count( $this->validation_errors ) ) {
259
+ return true;
260
+ }
261
+
262
+ return false;
263
+ }
264
+
265
+ /**
266
+ * Insert post data for a new FAQ or update a FAQ
267
+ * @since 2.0.0
268
+ */
269
+ public function insert_post_data() {
270
+
271
+ $args = array(
272
+ 'post_type' => EWD_UFAQ_FAQ_POST_TYPE,
273
+ 'post_title' => $this->question,
274
+ 'post_content' => ! empty( $this->answer ) ? $this->answer : '',
275
+ 'post_status' => $this->post_status,
276
+ );
277
+
278
+ if ( ! empty( $this->ID ) ) {
279
+ $args['ID'] = $this->ID;
280
+ }
281
+
282
+ $args = apply_filters( 'ewd_ufaq_insert_faq_data', $args, $this );
283
+
284
+ // When updating a FAQ, we need to update the metadata first, so that
285
+ // notifications hooked to the status changes go out with the new metadata.
286
+ // If we're inserting a new FAQ, we have to insert it before we can
287
+ // add metadata, and the default notifications don't fire until it's all done.
288
+ if ( ! empty( $this->ID ) ) {
289
+
290
+ $this->insert_post_meta();
291
+ $this->insert_post_categories();
292
+ $id = wp_insert_post( $args );
293
+ } else {
294
+
295
+ $id = wp_insert_post( $args );
296
+ if ( $id && ! is_wp_error( $id ) ) {
297
+ $this->ID = $id;
298
+ $this->insert_post_meta();
299
+ $this->insert_post_categories();
300
+
301
+ $this->clear_post_submission();
302
+ }
303
+ }
304
+
305
+ return ! is_wp_error( $id ) && $id !== false;
306
+ }
307
+
308
+ /**
309
+ * Insert the post metadata for a new FAQ or when updating a FAQ
310
+ * @since 2.0.0
311
+ */
312
+ public function insert_post_meta() {
313
+ global $ewd_ufaq_controller;
314
+
315
+ $meta = array();
316
+
317
+ if ( ! empty( $this->faq_author ) ) {
318
+
319
+ update_post_meta( $this->ID, 'EWD_UFAQ_Post_Author', $this->faq_author );
320
+ }
321
+
322
+ if ( ! empty( $this->faq_author_email ) ) {
323
+
324
+ update_post_meta( $this->ID, 'EWD_UFAQ_Post_Author_Email', $this->faq_author_email );
325
+ }
326
+
327
+ $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
328
+
329
+ foreach ( $custom_fields as $custom_field ) {
330
+
331
+ if ( ! empty( $this->custom_fields[ $custom_field->id ] ) ) {
332
+
333
+ update_post_meta( $this->ID, 'Custom_Field_' . $custom_field->id, $this->custom_fields[ $custom_field->id ] );
334
+ }
335
+ }
336
+ }
337
+
338
+ /**
339
+ * Update the categories for an FAQ
340
+ * @since 2.0.0
341
+ */
342
+ public function insert_post_categories() {
343
+
344
+ if ( ! is_array( $this->categories ) or empty( $this->categories ) ) { return; }
345
+
346
+ $submit_categories = array();
347
+ foreach ( $this->categories as $category ) { $submit_categories[] = $category->term_id; }
348
+
349
+ wp_set_object_terms( $this->ID, $submit_categories, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY );
350
+ }
351
+
352
+ /**
353
+ * Clears the $_POST values used by the plugin on successful submission
354
+ * @since 2.0.0
355
+ */
356
+ public function clear_post_submission() {
357
+ global $ewd_ufaq_controller;
358
+
359
+ unset( $_POST['faq_question'] );
360
+ unset( $_POST['faq_answer'] );
361
+ unset( $_POST['post_author'] );
362
+ unset( $_POST['post_author_email'] );
363
+
364
+ $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
365
+
366
+ foreach ( $custom_fields as $custom_field ) {
367
+
368
+ unset( $_POST[ 'ewd_ufaq_custom_field_' . $custom_field->id ] );
369
+ }
370
+ }
371
+
372
+ }
373
+ } // endif;
includes/Import.class.php ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class to handle importing FAQs into the plugin
5
+ */
6
+
7
+ if ( !defined( 'ABSPATH' ) )
8
+ exit;
9
+
10
+ if (!class_exists('ComposerAutoloaderInit4618f5c41cf5e27cc7908556f031e4d4')) {require_once EWD_UFAQ_PLUGIN_DIR . '/lib/PHPSpreadsheet/vendor/autoload.php';}
11
+ use PhpOffice\PhpSpreadsheet\Spreadsheet;
12
+ class ewdufaqImport {
13
+
14
+ public $status;
15
+ public $message;
16
+
17
+ public function __construct() {
18
+ add_action( 'admin_menu', array($this, 'register_install_screen' ));
19
+
20
+ if ( isset( $_POST['ewdufaqImport'] ) ) { add_action( 'admin_init', array($this, 'import_faqs' )); }
21
+
22
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_import_scripts' ) );
23
+ }
24
+
25
+ public function register_install_screen() {
26
+ global $ewd_ufaq_controller;
27
+
28
+ add_submenu_page(
29
+ 'edit.php?post_type=ufaq',
30
+ 'Import Menu',
31
+ 'Import',
32
+ $ewd_ufaq_controller->settings->get_setting( 'access-role' ),
33
+ 'ewd-ufaq-import',
34
+ array($this, 'display_import_screen')
35
+ );
36
+ }
37
+
38
+ public function display_import_screen() {
39
+ global $ewd_ufaq_controller;
40
+
41
+ $import_permission = $ewd_ufaq_controller->permissions->check_permission( 'import' );
42
+ ?>
43
+ <div class='wrap'>
44
+ <h2>Import</h2>
45
+ <?php if ( $import_permission ) { ?>
46
+ <form method='post' enctype="multipart/form-data">
47
+
48
+ <?php wp_nonce_field( 'EWD_UFAQ_Import', 'EWD_UFAQ_Import_Nonce' ); ?>
49
+
50
+ <p>
51
+ <label for="ewd_ufaq_faqs_spreadsheet"><?php _e( 'Spreadsheet Containing FAQs', 'ultimate-faqs' ) ?></label><br />
52
+ <input name="ewd_ufaq_faqs_spreadsheet" type="file" value=""/>
53
+ </p>
54
+ <input type='submit' name='ewdufaqImport' value='Import FAQs' class='button button-primary' />
55
+ </form>
56
+ <?php } else { ?>
57
+ <div class='ewd-ufaq-premium-locked'>
58
+ <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" target="_blank">Upgrade</a> to the premium version to use this feature
59
+ </div>
60
+ <?php } ?>
61
+ </div>
62
+ <?php }
63
+
64
+ public function import_faqs() {
65
+ global $ewd_ufaq_controller;
66
+
67
+ if ( ! current_user_can( 'edit_posts' ) ) { return; }
68
+
69
+ if ( ! isset( $_POST['EWD_UFAQ_Import_Nonce'] ) ) { return; }
70
+
71
+ if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Import_Nonce'], 'EWD_UFAQ_Import' ) ) { return; }
72
+
73
+ $update = $this->handle_spreadsheet_upload();
74
+
75
+ $fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
76
+
77
+ if ( $update['message_type'] != 'Success' ) :
78
+ $this->status = false;
79
+ $this->message = $update['message'];
80
+
81
+ add_action( 'admin_notices', array( $this, 'display_notice' ) );
82
+
83
+ return;
84
+ endif;
85
+
86
+ $excel_url = EWD_UFAQ_PLUGIN_DIR . '/faq-sheets/' . $update['filename'];
87
+
88
+ // Build the workbook object out of the uploaded spreadsheet
89
+ $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load( $excel_url );
90
+
91
+ // Create a worksheet object out of the product sheet in the workbook
92
+ $sheet = $spreadsheet->getActiveSheet();
93
+
94
+ $allowable_custom_fields = array();
95
+ foreach ( $fields as $field ) { $allowable_custom_fields[] = $field->name; }
96
+ //List of fields that can be accepted via upload
97
+ $allowed_fields = array( 'ID', 'Question', 'Answer', 'Categories', 'Tags', 'Post Date' );
98
+
99
+ // Get column names
100
+ $highest_column = $sheet->getHighestColumn();
101
+ $highest_column_index = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString( $highest_column );
102
+ for ( $column = 1; $column <= $highest_column_index; $column++ ) {
103
+
104
+ if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == 'ID' ) { $ID_column = $column; }
105
+ if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == 'Question' ) { $question_column = $column; }
106
+ if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == 'Answer' ) { $answer_column = $column; }
107
+ if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == 'Categories' ) { $categories_column = $column; }
108
+ if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == 'Tags' ) { $tags_column = $column; }
109
+ if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == 'Post Date' ) { $date_column = $column; }
110
+
111
+ foreach ( $fields as $field ) {
112
+
113
+ if ( trim( $sheet->getCellByColumnAndRow( $column, 1 )->getValue() ) == $field->name ) { $field->column = $column; }
114
+ }
115
+ }
116
+
117
+ $ID_column = ! empty( $ID_column ) ? $ID_column : -1;
118
+ $question_column = ! empty( $question_column ) ? $question_column : -1;
119
+ $answer_column = ! empty( $answer_column ) ? $answer_column : -1;
120
+ $categories_column = ! empty( $categories_column ) ? $categories_column : -1;
121
+ $tags_column = ! empty( $tags_column ) ? $tags_column : -1;
122
+ $date_column = ! empty( $date_column ) ? $date_column : -1;
123
+
124
+ // Put the spreadsheet data into a multi-dimensional array to facilitate processing
125
+ $highest_row = $sheet->getHighestRow();
126
+ for ( $row = 2; $row <= $highest_row; $row++ ) {
127
+ for ( $column = 1; $column <= $highest_column_index; $column++ ) {
128
+ $data[$row][$column] = $sheet->getCellByColumnAndRow( $column, $row )->getValue();
129
+ }
130
+ }
131
+
132
+ // Create the query to insert the products one at a time into the database and then run it
133
+ foreach ( $data as $faq ) {
134
+
135
+ // Create an array of the values that are being inserted for each FAQ
136
+ $post = array();
137
+ $field_values = array();
138
+ foreach ( $faq as $col_index => $value ) {
139
+
140
+ if ( $col_index == $ID_column ) { $post['ID'] = esc_sql( $value ); }
141
+ elseif ( $col_index == $question_column ) { $post['post_title'] = esc_sql( $value ); }
142
+ elseif ( $col_index == $answer_column ) { $post['post_content'] = esc_sql( $value ); }
143
+ elseif ( $col_index == $date_column ) { $post['post_date'] = esc_sql( $value ); }
144
+ elseif ( $col_index == $categories_column ) { $post_categories = explode( ',', esc_sql( $value ) ); }
145
+ elseif ( $col_index == $tags_column ) { $post_tags = explode( ',', esc_sql( $value ) ); }
146
+ else {
147
+
148
+ foreach ( $fields as $field ) {
149
+
150
+ if ( $col_index == $field->column ) { $field_values[ $field->name ] = esc_sql( $value ); }
151
+ }
152
+ }
153
+ }
154
+
155
+ $post['post_status'] = 'publish';
156
+ $post['post_type'] = EWD_UFAQ_FAQ_POST_TYPE;
157
+
158
+ $post_id = wp_insert_post( $post );
159
+
160
+ if ( $post_id != 0 ) {
161
+
162
+ if ( ! empty( $post_categories ) ) {
163
+
164
+ $category_ids = array();
165
+ foreach ( $post_categories as $category ) {
166
+
167
+ $term = term_exists( $category, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY );
168
+ if ( ! empty( $term ) ) { $category_ids[] = (int) $term['term_id']; }
169
+ }
170
+ }
171
+ if ( isset( $category_ids ) and is_array( $category_ids ) ) { wp_set_object_terms( $post_id, $category_ids, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY ); }
172
+
173
+ if ( ! empty( $post_tags ) ) {
174
+
175
+ $tag_ids = array();
176
+ foreach ( $post_tags as $tag ) {
177
+
178
+ $term = term_exists( $tag, EWD_UFAQ_FAQ_TAG_TAXONOMY );
179
+ if ( ! empty( $term ) ) { $tag_ids[] = (int) $term['term_id']; }
180
+ }
181
+ }
182
+ if ( isset( $tag_ids ) and is_array( $tag_ids ) ) { wp_set_object_terms( $post_id, $tag_ids, EWD_UFAQ_FAQ_TAG_TAXONOMY ); }
183
+
184
+ foreach ( $fields as $field ) {
185
+
186
+ if ( empty( $field->column ) ) { continue; }
187
+
188
+ if ( $field->type == 'checkbox' ) { update_post_meta( $post_id, "Custom_Field_" . $field->id, explode( ',', $field_values[ $field->name ] ) ); }
189
+ else { update_post_meta( $post_id, "Custom_Field_" . $field->id, $field_values[ $field->name ]); }
190
+ }
191
+ }
192
+
193
+ unset( $post_categories );
194
+ unset( $category_ids );
195
+ unset( $post_tags );
196
+ unset( $tag_ids );
197
+ }
198
+
199
+ $this->status = true;
200
+ $this->message = __( 'FAQs added successfully.', 'ultimate-faqs' );
201
+
202
+ add_action( 'admin_notices', array( $this, 'display_notice' ) );
203
+ }
204
+
205
+ function handle_spreadsheet_upload() {
206
+ /* Test if there is an error with the uploaded spreadsheet and return that error if there is */
207
+ if ( ! empty( $_FILES['ewd_ufaq_faqs_spreadsheet']['error'] ) ) {
208
+
209
+ switch( $_FILES['ewd_ufaq_faqs_spreadsheet']['error'] ) {
210
+
211
+ case '1':
212
+ $error = __( 'The uploaded file exceeds the upload_max_filesize directive in php.ini', 'ultimate-faqs' );
213
+ break;
214
+ case '2':
215
+ $error = __( 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form', 'ultimate-faqs' );
216
+ break;
217
+ case '3':
218
+ $error = __( 'The uploaded file was only partially uploaded', 'ultimate-faqs' );
219
+ break;
220
+ case '4':
221
+ $error = __( 'No file was uploaded.', 'ultimate-faqs' );
222
+ break;
223
+
224
+ case '6':
225
+ $error = __( 'Missing a temporary folder', 'ultimate-faqs' );
226
+ break;
227
+ case '7':
228
+ $error = __( 'Failed to write file to disk', 'ultimate-faqs' );
229
+ break;
230
+ case '8':
231
+ $error = __( 'File upload stopped by extension', 'ultimate-faqs' );
232
+ break;
233
+ case '999':
234
+ default:
235
+ $error = __( 'No error code avaiable', 'ultimate-faqs' );
236
+ }
237
+ }
238
+ /* Make sure that the file exists */
239
+ elseif ( empty($_FILES['ewd_ufaq_faqs_spreadsheet']['tmp_name']) || $_FILES['ewd_ufaq_faqs_spreadsheet']['tmp_name'] == 'none' ) {
240
+ $error = __( 'No file was uploaded here..', 'ultimate-faqs' );
241
+ }
242
+ /* Move the file and store the URL to pass it onwards*/
243
+ /* Check that it is a .xls or .xlsx file */
244
+ if ( ! isset($_FILES['ewd_ufaq_faqs_spreadsheet']['name'] ) or ( ! preg_match("/\.(xls.?)$/", $_FILES['ewd_ufaq_faqs_spreadsheet']['name'] ) and ! preg_match( "/\.(csv.?)$/", $_FILES['ewd_ufaq_faqs_spreadsheet']['name'] ) ) ) {
245
+ $error = __( 'File must be .csv, .xls or .xlsx', 'ultimate-faqs' );
246
+ }
247
+ else {
248
+ $filename = basename( $_FILES['ewd_ufaq_faqs_spreadsheet']['name'] );
249
+ $filename = mb_ereg_replace( "([^\w\s\d\-_~,;\[\]\(\).])", '', $filename );
250
+ $filename = mb_ereg_replace ("([\.]{2,})", '', $filename );
251
+
252
+ //for security reason, we force to remove all uploaded file
253
+ $target_path = EWD_UFAQ_PLUGIN_DIR . "/faq-sheets/";
254
+
255
+ $target_path = $target_path . $filename;
256
+
257
+ if ( ! move_uploaded_file($_FILES['ewd_ufaq_faqs_spreadsheet']['tmp_name'], $target_path ) ) {
258
+ $error .= "There was an error uploading the file, please try again!";
259
+ }
260
+ else {
261
+ $excel_file_name = $filename;
262
+ }
263
+ }
264
+
265
+ /* Pass the data to the appropriate function in Update_Admin_Databases.php to create the products */
266
+ if ( ! isset( $error ) ) {
267
+ $update = array( "message_type" => "Success", "filename" => $excel_file_name );
268
+ }
269
+ else {
270
+ $update = array( "message_type" => "Error", "message" => $error );
271
+ }
272
+
273
+ return $update;
274
+ }
275
+
276
+ public function enqueue_import_scripts() {
277
+
278
+ $screen = get_current_screen();
279
+
280
+ if ( $screen->id == 'fdm-menu_page_fdm-import' ) {
281
+
282
+ wp_enqueue_style( 'fdm-admin', EWD_UFAQ_PLUGIN_URL . '/assets/css/admin.css', array(), '2.0.0' );
283
+ wp_enqueue_script( 'fdm-admin-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/admin.js', array( 'jquery' ), '2.0.0', true );
284
+ }
285
+ }
286
+
287
+ public function display_notice() {
288
+
289
+ if ( $this->status ) {
290
+
291
+ echo "<div class='updated'><p>" . $this->message . "</p></div>";
292
+ }
293
+ else {
294
+
295
+ echo "<div class='error'><p>" . $this->message . "</p></div>";
296
+ }
297
+ }
298
+
299
+ }
300
+
301
+
includes/InstallationWalkthrough.class.php ADDED
@@ -0,0 +1,384 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class to handle everything related to the walk-through that runs on plugin activation
5
+ */
6
+
7
+ if ( ! defined( 'ABSPATH' ) )
8
+ exit;
9
+
10
+ class ewdufaqInstallationWalkthrough {
11
+
12
+ public function __construct() {
13
+ add_action( 'admin_menu', array( $this, 'register_install_screen' ) );
14
+ add_action( 'admin_head', array( $this, 'hide_install_screen_menu_item' ) );
15
+ add_action( 'admin_init', array( $this, 'redirect' ), 9999 );
16
+
17
+ add_action( 'admin_head', array( $this, 'admin_enqueue' ) );
18
+
19
+ add_action( 'wp_ajax_ewd_ufaq_welcome_add_category', array( $this, 'create_category' ) );
20
+ add_action( 'wp_ajax_ewd_ufaq_welcome_add_faq', array( $this, 'create_faq' ) );
21
+ add_action( 'wp_ajax_ewd_ufaq_welcome_add_faq_page', array( $this, 'add_faqs_page' ) );
22
+ add_action( 'wp_ajax_ewd_ufaq_welcome_set_options', array( $this, 'set_options' ) );
23
+ }
24
+
25
+ /**
26
+ * On activation, redirect the user if they haven't used the plugin before
27
+ * @since 2.0.0
28
+ */
29
+ public function redirect() {
30
+ if ( ! get_transient( 'ewd-ufaq-getting-started' ) )
31
+ return;
32
+
33
+ delete_transient( 'ewd-ufaq-getting-started' );
34
+
35
+ if ( is_network_admin() || isset( $_GET['activate-multi'] ) )
36
+ return;
37
+
38
+ if ( ! empty( get_posts( array( 'post_type' => EWD_UFAQ_FAQ_POST_TYPE ) ) ) ) {
39
+ return;
40
+ }
41
+
42
+ wp_safe_redirect( admin_url( 'index.php?page=ewd-ufaq-getting-started' ) );
43
+ exit;
44
+ }
45
+
46
+ /**
47
+ * Create the installation admin page
48
+ * @since 2.0.0
49
+ */
50
+ public function register_install_screen() {
51
+
52
+ add_dashboard_page(
53
+ esc_html__( 'Ultimate FAQs - Welcome!', 'ultimate-faqs' ),
54
+ esc_html__( 'Ultimate FAQs - Welcome!', 'ultimate-faqs' ),
55
+ 'manage_options',
56
+ 'ewd-ufaq-getting-started',
57
+ array($this, 'display_install_screen')
58
+ );
59
+ }
60
+
61
+ /**
62
+ * Hide the installation admin page from the WordPress sidebar menu
63
+ * @since 2.0.0
64
+ */
65
+ public function hide_install_screen_menu_item() {
66
+
67
+ remove_submenu_page( 'index.php', 'ewd-ufaq-getting-started' );
68
+ }
69
+
70
+ /**
71
+ * Create an FAQ category
72
+ * @since 2.0.0
73
+ */
74
+ public function create_category() {
75
+
76
+ $category_name = isset( $_POST['category_name'] ) ? sanitize_text_field( $_POST['category_name'] ) : '';
77
+ $category_description = isset( $_POST['category_description'] ) ? sanitize_textarea_field( $_POST['category_description'] ) : '';
78
+
79
+ $category_term_id = wp_insert_term( $category_name, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY, array('description' => $category_description) );
80
+
81
+ echo json_encode ( array( 'category_name' => $category_name, 'category_id' => $category_term_id['term_id'] ) );
82
+
83
+ exit();
84
+ }
85
+
86
+ public function create_faq() {
87
+
88
+ $args = array(
89
+ 'post_title' => isset( $_POST['faq_question'] ) ? sanitize_text_field( $_POST['faq_question'] ) : '',
90
+ 'post_content' => isset( $_POST['faq_answer'] ) ? sanitize_text_field( $_POST['faq_answer'] ) : '',
91
+ 'post_status' => 'publish',
92
+ 'post_type' => EWD_UFAQ_FAQ_POST_TYPE
93
+ );
94
+
95
+ $faq_post_id = wp_insert_post( $args );
96
+
97
+ if ( isset( $_POST['faq_category'] ) and $_POST['faq_category'] ) {
98
+
99
+ wp_set_post_terms( $faq_post_id, sanitize_text_field( $_POST['faq_category'] ), EWD_UFAQ_FAQ_CATEGORY_TAXONOMY );
100
+ }
101
+
102
+ exit();
103
+ }
104
+
105
+ /**
106
+ * Add in a page with the ultimate-faqs shortcode
107
+ * @since 2.0.0
108
+ */
109
+ public function add_faqs_page() {
110
+
111
+ $args = array(
112
+ 'post_title' => isset($_POST['faq_page_title'] ) ? sanitize_text_field( $_POST['faq_page_title'] ) : '',
113
+ 'post_content' => '<!-- wp:paragraph --><p> [ultimate-faqs] </p><!-- /wp:paragraph -->',
114
+ 'post_status' => 'publish',
115
+ 'post_type' => 'page'
116
+ );
117
+
118
+ wp_insert_post( $args );
119
+
120
+ exit();
121
+ }
122
+
123
+ /**
124
+ * Set a number of key options selected during the walk-through process
125
+ * @since 2.0.0
126
+ */
127
+ public function set_options() {
128
+
129
+ $ewd_ufaq_options = get_option( 'ewd-ufaq-settings' );
130
+
131
+ if ( isset( $_POST['faq_accordion'] ) ) { $ewd_ufaq_options['faq-accordion'] = intval( $_POST['faq_accordion'] ); }
132
+ if ( isset( $_POST['disable_faq_toggle'] ) ) { $ewd_ufaq_options['disable-faq-toggle'] = intval( $_POST['disable_faq_toggle'] ); }
133
+ if ( isset( $_POST['group_by_category'] ) ) { $ewd_ufaq_options['group-by-category'] = intval( $_POST['group_by_category'] ); }
134
+ if ( isset( $_POST['order_by_setting'] ) ) { $ewd_ufaq_options['faq-order-by'] = sanitize_text_field( $_POST['order_by_setting'] ); }
135
+
136
+ update_option( 'ewd-ufaq-settings', $ewd_ufaq_options );
137
+
138
+ exit();
139
+ }
140
+
141
+ /**
142
+ * Enqueue the admin assets necessary to run the walk-through and display it nicely
143
+ * @since 2.0.0
144
+ */
145
+ public function admin_enqueue() {
146
+
147
+ if ( ! isset( $_GET['page'] ) or $_GET['page'] != 'ewd-ufaq-getting-started' ) { return; }
148
+
149
+ wp_enqueue_style( 'ewd-ufaq-admin-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/admin.css', array(), EWD_UFAQ_VERSION );
150
+ wp_enqueue_style( 'ewd-ufaq-sap-admin-css', EWD_UFAQ_PLUGIN_URL . '/lib/simple-admin-pages/css/admin.css', array(), EWD_UFAQ_VERSION );
151
+ wp_enqueue_style( 'ewd-ufaq-welcome-screen', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-welcome-screen.css', array(), EWD_UFAQ_VERSION );
152
+ wp_enqueue_style( 'ewd-ufaq-admin-settings-css', EWD_UFAQ_PLUGIN_URL . '/lib/simple-admin-pages/css/admin-settings.css', array(), EWD_UFAQ_VERSION );
153
+
154
+ wp_enqueue_script( 'ewd-ufaq-getting-started', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-welcome-screen.js', array( 'jquery' ), EWD_UFAQ_VERSION );
155
+ wp_enqueue_script( 'ewd-ufaq-admin-settings-js', EWD_UFAQ_PLUGIN_URL . '/lib/simple-admin-pages/js/admin-settings.js', array( 'jquery' ), EWD_UFAQ_VERSION );
156
+ wp_enqueue_script( 'ewd-ufaq-admin-spectrum-js', EWD_UFAQ_PLUGIN_URL . '/lib/simple-admin-pages/js/spectrum.js', array( 'jquery' ), EWD_UFAQ_VERSION );
157
+ }
158
+
159
+ /**
160
+ * Output the HTML of the walk-through screen
161
+ * @since 2.0.0
162
+ */
163
+ public function display_install_screen() {
164
+ global $ewd_ufaq_controller;
165
+
166
+ $faq_accordion = $ewd_ufaq_controller->settings->get_setting( 'faq-accordion' );
167
+ $disable_faq_toggle = $ewd_ufaq_controller->settings->get_setting( 'disable-faq-toggle' );
168
+ $group_by_category = $ewd_ufaq_controller->settings->get_setting( 'group-by-category' );
169
+ $faq_order_by = $ewd_ufaq_controller->settings->get_setting( 'faq-order-by' );
170
+
171
+ ?>
172
+
173
+ <div class='ewd-ufaq-welcome-screen'>
174
+
175
+ <div class='ewd-ufaq-welcome-screen-header'>
176
+ <h1><?php _e('Welcome to Ultimate FAQs', 'ultimate-faqs'); ?></h1>
177
+ <p><?php _e('Thanks for choosing Ultimate FAQs! The following will help you get started with the setup by creating your first FAQ and category, as well as adding your FAQs to a page and configuring a few key options.', 'ultimate-faqs'); ?></p>
178
+ </div>
179
+
180
+ <div class='ewd-ufaq-welcome-screen-box ewd-ufaq-welcome-screen-categories ewd-ufaq-welcome-screen-open' data-screen='categories'>
181
+ <h2><?php _e('1. Create Categories', 'ultimate-faqs'); ?></h2>
182
+ <div class='ewd-ufaq-welcome-screen-box-content'>
183
+ <p><?php _e('Categories let you organize your FAQs in a way that\'s easy for you - and your customers - to find.', 'ultimate-faqs'); ?></p>
184
+ <table class='form-table ewd-ufaq-welcome-screen-created-categories'>
185
+ <tr class='ewd-ufaq-welcome-screen-add-category-name ewd-ufaq-welcome-screen-box-content-divs'>
186
+ <th scope='row'><?php _e( 'Category Name', 'ultimate-faqs' ); ?></th>
187
+ <td class='ewd-ufaq-welcome-screen-option'>
188
+ <input type='text'>
189
+ </td>
190
+ </tr>
191
+ <tr class='ewd-ufaq-welcome-screen-add-category-description ewd-ufaq-welcome-screen-box-content-divs'>
192
+ <th scope='row'><?php _e( 'Category Description', 'ultimate-faqs' ); ?></th>
193
+ <td class='ewd-ufaq-welcome-screen-option'>
194
+ <textarea></textarea>
195
+ </td>
196
+ </tr>
197
+ <tr>
198
+ <th scope='row'></th>
199
+ <td>
200
+ <div class='ewd-ufaq-welcome-screen-add-category-button'><?php _e('Add Category', 'ultimate-faqs'); ?></div>
201
+ </td>
202
+ </tr>
203
+ <tr></tr>
204
+ <tr>
205
+ <td colspan="2">
206
+ <h3><?php _e('Created Categories', 'ultimate-faqs'); ?></h3>
207
+ <table class='ewd-ufaq-welcome-screen-show-created-categories'>
208
+ <tr>
209
+ <th class='ewd-ufaq-welcome-screen-show-created-categories-name'><?php _e('Name', 'ultimate-faqs'); ?></th>
210
+ <th class='ewd-ufaq-welcome-screen-show-created-categories-description'><?php _e('Description', 'ultimate-faqs'); ?></th>
211
+ </tr>
212
+ </table>
213
+ </td>
214
+ </tr>
215
+ </table>
216
+
217
+ <div class='ewd-ufaq-welcome-screen-next-button' data-nextaction='questions'><?php _e('Next', 'ultimate-faqs'); ?></div>
218
+ <div class='clear'></div>
219
+ </div>
220
+ </div>
221
+
222
+ <div class='ewd-ufaq-welcome-screen-box ewd-ufaq-welcome-screen-questions' data-screen='questions'>
223
+ <h2><?php _e('2. Questions & Answers', 'ultimate-faqs'); ?></h2>
224
+ <div class='ewd-ufaq-welcome-screen-box-content'>
225
+ <p><?php _e('Create your first set of questions and answers. Don\'t worry, you can always add more later.', 'ultimate-faqs'); ?></p>
226
+ <table class='form-table ewd-ufaq-welcome-screen-created-categories'>
227
+ <tr class='ewd-ufaq-welcome-screen-add-faq-question ewd-ufaq-welcome-screen-box-content-divs'>
228
+ <th scope='row'><?php _e( 'Questions', 'ultimate-faqs' ); ?></th>
229
+ <td class='ewd-ufaq-welcome-screen-option'>
230
+ <input type='text'>
231
+ </td>
232
+ </tr>
233
+ <tr class='ewd-ufaq-welcome-screen-add-faq-answer ewd-ufaq-welcome-screen-box-content-divs'>
234
+ <th scope='row'><?php _e( 'Answer', 'ultimate-faqs' ); ?></th>
235
+ <td class='ewd-ufaq-welcome-screen-option'>
236
+ <textarea></textarea>
237
+ </td>
238
+ </tr>
239
+ <tr class='ewd-ufaq-welcome-screen-add-faq-category ewd-ufaq-welcome-screen-box-content-divs'>
240
+ <th scope='row'><?php _e( 'FAQ Category', 'ultimate-faqs' ); ?></th>
241
+ <td class='ewd-ufaq-welcome-screen-option'>
242
+ <select>
243
+ <option></option>
244
+ </select>
245
+ </td>
246
+ </tr>
247
+ <tr>
248
+ <th scope='row'></th>
249
+ <td>
250
+ <div class='ewd-ufaq-welcome-screen-add-faq-button'><?php _e('Add FAQ', 'ultimate-faqs'); ?></div>
251
+ </td>
252
+ </tr>
253
+ <tr></tr>
254
+ <tr>
255
+ <td colspan="2">
256
+ <h3><?php _e('Created FAQs', 'ultimate-faqs'); ?></h3>
257
+ <table class='ewd-ufaq-welcome-screen-show-created-faqs'>
258
+ <tr>
259
+ <th class='ewd-ufaq-welcome-screen-show-created-faq-question'><?php _e('Question', 'ultimate-faqs'); ?></th>
260
+ <th class='ewd-ufaq-welcome-screen-show-created-faq-answer'><?php _e('Answer', 'ultimate-faqs'); ?></th>
261
+ <th class='ewd-ufaq-welcome-screen-show-created-faq-category'><?php _e('Category', 'ultimate-faqs'); ?></th>
262
+ </tr>
263
+ </table>
264
+ </td>
265
+ </tr>
266
+ </table>
267
+
268
+ <div class='ewd-ufaq-welcome-clear'></div>
269
+ <div class='ewd-ufaq-welcome-screen-next-button' data-nextaction='faq-page'><?php _e('Next', 'ultimate-faqs'); ?></div>
270
+ <div class='ewd-ufaq-welcome-screen-previous-button' data-previousaction='questions'><?php _e('Previous', 'ultimate-faqs'); ?></div>
271
+ <div class='ewd-ufaq-clear'></div>
272
+ </div>
273
+ </div>
274
+
275
+ <div class='ewd-ufaq-welcome-screen-box ewd-ufaq-welcome-screen-faq-page' data-screen='faq-page'>
276
+ <h2><?php _e('3. Add an FAQ Page', 'ultimate-faqs'); ?></h2>
277
+ <div class='ewd-ufaq-welcome-screen-box-content'>
278
+ <p><?php _e('You can create a dedicated FAQ page below, or skip this step and add your FAQs to a page you\'ve already created manually.', 'ultimate-faqs'); ?></p>
279
+ <table class='form-table ewd-ufaq-welcome-screen-faq-page'>
280
+ <tr class='ewd-ufaq-welcome-screen-add-faq-page-name ewd-ufaq-welcome-screen-box-content-divs'>
281
+ <th scope='row'><?php _e( 'Page Title', 'ultimate-faqs' ); ?></th>
282
+ <td class='ewd-ufaq-welcome-screen-option'>
283
+ <input type='text' value='FAQs'>
284
+ </td>
285
+ </tr>
286
+ <tr>
287
+ <th scope='row'></th>
288
+ <td>
289
+ <div class='ewd-ufaq-welcome-screen-add-faq-page-button' data-nextaction='options'><?php _e( 'Create Page', 'ultimate-faqs' ); ?></div>
290
+ </td>
291
+ </tr>
292
+ </table>
293
+
294
+ <div class='ewd-ufaq-welcome-clear'></div>
295
+ <div class='ewd-ufaq-welcome-screen-next-button' data-nextaction='options'><?php _e('Next', 'ultimate-faqs'); ?></div>
296
+ <div class='ewd-ufaq-welcome-screen-previous-button' data-previousaction='questions'><?php _e('Previous', 'ultimate-faqs'); ?></div>
297
+ <div class='ewd-ufaq-clear'></div>
298
+ </div>
299
+ </div>
300
+
301
+ <div class='ewd-ufaq-welcome-screen-box ewd-ufaq-welcome-screen-options' data-screen='options'>
302
+ <h2><?php _e('4. Set Key Options', 'ultimate-faqs'); ?></h2>
303
+ <div class='ewd-ufaq-welcome-screen-box-content'>
304
+ <p><?php _e('Options can always be changed later, but here are a few tha a lot of users want to set for themselves.', 'ultimate-faqs'); ?></p>
305
+ <table class='form-table'>
306
+ <tr>
307
+ <th scope='row'><?php _e('FAQ Accordion', 'ultimate-faqs'); ?></th>
308
+ <td class='ewd-ufaq-welcome-screen-option'>
309
+ <fieldset>
310
+ <div class='sap-admin-hide-radios'>
311
+ <input type='checkbox' name='faq_accordion' value='1'>
312
+ </div>
313
+ <label class='sap-admin-switch'>
314
+ <input type='checkbox' class='sap-admin-option-toggle' data-inputname='faq_accordion' <?php if ( $faq_accordion == '1' ) { echo 'checked'; } ?>>
315
+ <span class='sap-admin-switch-slider round'></span>
316
+ </label>
317
+ <p class='description'><?php _e('Should the FAQs accordion? (Only one FAQ is open at a time, requires FAQ Toggle)', 'ultimate-faqs'); ?></p>
318
+ </fieldset>
319
+ </td>
320
+ </tr>
321
+ <tr>
322
+ <th scope='row'><?php _e('FAQ Toggle', 'ultimate-faqs'); ?></th>
323
+ <td class='ewd-ufaq-welcome-screen-option'>
324
+ <fieldset>
325
+ <div class='sap-admin-hide-radios'>
326
+ <input type='checkbox' name='disable_faq_toggle' value='1'>
327
+ </div>
328
+ <label class='sap-admin-switch'>
329
+ <input type='checkbox' class='sap-admin-option-toggle' data-inputname='disable_faq_toggle' <?php if ( $disable_faq_toggle == '1' ) { echo 'checked'; } ?>>
330
+ <span class='sap-admin-switch-slider round'></span>
331
+ </label>
332
+ <p class='description'><?php _e('Should the FAQs open on a separate page when clicked, instead of opening and closing?', 'ultimate-faqs'); ?></p>
333
+ </fieldset>
334
+ </td>
335
+ </tr>
336
+ <tr>
337
+ <th scope='row'><?php _e('Group FAQs by Category', 'ultimate-faqs'); ?></th>
338
+ <td class='ewd-ufaq-welcome-screen-option'>
339
+ <fieldset>
340
+ <div class='sap-admin-hide-radios'>
341
+ <input type='checkbox' name='group_by_category' value='1'>
342
+ </div>
343
+ <label class='sap-admin-switch'>
344
+ <input type='checkbox' class='sap-admin-option-toggle' data-inputname='group_by_category' <?php if ( $group_by_category == '1' ) { echo 'checked'; } ?>>
345
+ <span class='sap-admin-switch-slider round'></span>
346
+ </label>
347
+ <p class='description'><?php _e('Should FAQs be grouped by category, or should all categories be mixed together?', 'ultimate-faqs'); ?></p>
348
+ </fieldset>
349
+ </td>
350
+ </tr>
351
+ <tr>
352
+ <th scope='row'><?php _e('FAQ Ordering', 'ultimate-faqs'); ?></th>
353
+ <td class='ewd-ufaq-welcome-screen-option'>
354
+ <fieldset>
355
+ <select name='order_by_setting'>
356
+ <option value='date' <?php if ( $faq_order_by == 'date' ) { echo 'selected';} ?> ><?php _e( 'Created Date', 'ultimate-faqs' ); ?></option>
357
+ <option value='title' <?php if ( $faq_order_by == 'title' ) { echo 'selected';} ?> ><?php _e( 'Title', 'ultimate-faqs' ); ?></option>
358
+ <option value='modified' <?php if ( $faq_order_by == 'modified' ) { echo 'selected';} ?> ><?php _e( 'Modified Date', 'ultimate-faqs' ); ?></option>
359
+ </select>
360
+ <p class='description'><?php _e('How should individual FAQs be ordered?', 'ultimate-faqs'); ?></p>
361
+ </fieldset>
362
+ </td>
363
+ </tr>
364
+ </table>
365
+
366
+ <div class='ewd-ufaq-welcome-screen-save-options-button'><?php _e('Save Options', 'ultimate-faqs'); ?></div>
367
+ <div class='ewd-ufaq-welcome-clear'></div>
368
+ <div class='ewd-ufaq-welcome-screen-previous-button' data-previousaction='faq-page'><?php _e('Previous', 'ultimate-faqs'); ?></div>
369
+ <div class='ewd-ufaq-welcome-screen-finish-button'><a href='admin.php?page=ewd-ufaq-settings'><?php _e('Finish', 'ultimate-faqs'); ?></a></div>
370
+
371
+ <div class='ewd-ufaq-clear'></div>
372
+ </div>
373
+ </div>
374
+
375
+ <div class='ewd-ufaq-welcome-screen-skip-container'>
376
+ <a href='admin.php?page=ewd-ufaq-settings'><div class='ewd-ufaq-welcome-screen-skip-button'><?php _e('Skip Setup', 'ultimate-faqs'); ?></div></a>
377
+ </div>
378
+ </div>
379
+
380
+ <?php }
381
+ }
382
+
383
+
384
+ ?>
includes/Notifications.class.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class to handle sending notifications when an FAQ is submitted
5
+ */
6
+
7
+ if ( !defined( 'ABSPATH' ) )
8
+ exit;
9
+
10
+ if ( !class_exists( 'ewdufaqNotifications' ) ) {
11
+ class ewdufaqNotifications {
12
+
13
+ public function __construct() {
14
+
15
+ add_action( 'ewd_ufaq_insert_faq', array( $this, 'admin_notification_email' ) );
16
+ add_action( 'ewd_ufaq_insert_faq', array( $this, 'user_submission_email' ) );
17
+ }
18
+
19
+ /**
20
+ * Send an email to the site admin when an FAQ is submitted, if selected
21
+ *
22
+ * @since 2.0.0
23
+ */
24
+ public function admin_notification_email( $faq ) {
25
+ global $ewd_ufaq_controller;
26
+
27
+ if ( ! $ewd_ufaq_controller->settings->get_setting( 'admin-question-notification' ) ) { return; }
28
+
29
+ $admin_email = $ewd_ufaq_controller->settings->get_setting( 'admin-notification-email' ) ? $ewd_ufaq_controller->settings->get_setting( 'admin-notification-email' ) : get_option( 'admin_email' );
30
+
31
+ $faq_link = site_url() . '/wp-admin/post.php?post=' . $faq->ID . '&action=edit';
32
+
33
+ $subject_line = __( 'New Question Received', 'ultimate-faqs' );
34
+
35
+ $message_body = __( 'Hello Admin,', 'ultimate-faqs' ) . '<br/><br/>';
36
+ $message_body .= __( 'You\'ve received a new question titled ', 'ultimate-faqs' ) . $faq->question . '.<br/><br/>';
37
+ $message_body .= __( 'The answer reads:<br>', 'ultimate-faqs' );
38
+ $message_body .= esc_html( $faq->answer ) . '<br><br><br>';
39
+ $message_body .= __( 'You can view the question in the admin area by going to the following link:<br>', 'ultimate-faqs' );
40
+ $message_body .= '<a href=\'' . $faq_link . '\'>' . __( 'See the FAQ', 'ultimate-faqs' ) . '</a><br/><br/>';
41
+ $message_body .= __( 'Have a great day,', 'ultimate-faqs' ) . '<br/><br/>';
42
+ $message_body .= __( 'Ultimate FAQs Team', 'ultimate-faqs' );
43
+
44
+ $headers = array( 'Content-Type: text/html; charset=UTF-8' );
45
+
46
+ return wp_mail( $admin_email, $subject_line, $message_body, $headers );
47
+ }
48
+
49
+ /**
50
+ * Send an email to the FAQ author using UWPM when an FAQ is submitted, if selected
51
+ *
52
+ * @since 2.0.0
53
+ */
54
+ public function user_submission_email( $faq ) {
55
+ global $ewd_ufaq_controller;
56
+
57
+ if ( ! $ewd_ufaq_controller->settings->get_setting( 'submit-faq-email' ) ) { return; }
58
+
59
+ $params = array(
60
+ 'Email_ID' => $ewd_ufaq_controller->settings->get_setting( 'submit-faq-email' ),
61
+ 'Email_Address' => $faq->faq_author_email,
62
+ 'post_id' => $faq->ID
63
+ );
64
+
65
+ if ( function_exists( 'EWD_UWPM_Send_Email_To_Non_User' ) ) {
66
+
67
+ EWD_UWPM_Send_Email_To_Non_User( $params );
68
+ }
69
+ }
70
+ }
71
+ } // endif;
72
+
includes/OrderingTable.class.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class to set the order of FAQs, if enabled
4
+ */
5
+
6
+ if ( !defined( 'ABSPATH' ) )
7
+ exit;
8
+
9
+ if ( !class_exists( 'ewdufaqOrderingTable' ) ) {
10
+ class ewdufaqOrderingTable {
11
+
12
+ public function __construct() {
13
+
14
+ add_action( 'admin_menu', array( $this, 'register_menu_screen' ) );
15
+ }
16
+
17
+ /**
18
+ * Adds filtering form, controls and column titles
19
+ * @since 3.0.0
20
+ */
21
+ public function register_menu_screen() {
22
+ global $ewd_ufaq_controller;
23
+
24
+ if ( $ewd_ufaq_controller->settings->get_setting( 'faq-order-by' ) != 'set_order' ) { return; }
25
+
26
+ add_submenu_page(
27
+ 'edit.php?post_type=ufaq',
28
+ esc_html__( 'Ordering Table', 'ultimate-faqs' ),
29
+ esc_html__( 'Ordering Table', 'ultimate-faqs' ),
30
+ $ewd_ufaq_controller->settings->get_setting( 'access-role' ),
31
+ 'ewd-ufaq-ordering-table',
32
+ array( $this, 'display_admin_screen' )
33
+ );
34
+ }
35
+
36
+ /**
37
+ * Diplays the admin screen where it's possible to set the order of FAQs
38
+ * @since 3.0.0
39
+ */
40
+ public function display_admin_screen() {
41
+
42
+ $args = array(
43
+ 'post_type' => EWD_UFAQ_FAQ_POST_TYPE,
44
+ 'posts_per_page' => -1,
45
+ 'meta_key' => 'ufaq_order',
46
+ 'orderby' => 'meta_value_num',
47
+ 'order' => 'ASC'
48
+ );
49
+
50
+ $faqs = get_posts( $args );
51
+
52
+ ?>
53
+
54
+ <h2>FAQ Ordering Table</h2>
55
+
56
+ <div id='ewd-ufaq-ordering-table-container'>
57
+
58
+ <div id='ewd-ufaq-ordering-table-explanation'>
59
+ <?php _e( 'Use the table below to set the order for your FAQs, either overall or within their categories depending on your selected settings.', 'ultimate-faqs' ); ?>
60
+ </div>
61
+
62
+ <table class='ewd-ufaq-ordering-table form-table wp-list-table widefat sorttable ewd-ufaq-list'>
63
+ <thead>
64
+ <tr>
65
+ <th><?php _e( 'Question', 'ultimate-faqs' ); ?></th>
66
+ <th><?php _e( 'Views', 'ultimate-faqs' ); ?></th>
67
+ <th><?php _e( 'Categories', 'ultimate-faqs' ); ?></th>
68
+ <th><?php _e( 'Tags', 'ultimate-faqs' ); ?></th>
69
+ </tr>
70
+ </thead>
71
+ <tbody>
72
+ <?php foreach ( $faqs as $faq ) { ?>
73
+
74
+ <?php $faq_views = get_post_meta( $faq->ID, 'ufaq_view_count', true ); ?>
75
+ <?php $faq_categories = get_the_term_list($faq->ID, 'ufaq-category', '', ', ', ''); ?>
76
+ <?php $faq_tags = get_the_term_list($faq->ID, 'ufaq-tag', '', ', ', ''); ?>
77
+
78
+ <tr id='ewd-ufaq-item-<?php echo $faq->ID; ?>' class='ewd-ufaq-item'>
79
+ <td class='ewd-ufaq-title'><?php echo esc_html( $faq->post_title ); ?></td>
80
+ <td class='ewd-ufaq-title'><?php echo esc_html( $faq_views ); ?></td>
81
+ <td class='ewd-ufaq-title'><?php echo esc_html( strip_tags( $faq_categories ) ); ?></td>
82
+ <td class='ewd-ufaq-title'><?php echo esc_html( strip_tags( $faq_tags ) ); ?></td>
83
+ </tr>
84
+
85
+ <?php } ?>
86
+ </tbody>
87
+ </table>
88
+
89
+ </div>
90
+
91
+ <?php }
92
+
93
+ }
94
+ } // endif;
includes/Permissions.class.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'ABSPATH' ) ) exit;
3
+
4
+ if ( !class_exists( 'ewdufaqPermissions' ) ) {
5
+ /**
6
+ * Class to handle plugin permissions for Ultimate FAQs
7
+ *
8
+ * @since 2.0.0
9
+ */
10
+ class ewdufaqPermissions {
11
+
12
+ private $plugin_permissions;
13
+ private $permission_level;
14
+
15
+ public function __construct() {
16
+
17
+ $this->plugin_permissions = array(
18
+ 'styling' => 2,
19
+ 'premium' => 2,
20
+ 'fields' => 2,
21
+ 'search' => 2,
22
+ 'woocommerce' => 2,
23
+ 'submit-faq' => 2,
24
+ 'ordering' => 2,
25
+ 'labelling' => 2,
26
+ 'import' => 2,
27
+ 'export' => 2
28
+ );
29
+ }
30
+
31
+ public function set_permissions() {
32
+ global $ewd_ufaq_controller;
33
+
34
+ if ( get_option( 'ewd-ufaq-permission-level' ) >= 2 ) { return; }
35
+
36
+ $this->permission_level = get_option( 'EWD_UFAQ_Full_Version' ) == 'Yes' ? 2 : 1;
37
+
38
+ update_option( 'ewd-ufaq-permission-level', $this->permission_level );
39
+ }
40
+
41
+ public function get_permission_level() {
42
+
43
+ $this->permission_level = get_option( 'ewd-ufaq-permission-level' );
44
+
45
+ if ( ! $this->permission_level ) { $this->set_permissions(); }
46
+ }
47
+
48
+ public function check_permission( $permission_type = '' ) {
49
+
50
+ if ( ! $this->permission_level ) { $this->get_permission_level(); }
51
+
52
+ return ( array_key_exists( $permission_type, $this->plugin_permissions ) ? ( $this->permission_level >= $this->plugin_permissions[$permission_type] ? true : false ) : false );
53
+ }
54
+
55
+ public function update_permissions() {
56
+
57
+ $this->permission_level = get_option( 'ewd-ufaq-permission-level' );
58
+ }
59
+ }
60
+
61
+ }
includes/Query.class.php ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'ABSPATH' ) ) exit;
3
+
4
+ if ( !class_exists( 'ewdufaqQuery' ) ) {
5
+ /**
6
+ * Class to handle common queries used to pull faqs from
7
+ * the database.
8
+ *
9
+ * Bookings can be retrieved with specific date ranges, common
10
+ * date params (today/upcoming), etc. This class is intended for
11
+ * the base plugin as well as extensions or custom projects which
12
+ * need a stable mechanism for reliably retrieving faqs data.
13
+ *
14
+ * Queries return an array of ewdufaqReview objects.
15
+ *
16
+ * @since 1.4.1
17
+ */
18
+ class ewdufaqQuery {
19
+
20
+ /**
21
+ * Bookings
22
+ *
23
+ * Array of faqs retrieved after get_faqs() is called
24
+ *
25
+ * @since 1.4.1
26
+ */
27
+ public $faqs = array();
28
+
29
+ /**
30
+ * Query args
31
+ *
32
+ * Passed to WP_Query
33
+ * http://codex.wordpress.org/Class_Reference/WP_Query
34
+ *
35
+ * @since 1.4.1
36
+ */
37
+ public $args = array();
38
+
39
+ /**
40
+ * Query context
41
+ *
42
+ * Defines the context in which the query is run.
43
+ * Useful for hooking into the right query without
44
+ * tampering with others.
45
+ *
46
+ * @since 1.4.1
47
+ */
48
+ public $context;
49
+
50
+ /**
51
+ * Instantiate the query with an array of arguments
52
+ *
53
+ * This supports all WP_Query args as well as several
54
+ * short-hand arguments for common needs. Short-hands
55
+ * include:
56
+ *
57
+ * date_range string today|upcoming|dates
58
+ * start_date string don't get faqs before this
59
+ * end_date string don't get faqs after this
60
+ *
61
+ * @see ewdufaqQuery::prepare_args()
62
+ * @param args array Options to tailor the query
63
+ * @param context string Context for the query, used
64
+ * in filters
65
+ * @since 1.4.1
66
+ */
67
+ public function __construct( $args = array(), $context = '' ) {
68
+
69
+ global $ewd_ufaq_controller;
70
+
71
+ $defaults = array(
72
+ 'post_type' => EWD_UFAQ_FAQ_POST_TYPE,
73
+ //'posts_per_page' => -1,
74
+ 'post_status' => 'publish',
75
+ 'order' => 'DESC',
76
+ 'paged' => 1,
77
+ );
78
+
79
+ $this->args = wp_parse_args( $args, $defaults );
80
+
81
+ $this->context = $context;
82
+
83
+ }
84
+
85
+ /**
86
+ * Parse the args array and convert custom arguments
87
+ * for use by WP_Query
88
+ *
89
+ * @since 1.4.1
90
+ */
91
+ public function prepare_args() {
92
+ global $ewd_ufaq_controller;
93
+
94
+ $args = $this->args;
95
+
96
+ $this->include_children = ( ! empty( $args['include_children'] ) and strtolower( $args['include_children'] ) != 'yes' ) ? false : true;
97
+
98
+ if ( ! empty( $args['search_string'] ) ) { $args['s'] = $args['search_string']; }
99
+
100
+ if ( ! empty( $args['post_count'] ) ) { $args['posts_per_page'] = $args['post_count']; }
101
+
102
+ if ( ! empty( $args['faq_page'] ) ) { $args['paged'] = $args['faq_page']; }
103
+
104
+ if ( ! empty( $args['post__in'] ) ) { $args['post__in'] = is_array( $args['post__in'] ) ? $args['post__in'] : json_decode( str_replace( array( '&lsqb;', '&rsqb;' ), array( '[', ']' ) ) ); }
105
+
106
+ if ( ! empty( $args['post__in_string'] ) ) { $args['post__in'] = ! empty( $args['post__in'] ) ? array_merge( $args['post__in'], explode( ',', $args['post__in_string'] ) ) : explode( ',', $args['post__in_string'] ); }
107
+
108
+ $tax_query = array();
109
+
110
+ if ( ! empty( $args['include_category'] ) ) {
111
+
112
+ $include_category_array = explode( ',', $args['include_category'] );
113
+
114
+ $tax_query[] = array(
115
+ 'taxonomy' => EWD_UFAQ_FAQ_CATEGORY_TAXONOMY,
116
+ 'field' => 'slug',
117
+ 'terms' => $include_category_array,
118
+ 'include_children' => $this->include_children
119
+ );
120
+ }
121
+
122
+ if ( ! empty( $args['exclude_category'] ) ) {
123
+
124
+ $exclude_category_array = explode( ',', $args['exclude_category'] );
125
+
126
+ $tax_query[] = array(
127
+ 'taxonomy' => EWD_UFAQ_FAQ_CATEGORY_TAXONOMY,
128
+ 'field' => 'slug',
129
+ 'operator' => 'NOT IN',
130
+ 'terms' => $exclude_category_array,
131
+ 'include_children' => $this->include_children
132
+ );
133
+ }
134
+
135
+ if ( ! empty( $args['include_category_ids'] ) ) {
136
+
137
+ $include_category_ids_array = explode( ',', $args['include_category_ids'] );
138
+
139
+ $tax_query[] = array(
140
+ 'taxonomy' => EWD_UFAQ_FAQ_CATEGORY_TAXONOMY,
141
+ 'field' => 'term_id',
142
+ 'terms' => $include_category_ids_array,
143
+ 'include_children' => $this->include_children
144
+ );
145
+ }
146
+
147
+ if ( ! empty( $args['exclude_category_ids'] ) ) {
148
+
149
+ $exclude_category_ids_array = explode( ',', $args['exclude_category_ids'] );
150
+
151
+ $tax_query[] = array(
152
+ 'taxonomy' => EWD_UFAQ_FAQ_CATEGORY_TAXONOMY,
153
+ 'field' => 'term_id',
154
+ 'operator' => 'NOT IN',
155
+ 'terms' => $exclude_category_ids_array,
156
+ 'include_children' => $this->include_children
157
+ );
158
+ }
159
+
160
+ if ( ! empty( $args['include_tag'] ) ) {
161
+
162
+ $include_tag_ids_array = explode( ',', $args['include_tag'] );
163
+
164
+ $tax_query[] = array(
165
+ 'taxonomy' => EWD_UFAQ_FAQ_TAG_TAXONOMY,
166
+ 'field' => 'slug',
167
+ 'terms' => $include_tag_ids_array
168
+ );
169
+ }
170
+
171
+ if ( ! empty( $tax_query ) ) { $args['tax_query'] = $tax_query; }
172
+
173
+ /*$meta_query = array();
174
+
175
+ if ( ! empty( $args['product_name'] ) ) {
176
+
177
+ $meta_query[] = array(
178
+ 'key' => 'EWD_UFAQ_Product_Name',
179
+ 'value' => $args['product_name'],
180
+ 'compare' => '=',
181
+ );
182
+ }
183
+
184
+ if ( ! empty( $meta_query ) ) { $args['meta_query'] = $meta_query; }*/
185
+
186
+ $orderby = array();
187
+
188
+ if ( empty( $args['product_name'] ) and $ewd_ufaq_controller->settings->get_setting( 'group-by-product' ) ) {
189
+
190
+ $orderby['meta_value'] = $ewd_ufaq_controller->settings->get_setting( 'group-by-product-order' );
191
+ }
192
+
193
+ if ( ! empty( $args['orderby'] ) ) {
194
+
195
+ if ( $args['orderby'] == 'rating' or $args['orderby'] == 'popular' ) { $orderby['meta_value_num'] = $args['order']; }
196
+ elseif ( $args['orderby'] == 'date' ) { $orderby['date'] = $args['order']; }
197
+ elseif ( $orderby == 'title' ) { $orderby['title'] = $args['order']; }
198
+ }
199
+
200
+ if ( $args['orderby'] == 'rating' ) { $args['meta_key'] = 'FAQ_Total_Score'; }
201
+ elseif ( $args['orderby'] == 'popular' ) { $args['meta_key'] = 'ufaq_view_count'; }
202
+
203
+ if ( ! empty( $orderby ) ) { $args['orderby'] = $orderby; }
204
+
205
+ $this->args = $args;
206
+
207
+ return $this->args;
208
+ }
209
+
210
+ /**
211
+ * Parse $_REQUEST args and store in $this->args
212
+ *
213
+ * @since 1.4.1
214
+ */
215
+ public function parse_request_args() {
216
+
217
+ $args = array();
218
+
219
+ if ( isset( $_REQUEST['faq_page'] ) ) {
220
+
221
+ $args['faq_page'] = intval( $_REQUEST['faq_page'] );
222
+ }
223
+
224
+ if ( isset( $_REQUEST['search_string'] ) ) {
225
+
226
+ $args['search_string'] = sanitize_text_field( stripslashes( $_REQUEST['search_string'] ) );
227
+ }
228
+
229
+ if ( isset( $_REQUEST['post_count'] ) ) {
230
+
231
+ $args['post_count'] = sanitize_text_field( $_REQUEST['post_count'] );
232
+ }
233
+
234
+ if ( isset( $_REQUEST['orderby'] ) ) {
235
+
236
+ $args['orderby'] = sanitize_text_field( $_REQUEST['orderby'] );
237
+ }
238
+
239
+ if ( isset( $_REQUEST['order'] ) ) {
240
+
241
+ $args['order'] = sanitize_text_field( $_REQUEST['order'] );
242
+ }
243
+
244
+ if ( isset( $_REQUEST['include_category'] ) ) {
245
+
246
+ $args['include_category'] = sanitize_text_field( $_REQUEST['include_category'] );
247
+ }
248
+
249
+ if ( isset( $_REQUEST['exclude_category'] ) ) {
250
+
251
+ $args['exclude_category'] = sanitize_text_field( $_REQUEST['exclude_category'] );
252
+ }
253
+
254
+ if ( get_query_var( 'ufaq_category_slug' ) ) {
255
+
256
+ $args['include_category'] = get_query_var( 'ufaq_category_slug' );
257
+ }
258
+
259
+ if ( isset( $_REQUEST['include_tag'] ) ) {
260
+
261
+ $args['include_tag'] = sanitize_text_field( $_REQUEST['include_tag'] );
262
+ }
263
+
264
+ if ( get_query_var( 'ufaq_tag_slug' ) ) {
265
+
266
+ $args['include_tag'] = get_query_var( 'ufaq_tag_slug' );
267
+ }
268
+
269
+ $this->args = array_merge( $this->args, $args );
270
+ }
271
+
272
+ /**
273
+ * Retrieve query results
274
+ *
275
+ * @since 2.0.0
276
+ */
277
+ public function get_faqs() {
278
+
279
+ $faqs = array();
280
+
281
+ $args = apply_filters( 'ewd_ufaq_query_args', $this->args, $this->context );
282
+
283
+ $query = new WP_Query( $args );
284
+
285
+ if ( $query->have_posts() ) {
286
+
287
+ while( $query->have_posts() ) {
288
+ $query->the_post();
289
+
290
+ $faq = new ewdufaqFaq();
291
+ if ( $faq->load_post( $query->post ) ) {
292
+ $faqs[] = $faq;
293
+ }
294
+ }
295
+ }
296
+
297
+ $this->found_faqs = $query->found_posts;
298
+
299
+ $this->current_page = $this->args['paged'];
300
+
301
+ $this->max_page = $query->max_num_pages;
302
+
303
+ $this->faqs = $faqs;
304
+
305
+ wp_reset_query();
306
+
307
+ return $this->faqs;
308
+ }
309
+ }
310
+ } // endif
includes/ReviewAsk.class.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+
4
+ if ( ! class_exists( 'ewdufaqReviewAsk' ) ) {
5
+ /**
6
+ * Class to handle plugin review ask
7
+ *
8
+ * @since 2.0.0
9
+ */
10
+ class ewdufaqReviewAsk {
11
+
12
+ public function __construct() {
13
+
14
+ add_action( 'admin_notices', array( $this, 'maybe_add_review_ask' ) );
15
+
16
+ add_action( 'wp_ajax_ewd_ufaq_hide_review_ask', array( $this, 'hide_review_ask' ) );
17
+ add_action( 'wp_ajax_ewd_ufaq_send_feedback', array( $this, 'send_feedback' ) );
18
+
19
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_review_ask_scripts' ) );
20
+ }
21
+
22
+ public function maybe_add_review_ask() {
23
+
24
+ $ask_review_time = get_option( 'ewd-ufaq-review-ask-time' );
25
+
26
+ $install_time = get_option( 'ewd-ufaq-installation-time' );
27
+ if ( ! $install_time ) { update_option( 'ewd-ufaq-installation-time', time() ); $install_time = time(); }
28
+
29
+ $ask_review_time = $ask_review_time != '' ? $ask_review_time : $install_time + 3600*24*4;
30
+
31
+ if ( $ask_review_time < time() and $install_time != '' and $install_time < time() - 3600*24*4 ) {
32
+
33
+ global $pagenow;
34
+
35
+ if ( $pagenow != 'post.php' && $pagenow != 'post-new.php' ) { ?>
36
+
37
+ <div class='notice notice-info is-dismissible ewd-ufaq-main-dashboard-review-ask' style='display:none'>
38
+ <div class='ewd-ufaq-review-ask-plugin-icon'></div>
39
+ <div class='ewd-ufaq-review-ask-text'>
40
+ <p class='ewd-ufaq-review-ask-starting-text'>Enjoying using the Ultimate FAQs?</p>
41
+ <p class='ewd-ufaq-review-ask-feedback-text ewd-ufaq-hidden'>Help us make the plugin better! Please take a minute to rate the plugin. Thanks!</p>
42
+ <p class='ewd-ufaq-review-ask-review-text ewd-ufaq-hidden'>Please let us know what we could do to make the plugin better!<br /><span>(If you would like a response, please include your email address.)</span></p>
43
+ <p class='ewd-ufaq-review-ask-thank-you-text ewd-ufaq-hidden'>Thank you for taking the time to help us!</p>
44
+ </div>
45
+ <div class='ewd-ufaq-review-ask-actions'>
46
+ <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-not-really ewd-ufaq-review-ask-white'>Not Really</div>
47
+ <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-yes ewd-ufaq-review-ask-green'>Yes!</div>
48
+ <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-no-thanks ewd-ufaq-review-ask-white ewd-ufaq-hidden'>No Thanks</div>
49
+ <a href='https://wordpress.org/support/plugin/ultimate-faqs/reviews/' target='_blank'>
50
+ <div class='ewd-ufaq-review-ask-action ewd-ufaq-review-ask-review ewd-ufaq-review-ask-green ewd-ufaq-hidden'>OK, Sure</div>
51
+ </a>
52
+ </div>
53
+ <div class='ewd-ufaq-review-ask-feedback-form ewd-ufaq-hidden'>
54
+ <div class='ewd-ufaq-review-ask-feedback-explanation'>
55
+ <textarea></textarea>
56
+ <br>
57
+ <input type="email" name="feedback_email_address" placeholder="<?php _e('Email Address', 'ultimate-faqs'); ?>">
58
+ </div>
59
+ <div class='ewd-ufaq-review-ask-send-feedback ewd-ufaq-review-ask-action ewd-ufaq-review-ask-green'>Send Feedback</div>
60
+ </div>
61
+ <div class='ewd-ufaq-clear'></div>
62
+ </div>
63
+
64
+ <?php
65
+ }
66
+ }
67
+ else {
68
+ wp_dequeue_script( 'ewd-ufaq-review-ask-js' );
69
+ wp_dequeue_style( 'ewd-ufaq-review-ask-css' );
70
+ }
71
+ }
72
+
73
+ public function enqueue_review_ask_scripts() {
74
+ wp_enqueue_style( 'ewd-ufaq-review-ask-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/dashboard-review-ask.css' );
75
+ wp_enqueue_script( 'ewd-ufaq-review-ask-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/dashboard-review-ask.js', array( 'jquery' ), EWD_UFAQ_VERSION, true );
76
+ }
77
+
78
+ public function hide_review_ask() {
79
+
80
+ $ask_review_time = sanitize_text_field($_POST['ask_review_time']);
81
+
82
+ if ( get_option( 'ewd-ufaq-review-ask-time' ) < time() + 3600*24 * $ask_review_time ) {
83
+ update_option( 'ewd-ufaq-review-ask-time', time() + 3600*24 * $ask_review_time );
84
+ }
85
+
86
+ die();
87
+ }
88
+
89
+ public function send_feedback() {
90
+ $headers = 'Content-type: text/html;charset=utf-8' . "\r\n";
91
+ $feedback = sanitize_text_field($_POST['feedback']);
92
+ $feedback .= '<br /><br />Email Address: ';
93
+ $feedback .= sanitize_text_field($_POST['email_address']);
94
+
95
+ wp_mail('contact@etoilewebdesign.com', 'UFAQ Feedback - Dashboard Form', $feedback, $headers);
96
+
97
+ die();
98
+ }
99
+ }
100
+
101
+ }
includes/Settings.class.php ADDED
@@ -0,0 +1,1964 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+
4
+ if ( ! class_exists( 'ewdufaqSettings' ) ) {
5
+ /**
6
+ * Class to handle configurable settings for Ultimate FAQs
7
+ * @since 2.0.0
8
+ */
9
+ class ewdufaqSettings {
10
+
11
+ /**
12
+ * Default values for settings
13
+ * @since 2.0.0
14
+ */
15
+ public $defaults = array();
16
+
17
+ /**
18
+ * Stored values for settings
19
+ * @since 2.0.0
20
+ */
21
+ public $settings = array();
22
+
23
+ public function __construct() {
24
+
25
+ add_action( 'init', array( $this, 'set_defaults' ) );
26
+
27
+ add_action( 'init', array( $this, 'load_settings_panel' ) );
28
+ }
29
+
30
+ /**
31
+ * Load the plugin's default settings
32
+ * @since 2.0.0
33
+ */
34
+ public function set_defaults() {
35
+
36
+ $this->defaults = array(
37
+
38
+ 'include-permalink' => 'none',
39
+ 'permalink-type' => 'same_page',
40
+ 'access-role' => 'manage_options',
41
+
42
+ 'display-style' => 'default',
43
+ 'number-of-columns' => 'one',
44
+ 'faqs-per-page' => 100000,
45
+ 'page-type' => 'distinct',
46
+ 'wpforms-faq-location' => 'above',
47
+
48
+ 'category-order' => 'asc',
49
+ 'faq-order-by' => 'title',
50
+ 'faq-order' => 'asc',
51
+
52
+ 'faq-fields' => array(),
53
+
54
+ 'styling-toggle-symbol' => 'A',
55
+ 'styling-category-heading-type' => 'h3',
56
+ 'styling-faq-heading-type' => 'h4',
57
+
58
+ 'faq-elements-order' => json_encode(
59
+ array(
60
+ 'categories' => 'Categories',
61
+ 'body' => 'Body',
62
+ 'author_date' => 'Author/Date',
63
+ 'custom_fields' => 'Custom Fields',
64
+ 'tags' => 'Tags',
65
+ 'ratings' => 'Ratings',
66
+ 'social_media' => 'Social Media',
67
+ 'permalink' => 'Permalink',
68
+ 'comments' => 'Comments',
69
+ 'back_to_top' => 'Back to Top',
70
+ )
71
+ ),
72
+
73
+ 'label-retrieving-results' => __( 'Retrieving Results', 'ultimate-faqs' ),
74
+ 'label-no-results-found' => __( 'No result FAQ\'s contained the term \'%s\'', 'ultimate-faqs' ),
75
+ 'label-woocommerce-tab' => __( 'FAQs', 'ultimate-faqs' ),
76
+ 'label-thank-you-submit' => __( 'Thank you for submitting an FAQ.', 'ultimate-faqs' ),
77
+ );
78
+
79
+ $this->defaults = apply_filters( 'ewd_ufaq_defaults', $this->defaults );
80
+ }
81
+
82
+ /**
83
+ * Get a setting's value or fallback to a default if one exists
84
+ * @since 2.0.0
85
+ */
86
+ public function get_setting( $setting ) {
87
+
88
+ if ( empty( $this->settings ) ) {
89
+ $this->settings = get_option( 'ewd-ufaq-settings' );
90
+ }
91
+
92
+ if ( ! empty( $this->settings[ $setting ] ) ) {
93
+ return apply_filters( 'ewd-ufaq-settings-' . $setting, $this->settings[ $setting ] );
94
+ }
95
+
96
+ if ( ! empty( $this->defaults[ $setting ] ) ) {
97
+ return apply_filters( 'ewd-ufaq-settings-' . $setting, $this->defaults[ $setting ] );
98
+ }
99
+
100
+ return apply_filters( 'ewd-ufaq-settings-' . $setting, null );
101
+ }
102
+
103
+ /**
104
+ * Set a setting to a particular value
105
+ * @since 2.0.0
106
+ */
107
+ public function set_setting( $setting, $value ) {
108
+
109
+ $this->settings[ $setting ] = $value;
110
+ }
111
+
112
+ /**
113
+ * Save all settings, to be used with set_setting
114
+ * @since 2.0.0
115
+ */
116
+ public function save_settings() {
117
+
118
+ update_option( 'ewd-ufaq-settings', $this->settings );
119
+ }
120
+
121
+ /**
122
+ * Load the admin settings page
123
+ * @since 2.0.0
124
+ * @sa https://github.com/NateWr/simple-admin-pages
125
+ */
126
+ public function load_settings_panel() {
127
+
128
+ global $ewd_ufaq_controller;
129
+
130
+ require_once( EWD_UFAQ_PLUGIN_DIR . '/lib/simple-admin-pages/simple-admin-pages.php' );
131
+ $sap = sap_initialize_library(
132
+ $args = array(
133
+ 'version' => '2.5.0',
134
+ 'lib_url' => EWD_UFAQ_PLUGIN_URL . '/lib/simple-admin-pages/',
135
+ )
136
+ );
137
+
138
+ $sap->add_page(
139
+ 'submenu',
140
+ array(
141
+ 'id' => 'ewd-ufaq-settings',
142
+ 'title' => __( 'Settings', 'ultimate-faqs' ),
143
+ 'menu_title' => __( 'Settings', 'ultimate-faqs' ),
144
+ 'parent_menu' => 'edit.php?post_type=ufaq',
145
+ 'description' => '',
146
+ 'capability' => $this->get_setting( 'access-role' ),
147
+ 'default_tab' => 'ewd-ufaq-basic-tab',
148
+ )
149
+ );
150
+
151
+ $sap->add_section(
152
+ 'ewd-ufaq-settings',
153
+ array(
154
+ 'id' => 'ewd-ufaq-basic-tab',
155
+ 'title' => __( 'Basic', 'ultimate-faqs' ),
156
+ 'is_tab' => true,
157
+ )
158
+ );
159
+
160
+ $sap->add_section(
161
+ 'ewd-ufaq-settings',
162
+ array(
163
+ 'id' => 'ewd-ufaq-general',
164
+ 'title' => __( 'General', 'ultimate-faqs' ),
165
+ 'tab' => 'ewd-ufaq-basic-tab',
166
+ )
167
+ );
168
+
169
+ $sap->add_setting(
170
+ 'ewd-ufaq-settings',
171
+ 'ewd-ufaq-general',
172
+ 'warningtip',
173
+ array(
174
+ 'id' => 'shortcodes-reminder',
175
+ 'title' => __( 'REMINDER:', 'ultimate-faqs' ),
176
+ 'placeholder' => __( 'To display FAQs, place the [ultimate-faqs] shortcode on a page' )
177
+ )
178
+ );
179
+
180
+ $sap->add_setting(
181
+ 'ewd-ufaq-settings',
182
+ 'ewd-ufaq-general',
183
+ 'textarea',
184
+ array(
185
+ 'id' => 'custom-css',
186
+ 'title' => __( 'Custom CSS', 'ultimate-faqs' ),
187
+ 'description' => __( 'You can add custom CSS styles to your FAQs in the box above.', 'ultimate-faqs' ), )
188
+ );
189
+
190
+ $sap->add_setting(
191
+ 'ewd-ufaq-settings',
192
+ 'ewd-ufaq-general',
193
+ 'toggle',
194
+ array(
195
+ 'id' => 'scroll-to-top',
196
+ 'title' => __( 'Scroll To Top', 'ultimate-faqs' ),
197
+ 'description' => __( 'Should the browser scroll to the top of the FAQ when it\'s opened?', 'ultimate-faqs' )
198
+ )
199
+ );
200
+
201
+ $sap->add_setting(
202
+ 'ewd-ufaq-settings',
203
+ 'ewd-ufaq-general',
204
+ 'toggle',
205
+ array(
206
+ 'id' => 'comments-on',
207
+ 'title' => __( 'Turn On Comment Support', 'ultimate-faqs' ),
208
+ 'description' => __( 'Should comment support be turned on, so that if the "Allow Comments" checkbox is selected for a given FAQ, comments are shown in the FAQ list?', 'ultimate-faqs' )
209
+ )
210
+ );
211
+
212
+ $sap->add_setting(
213
+ 'ewd-ufaq-settings',
214
+ 'ewd-ufaq-general',
215
+ 'toggle',
216
+ array(
217
+ 'id' => 'disable-microdata',
218
+ 'title' => __( 'Disable Microdata', 'ultimate-faqs' ),
219
+ 'description' => __( 'By default, the plugin adds FAQ page scheme when the shortcode is used. Select this option to disable this behaviour.', 'ultimate-faqs' )
220
+ )
221
+ );
222
+
223
+ $sap->add_setting(
224
+ 'ewd-ufaq-settings',
225
+ 'ewd-ufaq-general',
226
+ 'radio',
227
+ array(
228
+ 'id' => 'include-permalink',
229
+ 'title' => __( 'Include Permalink', 'ultimate-faqs' ),
230
+ 'description' => __( 'Display permalink to each question? If so, text, icon or both?', 'ultimate-faqs' ),
231
+ 'options' => array(
232
+ 'none' => __( 'None', 'ultimate-faqs' ),
233
+ 'text' => __( 'Text', 'ultimate-faqs' ),
234
+ 'icon' => __( 'Icon', 'ultimate-faqs' ),
235
+ 'both' => __( 'Both', 'ultimate-faqs' ),
236
+ ),
237
+ 'default' => $this->defaults['include-permalink']
238
+ )
239
+ );
240
+
241
+ $sap->add_setting(
242
+ 'ewd-ufaq-settings',
243
+ 'ewd-ufaq-general',
244
+ 'radio',
245
+ array(
246
+ 'id' => 'permalink-type',
247
+ 'title' => __( 'Permalink Destination', 'ultimate-faqs' ),
248
+ 'description' => __( 'Should the permalink link to the main FAQ page or the individual FAQ page?', 'ultimate-faqs' ),
249
+ 'options' => array(
250
+ 'same_page' => __( 'Main FAQ Page', 'ultimate-faqs' ),
251
+ 'individual_page' => __( 'Individual FAQ Page', 'ultimate-faqs' ),
252
+ ),
253
+ 'default' => $this->defaults['permalink-type']
254
+ )
255
+ );
256
+
257
+ $sap->add_setting(
258
+ 'ewd-ufaq-settings',
259
+ 'ewd-ufaq-general',
260
+ 'select',
261
+ array(
262
+ 'id' => 'access-role',
263
+ 'title' => __( 'Set Access Role', 'ultimate-faqs' ),
264
+ 'description' => __( 'Which level of user should have access to FAQs, Settings, etc.?.', 'ultimate-faqs' ),
265
+ 'blank_option' => false,
266
+ 'options' => array(
267
+ 'administrator' => __( 'Administrator', 'ultimate-faqs' ),
268
+ 'delete_others_pages' => __( 'Editor', 'ultimate-faqs' ),
269
+ 'delete_published_posts' => __( 'Author', 'ultimate-faqs' ),
270
+ 'delete_posts' => __( 'Contributor', 'ultimate-faqs' ),
271
+ )
272
+ )
273
+ );
274
+
275
+ $sap->add_section(
276
+ 'ewd-ufaq-settings',
277
+ array(
278
+ 'id' => 'ewd-ufaq-functionality',
279
+ 'title' => __( 'Functionality', 'ultimate-faqs' ),
280
+ 'tab' => 'ewd-ufaq-basic-tab',
281
+ )
282
+ );
283
+
284
+ $sap->add_setting(
285
+ 'ewd-ufaq-settings',
286
+ 'ewd-ufaq-functionality',
287
+ 'toggle',
288
+ array(
289
+ 'id' => 'disable-faq-toggle',
290
+ 'title' => __( 'Disable FAQ Toggle', 'ultimate-faqs' ),
291
+ 'description' => __( 'Should the FAQs open on a separate page when clicked, instead of opening and closing?', 'ultimate-faqs' )
292
+ )
293
+ );
294
+
295
+ $sap->add_setting(
296
+ 'ewd-ufaq-settings',
297
+ 'ewd-ufaq-functionality',
298
+ 'toggle',
299
+ array(
300
+ 'id' => 'faq-accordion',
301
+ 'title' => __( 'FAQ Accordion', 'ultimate-faqs' ),
302
+ 'description' => __( 'Should the FAQs accordion? (Only one FAQ is open at a time, requires FAQ Toggle)', 'ultimate-faqs' )
303
+ )
304
+ );
305
+
306
+ $sap->add_setting(
307
+ 'ewd-ufaq-settings',
308
+ 'ewd-ufaq-functionality',
309
+ 'toggle',
310
+ array(
311
+ 'id' => 'faq-category-toggle',
312
+ 'title' => __( 'FAQ Category Toggle', 'ultimate-faqs' ),
313
+ 'description' => __( 'Should the FAQ categories hide/open when they are clicked, if FAQs are being grouped by category ("Group FAQs by Category" in the "Ordering" area)?', 'ultimate-faqs' )
314
+ )
315
+ );
316
+
317
+ $sap->add_setting(
318
+ 'ewd-ufaq-settings',
319
+ 'ewd-ufaq-functionality',
320
+ 'toggle',
321
+ array(
322
+ 'id' => 'faq-category-accordion',
323
+ 'title' => __( 'FAQ Category Accordion', 'ultimate-faqs' ),
324
+ 'description' => __( 'Should it only be possible to open one FAQ category at a time, if FAQ categories are being toggled ("FAQ Category Toggle" must be enabled above)?', 'ultimate-faqs' )
325
+ )
326
+ );
327
+
328
+ $sap->add_setting(
329
+ 'ewd-ufaq-settings',
330
+ 'ewd-ufaq-functionality',
331
+ 'toggle',
332
+ array(
333
+ 'id' => 'expand-collapse-all',
334
+ 'title' => __( 'FAQ Expand/Collapse All', 'ultimate-faqs' ),
335
+ 'description' => __( 'Should there be a control to open and close all FAQs simultaneously?', 'ultimate-faqs' )
336
+ )
337
+ );
338
+
339
+ $sap->add_section(
340
+ 'ewd-ufaq-settings',
341
+ array(
342
+ 'id' => 'ewd-ufaq-display',
343
+ 'title' => __( 'Display', 'ultimate-faqs' ),
344
+ 'tab' => 'ewd-ufaq-basic-tab',
345
+ )
346
+ );
347
+
348
+ $sap->add_setting(
349
+ 'ewd-ufaq-settings',
350
+ 'ewd-ufaq-display',
351
+ 'toggle',
352
+ array(
353
+ 'id' => 'hide-categories',
354
+ 'title' => __( 'Hide Categories', 'ultimate-faqs' ),
355
+ 'description' => __( 'Should the categories for each FAQ be hidden?', 'ultimate-faqs' )
356
+ )
357
+ );
358
+
359
+ $sap->add_setting(
360
+ 'ewd-ufaq-settings',
361
+ 'ewd-ufaq-display',
362
+ 'toggle',
363
+ array(
364
+ 'id' => 'hide-tags',
365
+ 'title' => __( 'Hide Tags', 'ultimate-faqs' ),
366
+ 'description' => __( 'Should the tags for each FAQ be hidden?', 'ultimate-faqs' )
367
+ )
368
+ );
369
+
370
+ $sap->add_setting(
371
+ 'ewd-ufaq-settings',
372
+ 'ewd-ufaq-display',
373
+ 'toggle',
374
+ array(
375
+ 'id' => 'display-all-answers',
376
+ 'title' => __( 'Display All Answers', 'ultimate-faqs' ),
377
+ 'description' => __( 'Should all answers be displayed when the page loads? (Careful if FAQ Accordion is on)', 'ultimate-faqs' )
378
+ )
379
+ );
380
+
381
+ $sap->add_setting(
382
+ 'ewd-ufaq-settings',
383
+ 'ewd-ufaq-display',
384
+ 'toggle',
385
+ array(
386
+ 'id' => 'display-author',
387
+ 'title' => __( 'Display Post Author', 'ultimate-faqs' ),
388
+ 'description' => __( 'Should the display name of the post\'s author be displayed beneath the FAQ title?', 'ultimate-faqs' )
389
+ )
390
+ );
391
+
392
+ $sap->add_setting(
393
+ 'ewd-ufaq-settings',
394
+ 'ewd-ufaq-display',
395
+ 'toggle',
396
+ array(
397
+ 'id' => 'display-date',
398
+ 'title' => __( 'Display Post Date', 'ultimate-faqs' ),
399
+ 'description' => __( 'Should the date the post was created be displayed beneath the FAQ title?', 'ultimate-faqs' )
400
+ )
401
+ );
402
+
403
+ $sap->add_setting(
404
+ 'ewd-ufaq-settings',
405
+ 'ewd-ufaq-display',
406
+ 'toggle',
407
+ array(
408
+ 'id' => 'display-back-to-top',
409
+ 'title' => __( 'Display \'Back to Top\'', 'ultimate-faqs' ),
410
+ 'description' => __( 'Should a link to return to the top of the page be added to each FAQ post?', 'ultimate-faqs' )
411
+ )
412
+ );
413
+
414
+ if ( ! $ewd_ufaq_controller->permissions->check_permission( 'premium' ) ) {
415
+ $ewd_ufaq_premium_permissions = array(
416
+ 'disabled' => true,
417
+ 'disabled_image'=> '#',
418
+ 'purchase_link' => 'https://www.etoilewebdesign.com/plugins/ultimate-faq/'
419
+ );
420
+ }
421
+ else { $ewd_ufaq_premium_permissions = array(); }
422
+
423
+ $sap->add_section(
424
+ 'ewd-ufaq-settings',
425
+ array(
426
+ 'id' => 'ewd-ufaq-premium-tab',
427
+ 'title' => __( 'Premium', 'ultimate-faqs' ),
428
+ 'is_tab' => true,
429
+ )
430
+ );
431
+
432
+ $sap->add_section(
433
+ 'ewd-ufaq-settings',
434
+ array_merge(
435
+ array(
436
+ 'id' => 'ewd-ufaq-premium-display',
437
+ 'title' => __( 'Display', 'ultimate-faqs' ),
438
+ 'tab' => 'ewd-ufaq-premium-tab',
439
+ ),
440
+ $ewd_ufaq_premium_permissions
441
+ )
442
+ );
443
+
444
+ $sap->add_setting(
445
+ 'ewd-ufaq-settings',
446
+ 'ewd-ufaq-premium-display',
447
+ 'radio',
448
+ array(
449
+ 'id' => 'display-style',
450
+ 'title' => __( 'FAQ Display Style', 'ultimate-faqs' ),
451
+ 'description' => __( 'Which theme should be used to display the FAQ\'s?', 'ultimate-faqs' ),
452
+ 'options' => array(
453
+ 'default' => __( 'Default', 'ultimate-faqs' ),
454
+ 'block' => __( 'Block', 'ultimate-faqs' ),
455
+ 'border_block' => __( 'Border Block', 'ultimate-faqs' ),
456
+ 'contemporary' => __( 'Contemporary', 'ultimate-faqs' ),
457
+ 'list' => __( 'List', 'ultimate-faqs' ),
458
+ 'minimalist' => __( 'Minimalist', 'ultimate-faqs' ),
459
+ ),
460
+ 'default' => $this->defaults['display-style']
461
+ )
462
+ );
463
+
464
+ $sap->add_setting(
465
+ 'ewd-ufaq-settings',
466
+ 'ewd-ufaq-premium-display',
467
+ 'radio',
468
+ array(
469
+ 'id' => 'number-of-columns',
470
+ 'title' => __( 'Number of Columns', 'ultimate-faqs' ),
471
+ 'description' => __( 'In how many columns would you like your FAQs displayed?', 'ultimate-faqs' ),
472
+ 'options' => array(
473
+ 'one' => __( 'One', 'ultimate-faqs' ),
474
+ 'two' => __( 'Two', 'ultimate-faqs' ),
475
+ 'three' => __( 'Three', 'ultimate-faqs' ),
476
+ 'four' => __( 'Four', 'ultimate-faqs' ),
477
+ ),
478
+ 'default' => $this->defaults['number-of-columns']
479
+ )
480
+ );
481
+
482
+ $sap->add_setting(
483
+ 'ewd-ufaq-settings',
484
+ 'ewd-ufaq-premium-display',
485
+ 'toggle',
486
+ array(
487
+ 'id' => 'responsive-columns',
488
+ 'title' => __( 'Responsive Columns', 'ultimate-faqs' ),
489
+ 'description' => __( 'If you have more than one column, would you like them to be responsive? If this option is disabled, the number of columns will remain the same on all screen sizes.', 'ultimate-faqs' )
490
+ )
491
+ );
492
+
493
+ $sap->add_setting(
494
+ 'ewd-ufaq-settings',
495
+ 'ewd-ufaq-premium-display',
496
+ 'select',
497
+ array(
498
+ 'id' => 'reveal-effect',
499
+ 'title' => __( 'Reveal Effect', 'ultimate-faqs' ),
500
+ 'description' => __( 'How should FAQ\'s be displayed when their titles are clicked?', 'ultimate-faqs' ),
501
+ 'blank_option' => false,
502
+ 'options' => array(
503
+ 'none' => __( 'None', 'ultimate-faqs' ),
504
+ 'blind' => __( 'Blind', 'ultimate-faqs' ),
505
+ 'bounce' => __( 'Bounce', 'ultimate-faqs' ),
506
+ 'clip' => __( 'Clip', 'ultimate-faqs' ),
507
+ 'drop' => __( 'Drop', 'ultimate-faqs' ),
508
+ 'explode' => __( 'Explode', 'ultimate-faqs' ),
509
+ 'fade' => __( 'Fade', 'ultimate-faqs' ),
510
+ 'fold' => __( 'Fold', 'ultimate-faqs' ),
511
+ 'highlight' => __( 'Highlight', 'ultimate-faqs' ),
512
+ 'puff' => __( 'Puff', 'ultimate-faqs' ),
513
+ 'pulsate' => __( 'Pulsate', 'ultimate-faqs' ),
514
+ 'shake' => __( 'Shake', 'ultimate-faqs' ),
515
+ 'size' => __( 'Size', 'ultimate-faqs' ),
516
+ 'slide' => __( 'Slide', 'ultimate-faqs' ),
517
+ )
518
+ )
519
+ );
520
+
521
+ $sap->add_setting(
522
+ 'ewd-ufaq-settings',
523
+ 'ewd-ufaq-premium-display',
524
+ 'text',
525
+ array(
526
+ 'id' => 'faqs-per-page',
527
+ 'title' => __( 'FAQs Per Page', 'ultimate-faqs' ),
528
+ 'description' => __( 'How many FAQs should be displayed on each page? (Leave blank to display all FAQs)', 'ultimate-faqs' ),
529
+ 'small' => true
530
+ )
531
+ );
532
+
533
+ $sap->add_setting(
534
+ 'ewd-ufaq-settings',
535
+ 'ewd-ufaq-premium-display',
536
+ 'radio',
537
+ array(
538
+ 'id' => 'page-type',
539
+ 'title' => __( 'FAQ Page Type', 'ultimate-faqs' ),
540
+ 'description' => __( 'If FAQs are in pages, how should pages load?', 'ultimate-faqs' ),
541
+ 'options' => array(
542
+ 'distinct' => __( 'Distinct Pages', 'ultimate-faqs' ),
543
+ 'load_more' => __( 'Load More Button', 'ultimate-faqs' ),
544
+ 'infinite_scroll' => __( 'Infinite Scroll', 'ultimate-faqs' )
545
+ ),
546
+ 'default' => $this->defaults['page-type']
547
+ )
548
+ );
549
+
550
+ $sap->add_section(
551
+ 'ewd-ufaq-settings',
552
+ array_merge(
553
+ array(
554
+ 'id' => 'ewd-ufaq-premium-general',
555
+ 'title' => __( 'General', 'ultimate-faqs' ),
556
+ 'tab' => 'ewd-ufaq-premium-tab',
557
+ ),
558
+ $ewd_ufaq_premium_permissions
559
+ )
560
+ );
561
+
562
+ $sap->add_setting(
563
+ 'ewd-ufaq-settings',
564
+ 'ewd-ufaq-premium-general',
565
+ 'toggle',
566
+ array(
567
+ 'id' => 'faq-ratings',
568
+ 'title' => __( 'FAQ Ratings', 'ultimate-faqs' ),
569
+ 'description' => __( 'Should visitors be able to up or down vote FAQs to let others know if they found them helpful?', 'ultimate-faqs' )
570
+ )
571
+ );
572
+
573
+ $sap->add_setting(
574
+ 'ewd-ufaq-settings',
575
+ 'ewd-ufaq-premium-general',
576
+ 'file-upload',
577
+ array(
578
+ 'id' => 'thumbs-up-image',
579
+ 'title' => __( 'FAQ Ratings \'Thumbs Up\' Image', 'ultimate-faqs' ),
580
+ 'description' => __( 'You can use this to upload your own image to replace the default "thumbs up" image.', 'ultimate-faqs' )
581
+ )
582
+ );
583
+
584
+ $sap->add_setting(
585
+ 'ewd-ufaq-settings',
586
+ 'ewd-ufaq-premium-general',
587
+ 'file-upload',
588
+ array(
589
+ 'id' => 'thumbs-down-image',
590
+ 'title' => __( 'FAQ Ratings \'Thumbs Down\' Image', 'ultimate-faqs' ),
591
+ 'description' => __( 'You can use this to upload your own image to replace the default "thumbs down" image.', 'ultimate-faqs' )
592
+ )
593
+ );
594
+
595
+ $sap->add_setting(
596
+ 'ewd-ufaq-settings',
597
+ 'ewd-ufaq-premium-general',
598
+ 'toggle',
599
+ array(
600
+ 'id' => 'pretty-permalinks',
601
+ 'title' => __( 'Pretty Permalinks', 'ultimate-faqs' ),
602
+ 'description' => __( 'Should an SEO friendly permalink structure be used for the link to the FAQ?', 'ultimate-faqs' )
603
+ )
604
+ );
605
+
606
+ $sap->add_setting(
607
+ 'ewd-ufaq-settings',
608
+ 'ewd-ufaq-premium-general',
609
+ 'toggle',
610
+ array(
611
+ 'id' => 'auto-complete-titles',
612
+ 'title' => __( 'FAQ Auto Complete Titles', 'ultimate-faqs' ),
613
+ 'description' => __( 'Should the FAQ Titles auto complete when using the FAQ search shortcode?', 'ultimate-faqs' )
614
+ )
615
+ );
616
+
617
+ $sap->add_setting(
618
+ 'ewd-ufaq-settings',
619
+ 'ewd-ufaq-premium-general',
620
+ 'text',
621
+ array(
622
+ 'id' => 'slug-base',
623
+ 'title' => __( 'FAQ Slug Base', 'ultimate-faqs' ),
624
+ 'description' => __( 'This option can be used to change the slug base for all FAQ posts. Be sure to go to "Settings" -> "Permalinks" in the WordPress sidebar and hit "Save Changes" to avoid 404 errors.', 'ultimate-faqs' ),
625
+ 'small' => true
626
+ )
627
+ );
628
+
629
+ $sap->add_setting(
630
+ 'ewd-ufaq-settings',
631
+ 'ewd-ufaq-premium-general',
632
+ 'checkbox',
633
+ array(
634
+ 'id' => 'social-media',
635
+ 'title' => __( 'Social Media Options', 'ultimate-faqs' ),
636
+ 'description' => '',
637
+ 'options' => array(
638
+ 'facebook' => 'Facebook',
639
+ 'twitter' => 'Twitter',
640
+ 'linkedin' => 'LinkedIn',
641
+ 'pinterest' => 'Pinterest',
642
+ 'email' => 'Email',
643
+ )
644
+ )
645
+ );
646
+
647
+ $sap->add_section(
648
+ 'ewd-ufaq-settings',
649
+ array_merge(
650
+ array(
651
+ 'id' => 'ewd-ufaq-woocommerce',
652
+ 'title' => __( 'WooCommerce', 'ultimate-faqs' ),
653
+ 'tab' => 'ewd-ufaq-premium-tab',
654
+ ),
655
+ $ewd_ufaq_premium_permissions
656
+ )
657
+ );
658
+
659
+ $sap->add_setting(
660
+ 'ewd-ufaq-settings',
661
+ 'ewd-ufaq-woocommerce',
662
+ 'toggle',
663
+ array(
664
+ 'id' => 'woocommerce-faqs',
665
+ 'title' => __( 'WooCommerce FAQs', 'ultimate-faqs' ),
666
+ 'description' => __( 'Should FAQs for a given product be displayed as an extra tab on the WooCommerce product page? For this to work correctly, an FAQ category needs to be created with the same name as a given WooCommerce product.', 'ultimate-faqs' )
667
+ )
668
+ );
669
+
670
+ $sap->add_setting(
671
+ 'ewd-ufaq-settings',
672
+ 'ewd-ufaq-woocommerce',
673
+ 'toggle',
674
+ array(
675
+ 'id' => 'woocommerce-use-product',
676
+ 'title' => __( 'Use WooCommerce Product Object', 'ultimate-faqs' ),
677
+ 'description' => __( 'Should the FAQ tab be set up using the WooCommerce product object, as in the WC documentation, or just using the ID of the page?', 'ultimate-faqs' )
678
+ )
679
+ );
680
+
681
+ $sap->add_section(
682
+ 'ewd-ufaq-settings',
683
+ array_merge(
684
+ array(
685
+ 'id' => 'ewd-ufaq-wpforms-integration',
686
+ 'title' => __( 'WP Forms', 'ultimate-faqs' ),
687
+ 'tab' => 'ewd-ufaq-premium-tab',
688
+ ),
689
+ $ewd_ufaq_premium_permissions
690
+ )
691
+ );
692
+
693
+ $sap->add_setting(
694
+ 'ewd-ufaq-settings',
695
+ 'ewd-ufaq-wpforms-integration',
696
+ 'toggle',
697
+ array(
698
+ 'id' => 'wpforms-integration',
699
+ 'title' => __( 'WP Forms Integration', 'ultimate-faqs' ),
700
+ 'description' => __( 'Should FAQs be displayed when a visitor starts typing a message into a paragraph text field in WP Forms? This can be turned off for specific forms via the form\'s settings panel.', 'ultimate-faqs' )
701
+ )
702
+ );
703
+
704
+ $sap->add_setting(
705
+ 'ewd-ufaq-settings',
706
+ 'ewd-ufaq-wpforms-integration',
707
+ 'text',
708
+ array(
709
+ 'id' => 'wpforms-post-count',
710
+ 'title' => __( 'WP Forms Post Count', 'ultimate-faqs' ),
711
+ 'description' => __( 'How many posts should be displayed below paragraph text fields, if WP Forms Integration has been turned on?', 'ultimate-faqs' ),
712
+ 'small' => true
713
+ )
714
+ );
715
+
716
+ $sap->add_setting(
717
+ 'ewd-ufaq-settings',
718
+ 'ewd-ufaq-wpforms-integration',
719
+ 'radio',
720
+ array(
721
+ 'id' => 'wpforms-faq-location',
722
+ 'title' => __( 'WP Forms FAQ Location', 'ultimate-faqs' ),
723
+ 'description' => __( 'If WP Forms Integration has been turned on, where should the FAQs be displayed?', 'ultimate-faqs' ),
724
+ 'options' => array(
725
+ 'above' => __( 'Above', 'ultimate-faqs' ),
726
+ 'below' => __( 'Below', 'ultimate-faqs' ),
727
+ ),
728
+ 'default' => $this->defaults['wpforms-faq-location']
729
+ )
730
+ );
731
+
732
+ $sap->add_section(
733
+ 'ewd-ufaq-settings',
734
+ array_merge(
735
+ array(
736
+ 'id' => 'ewd-ufaq-submit-faq',
737
+ 'title' => __( 'Submit FAQ', 'ultimate-faqs' ),
738
+ 'tab' => 'ewd-ufaq-premium-tab',
739
+ ),
740
+ $ewd_ufaq_premium_permissions
741
+ )
742
+ );
743
+
744
+ $sap->add_setting(
745
+ 'ewd-ufaq-settings',
746
+ 'ewd-ufaq-submit-faq',
747
+ 'toggle',
748
+ array(
749
+ 'id' => 'allow-proposed-answer',
750
+ 'title' => __( 'Allow Proposed Answer', 'ultimate-faqs' ),
751
+ 'description' => __( 'When using the user-submitted question shortcode, should users be able to propose an answer to the question they\'re submitting?', 'ultimate-faqs' )
752
+ )
753
+ );
754
+
755
+ $sap->add_setting(
756
+ 'ewd-ufaq-settings',
757
+ 'ewd-ufaq-submit-faq',
758
+ 'toggle',
759
+ array(
760
+ 'id' => 'submit-custom-fields',
761
+ 'title' => __( 'Submit Custom Fields', 'ultimate-faqs' ),
762
+ 'description' => __( 'When using the user-submitted question shortcode, should users be able to fill in custom fields for the question they\'re submitting? File type custom fields cannot be submitted for security reasons.', 'ultimate-faqs' )
763
+ )
764
+ );
765
+
766
+ $sap->add_setting(
767
+ 'ewd-ufaq-settings',
768
+ 'ewd-ufaq-submit-faq',
769
+ 'toggle',
770
+ array(
771
+ 'id' => 'submit-question-captcha',
772
+ 'title' => __( 'Submit Question Captcha', 'ultimate-faqs' ),
773
+ 'description' => __( 'When using the user-submitted question shortcode, should a captcha field be added to the form to reduce the volume of spam FAQs?', 'ultimate-faqs' )
774
+ )
775
+ );
776
+
777
+ $args = array(
778
+ 'hide_empty' => false,
779
+ 'taxonomy' => EWD_UFAQ_FAQ_CATEGORY_TAXONOMY
780
+ );
781
+
782
+ $categories = get_terms( $args );
783
+
784
+ $category_options = array();
785
+
786
+ foreach ( $categories as $category ) {
787
+
788
+ $category_options[ $category->slug ] = $category->name;
789
+ }
790
+
791
+ $sap->add_setting(
792
+ 'ewd-ufaq-settings',
793
+ 'ewd-ufaq-submit-faq',
794
+ 'select',
795
+ array(
796
+ 'id' => 'submitted-default-category',
797
+ 'title' => __( 'Default Category', 'ultimate-faqs' ),
798
+ 'description' => __( 'Which category should submitted questions default to?', 'ultimate-faqs' ),
799
+ 'blank_option' => true,
800
+ 'options' => $category_options
801
+ )
802
+ );
803
+
804
+ $sap->add_setting(
805
+ 'ewd-ufaq-settings',
806
+ 'ewd-ufaq-submit-faq',
807
+ 'toggle',
808
+ array(
809
+ 'id' => 'admin-question-notification',
810
+ 'title' => __( 'Admin Question Notification', 'ultimate-faqs' ),
811
+ 'description' => __( 'Should an email be sent to the site administrator when a question is submitted?', 'ultimate-faqs' )
812
+ )
813
+ );
814
+
815
+ $sap->add_setting(
816
+ 'ewd-ufaq-settings',
817
+ 'ewd-ufaq-submit-faq',
818
+ 'text',
819
+ array(
820
+ 'id' => 'admin-notification-email',
821
+ 'title' => __( 'Admin Notification Email', 'ultimate-faqs' ),
822
+ 'description' => __( 'What email address should the notifications be sent to if "Admin Question Notification" is enabled above? If blank, the default WordPress admin email will be used.', 'ultimate-faqs' ),
823
+ 'small' => true
824
+ )
825
+ );
826
+
827
+ $emails = array();
828
+ if ( is_plugin_active( 'ultimate-wp-mail/Main.php' ) ) {
829
+
830
+ $email_posts = get_posts( array( 'post_type' => 'uwpm_mail_template', 'posts_per_page' => -1 ) );
831
+ foreach ( $email_posts as $email_post ) { $emails[$email_post->ID ] = $email_post->post_title; }
832
+ }
833
+
834
+ $sap->add_setting(
835
+ 'ewd-ufaq-settings',
836
+ 'ewd-ufaq-submit-faq',
837
+ 'select',
838
+ array(
839
+ 'id' => 'submit-faq-email',
840
+ 'title' => __( 'FAQ Submitted Thank You E-mail', 'ultimate-faqs' ),
841
+ 'description' => __( 'You can use the <a href="https://wordpress.org/plugins/ultimate-wp-mail/">Ultimate WP Mail plugin</a> to create a custom email that is sent whenever an faq is submitted.', 'ultimate-faqs' ),
842
+ 'blank_option' => true,
843
+ 'options' => $emails
844
+ )
845
+ );
846
+
847
+ $sap->add_section(
848
+ 'ewd-ufaq-settings',
849
+ array_merge(
850
+ array(
851
+ 'id' => 'ewd-ufaq-faq-elements-order',
852
+ 'title' => __( 'FAQ Elements Order', 'ultimate-faqs' ),
853
+ 'tab' => 'ewd-ufaq-premium-tab',
854
+ ),
855
+ $ewd_ufaq_premium_permissions
856
+ )
857
+ );
858
+
859
+ $sap->add_setting(
860
+ 'ewd-ufaq-settings',
861
+ 'ewd-ufaq-faq-elements-order',
862
+ 'ordering-table',
863
+ array(
864
+ 'id' => 'faq-elements-order',
865
+ 'title' => __( 'FAQ Elements Order', 'ultimate-faqs' ),
866
+ 'description' => __( 'You can use this table to drag-and-drop the elements of an FAQ into a different order.', 'ultimate-faqs' ),
867
+ 'items' => json_decode( $this->get_setting( 'faq-elements-order' ), true )
868
+ )
869
+ );
870
+
871
+ $sap->add_section(
872
+ 'ewd-ufaq-settings',
873
+ array(
874
+ 'id' => 'ewd-ufaq-ordering-tab',
875
+ 'title' => __( 'Ordering', 'ultimate-faqs' ),
876
+ 'is_tab' => true,
877
+ )
878
+ );
879
+
880
+ $sap->add_section(
881
+ 'ewd-ufaq-settings',
882
+ array(
883
+ 'id' => 'ewd-ufaq-ordering-settings',
884
+ 'title' => __( 'Settings', 'ultimate-faqs' ),
885
+ 'tab' => 'ewd-ufaq-ordering-tab',
886
+ )
887
+ );
888
+
889
+ $sap->add_setting(
890
+ 'ewd-ufaq-settings',
891
+ 'ewd-ufaq-ordering-settings',
892
+ 'toggle',
893
+ array(
894
+ 'id' => 'group-by-category',
895
+ 'title' => __( 'Group FAQs by Category', 'ultimate-faqs' ),
896
+ 'description' => __( 'Should FAQs be grouped by category, or should all categories be mixed together?', 'ultimate-faqs' )
897
+ )
898
+ );
899
+
900
+ $sap->add_setting(
901
+ 'ewd-ufaq-settings',
902
+ 'ewd-ufaq-ordering-settings',
903
+ 'toggle',
904
+ array(
905
+ 'id' => 'group-by-category-count',
906
+ 'title' => __( 'Display FAQ Category Count', 'ultimate-faqs' ),
907
+ 'description' => __( 'If FAQs are grouped by category, should the number of FAQs in a category be displayed beside the category name?', 'ultimate-faqs' )
908
+ )
909
+ );
910
+
911
+ $sap->add_setting(
912
+ 'ewd-ufaq-settings',
913
+ 'ewd-ufaq-ordering-settings',
914
+ 'select',
915
+ array(
916
+ 'id' => 'category-order-by',
917
+ 'title' => __( 'Sort Categories', 'ultimate-faqs' ),
918
+ 'description' => __( 'How should FAQ categories be ordered? (Only used if "Group FAQs by Category" above is enabled.)', 'ultimate-faqs' ),
919
+ 'blank_option' => false,
920
+ 'options' => array(
921
+ 'name' => __( 'Name', 'ultimate-faqs' ),
922
+ 'count' => __( 'FAQ Count', 'ultimate-faqs' ),
923
+ 'slug' => __( 'Slug', 'ultimate-faqs' ),
924
+ )
925
+ )
926
+ );
927
+
928
+ $sap->add_setting(
929
+ 'ewd-ufaq-settings',
930
+ 'ewd-ufaq-ordering-settings',
931
+ 'radio',
932
+ array(
933
+ 'id' => 'category-order',
934
+ 'title' => __( 'Sort Categories Ordering', 'ultimate-faqs' ),
935
+ 'description' => __( 'How should FAQ categories be ordered? (Only used if "Group FAQs by Category" above is enabled.)', 'ultimate-faqs' ),
936
+ 'options' => array(
937
+ 'asc' => __( 'Ascending', 'ultimate-faqs' ),
938
+ 'desc' => __( 'Descending', 'ultimate-faqs' ),
939
+ ),
940
+ 'default' => $this->defaults['category-order']
941
+ )
942
+ );
943
+
944
+ $sap->add_setting(
945
+ 'ewd-ufaq-settings',
946
+ 'ewd-ufaq-ordering-settings',
947
+ 'radio',
948
+ array(
949
+ 'id' => 'faq-order-by',
950
+ 'title' => __( 'FAQ Ordering', 'ultimate-faqs' ),
951
+ 'description' => __( 'How should individual FAQs be ordered?', 'ultimate-faqs' ),
952
+ 'blank_option' => false,
953
+ 'options' => array(
954
+ 'date' => __( 'Created Date', 'ultimate-faqs' ),
955
+ 'title' => __( 'Title', 'ultimate-faqs' ),
956
+ 'modified' => __( 'Modified Date', 'ultimate-faqs' ),
957
+ 'set_order' => __( 'Selected Order (Premium option)', 'ultimate-faqs' ),
958
+ ),
959
+ 'default' => $this->defaults['faq-order-by']
960
+ )
961
+ );
962
+
963
+ $sap->add_setting(
964
+ 'ewd-ufaq-settings',
965
+ 'ewd-ufaq-ordering-settings',
966
+ 'radio',
967
+ array(
968
+ 'id' => 'faq-order',
969
+ 'title' => __( 'Sort FAQs Ordering', 'ultimate-faqs' ),
970
+ 'description' => __( 'Should FAQ be ascending or descending order, based on the ordering criteria above?', 'ultimate-faqs' ),
971
+ 'options' => array(
972
+ 'asc' => __( 'Ascending', 'ultimate-faqs' ),
973
+ 'desc' => __( 'Descending', 'ultimate-faqs' ),
974
+ ),
975
+ 'default' => $this->defaults['faq-order']
976
+ )
977
+ );
978
+
979
+ if ( ! $ewd_ufaq_controller->permissions->check_permission( 'fields' ) ) {
980
+ $ewd_ufaq_fields_permissions = array(
981
+ 'disabled' => true,
982
+ 'disabled_image'=> '#',
983
+ 'purchase_link' => 'https://www.etoilewebdesign.com/plugins/ultimate-faq/'
984
+ );
985
+ }
986
+ else { $ewd_ufaq_fields_permissions = array(); }
987
+
988
+ $sap->add_section(
989
+ 'ewd-ufaq-settings',
990
+ array(
991
+ 'id' => 'ewd-ufaq-fields-tab',
992
+ 'title' => __( 'Fields', 'ultimate-faqs' ),
993
+ 'is_tab' => true,
994
+ )
995
+ );
996
+
997
+ $sap->add_section(
998
+ 'ewd-ufaq-settings',
999
+ array_merge(
1000
+ array(
1001
+ 'id' => 'ewd-ufaq-fields-settings',
1002
+ 'title' => __( 'Settings', 'ultimate-faqs' ),
1003
+ 'tab' => 'ewd-ufaq-fields-tab',
1004
+ ),
1005
+ $ewd_ufaq_fields_permissions
1006
+ )
1007
+ );
1008
+
1009
+ $sap->add_setting(
1010
+ 'ewd-ufaq-settings',
1011
+ 'ewd-ufaq-fields-settings',
1012
+ 'toggle',
1013
+ array(
1014
+ 'id' => 'hide-blank-fields',
1015
+ 'title' => __( 'Hide Blank Fields', 'ultimate-faqs' ),
1016
+ 'description' => __( 'Should field labels be hidden if a field hasn\'t been filled out for a particular FAQ?', 'ultimate-faqs' )
1017
+ )
1018
+ );
1019
+
1020
+ $fields_description = __( 'Should any extra fields be added to the FAQs?', 'ultimate-faqs' ) . '<br />';
1021
+ $fields_description .= __( 'The "Field Values" should be a comma-separated list of values for the select, radio or checkbox field types (no extra spaces after the comma).', 'ultimate-faqs' ) . '<br />';
1022
+ $fields_description .= __( 'For security reasons, file fields cannot be included in the submit FAQ form.', 'ultimate-faqs' ) . '<br />';
1023
+
1024
+ $sap->add_setting(
1025
+ 'ewd-ufaq-settings',
1026
+ 'ewd-ufaq-fields-settings',
1027
+ 'infinite_table',
1028
+ array(
1029
+ 'id' => 'faq-fields',
1030
+ 'title' => __( 'FAQ Custom Fields', 'ultimate-faqs' ),
1031
+ 'add_label' => __( '&plus; ADD', 'ultimate-faqs' ),
1032
+ 'del_label' => __( 'Delete', 'ultimate-faqs' ),
1033
+ 'description' => $fields_description,
1034
+ 'fields' => array(
1035
+ 'id' => array(
1036
+ 'type' => 'hidden',
1037
+ 'label' => 'Field ID',
1038
+ 'required' => true
1039
+ ),
1040
+ 'name' => array(
1041
+ 'type' => 'text',
1042
+ 'label' => 'Field Name',
1043
+ 'required' => true
1044
+ ),
1045
+ 'type' => array(
1046
+ 'type' => 'select',
1047
+ 'label' => __( 'Field Type', 'ultimate-faqs' ),
1048
+ 'options' => array(
1049
+ 'text' => __( 'Text', 'ultimate-faqs' ),
1050
+ 'textarea' => __( 'Text Area', 'ultimate-faqs' ),
1051
+ 'select' => __( 'Select Box', 'ultimate-faqs' ),
1052
+ 'radio' => __( 'Radio Buttons', 'ultimate-faqs' ),
1053
+ 'checkbox' => __( 'Checkbox', 'ultimate-faqs' ),
1054
+ 'file' => __( 'File', 'ultimate-faqs' ),
1055
+ 'link' => __( 'Link', 'ultimate-faqs' ),
1056
+ 'date' => __( 'Date', 'ultimate-faqs' ),
1057
+ 'datetime' => __( 'Date/Time', 'ultimate-faqs' ),
1058
+ )
1059
+ ),
1060
+ 'options' => array(
1061
+ 'type' => 'text',
1062
+ 'label' => __( 'Field Values', 'ultimate-faqs' ),
1063
+ 'required' => false
1064
+ )
1065
+ )
1066
+ )
1067
+ );
1068
+
1069
+ if ( ! $ewd_ufaq_controller->permissions->check_permission( 'labelling' ) ) {
1070
+ $ewd_ufaq_labelling_permissions = array(
1071
+ 'disabled' => true,
1072
+ 'disabled_image'=> '#',
1073
+ 'purchase_link' => 'https://www.etoilewebdesign.com/plugins/ultimate-faq/'
1074
+ );
1075
+ }
1076
+ else { $ewd_ufaq_labelling_permissions = array(); }
1077
+
1078
+ $sap->add_section(
1079
+ 'ewd-ufaq-settings',
1080
+ array(
1081
+ 'id' => 'ewd-ufaq-labelling-tab',
1082
+ 'title' => __( 'Labelling', 'ultimate-faqs' ),
1083
+ 'is_tab' => true,
1084
+ )
1085
+ );
1086
+
1087
+ $sap->add_section(
1088
+ 'ewd-ufaq-settings',
1089
+ array_merge(
1090
+ array(
1091
+ 'id' => 'ewd-ufaq-labelling-faq-and-search',
1092
+ 'title' => __( 'FAQ Page and Search', 'ultimate-faqs' ),
1093
+ 'tab' => 'ewd-ufaq-labelling-tab',
1094
+ ),
1095
+ $ewd_ufaq_labelling_permissions
1096
+ )
1097
+ );
1098
+
1099
+ $sap->add_setting(
1100
+ 'ewd-ufaq-settings',
1101
+ 'ewd-ufaq-labelling-faq-and-search',
1102
+ 'text',
1103
+ array(
1104
+ 'id' => 'label-posted',
1105
+ 'title' => __( 'Posted', 'ultimate-faqs' ),
1106
+ 'description' => ''
1107
+ )
1108
+ );
1109
+
1110
+ $sap->add_setting(
1111
+ 'ewd-ufaq-settings',
1112
+ 'ewd-ufaq-labelling-faq-and-search',
1113
+ 'text',
1114
+ array(
1115
+ 'id' => 'label-by',
1116
+ 'title' => __( 'By', 'ultimate-faqs' ),
1117
+ 'description' => ''
1118
+ )
1119
+ );
1120
+
1121
+ $sap->add_setting(
1122
+ 'ewd-ufaq-settings',
1123
+ 'ewd-ufaq-labelling-faq-and-search',
1124
+ 'text',
1125
+ array(
1126
+ 'id' => 'label-on',
1127
+ 'title' => __( 'On', 'ultimate-faqs' ),
1128
+ 'description' => ''
1129
+ )
1130
+ );
1131
+
1132
+ $sap->add_setting(
1133
+ 'ewd-ufaq-settings',
1134
+ 'ewd-ufaq-labelling-faq-and-search',
1135
+ 'text',
1136
+ array(
1137
+ 'id' => 'label-categories',
1138
+ 'title' => __( 'Categories', 'ultimate-faqs' ),
1139
+ 'description' => ''
1140
+ )
1141
+ );
1142
+
1143
+ $sap->add_setting(
1144
+ 'ewd-ufaq-settings',
1145
+ 'ewd-ufaq-labelling-faq-and-search',
1146
+ 'text',
1147
+ array(
1148
+ 'id' => 'label-tags',
1149
+ 'title' => __( 'Tags', 'ultimate-faqs' ),
1150
+ 'description' => ''
1151
+ )
1152
+ );
1153
+
1154
+ $sap->add_setting(
1155
+ 'ewd-ufaq-settings',
1156
+ 'ewd-ufaq-labelling-faq-and-search',
1157
+ 'text',
1158
+ array(
1159
+ 'id' => 'label-permalink',
1160
+ 'title' => __( 'Permalink', 'ultimate-faqs' ),
1161
+ 'description' => ''
1162
+ )
1163
+ );
1164
+
1165
+ $sap->add_setting(
1166
+ 'ewd-ufaq-settings',
1167
+ 'ewd-ufaq-labelling-faq-and-search',
1168
+ 'text',
1169
+ array(
1170
+ 'id' => 'label-back-to-top',
1171
+ 'title' => __( 'Back To Top', 'ultimate-faqs' ),
1172
+ 'description' => ''
1173
+ )
1174
+ );
1175
+
1176
+ $sap->add_setting(
1177
+ 'ewd-ufaq-settings',
1178
+ 'ewd-ufaq-labelling-faq-and-search',
1179
+ 'text',
1180
+ array(
1181
+ 'id' => 'label-woocommerce-tab',
1182
+ 'title' => __( 'WooCommerce Tab', 'ultimate-faqs' ),
1183
+ 'description' => ''
1184
+ )
1185
+ );
1186
+
1187
+ $sap->add_setting(
1188
+ 'ewd-ufaq-settings',
1189
+ 'ewd-ufaq-labelling-faq-and-search',
1190
+ 'text',
1191
+ array(
1192
+ 'id' => 'label-share-faq',
1193
+ 'title' => __( 'Share', 'ultimate-faqs' ),
1194
+ 'description' => ''
1195
+ )
1196
+ );
1197
+
1198
+ $sap->add_setting(
1199
+ 'ewd-ufaq-settings',
1200
+ 'ewd-ufaq-labelling-faq-and-search',
1201
+ 'text',
1202
+ array(
1203
+ 'id' => 'label-find-faq-helpful',
1204
+ 'title' => __( 'Did you find this FAQ helpful?', 'ultimate-faqs' ),
1205
+ 'description' => ''
1206
+ )
1207
+ );
1208
+
1209
+ $sap->add_setting(
1210
+ 'ewd-ufaq-settings',
1211
+ 'ewd-ufaq-labelling-faq-and-search',
1212
+ 'text',
1213
+ array(
1214
+ 'id' => 'label-enter-question',
1215
+ 'title' => __( 'Enter your quetion', 'ultimate-faqs' ),
1216
+ 'description' => ''
1217
+ )
1218
+ );
1219
+
1220
+ $sap->add_setting(
1221
+ 'ewd-ufaq-settings',
1222
+ 'ewd-ufaq-labelling-faq-and-search',
1223
+ 'text',
1224
+ array(
1225
+ 'id' => 'label-search-placeholder',
1226
+ 'title' => __( 'Search Placeholder', 'ultimate-faqs' ),
1227
+ 'description' => ''
1228
+ )
1229
+ );
1230
+
1231
+ $sap->add_setting(
1232
+ 'ewd-ufaq-settings',
1233
+ 'ewd-ufaq-labelling-faq-and-search',
1234
+ 'text',
1235
+ array(
1236
+ 'id' => 'label-search',
1237
+ 'title' => __( 'Search Button', 'ultimate-faqs' ),
1238
+ 'description' => ''
1239
+ )
1240
+ );
1241
+
1242
+ $sap->add_setting(
1243
+ 'ewd-ufaq-settings',
1244
+ 'ewd-ufaq-labelling-faq-and-search',
1245
+ 'text',
1246
+ array(
1247
+ 'id' => 'label-retrieving-results',
1248
+ 'title' => __( 'Retrieving Results', 'ultimate-faqs' ),
1249
+ 'description' => ''
1250
+ )
1251
+ );
1252
+
1253
+ $sap->add_setting(
1254
+ 'ewd-ufaq-settings',
1255
+ 'ewd-ufaq-labelling-faq-and-search',
1256
+ 'text',
1257
+ array(
1258
+ 'id' => 'label-no-results-found',
1259
+ 'title' => __( 'No result FAQ\'s contained the term \'%s\'', 'ultimate-faqs' ),
1260
+ 'description' => ''
1261
+ )
1262
+ );
1263
+
1264
+ $sap->add_section(
1265
+ 'ewd-ufaq-settings',
1266
+ array_merge(
1267
+ array(
1268
+ 'id' => 'ewd-ufaq-labelling-faq-submit-page',
1269
+ 'title' => __( 'FAQ Submit Page', 'ultimate-faqs' ),
1270
+ 'tab' => 'ewd-ufaq-labelling-tab',
1271
+ ),
1272
+ $ewd_ufaq_labelling_permissions
1273
+ )
1274
+ );
1275
+
1276
+ $sap->add_setting(
1277
+ 'ewd-ufaq-settings',
1278
+ 'ewd-ufaq-labelling-faq-submit-page',
1279
+ 'text',
1280
+ array(
1281
+ 'id' => 'label-thank-you-submit',
1282
+ 'title' => __( 'Thank you for submitting an FAQ', 'ultimate-faqs' ),
1283
+ 'description' => ''
1284
+ )
1285
+ );
1286
+
1287
+ $sap->add_setting(
1288
+ 'ewd-ufaq-settings',
1289
+ 'ewd-ufaq-labelling-faq-submit-page',
1290
+ 'text',
1291
+ array(
1292
+ 'id' => 'label-submit-question',
1293
+ 'title' => __( 'Submit a Question', 'ultimate-faqs' ),
1294
+ 'description' => ''
1295
+ )
1296
+ );
1297
+
1298
+ $sap->add_setting(
1299
+ 'ewd-ufaq-settings',
1300
+ 'ewd-ufaq-labelling-faq-submit-page',
1301
+ 'text',
1302
+ array(
1303
+ 'id' => 'label-please-fill-form-below',
1304
+ 'title' => __( 'Please fill out the form below to submit a question.', 'ultimate-faqs' ),
1305
+ 'description' => ''
1306
+ )
1307
+ );
1308
+
1309
+ $sap->add_setting(
1310
+ 'ewd-ufaq-settings',
1311
+ 'ewd-ufaq-labelling-faq-submit-page',
1312
+ 'text',
1313
+ array(
1314
+ 'id' => 'label-send-question',
1315
+ 'title' => __( 'Send Question', 'ultimate-faqs' ),
1316
+ 'description' => ''
1317
+ )
1318
+ );
1319
+
1320
+ $sap->add_setting(
1321
+ 'ewd-ufaq-settings',
1322
+ 'ewd-ufaq-labelling-faq-submit-page',
1323
+ 'text',
1324
+ array(
1325
+ 'id' => 'label-question-title',
1326
+ 'title' => __( 'Question Title', 'ultimate-faqs' ),
1327
+ 'description' => ''
1328
+ )
1329
+ );
1330
+
1331
+ $sap->add_setting(
1332
+ 'ewd-ufaq-settings',
1333
+ 'ewd-ufaq-labelling-faq-submit-page',
1334
+ 'text',
1335
+ array(
1336
+ 'id' => 'label-question-title-explanation',
1337
+ 'title' => __( 'What question is being answered?', 'ultimate-faqs' ),
1338
+ 'description' => ''
1339
+ )
1340
+ );
1341
+
1342
+ $sap->add_setting(
1343
+ 'ewd-ufaq-settings',
1344
+ 'ewd-ufaq-labelling-faq-submit-page',
1345
+ 'text',
1346
+ array(
1347
+ 'id' => 'label-proposed-answer',
1348
+ 'title' => __( 'Proposed Answer', 'ultimate-faqs' ),
1349
+ 'description' => ''
1350
+ )
1351
+ );
1352
+
1353
+ $sap->add_setting(
1354
+ 'ewd-ufaq-settings',
1355
+ 'ewd-ufaq-labelling-faq-submit-page',
1356
+ 'text',
1357
+ array(
1358
+ 'id' => 'label-proposed-answer-explanation',
1359
+ 'title' => __( 'What answer should be displayed for this question?', 'ultimate-faqs' ),
1360
+ 'description' => ''
1361
+ )
1362
+ );
1363
+
1364
+ $sap->add_setting(
1365
+ 'ewd-ufaq-settings',
1366
+ 'ewd-ufaq-labelling-faq-submit-page',
1367
+ 'text',
1368
+ array(
1369
+ 'id' => 'label-question-author',
1370
+ 'title' => __( 'Question Author', 'ultimate-faqs' ),
1371
+ 'description' => ''
1372
+ )
1373
+ );
1374
+
1375
+ $sap->add_setting(
1376
+ 'ewd-ufaq-settings',
1377
+ 'ewd-ufaq-labelling-faq-submit-page',
1378
+ 'text',
1379
+ array(
1380
+ 'id' => 'label-captcha-image-number',
1381
+ 'title' => __( 'Image Number', 'ultimate-faqs' ),
1382
+ 'description' => ''
1383
+ )
1384
+ );
1385
+
1386
+ $sap->add_setting(
1387
+ 'ewd-ufaq-settings',
1388
+ 'ewd-ufaq-labelling-faq-submit-page',
1389
+ 'text',
1390
+ array(
1391
+ 'id' => 'label-question-author-explanation',
1392
+ 'title' => __( 'What name should be displayed with your question?', 'ultimate-faqs' ),
1393
+ 'description' => ''
1394
+ )
1395
+ );
1396
+
1397
+ if ( ! $ewd_ufaq_controller->permissions->check_permission( 'styling' ) ) {
1398
+ $ewd_ufaq_styling_permissions = array(
1399
+ 'disabled' => true,
1400
+ 'disabled_image'=> '#',
1401
+ 'purchase_link' => 'https://www.etoilewebdesign.com/plugins/ultimate-faq/'
1402
+ );
1403
+ }
1404
+ else { $ewd_ufaq_styling_permissions = array(); }
1405
+
1406
+ $sap->add_section(
1407
+ 'ewd-ufaq-settings',
1408
+ array(
1409
+ 'id' => 'ewd-ufaq-styling-tab',
1410
+ 'title' => __( 'Styling', 'ultimate-faqs' ),
1411
+ 'is_tab' => true,
1412
+ )
1413
+ );
1414
+
1415
+ $sap->add_section(
1416
+ 'ewd-ufaq-settings',
1417
+ array_merge(
1418
+ array(
1419
+ 'id' => 'ewd-ufaq-styling-toggle-symbol',
1420
+ 'title' => __( 'Toggle Symbol', 'ultimate-faqs' ),
1421
+ 'tab' => 'ewd-ufaq-styling-tab',
1422
+ ),
1423
+ $ewd_ufaq_styling_permissions
1424
+ )
1425
+ );
1426
+
1427
+ $sap->add_setting(
1428
+ 'ewd-ufaq-settings',
1429
+ 'ewd-ufaq-styling-toggle-symbol',
1430
+ 'radio',
1431
+ array(
1432
+ 'id' => 'styling-toggle-symbol',
1433
+ 'title' => __( 'Toggle Symbol', 'ultimate-lightbox' ),
1434
+ 'columns' => '3',
1435
+ 'options' => array(
1436
+ 'A' => '<span class="ewd-ufaq-toggle-symbol">a A</span>',
1437
+ 'B' => '<span class="ewd-ufaq-toggle-symbol">b B</span>',
1438
+ 'C' => '<span class="ewd-ufaq-toggle-symbol">c C</span>',
1439
+ 'D' => '<span class="ewd-ufaq-toggle-symbol">d D</span>',
1440
+ 'E' => '<span class="ewd-ufaq-toggle-symbol">e E</span>',
1441
+ 'F' => '<span class="ewd-ufaq-toggle-symbol">f F</span>',
1442
+ 'G' => '<span class="ewd-ufaq-toggle-symbol">g G</span>',
1443
+ 'H' => '<span class="ewd-ufaq-toggle-symbol">h H</span>',
1444
+ 'I' => '<span class="ewd-ufaq-toggle-symbol">i I</span>',
1445
+ 'J' => '<span class="ewd-ufaq-toggle-symbol">j J</span>',
1446
+ 'K' => '<span class="ewd-ufaq-toggle-symbol">k K</span>',
1447
+ 'L' => '<span class="ewd-ufaq-toggle-symbol">l L</span>',
1448
+ 'M' => '<span class="ewd-ufaq-toggle-symbol">m M</span>',
1449
+ 'N' => '<span class="ewd-ufaq-toggle-symbol">n N</span>',
1450
+ 'O' => '<span class="ewd-ufaq-toggle-symbol">o O</span>',
1451
+ ),
1452
+ 'default' => $this->defaults['styling-toggle-symbol']
1453
+ )
1454
+ );
1455
+
1456
+ $sap->add_setting(
1457
+ 'ewd-ufaq-settings',
1458
+ 'ewd-ufaq-styling-toggle-symbol',
1459
+ 'colorpicker',
1460
+ array(
1461
+ 'id' => 'styling-toggle-background-color',
1462
+ 'title' => __( 'Toggle Background Color', 'ultimate-faqs' )
1463
+ )
1464
+ );
1465
+
1466
+ $sap->add_setting(
1467
+ 'ewd-ufaq-settings',
1468
+ 'ewd-ufaq-styling-toggle-symbol',
1469
+ 'colorpicker',
1470
+ array(
1471
+ 'id' => 'styling-toggle-font-color',
1472
+ 'title' => __( 'Toggle Color', 'ultimate-faqs' )
1473
+ )
1474
+ );
1475
+
1476
+ $sap->add_setting(
1477
+ 'ewd-ufaq-settings',
1478
+ 'ewd-ufaq-styling-toggle-symbol',
1479
+ 'colorpicker',
1480
+ array(
1481
+ 'id' => 'styling-toggle-border-color',
1482
+ 'title' => __( 'Toggle Border Color', 'ultimate-faqs' )
1483
+ )
1484
+ );
1485
+
1486
+ $sap->add_setting(
1487
+ 'ewd-ufaq-settings',
1488
+ 'ewd-ufaq-styling-toggle-symbol',
1489
+ 'text',
1490
+ array(
1491
+ 'id' => 'styling-toggle-symbol-size',
1492
+ 'title' => __( 'Toggle Font Size', 'ultimate-faqs' ),
1493
+ 'description' => '',
1494
+ 'small' => true
1495
+ )
1496
+ );
1497
+
1498
+ $sap->add_setting(
1499
+ 'ewd-ufaq-settings',
1500
+ 'ewd-ufaq-styling-toggle-symbol',
1501
+ 'text',
1502
+ array(
1503
+ 'id' => 'styling-toggle-border-size',
1504
+ 'title' => __( 'Border Size', 'ultimate-faqs' ),
1505
+ 'description' => '',
1506
+ 'small' => true
1507
+ )
1508
+ );
1509
+
1510
+ $sap->add_setting(
1511
+ 'ewd-ufaq-settings',
1512
+ 'ewd-ufaq-styling-toggle-symbol',
1513
+ 'text',
1514
+ array(
1515
+ 'id' => 'styling-toggle-border-radius',
1516
+ 'title' => __( 'Border Radius', 'ultimate-faqs' ),
1517
+ 'description' => '',
1518
+ 'small' => true
1519
+ )
1520
+ );
1521
+
1522
+ $sap->add_section(
1523
+ 'ewd-ufaq-settings',
1524
+ array_merge(
1525
+ array(
1526
+ 'id' => 'ewd-ufaq-styling-themes',
1527
+ 'title' => __( 'Themes', 'ultimate-faqs' ),
1528
+ 'tab' => 'ewd-ufaq-styling-tab',
1529
+ ),
1530
+ $ewd_ufaq_styling_permissions
1531
+ )
1532
+ );
1533
+
1534
+ $sap->add_setting(
1535
+ 'ewd-ufaq-settings',
1536
+ 'ewd-ufaq-styling-themes',
1537
+ 'colorpicker',
1538
+ array(
1539
+ 'id' => 'styling-block-background-color',
1540
+ 'title' => __( 'Block and Border Block Background Color', 'ultimate-faqs' )
1541
+ )
1542
+ );
1543
+
1544
+ $sap->add_setting(
1545
+ 'ewd-ufaq-settings',
1546
+ 'ewd-ufaq-styling-themes',
1547
+ 'colorpicker',
1548
+ array(
1549
+ 'id' => 'styling-block-font-color',
1550
+ 'title' => __( 'Block and Border Block Hover Font Color', 'ultimate-faqs' )
1551
+ )
1552
+ );
1553
+
1554
+ $sap->add_setting(
1555
+ 'ewd-ufaq-settings',
1556
+ 'ewd-ufaq-styling-themes',
1557
+ 'colorpicker',
1558
+ array(
1559
+ 'id' => 'styling-list-font-color',
1560
+ 'title' => __( 'List Font Color', 'ultimate-faqs' )
1561
+ )
1562
+ );
1563
+
1564
+
1565
+ $sap->add_setting(
1566
+ 'ewd-ufaq-settings',
1567
+ 'ewd-ufaq-styling-themes',
1568
+ 'text',
1569
+ array(
1570
+ 'id' => 'styling-list-font',
1571
+ 'title' => __( 'Font Family', 'ultimate-faqs' ),
1572
+ 'description' => '',
1573
+ 'small' => true
1574
+ )
1575
+ );
1576
+
1577
+ $sap->add_setting(
1578
+ 'ewd-ufaq-settings',
1579
+ 'ewd-ufaq-styling-themes',
1580
+ 'text',
1581
+ array(
1582
+ 'id' => 'styling-list-font-size',
1583
+ 'title' => __( 'Font Size', 'ultimate-faqs' ),
1584
+ 'description' => '',
1585
+ 'small' => true
1586
+ )
1587
+ );
1588
+
1589
+ $sap->add_setting(
1590
+ 'ewd-ufaq-settings',
1591
+ 'ewd-ufaq-styling-themes',
1592
+ 'text',
1593
+ array(
1594
+ 'id' => 'styling-list-margin',
1595
+ 'title' => __( 'Margin', 'ultimate-faqs' ),
1596
+ 'description' => '',
1597
+ 'small' => true
1598
+ )
1599
+ );
1600
+
1601
+ $sap->add_setting(
1602
+ 'ewd-ufaq-settings',
1603
+ 'ewd-ufaq-styling-themes',
1604
+ 'text',
1605
+ array(
1606
+ 'id' => 'styling-list-padding',
1607
+ 'title' => __( 'Padding', 'ultimate-faqs' ),
1608
+ 'description' => '',
1609
+ 'small' => true
1610
+ )
1611
+ );
1612
+
1613
+ $sap->add_section(
1614
+ 'ewd-ufaq-settings',
1615
+ array_merge(
1616
+ array(
1617
+ 'id' => 'ewd-ufaq-styling-faq-elements',
1618
+ 'title' => __( 'FAQ Elements', 'ultimate-faqs' ),
1619
+ 'tab' => 'ewd-ufaq-styling-tab',
1620
+ ),
1621
+ $ewd_ufaq_styling_permissions
1622
+ )
1623
+ );
1624
+
1625
+ $sap->add_setting(
1626
+ 'ewd-ufaq-settings',
1627
+ 'ewd-ufaq-styling-faq-elements',
1628
+ 'colorpicker',
1629
+ array(
1630
+ 'id' => 'styling-question-font-color',
1631
+ 'title' => __( 'Question Font Color', 'ultimate-faqs' )
1632
+ )
1633
+ );
1634
+
1635
+
1636
+ $sap->add_setting(
1637
+ 'ewd-ufaq-settings',
1638
+ 'ewd-ufaq-styling-faq-elements',
1639
+ 'text',
1640
+ array(
1641
+ 'id' => 'styling-question-font',
1642
+ 'title' => __( 'Question Font Family', 'ultimate-faqs' ),
1643
+ 'description' => '',
1644
+ 'small' => true
1645
+ )
1646
+ );
1647
+
1648
+ $sap->add_setting(
1649
+ 'ewd-ufaq-settings',
1650
+ 'ewd-ufaq-styling-faq-elements',
1651
+ 'text',
1652
+ array(
1653
+ 'id' => 'styling-question-font-size',
1654
+ 'title' => __( 'Question Font Size', 'ultimate-faqs' ),
1655
+ 'description' => '',
1656
+ 'small' => true
1657
+ )
1658
+ );
1659
+
1660
+ $sap->add_setting(
1661
+ 'ewd-ufaq-settings',
1662
+ 'ewd-ufaq-styling-faq-elements',
1663
+ 'text',
1664
+ array(
1665
+ 'id' => 'styling-question-margin',
1666
+ 'title' => __( 'Question Margin', 'ultimate-faqs' ),
1667
+ 'description' => '',
1668
+ 'small' => true
1669
+ )
1670
+ );
1671
+
1672
+ $sap->add_setting(
1673
+ 'ewd-ufaq-settings',
1674
+ 'ewd-ufaq-styling-faq-elements',
1675
+ 'text',
1676
+ array(
1677
+ 'id' => 'styling-question-padding',
1678
+ 'title' => __( 'Question Padding', 'ultimate-faqs' ),
1679
+ 'description' => '',
1680
+ 'small' => true
1681
+ )
1682
+ );
1683
+
1684
+ $sap->add_setting(
1685
+ 'ewd-ufaq-settings',
1686
+ 'ewd-ufaq-styling-faq-elements',
1687
+ 'text',
1688
+ array(
1689
+ 'id' => 'styling-question-icon-top-margin',
1690
+ 'title' => __( 'Toggle Symbol Top Margin', 'ultimate-faqs' ),
1691
+ 'description' => '',
1692
+ 'small' => true
1693
+ )
1694
+ );
1695
+
1696
+ $sap->add_setting(
1697
+ 'ewd-ufaq-settings',
1698
+ 'ewd-ufaq-styling-faq-elements',
1699
+ 'colorpicker',
1700
+ array(
1701
+ 'id' => 'styling-answer-font-color',
1702
+ 'title' => __( 'Answer Font Color', 'ultimate-faqs' )
1703
+ )
1704
+ );
1705
+
1706
+
1707
+ $sap->add_setting(
1708
+ 'ewd-ufaq-settings',
1709
+ 'ewd-ufaq-styling-faq-elements',
1710
+ 'text',
1711
+ array(
1712
+ 'id' => 'styling-answer-font',
1713
+ 'title' => __( 'Answer Font Family', 'ultimate-faqs' ),
1714
+ 'description' => '',
1715
+ 'small' => true
1716
+ )
1717
+ );
1718
+
1719
+ $sap->add_setting(
1720
+ 'ewd-ufaq-settings',
1721
+ 'ewd-ufaq-styling-faq-elements',
1722
+ 'text',
1723
+ array(
1724
+ 'id' => 'styling-answer-font-size',
1725
+ 'title' => __( 'Answer Font Size', 'ultimate-faqs' ),
1726
+ 'description' => '',
1727
+ 'small' => true
1728
+ )
1729
+ );
1730
+
1731
+ $sap->add_setting(
1732
+ 'ewd-ufaq-settings',
1733
+ 'ewd-ufaq-styling-faq-elements',
1734
+ 'text',
1735
+ array(
1736
+ 'id' => 'styling-answer-margin',
1737
+ 'title' => __( 'Answer Margin', 'ultimate-faqs' ),
1738
+ 'description' => '',
1739
+ 'small' => true
1740
+ )
1741
+ );
1742
+
1743
+ $sap->add_setting(
1744
+ 'ewd-ufaq-settings',
1745
+ 'ewd-ufaq-styling-faq-elements',
1746
+ 'text',
1747
+ array(
1748
+ 'id' => 'styling-answer-padding',
1749
+ 'title' => __( 'Answer Padding', 'ultimate-faqs' ),
1750
+ 'description' => '',
1751
+ 'small' => true
1752
+ )
1753
+ );
1754
+
1755
+ $sap->add_setting(
1756
+ 'ewd-ufaq-settings',
1757
+ 'ewd-ufaq-styling-faq-elements',
1758
+ 'colorpicker',
1759
+ array(
1760
+ 'id' => 'styling-category-font-color',
1761
+ 'title' => __( 'Categories, Tags Font Color', 'ultimate-faqs' )
1762
+ )
1763
+ );
1764
+
1765
+
1766
+ $sap->add_setting(
1767
+ 'ewd-ufaq-settings',
1768
+ 'ewd-ufaq-styling-faq-elements',
1769
+ 'text',
1770
+ array(
1771
+ 'id' => 'styling-category-font',
1772
+ 'title' => __( 'Categories, Tags Font Family', 'ultimate-faqs' ),
1773
+ 'description' => '',
1774
+ 'small' => true
1775
+ )
1776
+ );
1777
+
1778
+ $sap->add_setting(
1779
+ 'ewd-ufaq-settings',
1780
+ 'ewd-ufaq-styling-faq-elements',
1781
+ 'text',
1782
+ array(
1783
+ 'id' => 'styling-category-font-size',
1784
+ 'title' => __( 'Categories, Tags Font Size', 'ultimate-faqs' ),
1785
+ 'description' => '',
1786
+ 'small' => true
1787
+ )
1788
+ );
1789
+
1790
+ $sap->add_setting(
1791
+ 'ewd-ufaq-settings',
1792
+ 'ewd-ufaq-styling-faq-elements',
1793
+ 'text',
1794
+ array(
1795
+ 'id' => 'styling-category-margin',
1796
+ 'title' => __( 'Categories, Tags Margin', 'ultimate-faqs' ),
1797
+ 'description' => '',
1798
+ 'small' => true
1799
+ )
1800
+ );
1801
+
1802
+ $sap->add_setting(
1803
+ 'ewd-ufaq-settings',
1804
+ 'ewd-ufaq-styling-faq-elements',
1805
+ 'text',
1806
+ array(
1807
+ 'id' => 'styling-category-padding',
1808
+ 'title' => __( 'Categories, Tags Padding', 'ultimate-faqs' ),
1809
+ 'description' => '',
1810
+ 'small' => true
1811
+ )
1812
+ );
1813
+
1814
+ $sap->add_setting(
1815
+ 'ewd-ufaq-settings',
1816
+ 'ewd-ufaq-styling-faq-elements',
1817
+ 'colorpicker',
1818
+ array(
1819
+ 'id' => 'styling-postdate-font-color',
1820
+ 'title' => __( 'Post Date Font Color', 'ultimate-faqs' )
1821
+ )
1822
+ );
1823
+
1824
+
1825
+ $sap->add_setting(
1826
+ 'ewd-ufaq-settings',
1827
+ 'ewd-ufaq-styling-faq-elements',
1828
+ 'text',
1829
+ array(
1830
+ 'id' => 'styling-postdate-font',
1831
+ 'title' => __( 'Post Date Font Family', 'ultimate-faqs' ),
1832
+ 'description' => '',
1833
+ 'small' => true
1834
+ )
1835
+ );
1836
+
1837
+ $sap->add_setting(
1838
+ 'ewd-ufaq-settings',
1839
+ 'ewd-ufaq-styling-faq-elements',
1840
+ 'text',
1841
+ array(
1842
+ 'id' => 'styling-postdate-font-size',
1843
+ 'title' => __( 'Post Date Font Size', 'ultimate-faqs' ),
1844
+ 'description' => '',
1845
+ 'small' => true
1846
+ )
1847
+ );
1848
+
1849
+ $sap->add_setting(
1850
+ 'ewd-ufaq-settings',
1851
+ 'ewd-ufaq-styling-faq-elements',
1852
+ 'text',
1853
+ array(
1854
+ 'id' => 'styling-postdate-margin',
1855
+ 'title' => __( 'Post Date Margin', 'ultimate-faqs' ),
1856
+ 'description' => '',
1857
+ 'small' => true
1858
+ )
1859
+ );
1860
+
1861
+ $sap->add_setting(
1862
+ 'ewd-ufaq-settings',
1863
+ 'ewd-ufaq-styling-faq-elements',
1864
+ 'text',
1865
+ array(
1866
+ 'id' => 'styling-postdate-padding',
1867
+ 'title' => __( 'Post Date Padding', 'ultimate-faqs' ),
1868
+ 'description' => '',
1869
+ 'small' => true
1870
+ )
1871
+ );
1872
+
1873
+ $sap->add_section(
1874
+ 'ewd-ufaq-settings',
1875
+ array_merge(
1876
+ array(
1877
+ 'id' => 'ewd-ufaq-styling-headings',
1878
+ 'title' => __( 'Headings', 'ultimate-faqs' ),
1879
+ 'tab' => 'ewd-ufaq-styling-tab',
1880
+ ),
1881
+ $ewd_ufaq_styling_permissions
1882
+ )
1883
+ );
1884
+
1885
+ $sap->add_setting(
1886
+ 'ewd-ufaq-settings',
1887
+ 'ewd-ufaq-styling-headings',
1888
+ 'radio',
1889
+ array(
1890
+ 'id' => 'styling-category-heading-type',
1891
+ 'title' => __( 'Category Heading Type', 'ultimate-faqs' ),
1892
+ 'options' => array(
1893
+ 'h1' => __( 'H1', 'ultimate-faqs' ),
1894
+ 'h2' => __( 'H2', 'ultimate-faqs' ),
1895
+ 'h3' => __( 'H3', 'ultimate-faqs' ),
1896
+ 'h4' => __( 'H4', 'ultimate-faqs' ),
1897
+ 'h5' => __( 'H5', 'ultimate-faqs' ),
1898
+ 'h6' => __( 'H6', 'ultimate-faqs' ),
1899
+ ),
1900
+ 'default' => $this->defaults['styling-category-heading-type']
1901
+ )
1902
+ );
1903
+
1904
+ $sap->add_setting(
1905
+ 'ewd-ufaq-settings',
1906
+ 'ewd-ufaq-styling-headings',
1907
+ 'radio',
1908
+ array(
1909
+ 'id' => 'styling-faq-heading-type',
1910
+ 'title' => __( 'FAQ Heading Type', 'ultimate-faqs' ),
1911
+ 'options' => array(
1912
+ 'h1' => __( 'H1', 'ultimate-faqs' ),
1913
+ 'h2' => __( 'H2', 'ultimate-faqs' ),
1914
+ 'h3' => __( 'H3', 'ultimate-faqs' ),
1915
+ 'h4' => __( 'H4', 'ultimate-faqs' ),
1916
+ 'h5' => __( 'H5', 'ultimate-faqs' ),
1917
+ 'h6' => __( 'H6', 'ultimate-faqs' ),
1918
+ ),
1919
+ 'default' => $this->defaults['styling-faq-heading-type']
1920
+ )
1921
+ );
1922
+
1923
+ $sap->add_setting(
1924
+ 'ewd-ufaq-settings',
1925
+ 'ewd-ufaq-styling-headings',
1926
+ 'colorpicker',
1927
+ array(
1928
+ 'id' => 'styling-category-heading-font-color',
1929
+ 'title' => __( 'Category Heading Font Color', 'ultimate-faqs' )
1930
+ )
1931
+ );
1932
+
1933
+
1934
+ $sap->add_setting(
1935
+ 'ewd-ufaq-settings',
1936
+ 'ewd-ufaq-styling-headings',
1937
+ 'text',
1938
+ array(
1939
+ 'id' => 'styling-category-heading-font',
1940
+ 'title' => __( 'Category Heading Font Family', 'ultimate-faqs' ),
1941
+ 'description' => '',
1942
+ 'small' => true
1943
+ )
1944
+ );
1945
+
1946
+ $sap->add_setting(
1947
+ 'ewd-ufaq-settings',
1948
+ 'ewd-ufaq-styling-headings',
1949
+ 'text',
1950
+ array(
1951
+ 'id' => 'styling-category-heading-font-size',
1952
+ 'title' => __( 'Category Heading Font Size', 'ultimate-faqs' ),
1953
+ 'description' => '',
1954
+ 'small' => true
1955
+ )
1956
+ );
1957
+
1958
+ $sap = apply_filters( 'ewd_ufaq_settings_page', $sap );
1959
+
1960
+ $sap->add_admin_menus();
1961
+
1962
+ }
1963
+ }
1964
+ } // endif;
includes/UltimateWPMail.class.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'ABSPATH' ) ) exit;
3
+
4
+ if ( !class_exists( 'ewdufaqUltimateWPMail' ) ) {
5
+ /**
6
+ * Class to handle Ultimate WP Mail integration for Ultimate FAQs
7
+ *
8
+ * @since 2.0.0
9
+ */
10
+ class ewdufaqUltimateWPMail {
11
+
12
+ public function __construct() {
13
+
14
+ add_filter( 'uwpm_register_custom_element_section', array( $this, 'add_element_section' ) );
15
+ add_action( 'uwpm_register_custom_element', array( $this, 'add_elements' ) );
16
+ }
17
+
18
+ /**
19
+ * Adds in a section for UFAQ tags in Ultimate WP Mail
20
+ * @since 2.0.0
21
+ */
22
+ public function add_element_section() {
23
+
24
+ if ( ! function_exists( 'uwpm_register_custom_element_section' ) ) { return; }
25
+
26
+ $args = array(
27
+ 'label' => 'FAQ Tags'
28
+ );
29
+
30
+ uwpm_register_custom_element_section( 'ewd_ufaq_uwpm_elements', $args );
31
+ }
32
+
33
+ /**
34
+ * Adds in tags for author and author email
35
+ * @since 2.0.0
36
+ */
37
+ public function add_elements() {
38
+
39
+ if ( ! function_exists( 'uwpm_register_custom_element' ) ) { return; }
40
+
41
+ $args = array(
42
+ 'label' => 'FAQ Author',
43
+ 'callback_function' => array( $this, 'get_faq_author' ),
44
+ 'section' => 'ewd_ufaq_uwpm_elements'
45
+ );
46
+
47
+ uwpm_register_custom_element( 'ewd_ufaq_author', $args );
48
+
49
+ $args = array(
50
+ 'label' => 'FAQ Author Email',
51
+ 'callback_function' => array( $this, 'get_faq_author_email' ),
52
+ 'section' => 'ewd_ufaq_uwpm_elements'
53
+ );
54
+
55
+ uwpm_register_custom_element( 'ewd_ufaq_author_email', $args );
56
+ }
57
+
58
+ /**
59
+ * Returns the author of a specified FAQ
60
+ * @since 2.0.0
61
+ */
62
+ public function get_faq_author( $params, $user ) {
63
+
64
+ return ! empty( $params['post_id'] ) ? get_post_meta( $params['post_id'], 'EWD_UFAQ_Post_Author', true ) : '';
65
+ }
66
+
67
+ /**
68
+ * Returns the author email of a specified FAQ
69
+ * @since 2.0.0
70
+ */
71
+ public function get_faq_author_email( $params, $user ) {
72
+
73
+ return ! empty( $params['post_id'] ) ? get_post_meta( $params['post_id'], 'EWD_UFAQ_Post_Author_Email', true ) : '';
74
+ }
75
+ }
76
+ }
includes/WPForms.class.php ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'ABSPATH' ) ) exit;
3
+
4
+ if ( !class_exists( 'ewdufaqWPForms' ) ) {
5
+ /**
6
+ * Class to handle WP Forms integration for Ultimate FAQs
7
+ *
8
+ * @since 2.0.0
9
+ */
10
+ class ewdufaqWPForms {
11
+
12
+ public function __construct() {
13
+
14
+ add_filter( 'wpforms_builder_settings_sections', array( $this, 'add_settings_panel' ) );
15
+ add_action( 'wpforms_form_settings_panel_content', array( $this, 'add_settings' ) );
16
+
17
+ add_action( 'wpforms_frontend_output_before', array( $this, 'js_localization' ), 10, 2 );
18
+
19
+ add_action( 'wpforms_display_field_before', array( $this, 'display_faqs' ), 10, 2 );
20
+ add_action( 'wpforms_display_field_after', array( $this, 'display_faqs' ), 10, 2 );
21
+
22
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
23
+ }
24
+
25
+ /**
26
+ * Adds an FAQs settings panel to the WP Forms admin screen
27
+ * @since 2.0.0
28
+ */
29
+ public function add_settings_panel( $panels ) {
30
+
31
+ $panels['ufaq'] = esc_html__( 'FAQs', 'ultimate-faqs' );
32
+
33
+ return $panels;
34
+
35
+ }
36
+
37
+ /**
38
+ * Adds an the settings to enable WP Forms integration
39
+ * @since 2.0.0
40
+ */
41
+ public function add_settings( $instance ) { ?>
42
+
43
+ <div class="wpforms-panel-content-section wpforms-panel-content-section-ufaq">
44
+
45
+ <div class="wpforms-panel-content-section-title">
46
+ <?php esc_html_e( 'Ultimate FAQs', 'ultimate-faqs' ); ?>
47
+ </div>
48
+
49
+ <?php
50
+
51
+ wpforms_panel_field(
52
+ 'radio',
53
+ 'settings',
54
+ 'ufaq_enabled',
55
+ $instance->form_data,
56
+ esc_html__( 'Disable FAQ display for this form, or enable it only on specific fields.', 'wpforms-lite' ),
57
+ array(
58
+ 'options' => array(
59
+ 'enabled' => array( 'label' => 'Enable' ),
60
+ 'disabled' => array( 'label' => 'Disable' ),
61
+ 'specific' => array( 'label' => 'Specific Field' )
62
+ )
63
+ )
64
+ );
65
+
66
+ wpforms_panel_field(
67
+ 'select',
68
+ 'settings',
69
+ 'ufaq_selected_field',
70
+ $instance->form_data,
71
+ esc_html__( 'If FAQs are set to a specific field, which field should FAQs be displayed for?', 'wpforms-lite' ),
72
+ array(
73
+ 'field_map' => array(
74
+ 'text',
75
+ 'textarea'
76
+ ),
77
+ 'placeholder' => __( '-- Select Field --', 'ultimate-faqs' ),
78
+ )
79
+ );
80
+
81
+ ?>
82
+
83
+ </div>
84
+
85
+ <?php }
86
+
87
+ /**
88
+ * Pass the target field and other form data to the front-end
89
+ * @since 2.0.0
90
+ */
91
+ public function js_localization( $form_data, $form ) {
92
+
93
+ $target_field = $this->get_target_field( $form_data );
94
+
95
+ wp_localize_script(
96
+ 'ewd-ufaq-js',
97
+ 'wpforms_integration',
98
+ array(
99
+ 'ufaq_enabled' => isset ( $form_data['settings']['ufaq_enabled'] ) ? $form_data['settings']['ufaq_enabled'] : 'enabled',
100
+ 'ufaq_selected_field' => $target_field,
101
+ 'form_id' => $form_data['id']
102
+ )
103
+ );
104
+ }
105
+
106
+ public function enqueue_scripts() {
107
+
108
+ wp_enqueue_style( 'ewd-ufaq-wpforms-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-wpforms.css', array(), EWD_UFAQ_VERSION );
109
+ }
110
+
111
+ public function display_faqs( $field, $form_data ) {
112
+ global $ewd_ufaq_controller;
113
+
114
+ $target_field = $this->get_target_field( $form_data );
115
+
116
+ if ( isset( $form_data['settings']['ufaq_enabled'] ) and $form_data['settings']['ufaq_enabled'] == 'disabled' ) { return; }
117
+
118
+ if ( $field['id'] != $target_field ) { return; }
119
+
120
+ if ( current_action() == 'wpforms_display_field_after' and $ewd_ufaq_controller->settings->get_setting( 'wpforms-faq-location' ) == 'above' ) { return; }
121
+
122
+ if ( current_action() == 'wpforms_display_field_before' and $ewd_ufaq_controller->settings->get_setting( 'wpforms-faq-location' ) == 'below' ) { return; }
123
+
124
+ $post_count = $ewd_ufaq_controller->settings->get_setting( 'wpforms-post-count' );
125
+
126
+ ?>
127
+
128
+ <div class="ewd-ufaq-wpforms-label ewd-ufaq-hidden"><?php esc_html_e( 'Possible FAQs related to your message:', 'ultimate-faqs' ); ?></div>
129
+ <div class="ewd-ufaq-wpforms-faq-results ewd-ufaq-hidden"><?php echo do_shortcode( '[ultimate-faqs post__in_string="-1" post_count="' . $post_count . '"]' ); ?></div>
130
+
131
+ <?php }
132
+
133
+ /**
134
+ * Determine which field FAQs should be displayed for
135
+ * @since 2.0.0
136
+ */
137
+ public function get_target_field( $form_data ) {
138
+
139
+ if ( isset ( $form_data['settings']['ufaq_enabled'] ) and $form_data['settings']['ufaq_enabled'] == 'specific' ) {
140
+
141
+ return isset( $form_data['settings']['ufaq_selected_field'] ) ? $form_data['settings']['ufaq_selected_field'] : 0;
142
+ }
143
+
144
+ if ( ! isset( $form_data['settings']['ufaq_enabled'] ) or ( isset ( $form_data['settings']['ufaq_enabled'] ) and $form_data['settings']['ufaq_enabled'] != 'disabled' ) ) {
145
+
146
+ foreach ( $form_data['fields'] as $field_id => $field ){
147
+
148
+ if ( $field['type'] == 'textarea' ) {
149
+
150
+ return $field['id'];
151
+ }
152
+ }
153
+ }
154
+
155
+ return false;
156
+ }
157
+ }
158
+ }
includes/Widgets.class.php ADDED
@@ -0,0 +1,382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ewdufaqWidgetManager {
4
+
5
+ public function __construct() {
6
+
7
+ add_action( 'widgets_init', array( $this, 'register_faq_post_list_widget' ) );
8
+ add_action( 'widgets_init', array( $this, 'register_recent_faqs_widget' ) );
9
+ add_action( 'widgets_init', array( $this, 'register_popular_faqs_widget' ) );
10
+ add_action( 'widgets_init', array( $this, 'register_random_faqs_widget' ) );
11
+ add_action( 'widgets_init', array( $this, 'register_faq_categories_widget' ) );
12
+ }
13
+
14
+ public function register_faq_post_list_widget() {
15
+
16
+ return register_widget( 'ewdufaqFAQPostListWidget' );
17
+ }
18
+
19
+ public function register_recent_faqs_widget() {
20
+
21
+ return register_widget( 'ewdufaqRecentFAQsWidget' );
22
+ }
23
+
24
+ public function register_popular_faqs_widget() {
25
+
26
+ return register_widget( 'ewdufaqPopularFAQsWidget' );
27
+ }
28
+
29
+ public function register_random_faqs_widget() {
30
+
31
+ return register_widget( 'ewdufaqRandomFAQsWidget' );
32
+ }
33
+
34
+ public function register_faq_categories_widget() {
35
+
36
+ return register_widget( 'ewdufaqFAQCategoriesWidget' );
37
+ }
38
+
39
+ }
40
+
41
+ class ewdufaqFAQPostListWidget extends WP_Widget {
42
+
43
+ /**
44
+ * Sets up the widgets name etc
45
+ */
46
+ public function __construct() {
47
+
48
+ parent::__construct(
49
+ 'ewd_ufaq_display_faq_post_list', // Base ID
50
+ __( 'UFAQ FAQ ID List', 'ultimate-faqs' ), // Name
51
+ array( 'description' => __( 'Insert FAQ posts using a comma-separated list of post IDs', 'ultimate-faqs' ), ) // Args
52
+ );
53
+ }
54
+
55
+ /**
56
+ * Outputs the content of the widget
57
+ *
58
+ * @param array $args
59
+ * @param array $instance
60
+ */
61
+ public function widget( $args, $instance ) {
62
+
63
+ echo $args['before_widget'];
64
+ if ( $instance['faq_title'] != '' ) { echo ( $args['before_title'] != '' ? $args['before_title'] : '<h3>' ) . $instance['faq_title'] . ( $args['after_title'] != '' ? $args['after_title'] : '</h3>' ); }
65
+ echo do_shortcode( "[select-faq faq_id='". $instance['faq_id'] . "' no_comments='Yes']" );
66
+ echo $args['after_widget'];
67
+ }
68
+
69
+ /**
70
+ * Outputs the options form on admin
71
+ *
72
+ * @param array $instance The widget options
73
+ */
74
+ public function form( $instance ) {
75
+
76
+ $faq_id = ! empty( $instance['faq_id'] ) ? $instance['faq_id'] : __( 'FAQ ID List', 'ultimate-faqs' );
77
+ $faq_title = ! empty( $instance['faq_title'] ) ? $instance['faq_title'] : __( '', 'ultimate-faqs' );
78
+
79
+ ?>
80
+
81
+ <p>
82
+ <label for="<?php echo $this->get_field_id( 'faq_id' ); ?>"><?php _e( 'FAQ ID List:', 'ultimate-faqs' ); ?></label>
83
+ <input class="widefat" id="<?php echo $this->get_field_id( 'faq_id' ); ?>" name="<?php echo $this->get_field_name( 'faq_id' ); ?>" type="text" value="<?php echo esc_attr( $faq_id ); ?>">
84
+ </p>
85
+ <p>
86
+ <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'ultimate-faqs' ); ?></label>
87
+ <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
88
+ </p>
89
+
90
+ <?php
91
+ }
92
+
93
+ /**
94
+ * Processing widget options on save
95
+ *
96
+ * @param array $new_instance The new options
97
+ * @param array $old_instance The previous options
98
+ */
99
+ public function update( $new_instance, $old_instance ) {
100
+
101
+ $instance = array();
102
+ $instance['faq_id'] = ( ! empty( $new_instance['faq_id'] ) ) ? strip_tags( $new_instance['faq_id'] ) : '';
103
+ $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
104
+
105
+ return $instance;
106
+ }
107
+ }
108
+
109
+ class ewdufaqRecentFAQsWidget extends WP_Widget {
110
+
111
+ /**
112
+ * Sets up the widgets name etc
113
+ */
114
+ public function __construct() {
115
+
116
+ parent::__construct(
117
+ 'ewd_ufaq_display_recent_faqs', // Base ID
118
+ __( 'Recent FAQs', 'ultimate-faqs' ), // Name
119
+ array( 'description' => __( 'Insert a number of the most recent FAQs', 'ultimate-faqs' ), ) // Args
120
+ );
121
+ }
122
+
123
+ /**
124
+ * Outputs the content of the widget
125
+ *
126
+ * @param array $args
127
+ * @param array $instance
128
+ */
129
+ public function widget( $args, $instance ) {
130
+
131
+ echo $args['before_widget'];
132
+ if ( $instance['faq_title'] != '' ) { echo ( $args['before_title'] != '' ? $args['before_title'] : '<h3>' ) . $instance['faq_title'] . ( $args['after_title'] != '' ? $args['after_title'] : '</h3>' ); }
133
+ echo do_shortcode( "[recent-faqs post_count='". $instance['post_count'] . "' no_comments='Yes']" );
134
+ echo $args['after_widget'];
135
+ }
136
+
137
+ /**
138
+ * Outputs the options form on admin
139
+ *
140
+ * @param array $instance The widget options
141
+ */
142
+ public function form( $instance ) {
143
+
144
+ $post_count = ! empty( $instance['post_count'] ) ? $instance['post_count'] : __( 'Number of FAQs', 'ultimate-faqs' );
145
+ $faq_title = ! empty( $instance['faq_title'] ) ? $instance['faq_title'] : __( 'Widget Title', 'ultimate-faqs' );
146
+
147
+ ?>
148
+
149
+ <p>
150
+ <label for="<?php echo $this->get_field_id( 'post_count' ); ?>"><?php _e( 'Number of FAQs:', 'ultimate-faqs' ); ?></label>
151
+ <input class="widefat" id="<?php echo $this->get_field_id( 'post_count' ); ?>" name="<?php echo $this->get_field_name( 'post_count' ); ?>" type="text" value="<?php echo esc_attr( $post_count ); ?>">
152
+ </p>
153
+ <p>
154
+ <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'ultimate-faqs' ); ?></label>
155
+ <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
156
+ </p>
157
+
158
+ <?php
159
+ }
160
+
161
+ /**
162
+ * Processing widget options on save
163
+ *
164
+ * @param array $new_instance The new options
165
+ * @param array $old_instance The previous options
166
+ */
167
+ public function update( $new_instance, $old_instance ) {
168
+
169
+ $instance = array();
170
+ $instance['post_count'] = ( ! empty( $new_instance['post_count'] ) ) ? strip_tags( $new_instance['post_count'] ) : '';
171
+ $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
172
+
173
+ return $instance;
174
+ }
175
+ }
176
+
177
+ class ewdufaqPopularFAQsWidget extends WP_Widget {
178
+
179
+ /**
180
+ * Sets up the widgets name etc
181
+ */
182
+ public function __construct() {
183
+
184
+ parent::__construct(
185
+ 'ewd_ufaq_popular_reviews_widget', // Base ID
186
+ __( 'Popular FAQs', 'ultimate-faqs' ), // Name
187
+ array( 'description' => __( 'Insert a number of popular FAQs.', 'ultimate-faqs' ), ) // Args
188
+ );
189
+ }
190
+
191
+ /**
192
+ * Outputs the content of the widget
193
+ *
194
+ * @param array $args
195
+ * @param array $instance
196
+ */
197
+ public function widget( $args, $instance ) {
198
+
199
+ echo $args['before_widget'];
200
+ if ( $instance['faq_title'] != '' ) { echo ( $args['before_title'] != '' ? $args['before_title'] : '<h3>' ) . $instance['faq_title'] . ( $args['after_title'] != '' ? $args['after_title'] : '</h3>' ); }
201
+ echo do_shortcode( "[popular-faqs post_count='". $instance['post_count'] . "' no_comments='Yes']" );
202
+ echo $args['after_widget'];
203
+ }
204
+
205
+ /**
206
+ * Outputs the options form on admin
207
+ *
208
+ * @param array $instance The widget options
209
+ */
210
+ public function form( $instance ) {
211
+
212
+ $post_count = ! empty( $instance['post_count'] ) ? $instance['post_count'] : __( 'Number of FAQs', 'ultimate-faqs' );
213
+ $faq_title = ! empty( $instance['faq_title'] ) ? $instance['faq_title'] : __( 'Widget Title', 'ultimate-faqs' );
214
+
215
+ ?>
216
+
217
+ <p>
218
+ <label for="<?php echo $this->get_field_id( 'post_count' ); ?>"><?php _e( 'Number of FAQs:', 'ultimate-faqs' ); ?></label>
219
+ <input class="widefat" id="<?php echo $this->get_field_id( 'post_count' ); ?>" name="<?php echo $this->get_field_name( 'post_count' ); ?>" type="text" value="<?php echo esc_attr( $post_count ); ?>">
220
+ </p>
221
+ <p>
222
+ <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'ultimate-faqs' ); ?></label>
223
+ <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
224
+ </p>
225
+
226
+ <?php
227
+ }
228
+
229
+ /**
230
+ * Processing widget options on save
231
+ *
232
+ * @param array $new_instance The new options
233
+ * @param array $old_instance The previous options
234
+ */
235
+ public function update( $new_instance, $old_instance ) {
236
+
237
+ $instance = array();
238
+ $instance['post_count'] = ( ! empty( $new_instance['post_count'] ) ) ? strip_tags( $new_instance['post_count'] ) : '';
239
+ $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
240
+
241
+ return $instance;
242
+ }
243
+ }
244
+
245
+ class ewdufaqRandomFAQsWidget extends WP_Widget {
246
+
247
+ /**
248
+ * Sets up the widgets name etc
249
+ */
250
+ public function __construct() {
251
+
252
+ parent::__construct(
253
+ 'ewd_ufaq_display_random_faq', // Base ID
254
+ __( 'Random FAQ', 'ultimate-faqs' ), // Name
255
+ array( 'description' => __( 'Display a random FAQ', 'ultimate-faqs' ), ) // Args
256
+ );
257
+ }
258
+
259
+ /**
260
+ * Outputs the content of the widget
261
+ *
262
+ * @param array $args
263
+ * @param array $instance
264
+ */
265
+ public function widget( $args, $instance ) {
266
+
267
+ $args = array(
268
+ 'orderby' => 'rand',
269
+ 'posts_per_page' => '1',
270
+ 'post_type' => EWD_UFAQ_FAQ_POST_TYPE
271
+ );
272
+
273
+ $faqs = get_posts( $args );
274
+ $faq = reset( $faqs );
275
+
276
+ echo $args['before_widget'];
277
+ if ($instance['faq_title'] != "") {echo ($args['before_title'] != '' ? $args['before_title'] : "<h3>") . $instance['faq_title'] . ($args['after_title'] != '' ? $args['after_title'] : "</h3>");}
278
+ echo do_shortcode( "[select-faq faq_id='". $faq->ID . "' no_comments='Yes']" );
279
+ echo $args['after_widget'];
280
+ }
281
+
282
+ /**
283
+ * Outputs the options form on admin
284
+ *
285
+ * @param array $instance The widget options
286
+ */
287
+ public function form( $instance ) {
288
+
289
+ $faq_title = ! empty( $instance['faq_title'] ) ? $instance['faq_title'] : __( 'Widget Title', 'ultimate-faqs' );
290
+
291
+ ?>
292
+
293
+ <p>
294
+ <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'ultimate-faqs' ); ?></label>
295
+ <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
296
+ </p>
297
+
298
+ <?php
299
+ }
300
+
301
+ /**
302
+ * Processing widget options on save
303
+ *
304
+ * @param array $new_instance The new options
305
+ * @param array $old_instance The previous options
306
+ */
307
+ public function update( $new_instance, $old_instance ) {
308
+
309
+ $instance = array();
310
+ $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
311
+
312
+ return $instance;
313
+ }
314
+ }
315
+
316
+ class ewdufaqFAQCategoriesWidget extends WP_Widget {
317
+
318
+ /**
319
+ * Sets up the widgets name etc
320
+ */
321
+ public function __construct() {
322
+
323
+ parent::__construct(
324
+ 'ewd_ufaq_display_faq_categories', // Base ID
325
+ __( 'UFAQ FAQ Category List', 'ultimate-faqs' ), // Name
326
+ array( 'description' => __( 'Insert FAQ posts using a comma-separated list of categories', 'ultimate-faqs' ), ) // Args
327
+ );
328
+ }
329
+
330
+ /**
331
+ * Outputs the content of the widget
332
+ *
333
+ * @param array $args
334
+ * @param array $instance
335
+ */
336
+ public function widget( $args, $instance ) {
337
+
338
+ echo $args['before_widget'];
339
+ if ($instance['faq_title'] != "") {echo ($args['before_title'] != '' ? $args['before_title'] : "<h3>") . $instance['faq_title'] . ($args['after_title'] != '' ? $args['after_title'] : "</h3>");}
340
+ echo do_shortcode( "[ultimate-faqs include_category='". $instance['include_category'] . "' no_comments='Yes']" );
341
+ echo $args['after_widget'];
342
+ }
343
+
344
+ /**
345
+ * Outputs the options form on admin
346
+ *
347
+ * @param array $instance The widget options
348
+ */
349
+ public function form( $instance ) {
350
+
351
+ $include_category = ! empty( $instance['include_category'] ) ? $instance['include_category'] : __( 'FAQ Category List', 'ultimate-faqs' );
352
+ $faq_title = ! empty( $instance['faq_title'] ) ? $instance['faq_title'] : __( 'Widget Title', 'ultimate-faqs' );
353
+
354
+ ?>
355
+
356
+ <p>
357
+ <label for="<?php echo $this->get_field_id( 'include_category' ); ?>"><?php _e( 'FAQ Category List:', 'ultimate-faqs' ); ?></label>
358
+ <input class="widefat" id="<?php echo $this->get_field_id( 'include_category' ); ?>" name="<?php echo $this->get_field_name( 'include_category' ); ?>" type="text" value="<?php echo esc_attr( $include_category ); ?>">
359
+ </p>
360
+ <p>
361
+ <label for="<?php echo $this->get_field_id( 'faq_title' ); ?>"><?php _e( 'Widget Title:', 'ultimate-faqs' ); ?></label>
362
+ <input class="widefat" id="<?php echo $this->get_field_id( 'faq_title' ); ?>" name="<?php echo $this->get_field_name( 'faq_title' ); ?>" type="text" value="<?php echo esc_attr( $faq_title ); ?>">
363
+ </p>
364
+
365
+ <?php
366
+ }
367
+
368
+ /**
369
+ * Processing widget options on save
370
+ *
371
+ * @param array $new_instance The new options
372
+ * @param array $old_instance The previous options
373
+ */
374
+ public function update( $new_instance, $old_instance ) {
375
+
376
+ $instance = array();
377
+ $instance['include_category'] = ( ! empty( $new_instance['include_category'] ) ) ? strip_tags( $new_instance['include_category'] ) : '';
378
+ $instance['faq_title'] = ( ! empty( $new_instance['faq_title'] ) ) ? strip_tags( $new_instance['faq_title'] ) : '';
379
+
380
+ return $instance;
381
+ }
382
+ }
includes/WooCommerce.class.php ADDED
@@ -0,0 +1,307 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'ABSPATH' ) ) exit;
3
+
4
+ if ( !class_exists( 'ewdufaqWooCommerce' ) ) {
5
+ /**
6
+ * Class to handle WooCommerce integration for Ultimate FAQs
7
+ *
8
+ * @since 2.0.0
9
+ */
10
+ class ewdufaqWooCommerce {
11
+
12
+ public function __construct() {
13
+
14
+ add_filter( 'woocommerce_product_tabs', array( $this, 'add_woocommerce_tab' ) );
15
+
16
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue' ) );
17
+
18
+ add_filter( 'woocommerce_product_data_tabs', array( $this, 'add_admin_product_page_faq_tab' ), 10, 1 );
19
+ add_action( 'woocommerce_product_data_panels', array( $this, 'add_admin_product_page_faqs' ) );
20
+
21
+ add_action( 'wp_ajax_ewd_ufaq_add_wc_faqs', array( $this, 'add_wc_faqs' ) );
22
+ add_action( 'wp_ajax_ewd_ufaq_delete_wc_faqs', array( $this, 'delete_wc_faqs' ) );
23
+ add_action( 'wp_ajax_ewd_ufaq_wc_faq_category', array( $this, 'wc_faq_category' ) );
24
+ }
25
+
26
+ /**
27
+ * Adds an FAQ tab to WooCommerce
28
+ * @since 2.0.0
29
+ */
30
+ public function add_woocommerce_tab( $tabs ) {
31
+ global $product;
32
+ global $ewd_ufaq_controller;
33
+
34
+ if ( ! $ewd_ufaq_controller->settings->get_setting( 'woocommerce-faqs' ) ) { return $tabs; }
35
+
36
+ $product_post = ( $ewd_ufaq_controller->settings->get_setting( 'woocommerce-use-product' ) and is_object( $product ) ) ? get_post( $product->get_id() ) : get_post( get_the_id() );
37
+
38
+ $ufaq_product_category = get_term_by( 'name', $product_post->post_title, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY );
39
+
40
+ $wc_cats = get_the_terms( $product_post, 'product_cat' );
41
+
42
+ $ufaq_wccat_category = false;
43
+
44
+ if ( $wc_cats ) {
45
+
46
+ foreach ( $wc_cats as $wc_cat ) {
47
+
48
+ if ( get_term_by( 'name', $wc_cat->name, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY ) ) { $ufaq_wccat_category = true; }
49
+ }
50
+ }
51
+
52
+ $current_faqs = is_array( get_post_meta( $product_post->ID, 'EWD_UFAQ_WC_Selected_FAQs', true ) ) ? get_post_meta( $product_post->ID, 'EWD_UFAQ_WC_Selected_FAQs', true ) : array();
53
+
54
+ if ( ( $ufaq_product_category or $ufaq_wccat_category or ! empty( $current_faqs ) ) ) {
55
+
56
+ $tabs['faq_tab'] = array(
57
+ 'title' => $ewd_ufaq_controller->settings->get_setting( 'label-woocommerce-tab' ),
58
+ 'priority' => 50,
59
+ 'callback' => array( $this, 'faq_tab_content' )
60
+ );
61
+
62
+ return $tabs;
63
+ }
64
+ }
65
+
66
+ public function admin_enqueue( $hook ) {
67
+ global $post;
68
+ global $ewd_ufaq_controller;
69
+
70
+ if ( ! $ewd_ufaq_controller->settings->get_setting( 'woocommerce-faqs' ) ) { return; }
71
+
72
+ if ( $hook != 'edit.php' and $hook != 'post-new.php' and $hook != 'post.php' ) { return; }
73
+
74
+ if ( ! isset( $post->post_type ) or $post->post_type != 'product' ) { return; }
75
+
76
+ wp_enqueue_style( 'ewd-ufaq-wc-admin-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-wc-admin.css', array(), EWD_UFAQ_VERSION );
77
+
78
+ wp_enqueue_script( 'ewd-ufaq-wc-admin-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-wc-admin.js', array( 'jquery' ), EWD_UFAQ_VERSION );
79
+ }
80
+
81
+ public function faq_tab_content() {
82
+ global $product;
83
+ global $ewd_ufaq_controller;
84
+
85
+ $product_post = ( $ewd_ufaq_controller->settings->get_setting( 'woocommerce-use-product' ) and is_object( $product ) ) ? get_post( $product->get_id() ) : get_post( get_the_id() );
86
+
87
+ $ufaq_product_category = get_term_by( 'name', $product_post->post_title, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY );
88
+
89
+ echo '<h2>' . esc_html( $ewd_ufaq_controller->settings->get_setting( 'label-woocommerce-tab' ) ) . '</h2>';
90
+
91
+ $current_faqs = is_array( get_post_meta( $product_post->ID, 'EWD_UFAQ_WC_Selected_FAQs', true ) ) ? get_post_meta( $product_post->ID, 'EWD_UFAQ_WC_Selected_FAQs', true ) : array();
92
+
93
+ if ( ! empty( $current_faqs ) ) {
94
+
95
+ $faq_list = implode( ',', $current_faqs );
96
+ echo do_shortcode( "[ultimate-faqs post__in_string='". $faq_list . "']" );
97
+ }
98
+ else {
99
+
100
+ $wc_cats = get_the_terms( $product_post, 'product_cat' );
101
+ $ufaq_wc_category_list = '';
102
+
103
+ if ( $wc_cats ) {
104
+
105
+ foreach ( $wc_cats as $wc_cat ) {
106
+
107
+ $ufaq_wc_category = get_term_by( 'name', $wc_cat->name, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY );
108
+ if ( $ufaq_wc_category ) { $ufaq_wc_category_list .= ',' . $ufaq_wc_category->slug; }
109
+ }
110
+ }
111
+ echo do_shortcode( "[ultimate-faqs include_category='". $ufaq_product_category->slug . $ufaq_wc_category_list . "']" );
112
+ }
113
+ }
114
+
115
+ public function add_admin_product_page_faq_tab( $tabs ) {
116
+ global $ewd_ufaq_controller;
117
+
118
+ if ( ! $ewd_ufaq_controller->settings->get_setting( 'woocommerce-faqs' ) ) { return $tabs; }
119
+
120
+ $args = array(
121
+ 'label' => __('FAQs', 'ultimate-faqs'),
122
+ 'target' => 'ewd_ufaq_faqs',
123
+ 'class' => array()
124
+ );
125
+
126
+ $tabs['faqs'] = $args;
127
+
128
+ return $tabs;
129
+ }
130
+
131
+ public function add_admin_product_page_faqs() {
132
+ global $thepostid;
133
+ global $ewd_ufaq_controller;
134
+
135
+ if ( ! $ewd_ufaq_controller->settings->get_setting( 'woocommerce-faqs' ) ) { return $tabs; }
136
+
137
+ $current_faqs = (array) get_post_meta( $thepostid, 'EWD_UFAQ_WC_Selected_FAQs', true );
138
+
139
+ $all_faqs = get_posts( array( 'numberposts' => -1, 'post_type' => EWD_UFAQ_FAQ_POST_TYPE ) );
140
+ $categories = get_terms( array( 'taxonomy' => EWD_UFAQ_FAQ_CATEGORY_TAXONOMY ) );
141
+
142
+ ?>
143
+
144
+ <div id='ewd_ufaq_faqs' class='panel woocommerce_options_panel'>
145
+
146
+ <div class='ewd-ufaq-explanation'>
147
+ <?php _e( 'You can use the form below to select which FAQs to display for this product, or leave it blank to use the default category naming system.', 'ultimate-faqs' ); ?>
148
+ </div>
149
+
150
+ <div id='ewd-ufaq-add-delete-faq-form-container'>
151
+
152
+ <div id='ewd-ufaq-add-faq-form-div'>
153
+
154
+ <form id='ewd-ufaq-add-faq-form'>
155
+
156
+ <select class='ewd-ufaq-category-filter' name='ewd-ufaq-category-filter'>
157
+ <option value=''><?php _e('All Categories', 'ultimate-faqs' ); ?></option>
158
+ <?php foreach ( $categories as $category ) { ?> <option value='<?php echo $category->term_id; ?>'><?php echo esc_html( $category->name ); ?></option><?php } ?>
159
+ </select>
160
+
161
+ <table class='form-table ewd-ufaq-faq-add-table'>
162
+
163
+ <tr>
164
+ <th><?php _e( 'Add?', 'ultimate-faqs' ); ?></th>
165
+ <th><?php _e( 'FAQ', 'ultimate-faqs' ); ?></th>
166
+ </tr>
167
+
168
+ <?php foreach ( $all_faqs as $faq ) { ?>
169
+
170
+ <tr class='ewd-ufaq-faq-row' data-faqid='<?php echo $faq->ID; ?>'>
171
+ <td><input type='checkbox' class='ewd-ufaq-add-faq' name='Add_FAQs[]' value='<?php echo $faq->ID; ?>'/></td>
172
+ <td><?php echo esc_html( $faq->post_title ); ?></td>
173
+ </tr>
174
+ <?php } ?>
175
+
176
+ </table>
177
+ </form>
178
+
179
+ <button class='ewd-ufaq-add-faq-button'><?php _e( 'Add FAQs', 'ultimate-faqs' ); ?></button>
180
+ </div>
181
+
182
+ <div id='ewd-ufaq-delete-faq-form-div'>
183
+
184
+ <form id='ewd-ufaq-delete-faq-form'>
185
+
186
+ <input type='hidden' id='ewd-ufaq-post-id' value='<?php echo esc_attr( $thepostid ); ?>' />
187
+
188
+ <table class='form-table ewd-ufaq-delete-table'>
189
+
190
+ <tr>
191
+ <th><?php _e( 'Delete?', 'ultimate-faqs' ); ?></th>
192
+ <th><?php _e( 'FAQ', 'ultimate-faqs' ); ?></th>
193
+ </tr>
194
+
195
+ <?php foreach ( $current_faqs as $faq_id ) { ?>
196
+
197
+ <?php $faq = get_post( $faq_id ); ?>
198
+ <tr class='ewd-ufaq-faq-row ewd-ufaq-delete-faq-row' data-faqid='<?php echo $faq_id; ?>'>
199
+ <td><input type='checkbox' class='ewd-ufaq-delete-faq' name='Delete_FAQs[]' value='<?php echo $faq_id; ?>'/></td>
200
+ <td><?php echo esc_html( $faq->post_title ); ?></td>
201
+ </tr>
202
+ <?php } ?>
203
+
204
+ </table>
205
+ </form>
206
+
207
+ <button class='ewd-ufaq-delete-faq-button'><?php _e( 'Delete FAQs', 'ultimate-faqs' ); ?></button>
208
+ </div>
209
+ </div>
210
+ </div>
211
+
212
+ <?php
213
+
214
+ }
215
+
216
+ public function add_wc_faqs() {
217
+
218
+ $post_id = intval( $_POST['Post_ID'] );
219
+
220
+ $current_faqs = (array) get_post_meta( $post_id, 'EWD_UFAQ_WC_Selected_FAQs', true );
221
+
222
+ $faqs = json_decode( stripslashes_deep( $_POST['FAQs'] ) );
223
+ if ( ! is_array( $faqs ) ) { $faqs = array(); }
224
+
225
+ $added_faqs = array();
226
+ foreach ( $faqs as $faq ) {
227
+
228
+ if ( in_array( $faq, $current_faqs ) ) { continue; }
229
+
230
+ $current_faqs[] = $faq;
231
+
232
+ $faq_post = get_post( $faq );
233
+ $added_faqs[] = array( 'ID' => $faq, 'Name' => $faq_post->post_title);
234
+ }
235
+
236
+ update_post_meta( $post_id, 'EWD_UFAQ_WC_Selected_FAQs', $current_faqs );
237
+
238
+ echo json_encode( $added_faqs );
239
+
240
+ die();
241
+ }
242
+
243
+ public function delete_wc_faqs() {
244
+
245
+ $post_id = intval( $_POST['Post_ID'] );
246
+
247
+ $current_faqs = (array) get_post_meta( $post_id, 'EWD_UFAQ_WC_Selected_FAQs', true );
248
+
249
+ $faqs = json_decode( stripslashes_deep( $_POST['FAQs'] ) );
250
+ if ( ! is_array( $faqs ) ) { $faqs = array(); }
251
+
252
+ $remaining_faqs = array_diff( $current_faqs, $faqs );
253
+
254
+ update_post_meta( $post_id, 'EWD_UFAQ_WC_Selected_FAQs', $remaining_faqs );
255
+
256
+ die();
257
+ }
258
+
259
+ public function wc_faq_category() {
260
+
261
+ $cat_id = intval( $_POST['Cat_ID'] );
262
+
263
+ $args = array(
264
+ 'numberposts' => -1,
265
+ 'post_type' => EWD_UFAQ_FAQ_POST_TYPE,
266
+ );
267
+
268
+ if ( $cat_id != '' ) {
269
+
270
+ $args['tax_query'] = array(
271
+ array(
272
+ 'taxonomy' => EWD_UFAQ_FAQ_CATEGORY_TAXONOMY,
273
+ 'terms' => $cat_id
274
+ )
275
+ );
276
+ }
277
+
278
+ $all_faqs = get_posts( $args );
279
+
280
+ ob_start();
281
+
282
+ ?>
283
+
284
+ <table class='form-table ewd-ufaq-faq-add-table'>
285
+ <tr>
286
+ <th><?php _e( 'Add?', 'ultimate-faqs' ); ?></th>
287
+ <th><?php _e( 'FAQ', 'ultimate-faqs' ); ?></th>
288
+ </tr>
289
+ <?php foreach ( $all_faqs as $faq ) { ?>
290
+
291
+ <tr class='ewd-ufaq-faq-row' data-faqid='<?php echo $faq->ID; ?>'>
292
+ <td><input type='checkbox' class='ewd-ufaq-add-faq' name='Add_FAQs[]' value='<?php echo $faq->ID; ?>'/></td>
293
+ <td><?php echo esc_html( $faq->post_title ); ?></td>
294
+ </tr>
295
+ <?php } ?>
296
+ </table>
297
+
298
+ <?php
299
+
300
+ $output = ob_get_clean();
301
+
302
+ echo $output;
303
+
304
+ die();
305
+ }
306
+ }
307
+ }
includes/template-functions.php ADDED
@@ -0,0 +1,401 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Create a shortcode to display multiple FAQs
5
+ * @since 2.0.0
6
+ */
7
+ function ewd_ufaq_faqs_shortcode( $atts ) {
8
+ global $ewd_ufaq_controller;
9
+
10
+ // Define shortcode attributes
11
+ $faq_atts = array(
12
+ 'search_string' => '',
13
+ 'post__in' => '',
14
+ 'post__in_string' => '',
15
+ 'include_tag' => '',
16
+ 'include_category' => '',
17
+ 'exclude_category' => '',
18
+ 'include_category_ids' => '',
19
+ 'exclude_category_ids' => '',
20
+ 'include_category_children' => '',
21
+ 'no_comments' => '',
22
+ 'orderby' => '',
23
+ 'order' => '',
24
+ 'display_all_answers' => '',
25
+ 'faq_page' => 1,
26
+ 'post_count' => -1
27
+ );
28
+
29
+ if ( empty( $faq_atts['orderby'] ) ) { $faq_atts['orderby'] = $ewd_ufaq_controller->settings->get_setting( 'faq-order-by' ); }
30
+
31
+ if ( empty( $faq_atts['order'] ) ) { $faq_atts['order'] = $ewd_ufaq_controller->settings->get_setting( 'faq-order' ); }
32
+
33
+ // Create filter so addons can modify the accepted attributes
34
+ $faq_atts = apply_filters( 'ewd_ufaq_faqs_shortcode_atts', $faq_atts );
35
+
36
+ // Extract the shortcode attributes
37
+ $args = shortcode_atts( $faq_atts, $atts );
38
+
39
+ $query = new ewdufaqQuery( $args );
40
+
41
+ $query->parse_request_args();
42
+ $query->prepare_args();
43
+
44
+ // Render faqs
45
+ ewd_ufaq_load_view_files();
46
+
47
+ $faqs = new ewdufaqViewFAQs( $args );
48
+
49
+ $faqs->set_faqs( $query->get_faqs() );
50
+
51
+ $ewd_ufaq_controller->shortcode_printing = true;
52
+
53
+ $output = $faqs->render();
54
+
55
+ $ewd_ufaq_controller->shortcode_printing = false;
56
+
57
+ return $output;
58
+ }
59
+ add_shortcode( 'ultimate-faqs', 'ewd_ufaq_faqs_shortcode' );
60
+
61
+ /**
62
+ * Create a shortcode to display the FAQ search, plus any matching FAQs
63
+ * @since 2.0.0
64
+ */
65
+ function ewd_ufaq_search_faqs_shortcode( $atts ) {
66
+ global $ewd_ufaq_controller;
67
+
68
+ if ( ! $ewd_ufaq_controller->permissions->check_permission( 'search' ) ) { return; }
69
+
70
+ // Define shortcode attributes
71
+ $faq_atts = array(
72
+ 'include_category' => '',
73
+ 'exclude_category' => '',
74
+ 'show_on_load' => '',
75
+ 'no_comments' => '',
76
+ 'orderby' => '',
77
+ 'order' => '',
78
+ 'display_all_answers' => '',
79
+ 'faq_page' => 1,
80
+ 'post_count' => -1,
81
+ );
82
+
83
+ if ( empty( $faq_atts['orderby'] ) ) { $faq_atts['orderby'] = $ewd_ufaq_controller->settings->get_setting( 'faq-order-by' ); }
84
+
85
+ if ( empty( $faq_atts['order'] ) ) { $faq_atts['order'] = $ewd_ufaq_controller->settings->get_setting( 'faq-order' ); }
86
+
87
+ // Create filter so addons can modify the accepted attributes
88
+ $faq_atts = apply_filters( 'ewd_ufaq_faqs_shortcode_atts', $faq_atts );
89
+
90
+ // Extract the shortcode attributes
91
+ $args = shortcode_atts( $faq_atts, $atts );
92
+
93
+ $query = new ewdufaqQuery( $args );
94
+
95
+ $query->parse_request_args();
96
+ $query->prepare_args();
97
+
98
+ // Render faqs
99
+ ewd_ufaq_load_view_files();
100
+
101
+ $faqs = new ewdufaqViewFAQSearch( $args );
102
+
103
+ $faqs->set_faqs( $query->get_faqs() );
104
+
105
+ $ewd_ufaq_controller->shortcode_printing = true;
106
+
107
+ $output = $faqs->render();
108
+
109
+ $ewd_ufaq_controller->shortcode_printing = false;
110
+
111
+ return $output;
112
+ }
113
+ add_shortcode( 'ultimate-faq-search', 'ewd_ufaq_search_faqs_shortcode' );
114
+
115
+ /**
116
+ * Create a shortcode to display multiple FAQs
117
+ * @since 2.0.0
118
+ */
119
+ function ewd_ufaq_submit_faq_shortcode( $atts ) {
120
+ global $ewd_ufaq_controller;
121
+
122
+ if ( ! $ewd_ufaq_controller->permissions->check_permission( 'submit-faq' ) ) { return; }
123
+
124
+ // Define shortcode attributes
125
+ $faq_atts = array(
126
+ 'success_message' => '',
127
+ 'submit_faq_form_title' => '',
128
+ 'submit_faq_instructions' => '',
129
+ 'submit_text' => '',
130
+ );
131
+
132
+ // Create filter so addons can modify the accepted attributes
133
+ $faq_atts = apply_filters( 'ewd_ufaq_faqs_shortcode_atts', $faq_atts );
134
+
135
+ // Extract the shortcode attributes
136
+ $args = shortcode_atts( $faq_atts, $atts );
137
+
138
+ // Handle FAQ submission
139
+ if ( isset( $_POST['submit_question'] ) ) {
140
+
141
+ $args['faq_submitted'] = true;
142
+
143
+ $faq = new ewdufaqFAQ();
144
+ $success = $faq->insert_faq();
145
+
146
+ if ( $success ) {
147
+
148
+ $args['update_message'] = ! empty( $args['success_message'] ) ? $args['success_message'] : $ewd_ufaq_controller->settings->get_setting( 'label-thank-you-submit' );
149
+ }
150
+ else {
151
+
152
+ $args['update_message'] = '';
153
+
154
+ foreach ( $faq->validation_errors as $validation_error ) {
155
+
156
+ $args['update_message'] .= '<br />' . $validation_error['message'];
157
+ }
158
+ }
159
+ }
160
+
161
+ // Render faq
162
+ ewd_ufaq_load_view_files();
163
+
164
+ $submit_faq = new ewdufaqViewSubmitFAQ( $args );
165
+
166
+ $ewd_ufaq_controller->shortcode_printing = true;
167
+
168
+ $output = $submit_faq->render();
169
+
170
+ $ewd_ufaq_controller->shortcode_printing = false;
171
+
172
+ return $output;
173
+ }
174
+ add_shortcode( 'submit-question', 'ewd_ufaq_submit_faq_shortcode' );
175
+
176
+ /**
177
+ * Create a shortcode to display a single review
178
+ * @since 2.0.0
179
+ */
180
+ function ewd_ufaq_faq_shortcode( $atts ) {
181
+ global $ewd_ufaq_controller;
182
+
183
+ // Define shortcode attributes
184
+ $faq_atts = array(
185
+ 'faq_id' => 0,
186
+ 'faq_name' => '',
187
+ 'faq_slug' => '',
188
+ 'no_comments' => ''
189
+ );
190
+
191
+ // Create filter so addons can modify the accepted attributes
192
+ $faq_atts = apply_filters( 'ewd_ufaq_review_shortcode', $faq_atts );
193
+
194
+ $args = shortcode_atts( $faq_atts, $atts );
195
+
196
+ $name_array = ! empty( $args['faq_name'] ) ? explode( ',', $args['faq_name'] ) : array();
197
+ $slug_array = ! empty( $args['faq_slug'] ) ? explode( ',', $args['faq_slug'] ) : array();
198
+ $id_array = ! empty( $args['faq_id'] ) ? explode( ',', $args['faq_id'] ) : array();
199
+
200
+ $post_id_array = array();
201
+
202
+ foreach ( $name_array as $post_name ) {
203
+
204
+ $single_post = get_page_by_title( $post_name, 'OBJECT', EWD_UFAQ_FAQ_POST_TYPE );
205
+ $post_id_array[] = $single_post->ID;
206
+ }
207
+
208
+ foreach ( $slug_array as $post_slug ) {
209
+
210
+ $single_post = get_page_by_path( $post_slug, 'OBJECT', EWD_UFAQ_FAQ_POST_TYPE );
211
+ $post_id_array[] = $single_post->ID;
212
+ }
213
+
214
+ foreach ( $id_array as $post_id ) {
215
+
216
+ $post_id_array[] = (int) $post_id;
217
+ }
218
+
219
+ $faq_args = array(
220
+ 'post__in' => $post_id_array,
221
+ 'no_comments' => $args['no_comments']
222
+ );
223
+
224
+ $output = ewd_ufaq_faqs_shortcode( $faq_args );
225
+
226
+ return $output;
227
+ }
228
+ add_shortcode( 'select-faq', 'ewd_ufaq_faq_shortcode' );
229
+
230
+ /**
231
+ * Create a shortcode to display a number of the most popular FAQs
232
+ * @since 2.0.0
233
+ */
234
+ function ewd_ufaq_popular_faqs_shortcode( $atts ) {
235
+
236
+ $defaults = array(
237
+ 'no_comments' => '',
238
+ 'post_count' => 5
239
+ );
240
+
241
+ $shortcode_atts = shortcode_atts( $defaults, $atts ) ;
242
+
243
+ $shortcode_atts['orderby'] = 'popular';
244
+
245
+ $output = ewd_ufaq_faqs_shortcode( $shortcode_atts );
246
+
247
+ return $output;
248
+ }
249
+ add_shortcode( 'popular-faqs', 'ewd_ufaq_popular_faqs_shortcode' );
250
+
251
+ /**
252
+ * Create a shortcode to display a number of the most recently published FAQs
253
+ * @since 2.0.0
254
+ */
255
+ function ewd_ufaq_recent_faqs_shortcode( $atts ) {
256
+
257
+ $defaults = array(
258
+ 'no_comments' => '',
259
+ 'post_count' => 5
260
+ );
261
+
262
+ $shortcode_atts = shortcode_atts( $defaults, $atts );
263
+
264
+ $shortcode_atts['orderby'] = 'date';
265
+
266
+ $output = ewd_ufaq_faqs_shortcode( $shortcode_atts );
267
+
268
+ return $output;
269
+ }
270
+ add_shortcode( 'recent-faqs', 'ewd_ufaq_recent_faqs_shortcode' );
271
+
272
+ /**
273
+ * Create a shortcode to display a number of the top rated FAQs
274
+ * @since 2.0.0
275
+ */
276
+ function ewd_ufaq_top_rated_faqs_shortcode( $atts ) {
277
+
278
+ $defaults = array(
279
+ 'no_comments' => '',
280
+ 'post_count' => 5
281
+ );
282
+
283
+ $shortcode_atts = shortcode_atts( $defaults, $atts );
284
+
285
+ $shortcode_atts['orderby'] = 'rating';
286
+
287
+ $output = ewd_ufaq_faqs_shortcode( $shortcode_atts );
288
+
289
+ return $output;
290
+ }
291
+ add_shortcode( 'top-rated-faqs', 'ewd_ufaq_top_rated_faqs_shortcode' );
292
+
293
+ function ewd_ufaq_load_view_files() {
294
+
295
+ $files = array(
296
+ EWD_UFAQ_PLUGIN_DIR . '/views/Base.class.php' // This will load all default classes
297
+ );
298
+
299
+ $files = apply_filters( 'ewd_ufaq_load_view_files', $files );
300
+
301
+ foreach( $files as $file ) {
302
+ require_once( $file );
303
+ }
304
+
305
+ }
306
+
307
+ if ( ! function_exists( 'ewd_ufaq_validate_captcha' ) ) {
308
+ function ewd_ufaq_validate_captcha() {
309
+
310
+ $modifiedcode = intval( $_POST['ewd_ufaq_modified_captcha'] );
311
+ $usercode = intval( $_POST['ewd_ufaq_captcha'] );
312
+
313
+ $code = ewd_ufaq_decrypt_catpcha_code( $modifiedcode );
314
+
315
+ $validate_captcha = $code == $usercode ? 'Yes' : 'No';
316
+
317
+ return $validate_captcha;
318
+ }
319
+ }
320
+
321
+ if ( ! function_exists( 'ewd_ufaq_encrypt_captcha_code' ) ) {
322
+ function ewd_ufaq_encrypt_captcha_code( $code ) {
323
+
324
+ $modifiedcode = ($code + 5) * 3;
325
+
326
+ return $modifiedcode;
327
+ }
328
+ }
329
+
330
+ if ( ! function_exists( 'ewd_ufaq_encrypt_captcha_code' ) ) {
331
+ function ewd_ufaq_decrypt_catpcha_code( $modifiedcode ) {
332
+
333
+ $code = ($modifiedcode / 3) - 5;
334
+
335
+ return $code;
336
+ }
337
+ }
338
+
339
+ if ( ! function_exists( 'ewd_ufaq_decode_infinite_table_setting' ) ) {
340
+ function ewd_ufaq_decode_infinite_table_setting( $values ) {
341
+
342
+ return is_array( json_decode( html_entity_decode( $values ) ) ) ? json_decode( html_entity_decode( $values ) ) : array();
343
+ }
344
+ }
345
+
346
+ if ( ! function_exists( 'ewd_hex_to_rgb' ) ) {
347
+ function ewd_hex_to_rgb( $hex ) {
348
+
349
+ $hex = str_replace("#", "", $hex);
350
+
351
+ // return if the string isn't a color code
352
+ if ( strlen( $hex ) !== 3 and strlen( $hex ) !== 6 ) { return '0,0,0'; }
353
+
354
+ if(strlen($hex) == 3) {
355
+ $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) );
356
+ $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) );
357
+ $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) );
358
+ } else {
359
+ $r = hexdec( substr( $hex, 0, 2 ) );
360
+ $g = hexdec( substr( $hex, 2, 2 ) );
361
+ $b = hexdec( substr( $hex, 4, 2 ) );
362
+ }
363
+
364
+ $rgb = $r . ", " . $g . ", " . $b;
365
+
366
+ return $rgb;
367
+ }
368
+ }
369
+
370
+ if ( ! function_exists( 'ewd_format_classes' ) ) {
371
+ function ewd_format_classes( $classes ) {
372
+
373
+ if ( count( $classes ) ) {
374
+ return ' class="' . join( ' ', $classes ) . '"';
375
+ }
376
+ }
377
+ }
378
+
379
+ if ( ! function_exists( 'ewd_add_frontend_ajax_url' ) ) {
380
+ function ewd_add_frontend_ajax_url() { ?>
381
+
382
+ <script type="text/javascript">
383
+ var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
384
+ </script>
385
+ <?php }
386
+ }
387
+
388
+ if ( ! function_exists( 'ewd_random_string' ) ) {
389
+ function ewd_random_string( $length = 10 ) {
390
+
391
+ $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
392
+ $randstring = '';
393
+
394
+ for ( $i = 0; $i < $length; $i++ ) {
395
+
396
+ $randstring .= $characters[ rand( 0, strlen( $characters ) - 1 ) ];
397
+ }
398
+
399
+ return $randstring;
400
+ }
401
+ }
js/Admin.js DELETED
@@ -1,332 +0,0 @@
1
- /* Used to show and hide the admin tabs for UPCP */
2
- function ShowTab(TabName) {
3
- jQuery(".OptionTab").each(function() {
4
- jQuery(this).addClass("HiddenTab");
5
- jQuery(this).removeClass("ActiveTab");
6
- });
7
- jQuery("#"+TabName).removeClass("HiddenTab");
8
- jQuery("#"+TabName).addClass("ActiveTab");
9
-
10
- jQuery(".nav-tab").each(function() {
11
- jQuery(this).removeClass("nav-tab-active");
12
- });
13
- jQuery("#"+TabName+"_Menu").addClass("nav-tab-active");
14
- }
15
-
16
- jQuery(document).ready(function() {
17
- jQuery('.ewd-ufaq-review-ask-overlay, .ewd-ufaq-review-ask-popup').removeClass('ufaq-hidden');
18
- });
19
- /* This code is required to make changing the FAQ order a drag-and-drop affair */
20
- jQuery(document).ready(function() {
21
- jQuery('.ewd-ufaq-list').sortable({
22
- items: '.ewd-ufaq-item',
23
- opacity: 0.6,
24
- cursor: 'move',
25
- axis: 'y',
26
- update: function() {
27
- var order = jQuery(this).sortable('serialize') + '&action=UFAQ_update_order';
28
- jQuery.post(ajaxurl, order, function(response) {});
29
- }
30
- });
31
- });
32
-
33
- /* This code is required to make changing the FAQ order a drag-and-drop affair */
34
- jQuery(document).ready(function() {
35
- jQuery('.ewd-ufaq-elements-table').sortable({
36
- items: '.ewd-ufaq-element',
37
- opacity: 0.6,
38
- cursor: 'move',
39
- axis: 'y',
40
- update: function() {
41
- jQuery('.ewd-ufaq-element td').each(function(index, el) {
42
- var Element_Name = jQuery(this).find('.ewd-ufaq-element-name').html();
43
- jQuery(this).find('input').val(Element_Name).attr('name', 'Element_' + index);
44
- });
45
- }
46
- });
47
- });
48
-
49
- function ShowOptionTab(TabName) {
50
- jQuery(".ufaq-option-set").each(function() {
51
- jQuery(this).addClass("ufaq-hidden");
52
- });
53
- jQuery("#"+TabName).removeClass("ufaq-hidden");
54
-
55
- // var activeContentHeight = jQuery("#"+TabName).innerHeight();
56
- // jQuery(".ufaq-options-page-tabbed-content").animate({
57
- // 'height':activeContentHeight
58
- // }, 500);
59
- // jQuery(".ufaq-options-page-tabbed-content").height(activeContentHeight);
60
-
61
- jQuery(".options-subnav-tab").each(function() {
62
- jQuery(this).removeClass("options-subnav-tab-active");
63
- });
64
- jQuery("#"+TabName+"_Menu").addClass("options-subnav-tab-active");
65
- jQuery('input[name="Display_Tab"]').val(TabName);
66
- }
67
-
68
- jQuery(document).ready(function() {
69
- SetCustomFieldDeleteHandlers();
70
-
71
- jQuery('.ewd-ufaq-add-custom-field').on('click', function(event) {
72
- var Counter = jQuery(this).data('nextid');
73
- var Max_ID = jQuery(this).data('maxid');
74
-
75
- var HTML = "<tr id='ewd-ufaq-custom-field-row-" + Counter + "'>";
76
- HTML += "<td><input type='hidden' name='Custom_Field_" + Counter + "_ID' value='" + Max_ID + "' /><a class='ewd-ufaq-delete-custom-field' data-fieldid='" + Counter + "'>Delete</a></td>";
77
- HTML += "<td><input type='text' name='Custom_Field_" + Counter + "_Name'></td>";
78
- HTML += "<td><select name='Custom_Field_" + Counter + "_Type'>";
79
- HTML += "<option value='text'>Text</option>";
80
- HTML += "<option value='textarea'>Text Area</option>";
81
- HTML += "<option value='select'>Select Box</option>";
82
- HTML += "<option value='radio'>Radio Buttons</option>";
83
- HTML += "<option value='checkbox'>Checkbox</option>";
84
- HTML += "<option value='file'>File</option>";
85
- HTML += "<option value='link'>Link</option>";
86
- HTML += "<option value='date'>Date</option>";
87
- HTML += "<option value='datetime'>Date/Time</option>";
88
- HTML += "</select></td>";
89
- HTML += "<td><input type='text' name='Custom_Field_" + Counter + "_Values'></td>";
90
- HTML += "</tr>";
91
-
92
- //jQuery('table > tr#ewd-uasp-add-reminder').before(HTML);
93
- jQuery('#ewd-ufaq-custom-fields-table tr:last').before(HTML);
94
-
95
- Counter++;
96
- Max_ID++;
97
- jQuery(this).data('nextid', Counter); //updates but doesn't show in DOM
98
- jQuery(this).data('maxid', Max_ID);
99
-
100
- SetCustomFieldDeleteHandlers();
101
-
102
- event.preventDefault();
103
- });
104
- });
105
-
106
- function SetCustomFieldDeleteHandlers() {
107
- jQuery('.ewd-ufaq-delete-custom-field').on('click', function(event) {
108
- var ID = jQuery(this).data('fieldid');
109
- var tr = jQuery('#ewd-ufaq-custom-field-row-'+ID);
110
-
111
- tr.fadeOut(400, function(){
112
- tr.remove();
113
- });
114
-
115
- event.preventDefault();
116
- });
117
- }
118
-
119
- jQuery(document).ready(function() {
120
- jQuery('.ewd-ufaq-hide-review-ask').on('click', function() {
121
- var Ask_Review_Date = jQuery(this).data('askreviewdelay');
122
-
123
- jQuery('.ewd-ufaq-review-ask-popup, #ewd-ufaq-review-ask-overlay').addClass('ufaq-hidden');
124
-
125
- var data = 'Ask_Review_Date=' + Ask_Review_Date + '&action=ewd_ufaq_hide_review_ask';
126
- jQuery.post(ajaxurl, data, function() {});
127
- });
128
- jQuery('#ewd-ufaq-review-ask-overlay').on('click', function() {
129
- jQuery('.ewd-ufaq-review-ask-popup, #ewd-ufaq-review-ask-overlay').addClass('ufaq-hidden');
130
- })
131
- });
132
-
133
- jQuery(document).ready(function() {
134
- jQuery('.ewd-ufaq-spectrum').spectrum({
135
- showInput: true,
136
- showInitial: true,
137
- preferredFormat: "hex",
138
- allowEmpty: true
139
- });
140
-
141
- jQuery('.ewd-ufaq-spectrum').css('display', 'inline');
142
-
143
- jQuery('.ewd-ufaq-spectrum').on('change', function() {
144
- if (jQuery(this).val() != "") {
145
- jQuery(this).css('background', jQuery(this).val());
146
- var rgb = EWD_UFAQ_hexToRgb(jQuery(this).val());
147
- var Brightness = (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
148
- if (Brightness < 100) {jQuery(this).css('color', '#ffffff');}
149
- else {jQuery(this).css('color', '#000000');}
150
- }
151
- else {
152
- jQuery(this).css('background', 'none');
153
- }
154
- });
155
-
156
- jQuery('.ewd-ufaq-spectrum').each(function() {
157
- if (jQuery(this).val() != "") {
158
- jQuery(this).css('background', jQuery(this).val());
159
- var rgb = EWD_UFAQ_hexToRgb(jQuery(this).val());
160
- var Brightness = (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
161
- if (Brightness < 100) {jQuery(this).css('color', '#ffffff');}
162
- else {jQuery(this).css('color', '#000000');}
163
- }
164
- });
165
- });
166
-
167
- function EWD_UFAQ_hexToRgb(hex) {
168
- var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
169
- return result ? {
170
- r: parseInt(result[1], 16),
171
- g: parseInt(result[2], 16),
172
- b: parseInt(result[3], 16)
173
- } : null;
174
- }
175
-
176
- //NEW DASHBOARD MOBILE MENU AND WIDGET TOGGLING
177
- jQuery(document).ready(function($){
178
- $('#ewd-ufaq-dash-mobile-menu-open').click(function(){
179
- $('.EWD_UFAQ_Menu .nav-tab:nth-of-type(1n+2)').toggle();
180
- $('#ewd-ufaq-dash-mobile-menu-up-caret').toggle();
181
- $('#ewd-ufaq-dash-mobile-menu-down-caret').toggle();
182
- return false;
183
- });
184
- $(function(){
185
- $(window).resize(function(){
186
- if($(window).width() > 800){
187
- $('.EWD_UFAQ_Menu .nav-tab:nth-of-type(1n+2)').show();
188
- }
189
- else{
190
- $('.EWD_UFAQ_Menu .nav-tab:nth-of-type(1n+2)').hide();
191
- $('#ewd-ufaq-dash-mobile-menu-up-caret').hide();
192
- $('#ewd-ufaq-dash-mobile-menu-down-caret').show();
193
- }
194
- }).resize();
195
- });
196
- $('#ewd-ufaq-dashboard-support-widget-box .ewd-ufaq-dashboard-new-widget-box-top').click(function(){
197
- $('#ewd-ufaq-dashboard-support-widget-box .ewd-ufaq-dashboard-new-widget-box-bottom').toggle();
198
- $('#ewd-ufaq-dash-mobile-support-up-caret').toggle();
199
- $('#ewd-ufaq-dash-mobile-support-down-caret').toggle();
200
- });
201
- $('#ewd-ufaq-dashboard-optional-table .ewd-ufaq-dashboard-new-widget-box-top').click(function(){
202
- $('#ewd-ufaq-dashboard-optional-table .ewd-ufaq-dashboard-new-widget-box-bottom').toggle();
203
- $('#ewd-ufaq-dash-optional-table-up-caret').toggle();
204
- $('#ewd-ufaq-dash-optional-table-down-caret').toggle();
205
- });
206
- });
207
-
208
- //OPTIONS HELP/DESCRIPTION TEXT
209
- jQuery(document).ready(function($) {
210
- $('.ufaq-option-set .form-table tr').each(function(){
211
- var thisOptionClick = $(this);
212
- thisOptionClick.find('th').click(function(){
213
- thisOptionClick.find('td p').toggle();
214
- });
215
- });
216
- $('.ewdOptionHasInfo').each(function(){
217
- var thisNonTableOptionClick = $(this);
218
- thisNonTableOptionClick.find('.ewd-ufaq-admin-styling-subsection-label').click(function(){
219
- thisNonTableOptionClick.find('fieldset p').toggle();
220
- });
221
- });
222
- $(function(){
223
- $(window).resize(function(){
224
- $('.ufaq-option-set .form-table tr').each(function(){
225
- var thisOption = $(this);
226
- if( $(window).width() < 783 ){
227
- if( thisOption.find('.ewd-ufaq-admin-hide-radios').length > 0 ) {
228
- thisOption.find('td p').show();
229
- thisOption.find('th').css('background-image', 'none');
230
- thisOption.find('th').css('cursor', 'default');
231
- }
232
- else{
233
- thisOption.find('td p').hide();
234
- thisOption.find('th').css('background-image', 'url(../wp-content/plugins/ultimate-faqs/images/options-asset-info.png)');
235
- thisOption.find('th').css('background-position', '95% 20px');
236
- thisOption.find('th').css('background-size', '18px 18px');
237
- thisOption.find('th').css('background-repeat', 'no-repeat');
238
- thisOption.find('th').css('cursor', 'pointer');
239
- }
240
- }
241
- else{
242
- thisOption.find('td p').hide();
243
- thisOption.find('th').css('background-image', 'url(../wp-content/plugins/ultimate-faqs/images/options-asset-info.png)');
244
- thisOption.find('th').css('background-position', 'calc(100% - 20px) 15px');
245
- thisOption.find('th').css('background-size', '18px 18px');
246
- thisOption.find('th').css('background-repeat', 'no-repeat');
247
- thisOption.find('th').css('cursor', 'pointer');
248
- }
249
- });
250
- $('.ewdOptionHasInfo').each(function(){
251
- var thisNonTableOption = $(this);
252
- if( $(window).width() < 783 ){
253
- if( thisNonTableOption.find('.ewd-ufaq-admin-hide-radios').length > 0 ) {
254
- thisNonTableOption.find('fieldset p').show();
255
- thisNonTableOption.find('ewd-ufaq-admin-styling-subsection-label').css('background-image', 'none');
256
- thisNonTableOption.find('ewd-ufaq-admin-styling-subsection-label').css('cursor', 'default');
257
- }
258
- else{
259
- thisNonTableOption.find('fieldset p').hide();
260
- thisNonTableOption.find('ewd-ufaq-admin-styling-subsection-label').css('background-image', 'url(../wp-content/plugins/ultimate-faqs/images/options-asset-info.png)');
261
- thisNonTableOption.find('ewd-ufaq-admin-styling-subsection-label').css('background-position', 'calc(100% - 30px) 15px');
262
- thisNonTableOption.find('ewd-ufaq-admin-styling-subsection-label').css('background-size', '18px 18px');
263
- thisNonTableOption.find('ewd-ufaq-admin-styling-subsection-label').css('background-repeat', 'no-repeat');
264
- thisNonTableOption.find('ewd-ufaq-admin-styling-subsection-label').css('cursor', 'pointer');
265
- }
266
- }
267
- else{
268
- thisNonTableOption.find('fieldset p').hide();
269
- thisNonTableOption.find('ewd-ufaq-admin-styling-subsection-label').css('background-image', 'url(../wp-content/plugins/ultimate-faqs/images/options-asset-info.png)');
270
- thisNonTableOption.find('ewd-ufaq-admin-styling-subsection-label').css('background-position', 'calc(100% - 30px) 15px');
271
- thisNonTableOption.find('ewd-ufaq-admin-styling-subsection-label').css('background-size', '18px 18px');
272
- thisNonTableOption.find('ewd-ufaq-admin-styling-subsection-label').css('background-repeat', 'no-repeat');
273
- thisNonTableOption.find('ewd-ufaq-admin-styling-subsection-label').css('cursor', 'pointer');
274
- }
275
- });
276
- }).resize();
277
- });
278
- });
279
-
280
-
281
- //OPTIONS PAGE YES/NO TOGGLE SWITCHES
282
- jQuery(document).ready(function($) {
283
- jQuery('.ewd-ufaq-admin-option-toggle').on('change', function() {
284
- var Input_Name = jQuery(this).data('inputname'); console.log(Input_Name);
285
- if (jQuery(this).is(':checked')) {
286
- jQuery('input[name="' + Input_Name + '"][value="Yes"]').prop('checked', true).trigger('change');
287
- jQuery('input[name="' + Input_Name + '"][value="No"]').prop('checked', false);
288
- }
289
- else {
290
- jQuery('input[name="' + Input_Name + '"][value="Yes"]').prop('checked', false).trigger('change');
291
- jQuery('input[name="' + Input_Name + '"][value="No"]').prop('checked', true);
292
- }
293
- });
294
- $(function(){
295
- $(window).resize(function(){
296
- $('.ufaq-option-set .form-table tr').each(function(){
297
- var thisOptionTr = $(this);
298
- if( $(window).width() < 783 ){
299
- if( thisOptionTr.find('.ewd-ufaq-admin-switch').length > 0 ) {
300
- thisOptionTr.find('th').css('width', 'calc(90% - 50px');
301
- thisOptionTr.find('th').css('padding-right', 'calc(5% + 50px');
302
- }
303
- else{
304
- thisOptionTr.find('th').css('width', '90%');
305
- thisOptionTr.find('th').css('padding-right', '5%');
306
- }
307
- }
308
- else{
309
- thisOptionTr.find('th').css('width', '200px');
310
- thisOptionTr.find('th').css('padding-right', '46px');
311
- }
312
- });
313
- }).resize();
314
- });
315
- });
316
-
317
-
318
- /*************************************************************************
319
- CONDITIONAL OPTIONS
320
- **************************************************************************/
321
- jQuery(document).ready(function($){
322
- $('input[data-inputname="faq_ratings"]').click(function(){
323
- if($(this).attr('checked') == 'checked'){
324
- $('#ewd-ufaq-thumbs-up-upload').show();
325
- $('#ewd-ufaq-thumbs-down-upload').show();
326
- }
327
- else{
328
- $('#ewd-ufaq-thumbs-up-upload').hide();
329
- $('#ewd-ufaq-thumbs-down-upload').hide();
330
- }
331
- });
332
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/ewd-ufaq-dashboard-review-ask.js DELETED
@@ -1,62 +0,0 @@
1
- jQuery(document).ready(function($) {
2
- jQuery('.ewd-ufaq-main-dashboard-review-ask').css('display', 'block');
3
-
4
- jQuery(document).on('click', '.ewd-ufaq-main-dashboard-review-ask .notice-dismiss', function(event) {
5
- var data = 'Ask_Review_Date=7&action=ewd_ufaq_hide_review_ask';
6
- jQuery.post(ajaxurl, data, function() {});
7
- });
8
-
9
- jQuery('.ewd-ufaq-review-ask-yes').on('click', function() {
10
- jQuery('.ewd-ufaq-review-ask-feedback-text').removeClass('ufaq-hidden');
11
- jQuery('.ewd-ufaq-review-ask-starting-text').addClass('ufaq-hidden');
12
-
13
- jQuery('.ewd-ufaq-review-ask-no-thanks').removeClass('ufaq-hidden');
14
- jQuery('.ewd-ufaq-review-ask-review').removeClass('ufaq-hidden');
15
-
16
- jQuery('.ewd-ufaq-review-ask-not-really').addClass('ufaq-hidden');
17
- jQuery('.ewd-ufaq-review-ask-yes').addClass('ufaq-hidden');
18
-
19
- var data = 'Ask_Review_Date=7&action=ewd_ufaq_hide_review_ask';
20
- jQuery.post(ajaxurl, data, function() {});
21
- });
22
-
23
- jQuery('.ewd-ufaq-review-ask-not-really').on('click', function() {
24
- jQuery('.ewd-ufaq-review-ask-review-text').removeClass('ufaq-hidden');
25
- jQuery('.ewd-ufaq-review-ask-starting-text').addClass('ufaq-hidden');
26
-
27
- jQuery('.ewd-ufaq-review-ask-feedback-form').removeClass('ufaq-hidden');
28
- jQuery('.ewd-ufaq-review-ask-actions').addClass('ufaq-hidden');
29
-
30
- var data = 'Ask_Review_Date=1000&action=ewd_ufaq_hide_review_ask';
31
- jQuery.post(ajaxurl, data, function() {});
32
- });
33
-
34
- jQuery('.ewd-ufaq-review-ask-no-thanks').on('click', function() {
35
- var data = 'Ask_Review_Date=1000&action=ewd_ufaq_hide_review_ask';
36
- jQuery.post(ajaxurl, data, function() {});
37
-
38
- jQuery('.ewd-ufaq-main-dashboard-review-ask').css('display', 'none');
39
- });
40
-
41
- jQuery('.ewd-ufaq-review-ask-review').on('click', function() {
42
- jQuery('.ewd-ufaq-review-ask-feedback-text').addClass('ufaq-hidden');
43
- jQuery('.ewd-ufaq-review-ask-thank-you-text').removeClass('ufaq-hidden');
44
-
45
- var data = 'Ask_Review_Date=1000&action=ewd_ufaq_hide_review_ask';
46
- jQuery.post(ajaxurl, data, function() {});
47
- });
48
-
49
- jQuery('.ewd-ufaq-review-ask-send-feedback').on('click', function() {
50
- var Feedback = jQuery('.ewd-ufaq-review-ask-feedback-explanation textarea').val();
51
- var EmailAddress = jQuery('.ewd-ufaq-review-ask-feedback-explanation input[name="feedback_email_address"]').val();
52
- var data = 'Feedback=' + Feedback + '&EmailAddress=' + EmailAddress + '&action=ewd_ufaq_send_feedback';
53
- jQuery.post(ajaxurl, data, function() {});
54
-
55
- var data = 'Ask_Review_Date=1000&action=ewd_ufaq_hide_review_ask';
56
- jQuery.post(ajaxurl, data, function() {});
57
-
58
- jQuery('.ewd-ufaq-review-ask-feedback-form').addClass('ufaq-hidden');
59
- jQuery('.ewd-ufaq-review-ask-review-text').addClass('ufaq-hidden');
60
- jQuery('.ewd-ufaq-review-ask-thank-you-text').removeClass('ufaq-hidden');
61
- });
62
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/ewd-ufaq-js.js DELETED
@@ -1,409 +0,0 @@
1
- var filtering_running = 'No';
2
- var wpforms_search_running = 'No';
3
-
4
- jQuery(function(){ //DOM Ready
5
- ufaqSetClickHandlers();
6
- UFAQSetAutoCompleteClickHandlers();
7
- UFAQSetRatingHandlers();
8
- UFAQSetExpandCollapseHandlers();
9
- UFAQSetPaginationHandlers();
10
-
11
- UFAQWPFormsHandler();
12
- });
13
-
14
- function runEffect(display, post_id) {
15
- var selectedEffect = reveal_effect;
16
- // most effect types need no options passed by default
17
- var options = {};
18
- // some effects have required parameters
19
- if ( selectedEffect === "size" ) {
20
- options = { to: { width: 200, height: 60 } };
21
- }
22
- // run the effect
23
- if (display == "show") {jQuery( "#ufaq-body-"+post_id ).show( selectedEffect, options, 500, handleStyles(display, post_id) );}
24
- if (display == "hide") {jQuery( "#ufaq-body-"+post_id ).hide( selectedEffect, options, 500, handleStyles(display, post_id) );}
25
- };
26
-
27
- // callback function to bring a hidden box back
28
- function handleStyles(display, post_id) {
29
- if (display == "show") {setTimeout(function() {jQuery('#ufaq-body-'+post_id).removeClass("ewd-ufaq-hidden"); }, 500 );}
30
- if (display == "hide") {setTimeout(function() {jQuery('#ufaq-body-'+post_id).addClass("ewd-ufaq-hidden");}, 500 );}
31
- };
32
-
33
- function ufaqSetClickHandlers() {
34
- jQuery('.ufaq-faq-toggle').off('click').on('click', function(event) {
35
- var post_id = jQuery(this).attr("data-postid");
36
-
37
- jQuery(this).attr('aria-expanded', function (i, attr) {
38
- return attr == 'true' ? 'false' : 'true'
39
- });
40
-
41
- event.preventDefault();
42
-
43
- var selectedIDString = 'ufaq-body-'+post_id;
44
-
45
- if (jQuery('#'+selectedIDString).hasClass("ewd-ufaq-hidden")) {
46
- EWD_UFAQ_Reveal_FAQ(post_id, selectedIDString);
47
- }
48
- else {
49
- EWD_UFAQ_Hide_FAQ(post_id);
50
- }
51
- });
52
-
53
- jQuery('.ufaq-faq-category-title-toggle').off('click').on('click', function(event) {
54
- var category_id = jQuery(this).attr("data-categoryid");
55
- var closed = jQuery('#ufaq-faq-category-body-'+category_id).hasClass("ufaq-faq-category-body-hidden");
56
-
57
- if (jQuery(this).hasClass('ufaq-faq-category-title-accordion')) {
58
- jQuery('.ufaq-faq-category-inner').addClass("ufaq-faq-category-body-hidden");
59
- }
60
-
61
- if (closed) {
62
- jQuery('#ufaq-faq-category-body-'+category_id).removeClass("ufaq-faq-category-body-hidden");
63
- }
64
- else {
65
- jQuery('#ufaq-faq-category-body-'+category_id).addClass("ufaq-faq-category-body-hidden");
66
- }
67
- });
68
-
69
- jQuery('.ufaq-back-to-top-link').off('click').on('click', function(event) {
70
- event.preventDefault();
71
-
72
- jQuery('html, body').animate({scrollTop: jQuery("#ufaq-faq-list").offset().top -80}, 100);
73
- });
74
-
75
- jQuery('.ufaq-faq-header-link').off('click').on('click', function(event) {
76
- event.preventDefault();
77
-
78
- var faqID = jQuery(this).data("postid");
79
- if (jQuery('#ufaq-body-'+faqID).hasClass('ewd-ufaq-hidden')) {
80
- var selectedIDString = 'ufaq-body-'+faqID;
81
- EWD_UFAQ_Reveal_FAQ(faqID, selectedIDString);
82
- }
83
- jQuery('html, body').animate({scrollTop: jQuery("#ufaq-post-"+faqID).offset().top -20}, 100);
84
- })