White Label CMS - Version 2.0.2.2

Version Description

  • Use space to remove howdy
  • Change login logo url if custom logo setup
  • Moved wlcms style to header
  • Hiding Dashboard widgets can now configured by user role
  • Minor fixes
Download this release

Release Info

Developer VideoUserManuals
Plugin Icon 128x128 White Label CMS
Version 2.0.2.2
Comparing to
See all releases

Code changes from version 1.6.2 to 2.0.2.2

Files changed (110) hide show
  1. assets/css/admin-settings.css +1 -0
  2. assets/css/admin.css +1 -0
  3. assets/css/admin.css.map +1 -0
  4. assets/css/index.php +4 -0
  5. assets/css/select2.min.css +1 -0
  6. assets/images/Better-Clients-Banner-white-label-cms-m.jpg +0 -0
  7. assets/images/Better-Clients-Banner.jpg +0 -0
  8. assets/images/better-wordpress-for-client.jpg +0 -0
  9. assets/images/index.php +4 -0
  10. assets/images/learn-title.jpg +0 -0
  11. assets/images/wlcms-logo.png +0 -0
  12. assets/index.php +4 -0
  13. assets/js/admin-settings.js +1 -0
  14. assets/js/ays-beforeunload-shim.js +1 -0
  15. assets/js/index.php +4 -0
  16. assets/js/jquery-areyousure.js +1 -0
  17. assets/js/jquery.validate.min.js +4 -0
  18. assets/js/select2.min.js +1 -0
  19. changelog.txt +120 -0
  20. css/editor.css +0 -4
  21. css/wlcms_style.css +0 -320
  22. images/WPElevation-WP-Skyscaper-Button-157x40.gif +0 -0
  23. images/WPElevatoon-WP-Skyscraper-Image-232x337.jpg +0 -0
  24. images/arrow-down.gif +0 -0
  25. images/arrow.gif +0 -0
  26. images/arrow.jpg +0 -0
  27. images/arrow.png +0 -0
  28. images/arrows-dark-vs.png +0 -0
  29. images/better-ebooks-ad.jpg +0 -0
  30. images/better-ebooks-ad.png +0 -0
  31. images/download-button.png +0 -0
  32. images/pointer.png +0 -0
  33. images/privacy.png +0 -0
  34. images/screenshot-1.png +0 -0
  35. images/screenshot-2.png +0 -0
  36. images/screenshot-3.png +0 -0
  37. images/screenshot-4.png +0 -0
  38. images/screenshot-5.png +0 -0
  39. images/toggle-arrow.gif +0 -0
  40. images/trans.png +0 -0
  41. images/wlcms-plugin-advert.png +0 -0
  42. includes/Functions.php +288 -0
  43. includes/admin.config.php +0 -647
  44. includes/admin.view.php +0 -647
  45. includes/classes/Admin_Core.php +145 -0
  46. includes/classes/Admin_Dashboard.php +437 -0
  47. includes/classes/Admin_Menus.php +612 -0
  48. includes/classes/Admin_Script.php +127 -0
  49. includes/classes/Admin_Settings.php +104 -0
  50. includes/classes/Branding.php +225 -0
  51. includes/classes/I18n.php +20 -0
  52. includes/classes/Loader.php +177 -0
  53. includes/classes/Login.php +320 -0
  54. includes/classes/Messages.php +54 -0
  55. includes/classes/Previewable.php +67 -0
  56. includes/classes/Settings.php +384 -0
  57. includes/classes/Upgrade.php +375 -0
  58. includes/classes/Wizard.php +102 -0
  59. includes/classes/index.php +4 -0
  60. includes/conditionals.php +0 -143
  61. includes/index.php +4 -0
  62. includes/plugin_deactivate.php +0 -25
  63. index.php +4 -0
  64. readme.txt +67 -165
  65. screenshot-1.png +0 -0
  66. screenshot-2.png +0 -0
  67. screenshot-3.png +0 -0
  68. screenshot-4.png +0 -0
  69. screenshot-5.png +0 -0
  70. scripts/wlcms_script.js +0 -271
  71. uninstall.php +4 -14
  72. view/admin/index.php +4 -0
  73. view/admin/parts/advert.php +8 -0
  74. view/admin/parts/branding-admin-bar.php +34 -0
  75. view/admin/parts/branding-developer.php +45 -0
  76. view/admin/parts/branding-footer.php +34 -0
  77. view/admin/parts/branding-side-menu.php +25 -0
  78. view/admin/parts/branding-wordpress.php +30 -0
  79. view/admin/parts/branding.php +32 -0
  80. view/admin/parts/dashboard-custom-welcome-dashboard-panel.php +198 -0
  81. view/admin/parts/dashboard-default-panels.php +68 -0
  82. view/admin/parts/dashboard-rss-dashboard-panel.php +73 -0
  83. view/admin/parts/dashboard.php +24 -0
  84. view/admin/parts/import-settings.php +17 -0
  85. view/admin/parts/index.php +4 -0
  86. view/admin/parts/live-preview.php +6 -0
  87. view/admin/parts/login-advanced.php +122 -0
  88. view/admin/parts/login-custom-css.php +19 -0
  89. view/admin/parts/login-live-preview.php +6 -0
  90. view/admin/parts/login-logo-and-background.php +97 -0
  91. view/admin/parts/login.php +31 -0
  92. view/admin/parts/menus-admin-bar-menus.php +16 -0
  93. view/admin/parts/menus-legacy.php +23 -0
  94. view/admin/parts/menus-menus.php +74 -0
  95. view/admin/parts/menus-white-label-cms-admin.php +43 -0
  96. view/admin/parts/menus.php +25 -0
  97. view/admin/parts/settings-admin-bar-setting.php +10 -0
  98. view/admin/parts/settings-admin-settings.php +20 -0
  99. view/admin/parts/settings-custom-css-for-admin.php +6 -0
  100. view/admin/parts/settings-custom-editor-stylesheet.php +9 -0
  101. view/admin/parts/settings-hide-page-meta-boxes.php +26 -0
  102. view/admin/parts/settings-hide-post-meta-boxes.php +30 -0
  103. view/admin/parts/settings-nag-messages.php +9 -0
  104. view/admin/parts/settings.php +40 -0
  105. view/admin/parts/wizard-step-1.php +58 -0
  106. view/admin/parts/wizard-step-2.php +34 -0
  107. view/admin/settings.php +65 -0
  108. view/admin/wizard.php +44 -0
  109. view/index.php +4 -0
  110. wlcms-plugin.php +19 -938
assets/css/admin-settings.css ADDED
@@ -0,0 +1 @@
 
1
+ .wlcms_wrapper{max-width:47rem;margin:30px auto 0}.wlcms_wrapper .wlcms_page_title img{padding-right:10px;width:70px;height:auto}.wlcms_wrapper .wlcms-advert-wrapper img{width:100%}.wlcms_wrapper .navigation{width:100%;padding-bottom:20px;padding-top:20px}.wlcms_wrapper .navigation ul{margin:0;padding:0;list-style:none;display:inline-block}.wlcms_wrapper .navigation li{display:inline-block}.wlcms_wrapper .navigation li a{background:none;color:#222;padding:10px 15px;text-decoration:none}.wlcms_wrapper .navigation li a.current{background:#ededed;color:#222;border-bottom:1px solid rgba(2,144,194,.51)}.wlcms_wrapper .navigation li a:active,.wlcms_wrapper .navigation li a:focus{outline:none!important;box-shadow:none}.wlcms_wrapper .navigation li a span{color:rgba(247,46,12,.87)}.wlcms_wrapper .navigation .wlcms-pull-right{float:right;padding-right:10px}.wlcms_wrapper .fixed{position:fixed;background:#f1f1f1;z-index:10000}@media screen and (max-width:550px){.wlcms_wrapper .fixed{position:inherit}}.wlcms_wrapper .wizard-steps li,.wlcms_wrapper .wizard-steps ul{width:100%;display:block}.wizard-step1{padding-top:0!important}.wlcms_wrapper .wlcms-body-header h2{position:relative}.wlcms_wrapper .wlcms-toggle-arrow{width:20px;height:20px;position:relative;cursor:pointer;float:right;text-decoration:none;border-bottom:none;box-shadow:none}.wlcms_wrapper .wlcms-toggle-arrow:after,.wlcms_wrapper .wlcms-toggle-arrow:before{content:"";display:block;width:13px;height:4px;background:#0184ba;position:absolute;top:5px;transition:-webkit-transform .1s;transition:transform .1s;transition:transform .1s,-webkit-transform .1s}.wlcms_wrapper .wlcms-toggle-arrow:before{left:0;border-top-left-radius:5px;border-bottom-left-radius:5px;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.wlcms_wrapper .wlcms-toggle-arrow:after{right:0}.wlcms_wrapper .wlcms-toggle-arrow.active:before,.wlcms_wrapper .wlcms-toggle-arrow:after{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.wlcms_wrapper .wlcms-toggle-arrow.active:after{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.wlcms_content{width:100%}.wlcms_content label.error{color:rgba(247,46,12,.87);margin-left:10px}.wlcms_content input.error{border:1px solid rgba(247,46,12,.87);box-shadow:inset 0 1px 2px rgba(247,46,12,.44)}.wlcms_content section{display:none}.wlcms_content section.current{display:block}.wlcms_content .sub-fields{padding-left:30px}.wlcms_content .wlcms-body-wrapper{border:1px solid #f1f1f1;margin-bottom:20px;background:#fff}.wlcms_content .wlcms-body-header{padding:16px 24px;border-bottom:1px solid #f1f1f1}.wlcms_content .wlcms-body-header h2{margin:0!important}.wlcms_content .wlcms-body-main{padding:24px}.wlcms-input-group{padding-bottom:10px}.wlcms-input-group label{font-weight:700;display:inline-block;padding-bottom:10px}.wlcms-input-group .wlcms-upload-thumbnail{position:relative;max-width:100px}.wlcms-input-group .wlcms-upload-thumbnail img{display:block;height:auto;max-width:100px;padding-bottom:5px}.wlcms-input-group .wlcms-upload-thumbnail .wlcms-remove-img{position:absolute;top:-10px;left:-10px;width:10px;height:10px;color:#404040;z-index:20;cursor:pointer}.wlcms-input-group .wlcms-upload-thumbnail .wlcms-remove-img:hover{color:#d54e21}.wlcms-input-group .wlcms-input{padding-bottom:10px}.wlcms-input-group .wlcms-help{padding-bottom:10px;font-size:11px}.wlcms-input-group .tab-login{position:relative}.wlcms-input-group .wlcms-login-live-preview{position:absolute}.wlcms-form{position:relative}.wlcms-form .wlcms-menus-settings .wlcms-input{padding-bottom:0}.wlcms-form .wlcms-menus-settings .toggle-label{padding-bottom:5px;padding-top:5px}.wlcms-form input[type=number],.wlcms-form input[type=phone],.wlcms-form input[type=text],.wlcms-form input[type=url]{width:50%;line-height:32px}.wlcms-form input[type=number]{height:40px}.wlcms_admin_wrapper .sub-fields,.wlcms_admin_wrapper .wlcms-input .toggle-label{padding-left:0}.wlcms-other-admins{padding-left:30px}.wlcms-menus-settings>ul{width:75%}.wlcms-input-group li,.wlcms-input-group li .wlcms-input{padding:0}.wlcms-input-group li label.toggle-label{padding-top:5px;padding-bottom:5px!important}.wlcms-toggle-wrapper ul ul{padding-left:30px}.wlcms-toggle{display:none!important}.wlcms-toggle,.wlcms-toggle *,.wlcms-toggle+.wlcms-toggle-btn,.wlcms-toggle:after,.wlcms-toggle :after,.wlcms-toggle:before,.wlcms-toggle :before{box-sizing:border-box}.wlcms-toggle+.wlcms-toggle-btn::-moz-selection,.wlcms-toggle::-moz-selection,.wlcms-toggle ::-moz-selection,.wlcms-toggle:after::-moz-selection,.wlcms-toggle :after::-moz-selection,.wlcms-toggle:before::-moz-selection,.wlcms-toggle :before::-moz-selection{background:none}.wlcms-toggle+.wlcms-toggle-btn::selection,.wlcms-toggle::selection,.wlcms-toggle ::selection,.wlcms-toggle:after::selection,.wlcms-toggle :after::selection,.wlcms-toggle:before::selection,.wlcms-toggle :before::selection{background:none}.wlcms-toggle+.wlcms-toggle-btn{outline:0;width:2em;height:1em;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.wlcms-toggle+.wlcms-toggle-btn:after,.wlcms-toggle+.wlcms-toggle-btn:before{position:relative;display:block;content:"";width:50%;height:100%}.wlcms-toggle+.wlcms-toggle-btn:after{left:0}.wlcms-toggle+.wlcms-toggle-btn:before{display:none}.wlcms-toggle:checked+.wlcms-toggle-btn:after{left:50%}.wlcms-toggle-light+.wlcms-toggle-btn{background:#9e9c9c;border-radius:1em;padding:1px;transition:all .4s ease}.wlcms-toggle-light+.wlcms-toggle-btn:after{border-radius:50%;background:#fff;transition:all .2s ease}.wlcms-toggle-light+.wlcms-toggle-btn.disabled{background-color:hsla(0,1%,61.6%,.1882352941)}.wlcms-toggle-light:checked+.wlcms-toggle-btn{background:#9fd6ae}.wlcms-toggle-light:checked+.wlcms-toggle-btn.disabled{background-color:hsla(0,1%,61.6%,.1882352941)}.wlcms-input-group .textarea-full{width:100%;min-height:300px;padding:10px 10px 10px 20px}.wlcms-input-group .toggle-label{padding-left:10px;padding-top:10px}.wlcms-input-group .toggle-label.disabled{color:rgba(103,102,102,.44)}textarea.wlcms-css{font-family:monospace}.wlcms_footer .wlcms-navigation{width:100%;padding-bottom:20px;padding-top:20px}.wlcms_footer .wlcms-navigation ul{margin:0;padding:0;list-style:none;display:inline-block}.wlcms_footer .wlcms-navigation li{display:inline-block}.wlcms_footer .wlcms-navigation li a{background:none;color:#222;padding:10px 15px}.wlcms_footer .wlcms-navigation li a.current{background:#ededed;color:#222}iframe.long-animate{width:100%;height:100%;position:absolute;border:0;display:none}.wlcms-preview-notice{text-align:center;position:absolute;top:20px;margin:0 auto;left:20px;font-weight:300;font-size:24px;background:rgba(218,217,217,.81);line-height:35px;padding:0 20px;color:#790404}*{margin:0;padding:0;box-sizing:border-box}.short-animate{transition:.5s ease-in-out}.long-animate{transition:.5s ease-in-out .5s}.lightbox{position:fixed;top:-100%;bottom:100%;left:0;right:0;background:rgba(35,40,45,.7);z-index:999990;opacity:0}.lightbox #wlcms-preview-content{position:absolute;margin:auto;top:0;left:0;right:0;bottom:0;max-width:0;max-height:0%}#lightbox-controls{position:fixed;height:70px;width:70px;top:-70px;right:0;z-index:999992;background:rgba(0,0,0,.1)}#close-lightbox{display:block;position:absolute;overflow:hidden;height:50px;width:50px;text-indent:-5000px;right:10px;top:10px;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#close-lightbox:before{height:0;width:3px;left:24px;top:0;transition:.5s ease-in-out .5s}#close-lightbox:after,#close-lightbox:before{content:"";display:block;position:absolute;background:#fff;border-radius:2px}#close-lightbox:after{width:0;height:3px;top:24px;left:0;transition:.5s ease-in-out 1s}.lightbox:target{top:0;bottom:0;opacity:1}.lightbox:target #wlcms-preview-content{max-width:100%;max-height:100%}.lightbox:target~#lightbox-controls{top:0}.lightbox:target~#lightbox-controls #close-lightbox:after{width:50px}.lightbox:target~#lightbox-controls #close-lightbox:before{height:50px}
assets/css/admin.css ADDED
@@ -0,0 +1 @@
 
1
+ .warning-text{color:rgba(240,116,95,.808);display:block}
assets/css/admin.css.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"file":"css/admin.css","sources":[],"mappings":"","sourceRoot":""}
assets/css/index.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ die('Access denied.');
4
+ }
assets/css/select2.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
assets/images/Better-Clients-Banner-white-label-cms-m.jpg ADDED
Binary file
assets/images/Better-Clients-Banner.jpg ADDED
Binary file
assets/images/better-wordpress-for-client.jpg ADDED
Binary file
assets/images/index.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ die('Access denied.');
4
+ }
assets/images/learn-title.jpg ADDED
Binary file
assets/images/wlcms-logo.png ADDED
Binary file
assets/index.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ die('Access denied.');
4
+ }
assets/js/admin-settings.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=0)}([function(e,t,r){r(1),r(6),e.exports=r(11)},function(e,t){jQuery(document).ready(function(){jQuery(".wlcms-next-step").on("click",function(){jQuery("#wlcms_tab_step-1").hide(),jQuery("#tab-step-1").hide(),jQuery("#wlcms_tab_step-2").show(),jQuery("#tab-step-2").show()}),jQuery(".wlcms-prev-step").on("click",function(){jQuery("#wlcms_tab_step-2").hide(),jQuery("#tab-step-2").hide(),jQuery("#wlcms_tab_step-1").show(),jQuery("#tab-step-1").show()}),jQuery("form.wlcms-form").areYouSure({message:"Changes that you made may not be saved"}),jQuery(".reset-confirm").click(function(){if(0==confirm("Are you sure you want to reset!"))return!1});var e=jQuery(".wlcms_wrapper .navigation"),t=e.offset();function r(e){var t=jQuery(".wlcms-form"),r=t.attr("action");-1!==r.indexOf("#")&&(hash=r.replace(/.*#/,"#"),r=r.replace(/#.*/,"")),t.attr({action:r+"#"+e})}jQuery(window).scroll(function(){var r=jQuery("#wpadminbar").height(),n=t.top-(e.height()+r);jQuery(this).scrollTop()>n?(e.addClass("fixed"),e.css({top:r}).width(jQuery(".wlcms_wrapper").width())):jQuery(this).scrollTop()<=t.top&&e.hasClass("fixed")&&e.removeClass("fixed")}),jQuery(".wlcms-navigation ul li a:not(.wlcms-ignore)").click(function(){var e=jQuery(this).attr("data-tab");jQuery(".wlcms-navigation ul li a").removeClass("current"),jQuery(".tab-content").removeClass("current"),jQuery(this).addClass("current"),jQuery(".wlcms_content section").removeClass("current"),jQuery(".wlcms_content section."+e).addClass("current"),r(e),jQuery("html, body").animate({scrollTop:0},400)});var n=window.location.hash;function i(){jQuery(".wlcms-remove-img").on("click",function(){var e=jQuery(this).parents(".wlcms-input-group");e.find(".wlcms-upload-thumbnail").html(""),e.find(".wlcms-upload-input").val("")})}""!=(n=n.replace("#",""))?(jQuery(".wlcms-navigation ul li a#wlcms_"+n).addClass("current"),jQuery(".wlcms_content section."+n).addClass("current"),r(n)):0==jQuery(".wlcms_content section.current").length&&(jQuery(".wlcms_content section").eq(0).addClass("current"),jQuery(".wlcms-navigation ul li").eq(0).find("a").addClass("current")),jQuery(".wlcms_upload").click(function(){var e=wp.media.editor.send.attachment,t=jQuery(this);return wp.media.editor.send.attachment=function(r,n){var a='<img id="'+n.id+'" src="'+n.url+'" />';a+='<span class="dashicons dashicons-dismiss wlcms-remove-img"></span>',t.parents(".wlcms-input-group").find(".wlcms-upload-thumbnail").html(a),t.parents(".wlcms-input-group").find(".wlcms-upload-input").val(n.url),i(),wp.media.editor.send.attachment=e},wp.media.editor.open(),!1}),i(),jQuery(".wlcms-color-field").wpColorPicker(),jQuery(".wlcms-preview-link").on("click",function(){jQuery("#wlcms-preview-content").html("...");var e=jQuery(".wlcms-form").serialize()+"&action=wlcms_save_login_preview_settings&_ajax_nonce="+wlcms_settings.wlcms_ajax_nonce;jQuery.ajax({type:"post",url:ajaxurl,data:e,success:function(e){jQuery("#wlcms-preview-content").html('<iframe allowtransparency="true" class="long-animate wlcms-preview-iframe" title="Login Preview" onmousewheel="" src="'+wlcms_settings.loginurl+'?wlcms-action=preview&preview_section=login&reauth=1"></iframe>'),jQuery("iframe.wlcms-preview-iframe").load(function(){var e=jQuery(this),t=e.contents();e.slideDown("slow"),t.find("body").prepend('<div style="text-align: center;position: absolute;top: 40px;margin: 0 30%;left: 0;font-weight: 300;font-size: 24px;background: #dad9d9cf;line-height: 35px;padding: 0;color: #790404;width: 40%;">Preview mode</div>'),t.find("form").attr("action","#"),t.find("#wp-submit").attr("type","button"),t.find("a").attr("href","#")})}})}),jQuery(".wlcms-dashboard-preview-link").on("click",function(){jQuery("#wlcms-dashboard-content").html("...");var e=jQuery(".wlcms-form").serialize()+"&action=wlcms_save_dashboard_preview_settings";jQuery.ajax({type:"post",url:ajaxurl,data:e,success:function(e){jQuery("#wlcms-preview-content").html('<iframe allowtransparency="true" class="long-animate wlcms-preview-iframe" title="Preview" onmousewheel="" src="'+wlcms_settings.adminurl+'?wlcms-action=preview&preview_section=dashboard"></iframe>'),jQuery("iframe.wlcms-preview-iframe").load(function(){var e=jQuery(this),t=e.contents();e.slideDown("slow"),t.find("body").prepend('<div style="text-align: center;position: absolute;top: 40px;margin: 0 30%;font-weight: 300;font-size: 24px;background: #dad9d9cf;line-height: 35px;padding: 0 20px;color: #790404;width: 40%;z-index:999999">Preview mode</div>'),t.find("a").each(function(){jQuery(this).attr("href","#")})})}})}),jQuery(".wlcms-select2").select2({width:"100%",placeholder:"Select"})}),jQuery.validator.addMethod("feedurl",function(e,t){return this.optional(t)||/^(?:(?:(?:https?|ftp|feed):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test(e)},"Please use a valid URL"),jQuery.validator.messages.url="Please use a valid URL",jQuery(document).ready(function(){jQuery('.main-toggle[type="checkbox"]').change(function(e){var t=jQuery(this).prop("checked"),r=jQuery(this).attr("data-revised"),n=jQuery(this).parents(".toggle-group").find(".sub-fields");n.length&&(t&&"1"!=r&&n.find('input[type="checkbox"]:checked').length==n.find('input[type="checkbox"]').length||!t&&"1"==r?n.hide():n.show())}).trigger("change"),jQuery(".wlcms-toggle-arrow").on("click",function(){jQuery(this).toggleClass("active"),jQuery(this).next("ul").slideToggle()}),jQuery("#enable_wlcms_admin").on("change",function(){jQuery(this).is(":checked")?jQuery(".menu-admin-wrapper").show():jQuery(".menu-admin-wrapper").hide()}).trigger("change"),jQuery(".enable_welcome_for_all_roles").on("change",function(){var e=jQuery("#select_user_roles"+jQuery(this).data("section"));jQuery(this).is(":checked")?e.hide():e.show()}).trigger("change"),jQuery('.wlcms-toggle[type="checkbox"]').change(function(e){var t=jQuery(this).prop("checked"),r=jQuery(this).parent();r.siblings();r.find('input[type="checkbox"]').prop({checked:t}),function e(r){var n=r.parent().parent(),i=!0;if(r.siblings().each(function(){return i=jQuery(this).children('input[type="checkbox"]').prop("checked")===t}),i&&t)n.children('input[type="checkbox"]').prop({checked:t}),e(n);else if(i&&!t)n.children('input[type="checkbox"]').prop("checked",t),n.children('input[type="checkbox"]').prop("indeterminate",n.find('input[type="checkbox"]:checked').length>0),e(n);else{var a=!0;r.parents("li").children('input[type="checkbox"]').hasClass("main-toggle-reverse")&&(a=!1),r.parents("li").children('input[type="checkbox"]').prop({checked:a})}}(r)}),jQuery(".wlcms-menus-settings > ul > li").each(function(){jQuery(this).find('input[type="checkbox"]:checked').length==jQuery(this).find('input[type="checkbox"]').length?jQuery(this).find("ul.sub_menu_wrapper").hide():jQuery(this).find("ul.sub_menu_wrapper").show()});jQuery(".wlcms-form").validate({ignore:".ignore",rules:{rss_feed_address:{required:!1,feedurl:!0}},invalidHandler:function(e,t){var r=t.errorList;jQuery(".wlcms-navigation ul li span").remove();var n=[];for(i=0;i<r.length;i++){var a=r[i].element,s=jQuery(a).closest("section").attr("id");-1===n.indexOf(s)&&n.push(s),console.log(s)}for(i=0;i<n.length;i++)jQuery(".wlcms-navigation ul li a#wlcms_tab-"+n[i]).append('<span class="dashicons dashicons-no-alt"></span>');var c=t.numberOfInvalids();if(c){var o=1==c?"You missed 1 field. It has been highlighted":"You missed "+c+" fields. They have been highlighted";jQuery("div.wlcms_messages span").html(o),jQuery("div.wlcms_messages").show()}else jQuery("div.wlcms_messages").hide()}});jQuery(".template_type").on("change",function(){var e=jQuery(this).data("template_type"),t=jQuery(".template_type"+e).filter(":checked"),r=t.data("page_type");"html"==t.val()?(jQuery(".welcome-basicHtml"+e).show(),jQuery(".welcome-page"+e).hide()):(jQuery(".welcome-basicHtml"+e).hide(),jQuery(".welcome-page"+e).show(),"beaver"==r?(jQuery(".beaver_page"+e).next().show(),jQuery(".elementor_page"+e).next().hide()):(jQuery(".beaver_page"+e).next().hide(),jQuery(".elementor_page"+e).next().show()))}),jQuery(".template_type").trigger("change"),jQuery("form.wlcms-advert").on("submit",function(){var e=jQuery("#ad-authorize").is(":checked"),t=jQuery("#inf_custom_GDPR");t.val(e+" "+t.data("date"))})})},,,,,function(e,t){},,,,,function(e,t){}]);
assets/js/ays-beforeunload-shim.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=4)}({4:function(e,t,r){e.exports=r(5)},5:function(e,t){jQuery(function(){navigator.userAgent.toLowerCase().match(/iphone|ipad|ipod|opera/)&&$("a").bind("click",function(e){var t=$(e.target).closest("a").attr("href");if(void 0!==t&&!t.match(/^#/)&&""!=t.trim()){var r=$(window).triggerHandler("beforeunload",r);if(r&&""!=r)if(!confirm(r+"\n\nPress OK to leave this page or Cancel to stay."))return!1;return window.location.href=t,!1}})})}});
assets/js/index.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ die('Access denied.');
4
+ }
assets/js/jquery-areyousure.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=2)}([,,function(e,t,r){e.exports=r(3)},function(e,t){var r;(r=jQuery).fn.areYouSure=function(e){var t=r.extend({message:"You have unsaved changes!",dirtyClass:"dirty",change:null,silent:!1,addRemoveFieldsMarksDirty:!1,fieldEvents:"change keyup propertychange input",fieldSelector:":input:not(input[type=submit]):not(input[type=button])"},e),n=function(e){if(e.hasClass("ays-ignore")||e.hasClass("aysIgnore")||e.attr("data-ays-ignore")||void 0===e.attr("name"))return null;if(e.is(":disabled"))return"ays-disabled";var t,n=e.attr("type");switch(e.is("select")&&(n="select"),n){case"checkbox":case"radio":t=e.is(":checked");break;case"select":t="",e.find("option").each(function(e){var n=r(this);n.is(":selected")&&(t+=n.val())});break;default:t=e.val()}return t},i=function(e){e.data("ays-orig",n(e))},a=function(e){var i=function(e){var t=e.data("ays-orig");return void 0!==t&&n(e)!=t},a=r(this).is("form")?r(this):r(this).parents("form");if(i(r(e.target)))s(a,!0);else{if($fields=a.find(t.fieldSelector),t.addRemoveFieldsMarksDirty&&a.data("ays-orig-field-count")!=$fields.length)return void s(a,!0);var o=!1;$fields.each(function(){if($field=r(this),i($field))return o=!0,!1}),s(a,o)}},o=function(e){var n=e.find(t.fieldSelector);r(n).each(function(){i(r(this))}),r(n).unbind(t.fieldEvents,a),r(n).bind(t.fieldEvents,a),e.data("ays-orig-field-count",r(n).length),s(e,!1)},s=function(e,r){var n=r!=e.hasClass(t.dirtyClass);e.toggleClass(t.dirtyClass,r),n&&(t.change&&t.change.call(e,e),r&&e.trigger("dirty.areYouSure",[e]),r||e.trigger("clean.areYouSure",[e]),e.trigger("change.areYouSure",[e]))},u=function(){var e=r(this),n=e.find(t.fieldSelector);r(n).each(function(){var e=r(this);e.data("ays-orig")||(i(e),e.bind(t.fieldEvents,a))}),e.trigger("checkform.areYouSure")},d=function(){o(r(this))};return t.silent||window.aysUnloadSet||(window.aysUnloadSet=!0,r(window).bind("beforeunload",function(){if($dirtyForms=r("form").filter("."+t.dirtyClass),0!=$dirtyForms.length){if(navigator.userAgent.toLowerCase().match(/msie|chrome/)){if(window.aysHasPrompted)return;window.aysHasPrompted=!0,window.setTimeout(function(){window.aysHasPrompted=!1},900)}return t.message}})),this.each(function(e){if(r(this).is("form")){var n=r(this);n.submit(function(){n.removeClass(t.dirtyClass)}),n.bind("reset",function(){s(n,!1)}),n.bind("rescan.areYouSure",u),n.bind("reinitialize.areYouSure",d),n.bind("checkform.areYouSure",a),o(n)}})}}]);
assets/js/jquery.validate.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! jQuery Validation Plugin - v1.17.0 - 7/29/2017
2
+ * https://jqueryvalidation.org/
3
+ * Copyright (c) 2017 Jörn Zaefferer; Licensed MIT */
4
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.submitButton=b.currentTarget,a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.submitButton&&(c.settings.submitHandler||c.formSubmitted)&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),!c.settings.submitHandler||(e=c.settings.submitHandler.call(c,c.currentForm,b),d&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(null!=j&&(!j.form&&j.hasAttribute("contenteditable")&&(j.form=this.closest("form")[0],j.name=this.attr("name")),null!=j.form)){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(a,b){i[b]=f[b],delete f[b]}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g)),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}}),a.extend(a.expr.pseudos||a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){var c=a(b).val();return null!==c&&!!a.trim(""+c)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){!this.form&&this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0],this.name=a(this).attr("name"));var c=a.data(this.form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!a(this).is(e.ignore)&&e[d].call(c,this,b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)void 0!==a[b]&&null!==a[b]&&a[b]!==!1&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0],this.name=d),!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type;return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=b.hasAttribute("contenteditable")?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f,g=a(b).rules(),h=a.map(g,function(a,b){return b}).length,i=!1,j=this.elementValue(b);if("function"==typeof g.normalizer?f=g.normalizer:"function"==typeof this.settings.normalizer&&(f=this.settings.normalizer),f){if(j=f.call(b,j),"string"!=typeof j)throw new TypeError("The normalizer should return a string value.");delete g.normalizer}for(d in g){e={method:d,parameters:g[d]};try{if(c=a.validator.methods[d].call(this,j,b,e.parameters),"dependency-mismatch"===c&&1===h){i=!0;continue}if(i=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(k){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",k),k instanceof TypeError&&(k.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),k}}if(!i)return this.objectLength(g)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){"string"==typeof c&&(c={method:c});var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return a.replace(/([\\!"#$%&'()*+,.\/:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.submitButton&&a("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(d,e){b[d]=a.isFunction(e)&&"normalizer"!==d?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e<=d},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var b,c={};return a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a});
assets/js/select2.min.js ADDED
@@ -0,0 +1 @@
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.__cache={};var e=0;return c.GetUniqueElementId=function(a){var b=a.getAttribute("data-select2-id");return null==b&&(a.id?(b=a.id,a.setAttribute("data-select2-id",b)):(a.setAttribute("data-select2-id",++e),b=e.toString())),b},c.StoreData=function(a,b,d){var e=c.GetUniqueElementId(a);c.__cache[e]||(c.__cache[e]={}),c.__cache[e][b]=d},c.GetData=function(b,d){var e=c.GetUniqueElementId(b);return d?c.__cache[e]&&null!=c.__cache[e][d]?c.__cache[e][d]:a(b).data(d):c.__cache[e]},c.RemoveData=function(a){var b=c.GetUniqueElementId(a);null!=c.__cache[b]&&delete c.__cache[b]},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var c=this;this.data.current(function(d){var e=a.map(d,function(a){return a.id.toString()});c.$results.find(".select2-results__option[aria-selected]").each(function(){var c=a(this),d=b.GetData(this,"data"),f=""+d.id;null!=d.element&&d.element.selected||null==d.element&&a.inArray(f,e)>-1?c.attr("aria-selected","true"):c.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(c){var d=document.createElement("li");d.className="select2-results__option";var e={role:"treeitem","aria-selected":"false"};c.disabled&&(delete e["aria-selected"],e["aria-disabled"]="true"),null==c.id&&delete e["aria-selected"],null!=c._resultId&&(d.id=c._resultId),c.title&&(d.title=c.title),c.children&&(e.role="group",e["aria-label"]=c.text,delete e["aria-selected"]);for(var f in e){var g=e[f];d.setAttribute(f,g)}if(c.children){var h=a(d),i=document.createElement("strong");i.className="select2-results__group";a(i);this.template(c,i);for(var j=[],k=0;k<c.children.length;k++){var l=c.children[k],m=this.option(l);j.push(m)}var n=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});n.append(j),h.append(i),h.append(n)}else this.template(c,d);return b.StoreData(d,"data",c),d},c.prototype.bind=function(c,d){var e=this,f=c.id+"-results";this.$results.attr("id",f),c.on("results:all",function(a){e.clear(),e.append(a.data),c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("results:append",function(a){e.append(a.data),c.isOpen()&&e.setClasses()}),c.on("query",function(a){e.hideMessages(),e.showLoading(a)}),c.on("select",function(){c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("unselect",function(){c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("open",function(){e.$results.attr("aria-expanded","true"),e.$results.attr("aria-hidden","false"),e.setClasses(),e.ensureHighlightVisible()}),c.on("close",function(){e.$results.attr("aria-expanded","false"),e.$results.attr("aria-hidden","true"),e.$results.removeAttr("aria-activedescendant")}),c.on("results:toggle",function(){var a=e.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),c.on("results:select",function(){var a=e.getHighlightedResults();if(0!==a.length){var c=b.GetData(a[0],"data");"true"==a.attr("aria-selected")?e.trigger("close",{}):e.trigger("select",{data:c})}}),c.on("results:previous",function(){var a=e.getHighlightedResults(),b=e.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var d=c-1;0===a.length&&(d=0);var f=b.eq(d);f.trigger("mouseenter");var g=e.$results.offset().top,h=f.offset().top,i=e.$results.scrollTop()+(h-g);0===d?e.$results.scrollTop(0):h-g<0&&e.$results.scrollTop(i)}}),c.on("results:next",function(){var a=e.getHighlightedResults(),b=e.$results.find("[aria-selected]"),c=b.index(a),d=c+1;if(!(d>=b.length)){var f=b.eq(d);f.trigger("mouseenter");var g=e.$results.offset().top+e.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=e.$results.scrollTop()+h-g;0===d?e.$results.scrollTop(0):h>g&&e.$results.scrollTop(i)}}),c.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),c.on("results:message",function(a){e.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=e.$results.scrollTop(),c=e.$results.get(0).scrollHeight-b+a.deltaY,d=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=e.$results.height();d?(e.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(e.$results.scrollTop(e.$results.get(0).scrollHeight-e.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(c){var d=a(this),f=b.GetData(this,"data");if("true"===d.attr("aria-selected"))return void(e.options.get("multiple")?e.trigger("unselect",{originalEvent:c,data:f}):e.trigger("close",{}));e.trigger("select",{originalEvent:c,data:f})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(c){var d=b.GetData(this,"data");e.getHighlightedResults().removeClass("select2-results__option--highlighted"),e.trigger("results:focus",{data:d,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var c=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=b.GetData(this.$element[0],"old-tabindex")?this._tabindex=b.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),c.attr("title",this.$element.attr("title")),c.attr("tabindex",this._tabindex),this.$selection=c,c},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(c){a(document.body).on("mousedown.select2."+c.id,function(c){var d=a(c.target),e=d.closest(".select2");a(".select2.select2-container--open").each(function(){a(this),this!=e[0]&&b.GetData(this,"element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()})},e.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty(),a.removeAttr("title")},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.attr("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,e){var f=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){f.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!f.options.get("disabled")){var d=a(this),e=d.parent(),g=c.GetData(e[0],"data");f.trigger("unselect",{originalEvent:b,data:g})}})},d.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty(),a.removeAttr("title")},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.attr("title",e.title||e.text),c.StoreData(f[0],"data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(a,b,c){function d(){}return d.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},d.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var d=this.$selection.find(".select2-selection__clear");if(0!==d.length){b.stopPropagation();var e=c.GetData(d[0],"data"),f=this.$element.val();this.$element.val(this.placeholder.id);var g={data:e};if(this.trigger("clear",g),g.prevented)return void this.$element.val(f);for(var h=0;h<e.length;h++)if(g={data:e[h]},this.trigger("unselect",g),g.prevented)return void this.$element.val(f);this.$element.trigger("change"),this.trigger("toggle",{})}}},d.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},d.prototype.update=function(b,d){if(b.call(this,d),!(this.$selection.find(".select2-selection__placeholder").length>0||0===d.length)){var e=a('<span class="select2-selection__clear">&times;</span>');c.StoreData(e[0],"data",d),this.$selection.find(".select2-selection__rendered").prepend(e)}},d}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,d,e){var f=this;a.call(this,d,e),d.on("open",function(){f.$search.trigger("focus")}),d.on("close",function(){f.$search.val(""),f.$search.removeAttr("aria-activedescendant"),f.$search.trigger("focus")}),d.on("enable",function(){f.$search.prop("disabled",!1),f._transferTabIndex()}),d.on("disable",function(){f.$search.prop("disabled",!0)}),d.on("focus",function(a){f.$search.trigger("focus")}),d.on("results:focus",function(a){f.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){f.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){f._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),f.trigger("keypress",a),f._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===f.$search.val()){var d=f.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var e=b.GetData(d[0],"data");f.searchRemoveChoice(e),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void f.$selection.off("input.search input.searchcheck");f.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void f.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&f.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],g=["opening","closing","selecting","unselecting","clearing"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){b.RemoveData(this)})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var d;a.children?(d=document.createElement("optgroup"),d.label=a.text):(d=document.createElement("option"),void 0!==d.textContent?d.textContent=a.text:d.innerText=a.text),void 0!==a.id&&(d.value=a.id),a.disabled&&(d.disabled=!0),a.selected&&(d.selected=!0),a.title&&(d.title=a.title);var e=c(d),f=this._normalizeItem(a);return f.element=d,b.StoreData(d,"data",f),e},d.prototype.item=function(a){var d={};if(null!=(d=b.GetData(a[0],"data")))return d;if(a.is("option"))d={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){d={text:a.prop("label"),children:[],title:a.prop("title")};for(var e=a.children("option"),f=[],g=0;g<e.length;g++){var h=c(e[g]),i=this.item(h);f.push(i)}d.children=f}return d=this._normalizeItem(d),d.element=a[0],b.StoreData(a[0],"data",d),d},d.prototype._normalizeItem=function(a){a!==Object(a)&&(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){"status"in d&&(0===d.status||"0"===d.status)||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.blur()}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){b.StoreData(this,"select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(c){var d=b.GetData(this,"select2-scroll-position");a(this).scrollTop(d.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",["../utils"],function(a){function b(){}return b.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},b.prototype._handleSelectOnClose=function(b,c){if(c&&null!=c.originalSelect2Event){var d=c.originalSelect2Event;if("select"===d._type||"unselect"===d._type)return}var e=this.getHighlightedResults();if(!(e.length<1)){var f=a.GetData(e[0],"data");null!=f.element&&f.element.selected||null==f.element&&f.selected||this.trigger("select",{data:f})}},b}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(!0,this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),d.GetData(a[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),d.StoreData(a[0],"data",d.GetData(a[0],"select2Tags")),d.StoreData(a[0],"tags",!0)),d.GetData(a[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",d.GetData(a[0],"ajaxUrl")),d.StoreData(a[0],"ajax-Url",d.GetData(a[0],"ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,d.GetData(a[0])):d.GetData(a[0]);var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,d){null!=c.GetData(a[0],"select2")&&c.GetData(a[0],"select2").destroy(),this.$element=a,this.id=this._generateId(a),d=d||{},this.options=new b(d,a),e.__super__.constructor.call(this);var f=a.attr("tabindex")||0;c.StoreData(a[0],"old-tabindex",f),a.attr("tabindex","-1");var g=this.options.get("dataAdapter");this.dataAdapter=new g(a,this.options);var h=this.render();this._placeContainer(h);var i=this.options.get("selectionAdapter");this.selection=new i(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,h);var j=this.options.get("dropdownAdapter");this.dropdown=new j(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,h);var k=this.options.get("resultsAdapter");this.results=new k(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){l.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),c.StoreData(a[0],"select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",c.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),c.RemoveData(this.$element[0]),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),c.StoreData(b[0],"element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(a,b,c,d,e){if(null==a.fn.select2){var f=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,g=Array.prototype.slice.call(arguments,1);return this.each(function(){var a=e.GetData(this,"select2");null==a&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=a[b].apply(a,g)}),a.inArray(b,f)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
changelog.txt ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ == Changelog ==
2
+
3
+ = 2.0 =
4
+ UX changes and added more functionalities
5
+
6
+ = 1.6.4 =
7
+ Update images directory
8
+
9
+ = 1.6.3 =
10
+ Removed opt-in form
11
+
12
+ = 1.6.2 =
13
+ Fixed deprecated php function
14
+
15
+ = 1.6.1 =
16
+ Fixed Import for php5.2
17
+
18
+ = 1.6 =
19
+ Fixed Import
20
+
21
+ = 1.5.9 =
22
+ Minor changes
23
+
24
+ = 1.5.8 =
25
+ Fixed minor bugs
26
+
27
+ = 1.5.7 =
28
+ Fixed issue with importer
29
+
30
+ = 1.5.6 =
31
+ Fixed bug with dashboard panels in wp-admin
32
+
33
+ = 1.5.5 =
34
+ WordPress v4.4.1 Compatibility
35
+
36
+ = 1.5.4 =
37
+ Fixed conflict with WP Mandrill plugin
38
+ Added option to hide the activity panel in the dashboard
39
+ Renamed Right Now widget to At a Glance
40
+
41
+ = 1.5.3 =
42
+ Security release. Better use of WordPress nonces and enhanced validation on import functionality. Disclosed by g0blin.
43
+
44
+ = 1.5.2 =
45
+ Login Logo width fixed for version WordPress 3.8
46
+ fixed 16px logo in admin bar on front end
47
+ Fixed advert on wlcms advert on the settings page
48
+ Fixed Dashboard logo not appear on dashboard for WP 3.8
49
+ Fixed Footer logo does not line up properly WP 3.8
50
+ Fixed Hide WordPress Logos from admin bar
51
+
52
+
53
+ = 1.5.1 =
54
+ Security patch - added nonce to admin form for better security. Props PC SJJ.
55
+
56
+ = 1.5 =
57
+ Added Custom RSS Feeds as new option
58
+ Added Import/Export of settings feature.
59
+ Updated CSS rules for wp-login.
60
+ Minor bug fixes
61
+
62
+ = 1.4.7 =
63
+ Minor Bug introduced with WordPress 3.4 and custom login images.
64
+ Also added conditionals to prevent any errors with user capabilities.
65
+
66
+ = 1.4.6 =
67
+ Patch submitted by Chris @ iThemes. Better support for users of iThemes.
68
+
69
+ = 1.4.5 =
70
+ Changed how media menu is hidden to allow both hiding the menu and still able to add content. (Small bug)
71
+
72
+ = 1.4.4 =
73
+ Better support for other languages, deactivating the plugin does not remove options, only deleting it will run the uninstall script. Other minor fixes.
74
+
75
+ = 1.4.3 =
76
+ Minor Bug Fixes and some improvements on how forms are saved.
77
+
78
+ = 1.4.2 =
79
+ Bug Fixes, hopefully the last ones for this version
80
+
81
+ = 1.4.1 =
82
+ Bug Fixes for radio buttons, media uploader and login style
83
+
84
+ = 1.4 =
85
+ Changes for WordPress 3.3
86
+ Ability to brand the dashboard
87
+ Lots of new changes and bug fixes
88
+
89
+ = 1.3 =
90
+ Changes for WordPress 3.2
91
+ Restructure of menus
92
+ Added classic header and footer for 3.2 to improve branding
93
+ Header logo as site link
94
+ Admin can view dashboards but hide them from editors
95
+ Hide browser nag
96
+
97
+ Bug fixes
98
+
99
+ = 1.2 =
100
+ Ability to show Menu & Widgets menu for Editors
101
+ Removed WordPress link and ALT text from login page.
102
+ Custom css for forgotten link on login page.
103
+ Tested on multi user sites.
104
+ Fixed a bug which was stopping the Profile from appearing.
105
+
106
+ = 1.1 =
107
+ Ability to remove menus
108
+ Added widths for header and footer logos.
109
+
110
+ = 1.0.5 =
111
+ Updated terminology
112
+
113
+ = 1.0.4 =
114
+ Updated custom login image file height
115
+
116
+ = 1.0.3 =
117
+ Updated logo filename
118
+
119
+ = 1.0.2 =
120
+ Added update log!
css/editor.css DELETED
@@ -1,4 +0,0 @@
1
- .mceContentBody
2
- {
3
- background-color: black;
4
- }
 
 
 
 
css/wlcms_style.css DELETED
@@ -1,320 +0,0 @@
1
- .wlcms_section {/*margin-bottom:15px*/}
2
- /* Custom CSS */
3
- #wlcms-footer-container {
4
- float: left;
5
- margin-left: 15px;
6
- }
7
- p#safari-fix {
8
- display: none;
9
- }
10
- #wlcms-footer-logo {
11
- float:left;
12
- padding-right: 10px;
13
- }
14
-
15
- .video-container {
16
- margin-right: 20px;
17
- float: left;
18
- text-align: center;
19
- margin-bottom: 20px;
20
- }
21
- .video-container img {
22
- margin-bottom: 6px;
23
- }
24
- .wlcms_wrap{
25
- width:740px;
26
- }
27
-
28
- .wlcms_section{
29
- border:1px solid #ddd;
30
- border-bottom:0;
31
- background:#f9f9f9;
32
- }
33
- .wlcms_opts label{
34
- font-size:12px;
35
- font-weight:700;
36
- width:200px;
37
- display:block;
38
- float:left;
39
- }
40
- .wlcms_input {
41
- clear:both;
42
- padding:30px 10px;
43
- border-bottom:1px solid #ddd;
44
- border-top:1px solid #fff;
45
- overflow: hidden;
46
- }
47
-
48
- #wlcms_o_head_cap {margin-top:10px;padding-left:30px}
49
-
50
- /**************************/
51
- .wlcms_radioinput {
52
- padding:30px 10px;
53
-
54
- }
55
- .wlcms_input_message1 {
56
- padding: 10px 10px;
57
- border-bottom: 1px solid #ddd;
58
- }
59
- /**************************/
60
- .wlcms_input_profile {
61
- padding:30px 10px 10px 10px;
62
- }
63
- .wlcms_checkbox_last {
64
- /*padding:10px 10px 30px 10px;*/
65
- clear:left;
66
- padding: 3px 3px 20px 3px;
67
- border-bottom:1px solid #ddd;
68
- }
69
- .wlcms_input_local_video {
70
- padding: 3px;
71
- clear:both;
72
- }
73
- .wlcms_input_message {
74
- padding: 10px 10px 0;
75
- border-bottom: none;
76
- }
77
- .wlcms_input_welcome_last {
78
- padding:10px 10px 30px 10px;
79
- border-bottom:1px solid #ddd;
80
- }
81
- .wlcms_opts small{
82
- display:block;
83
- float:right;
84
- width:200px;
85
- color:#999;
86
- }
87
- .wlcms_opts input[type="text"], .wlcms_opts select{
88
- width:250px;
89
- font-size:12px;
90
- padding:4px;
91
- color:#333;
92
- line-height:1em;
93
- background:#f3f3f3;
94
- }
95
- /***************************************************************************************************************/
96
- .wlcms_optsnew input[type="text"], .wlcms_optsnew select{
97
- width:125px;
98
- font-size:12px;
99
- padding:4px;
100
- color:#333;
101
- line-height:1em;
102
- background:#f3f3f3;
103
- }
104
- /***************************************************************************************************************/
105
- .wlcms_input input:focus, .wlcms_input_welcome_last textarea:focus{
106
- background:#fff;
107
- }
108
- .wlcms_input_welcome_last textarea{
109
- width:280px;
110
- height:280px;
111
- font-size:10px;
112
- padding:4px;
113
- color:#333;
114
- line-height:1.5em;
115
- background:#f3f3f3;
116
- }
117
- .wlcms_title h3 {
118
- cursor:pointer;
119
- font-size:1em;
120
- text-transform: uppercase;
121
- margin:0;
122
- font-weight:bold;
123
- color:#232323;
124
- float:left;
125
- width:80%;
126
- padding:14px 4px 4px;
127
- }
128
-
129
- .wlcms_title{
130
- cursor:pointer;
131
- border-bottom:1px solid #ddd;
132
- background:#fff ;
133
- padding:0;
134
- }
135
-
136
- .wlcms_title h3 img.inactive{
137
- margin:-8px 10px 0 2px;
138
- width:32px;
139
- height:32px;
140
- background:url('../images/pointer.png') no-repeat 0 0;
141
- float:left;
142
- -moz-border-radius:6px;
143
- border:1px solid #ccc;
144
- }
145
-
146
- .wlcms_subtitle{
147
- cursor:pointer;
148
- border-bottom:1px solid #ddd;
149
- background:#eee;
150
- padding:0;
151
- }
152
- .wlcms_subtitle h3{
153
- margin:-8px 10px 0 2px;
154
- height:10px;
155
- float:left;
156
- -moz-border-radius:6px;
157
- padding: 22px 8px;
158
- }
159
- .wlcms_title h3 img.active{
160
- margin:-8px 10px 0 2px;
161
- width:32px;
162
- height:32px;
163
- background:url('../images/pointer.png') no-repeat 0 -32px;
164
- float:left;
165
- -moz-border-radius:6px;
166
- -webkit-border-radius:6px;
167
- border:1px solid #ccc;
168
- }
169
-
170
- .wlcms_title h3:hover img{
171
- border:1px solid #999;
172
- }
173
- .wlcms_options h4 {
174
- font-size: 1.1em;
175
- padding: 1.33em 0 1em 10px;
176
- margin: 0;
177
- }
178
-
179
- .wlcms_title span.submit{
180
- display:block;
181
- float:right;
182
- margin:0;
183
- padding:0;
184
- width:15%;
185
- padding:12px 0;
186
- }
187
-
188
- .clearfix{
189
- clear:both;
190
- }
191
-
192
- .wlcms_table th, .wlcms_table td{
193
- border:1px solid #bbb;
194
- padding:10px;
195
- text-align:center;
196
- }
197
-
198
- .wlcms_table th, .wlcms_table td.feature{
199
- border-color:#888;
200
- }
201
- .wlcms_opts label.radioyesno {
202
- width: 50px;
203
- }
204
- .wlcms_opts label.radioCustom {
205
- width: 80px;
206
- }
207
- .wlcms_opts label.radioWebsite {
208
- width: 80px;
209
- }
210
- .wlcms_opts label.radioBlog {
211
- width: 60px;
212
- }
213
- /*.pretty-hover {
214
- background-color: #EEEEEE;
215
- }*/
216
- #vVideoVariables .wlcms_input {
217
- border-bottom: none;
218
- border-top:none;
219
- padding:10px 10px;
220
- }
221
- #wlcm-reset {
222
- margin: 0;
223
- padding-top: 0;
224
- }
225
- .wlcms-icon32 {
226
- float:left;
227
- height:36px;
228
- margin:0 6px 0 0;
229
- width:36px;
230
- }
231
- #wlcms_o_header_height{
232
- width:46px;
233
- }
234
- #wlcms_o_header_custom_logo_width{
235
- width:46px;
236
- }
237
- #wlcms_o_welcome_visible_to{
238
- width:80px;
239
- }
240
- #wlcms_o_footer_custom_logo_width{
241
- width:46px;
242
- }
243
- #wlcms_o_welcome_visible_to1{
244
- width:110px;
245
- }
246
- .wlcms_input_local_video wlcms_checkbox{
247
-
248
- float:left;
249
- }
250
-
251
- #wlcms_o_hide_post_div{
252
- padding:0 0 0 200px;
253
- margin-top:-35px;
254
- float:left;
255
- width:100px;}
256
- #wlcms_o_hide_post_divnew{
257
- padding:0 0 0 50px;
258
- float:left;
259
- width:200px;
260
- margin-top:-35px;
261
- }
262
- #wlcms_o_hide_page_div{
263
- padding:0 0 0 200px;
264
- float:left;
265
- margin-top:-35px;
266
- width:140px;
267
- }
268
- #wlcms_o_hide_page_divnew{
269
- padding:0 0 0px 10px;
270
- float:left;
271
- width:200px;
272
- margin:-35px 0 10px 0;
273
- }
274
- #wlcms_o_hide_page_divmain{
275
- }
276
- ul.role_name_editor{
277
- width:650px;}
278
- ul.role_name_editor li{
279
- float:left;
280
- width:200px;
281
- height:auto;
282
- }
283
- #wlcms_o_welcome_visible_to{
284
- width:110px;
285
- }
286
- .wlcms_o_parent_label{
287
- width:15px;
288
- height:15px;
289
- float:left;
290
- display:block;
291
- background:url('../images/arrow.gif') no-repeat 5px 2px !important;
292
- cursor:pointer;
293
- padding:0 0 0 20px;
294
- }
295
- .wlcms_o_parent_label_active{
296
- background:url('../images/arrow-down.gif') no-repeat 2px 5px !important;
297
- padding:0 0 0 20px;
298
-
299
- }
300
- .wlcms_o_child_label{
301
- padding:0 0 0 20px;}
302
-
303
- .wlcms_options .plugin-count, .wlcms_options .pending-count, .wlcms_options .update-count {display:none}
304
-
305
- #menus {margin-left:10px}
306
- #menus li {margin-bottom:10px}
307
- #menus li ul {padding-top:3px}
308
- #menus li li {margin:0 0 3px 15px}
309
- #menus li em {font-style:normal;font-weight:bold;color:#006699}
310
- #menus li strong {cursor:pointer}
311
-
312
- #wlcms-footer-container {position:relative}
313
- #wlcms-footer-container span {position:absolute;top:20%;width:500px}
314
-
315
- #form-show-template { border-top: none; padding: 10px;}
316
-
317
- .lineup {float:left}
318
-
319
- #vTheAppearanceMenu .wlcms_checkbox {padding:5px 10px}
320
- #vTheAppearanceMenu .wlcms_text {padding-bottom:15px;border-bottom: 1px solid #DDD}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
images/WPElevation-WP-Skyscaper-Button-157x40.gif DELETED
Binary file
images/WPElevatoon-WP-Skyscraper-Image-232x337.jpg DELETED
Binary file
images/arrow-down.gif DELETED
Binary file
images/arrow.gif DELETED
Binary file
images/arrow.jpg DELETED
Binary file
images/arrow.png DELETED
Binary file
images/arrows-dark-vs.png DELETED
Binary file
images/better-ebooks-ad.jpg DELETED
Binary file
images/better-ebooks-ad.png DELETED
Binary file
images/download-button.png DELETED
Binary file
images/pointer.png DELETED
Binary file
images/privacy.png DELETED
Binary file
images/screenshot-1.png DELETED
Binary file
images/screenshot-2.png DELETED
Binary file
images/screenshot-3.png DELETED
Binary file
images/screenshot-4.png DELETED
Binary file
images/screenshot-5.png DELETED
Binary file
images/toggle-arrow.gif DELETED
Binary file
images/trans.png DELETED
Binary file
images/wlcms-plugin-advert.png DELETED
Binary file
includes/Functions.php ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!function_exists('wlcms_field_setting')) {
3
+ function wlcms_field_setting($key = "", $default = false)
4
+ {
5
+ if (isset($_POST)) {
6
+ if (isset($_POST['wlcms'][$key])) {
7
+ return $_POST['wlcms'][$key];
8
+ }
9
+ }
10
+
11
+ $value = wlcms()->Settings()->get($key, $default);
12
+ return $value;
13
+ }
14
+ }
15
+
16
+ if (!function_exists('wlcms_welcome_value')) {
17
+ function wlcms_welcome_value($key = 0, $field, $default = false)
18
+ {
19
+ $welcome_panel = wlcms_field_setting('welcome_panel');
20
+
21
+ return isset($welcome_panel[$key][$field]) ? $welcome_panel[$key][$field] : $default;
22
+ }
23
+ }
24
+
25
+ if (!function_exists('wlcms_array_value')) {
26
+ function wlcms_array_value($data = array(), $default = false)
27
+ {
28
+ return isset($data) ? $data : $default;
29
+ }
30
+ }
31
+
32
+ if (!function_exists('wlcms_site_domain')) {
33
+ function wlcms_site_domain()
34
+ {
35
+ $site = get_site_url();
36
+ $scheme = '#^http(s)?://#';
37
+ return preg_replace($scheme, "", $site);
38
+ }
39
+ }
40
+
41
+ if (!function_exists('wlcms_sanitize_text_field')) {
42
+ function wlcms_sanitize_text_field($value)
43
+ {
44
+ if (!is_array($value)) {
45
+ return wp_kses_post($value);
46
+ }
47
+
48
+ foreach ($value as $key => $array_value) {
49
+ $value[$key] = wlcms_sanitize_text_field($array_value);
50
+ }
51
+ return $value;
52
+
53
+ }
54
+ }
55
+ if (!function_exists('wlcms_esc_html_e')) {
56
+ function wlcms_esc_html_e($value)
57
+ {
58
+ return wlcms_sanitize_text_field($value);
59
+
60
+ }
61
+ }
62
+
63
+ if (!function_exists('wlcms_removeslashes')) {
64
+ function wlcms_removeslashes($value)
65
+ {
66
+ return stripslashes_deep($value);
67
+ }
68
+ }
69
+
70
+ if (!function_exists('wlcms_set_css')) {
71
+ function wlcms_set_css($element, $props)
72
+ {
73
+ wlcms()->Admin_Script()->setCss($element, $props);
74
+ }
75
+ }
76
+
77
+ if (!function_exists('wlcms_set_hidden_css')) {
78
+ function wlcms_set_hidden_css($element)
79
+ {
80
+ wlcms()->Admin_Script()->set_CssHidden($element);
81
+ }
82
+ }
83
+
84
+ if (!function_exists('wlcms_add_js')) {
85
+ function wlcms_add_js($js)
86
+ {
87
+ wlcms()->Admin_Script()->appendJs($js);
88
+ }
89
+ }
90
+ if (!function_exists('is_wlcms_admin')) {
91
+ function is_wlcms_admin()
92
+ {
93
+ return wlcms()->Admin_Menus()->has_visible_roles();
94
+ }
95
+ }
96
+
97
+ if (!function_exists('wlcms_current_user_roles')) {
98
+ function wlcms_current_user_roles()
99
+ {
100
+ $roles = wp_get_current_user()->roles;
101
+ $role = array_shift($roles);
102
+ return $role;
103
+ }
104
+ }
105
+
106
+ if (!function_exists('wlcms_select_roles')) {
107
+ /**
108
+ * add role select element
109
+ *
110
+ * @param array $args
111
+ * @param string $selected
112
+ * @return string
113
+ */
114
+ function wlcms_select_roles($args = array(), $selected = array())
115
+ {
116
+
117
+ global $wp_roles;
118
+
119
+ $return = '<select name="' . $args['name'] . '[]" id="' . $args['name'] . '" multiple="multiple" class="' . $args['class'] . '">';
120
+ $return .= '<option value=""> </option>';
121
+ foreach ($wp_roles->role_names as $key => $title) {
122
+ $selected_val = '';
123
+
124
+ if (is_array($selected) && in_array($key, $selected)) {
125
+ $selected_val = ' selected';
126
+ }
127
+ $return .= '<option value="' . $key . '" ' . $selected_val . '>' . $title . '</option>';
128
+ }
129
+ $return .= '</select>';
130
+
131
+ return $return;
132
+ }
133
+ }
134
+
135
+ if (!function_exists('wlcms_select_pages')) {
136
+ /**
137
+ * add role select element
138
+ *
139
+ * @param array $args
140
+ * @param string $selected
141
+ * @return string
142
+ */
143
+ function wlcms_select_pages($args = array(), $selected = '', $query = false)
144
+ {
145
+
146
+ if (!$query) {
147
+ $post_type = array(
148
+ 'post_type' => 'page',
149
+ 'posts_per_page' => '-1',
150
+ 'post_status' => 'publish'
151
+ );
152
+ }
153
+ $pages = get_posts($query);
154
+
155
+ $return = '<select name="' . $args['name'] . '" id="' . $args['name'] . '" class="' . $args['class'] . '">';
156
+ $return .= '<option value=""> </option>';
157
+ if ($pages) :
158
+ foreach ($pages as $page) {
159
+ $selected_val = '';
160
+ $key = $page->ID;
161
+ $title = $page->post_title;
162
+
163
+ if ($selected == $key) {
164
+ $selected_val = ' selected';
165
+ }
166
+ $return .= '<option value="' . $key . '" ' . $selected_val . '>' . $title . '</option>';
167
+ }
168
+ endif;
169
+ $return .= '</select>';
170
+
171
+ return $return;
172
+ }
173
+ }
174
+
175
+ if (!function_exists('wlcms_kses')) {
176
+ function wlcms_kses($value, $callback = 'wp_kses_post')
177
+ {
178
+ if (is_array($value)) {
179
+ foreach ($value as $index => $item) {
180
+ $value[$index] = wlcms_kses($item, $callback);
181
+ }
182
+ } elseif (is_object($value)) {
183
+ $object_vars = get_object_vars($value);
184
+ foreach ($object_vars as $property_name => $property_value) {
185
+ $value->$property_name = wlcms_kses($property_value, $callback);
186
+ }
187
+ } else {
188
+ $value = call_user_func($callback, $value);
189
+ }
190
+
191
+ return $value;
192
+ }
193
+ }
194
+
195
+ if (!function_exists('vum_fix_json')) {
196
+ function vum_fix_json($matches)
197
+ {
198
+ return "s:" . strlen($matches[2]) . ':"' . $matches[2] . '";';
199
+ }
200
+ }
201
+
202
+ if (!function_exists('wlcms_form_upload_field')) {
203
+ /**
204
+ * Upload image field generator
205
+ *
206
+ * @param string $label
207
+ * @param string $key
208
+ * @param string $help
209
+ * @return string
210
+ */
211
+ function wlcms_form_upload_field($label = '', $key = '', $help = '')
212
+ {
213
+ $html = '<label>' . __($label, 'wlcms') . '</label>
214
+ <div class="wlcms-upload-thumbnail">';
215
+
216
+ $key_setting = wlcms_field_setting($key);
217
+ if ($key_setting) {
218
+ $html .= '<img src="' . $key_setting . '" alt="" /><span class="dashicons dashicons-dismiss wlcms-remove-img"></span>';
219
+ }
220
+
221
+ $html .= '</div>
222
+ <div class="wlcms-input">
223
+ <input type="text" name="' . $key . '" class="wlcms-upload-input" value="' . $key_setting . '" />
224
+ <a href="#" class="wlcms_upload">Upload</a>
225
+ </div>
226
+ <div class="wlcms-help">' . __($help, 'wlcms') . '</div>';
227
+
228
+ return $html;
229
+
230
+ }
231
+ }
232
+
233
+ if (!function_exists('wlcms_is_elementor_active')) {
234
+ function wlcms_is_elementor_active()
235
+ {
236
+ if (!version_compare(PHP_VERSION, '5.4', '>=')) {
237
+ return false;
238
+ }
239
+ return (function_exists('_is_elementor_installed') && _is_elementor_installed()) || defined('ELEMENTOR_VERSION');
240
+ }
241
+ }
242
+
243
+ if (!function_exists('wlcms_is_beaver_builder_active')) {
244
+ function wlcms_is_beaver_builder_active()
245
+ {
246
+ if (!version_compare(PHP_VERSION, '5.4', '>=')) {
247
+ return false;
248
+ }
249
+ return class_exists('FLBuilder');
250
+ }
251
+ }
252
+
253
+ if (!function_exists('wlcms_has_pagebuilder')) {
254
+ function wlcms_has_pagebuilder()
255
+ {
256
+ return (wlcms_is_beaver_builder_active() || wlcms_is_elementor_active());
257
+ }
258
+ }
259
+
260
+ if (!function_exists('wlcms_css_metrics')) {
261
+ function wlcms_css_metrics($value = 'auto')
262
+ {
263
+ if ($value == 'auto') return $value;
264
+
265
+ if (strpos($value, '%') !== false) return $value;
266
+
267
+ if (strpos($value, 'px') !== false) return $value;
268
+
269
+ return $value . 'px';
270
+
271
+ }
272
+ }
273
+
274
+ if (isset($_GET['preview_section']) && $_GET['preview_section'] == 'login') {
275
+ if (!function_exists('wp_clear_auth_cookie')) {
276
+
277
+ /**
278
+ * Multisite login hack to avoid redirecting to the dashboard while in preview mode
279
+ * By adding &reauth=1 from the param WordPress will act as force show login form.
280
+ * This will replace the pluggable function wp_clear_auth_cookie to avoid removing of cookies
281
+ * @return void
282
+ */
283
+ function wp_clear_auth_cookie()
284
+ {
285
+ return;
286
+ }
287
+ }
288
+ }
includes/admin.config.php DELETED
@@ -1,647 +0,0 @@
1
- <?php
2
-
3
- $wlcmsShortName = "wlcms_o";
4
-
5
-
6
-
7
- global $wp_version, $submenu;
8
-
9
- $wlcmsOptions = array(
10
- array( "name" => "White Label CMS Options", "type" => "title"),
11
- array( "name" => "Branding", "type" => "section"),
12
- array( "type" => "open"),
13
- array( "name" => "Admin Bar", "type" => "subtitle")
14
- );
15
-
16
- if ( version_compare( $wp_version, '3.2.5', '>=' ) )
17
- {
18
- $wlcmsOptions[] = array(
19
- "name" => "Hide WordPress Logos",
20
- "desc" => "Hide WordPress logo from the admin bar and home icon",
21
- "id" => $wlcmsShortName."_hide_wp_adminbar",
22
- "type" => "radio",
23
- "options" => array("1", "0"),
24
- "std" => 0);
25
- $wlcmsOptions[] = array(
26
- "name" => "Add Your Logo (16px x 16px)",
27
- "desc" => "Adds a 16px logo to the admin bar",
28
- "id" => $wlcmsShortName."_adminbar_custom_logo",
29
- "class" => 'upload_image_button',
30
- "type" => "file",
31
- "std" => '');
32
- $wlcmsOptions[] = array( "name" => "Add Dashboard Logo", "type" => "subtitle" );
33
- $wlcmsOptions[] = array(
34
- "name" => "Add Dashboard Logo",
35
- "desc" => "This will replace the home icon on the dashboard with your own logo.",
36
- "id" => $wlcmsShortName."_header_custom_logo",
37
- "class" =>'upload_image_button',
38
- "type" => "file",
39
- "std" => '');
40
- $wlcmsOptions[] = array(
41
- "name" => "Replace Dashboard Heading",
42
- "desc" => "This will replace the heading \"Dashboard\" on the dashboard page. This combined with a custom logo will help improve the branding experience for your client",
43
- "id" => $wlcmsShortName."_dashboard_override",
44
- "type" => "text",
45
- "title" => '',
46
- "std" => __('Dashboard'));
47
- }
48
- else
49
- {
50
- $wlcmsOptions[] = array(
51
- "name" => "Classic Header Height",
52
- "desc" => "<b>3.2 Only</b> - This will keep Header height to 46px, pre WordPress 3.2 size (better for branding) if its empty",
53
- "id" => $wlcmsShortName."_header_height",
54
- "type" => "text",
55
- "unit" => "px",
56
- "class" => 'default-text',
57
- "title" => 'Header',
58
- "std" => '0');
59
-
60
- $wlcmsOptions[] = array(
61
- "name" => "Custom Header Logo",
62
- "desc" => "This is a logo that will appear in the header. It should be a transparent .gif or .png and about 32px by 32px. You can either upload an image, or just type in the image name if you have already placed it in the images folder of your theme or child.",
63
- "id" => $wlcmsShortName."_header_custom_logo",
64
- "class" => 'upload_image_button',
65
- "type" => "file",
66
- "std" => '');
67
-
68
- $wlcmsOptions[] = array(
69
- "name" => "Custom Header Logo Width",
70
- "desc" => "Leave blank for default value of 32px.",
71
- "id" => $wlcmsShortName."_header_custom_logo_width",
72
- "type" => "text",
73
- "unit" => "px",
74
- "class" => 'default-text',
75
- "title" => '32',
76
- "std" => '');
77
-
78
- $wlcmsOptions[] = array(
79
- "name" => "Header Logo As Site Link",
80
- "desc" => "The logo that appears in the header with be the link to the site. It will remove the text link",
81
- "id" => $wlcmsShortName."_header_logo_link",
82
- "type" => "radio",
83
- "options" => array("1", "0"),
84
- "std" => 0);
85
- }
86
-
87
- $wlcmsOptions2 = array(
88
- array( "name" => "Footer", "type" => "subtitle" ),
89
- array(
90
- "name" => "Custom Footer Logo",
91
- "desc" => "This logo will appear in the footer on the left hand side",
92
- "id" => $wlcmsShortName."_footer_custom_logo",
93
- "type" => "file",
94
- "class" => 'upload_image_button',
95
- "std" => ''),
96
-
97
- array(
98
- "name" => "Developer Website URL",
99
- "desc" => "There will be a link to your website in the footer. Leave it blank if you don't want the link otherwise please include http://",
100
- "id" => $wlcmsShortName."_developer_url",
101
- "type" => "text",
102
- "std" => ''),
103
-
104
- array(
105
- "name" => "Developer Website Name",
106
- "desc" => "The developer's name will appear in the footer",
107
- "id" => $wlcmsShortName."_developer_name",
108
- "type" => "text",
109
- "std" => ''),
110
-
111
- array(
112
- "name" => "Hide WP Version",
113
- "desc" => "This will hide WordPress Version in right corner of the footer and on the Right Now dashboard panel",
114
- "id" => $wlcmsShortName."_hide_wpversion",
115
- "type" => "radio",
116
- "options" => array("1", "0"),
117
- "std" => 0),
118
-
119
- array( "name" => "Login", "type" => "subtitle"),
120
-
121
- array(
122
- "name" => "Make background colour white",
123
- "desc" => "This will make the login screen have a white background. Useful if your logo isn't transparent.",
124
- "id" => $wlcmsShortName."_loginbg_white",
125
- "type" => "radio",
126
- "options" => array("1", "0"),
127
- "std" => 0),
128
-
129
- array(
130
- "name" => "Custom Login Logo",
131
- "desc" => "This logo will appear on the login page. It should be about 300px by 80px.",
132
- "id" => $wlcmsShortName."_login_custom_logo",
133
- "type" => "file",
134
- "class" => 'upload_image_button',
135
- "std" => ''),
136
-
137
- array(
138
- "name" => "Custom Login CSS",
139
- "desc" => "For example:<br /> .login form { background-color: #0013FF } <br />.login #login p#nav a { color: #333 !important }<br /><br /> Or if you want to get fancy:<br /> #wlcms-login-wrapper{ background: url('wp-content/plugins/white-label-cms/images/footergrass.jpg') repeat-x fixed center bottom transparent; display: block; height: 100%; left: 0; overflow: auto; position: absolute; top: 0; width: 100%;} ",
140
- "id" => $wlcmsShortName."_login_bg_css",
141
- "type" => "textarea",
142
- "std" => ''),
143
-
144
- array( "name" => "Admin Page Title","type" => "subtitle"),
145
-
146
- array(
147
- "name" => "Custom Page Titles",
148
- "desc" => "This replaces the - WordPress in the admin page titles. If this is set to nothing WordPress will continue to appear in the page titles",
149
- "id" => $wlcmsShortName."_admin_page_title",
150
- "type" => "text",
151
- "std" => ''),
152
-
153
- array( "type" => "close"),
154
- array( "name" => "Dashboard Panels", "type" => "section"),
155
- array( "type" => "open"),
156
-
157
- array(
158
- "name" => "Hide 'At a Glance'",
159
- "desc" => "Hides the at a glance panel",
160
- "id" => $wlcmsShortName."_dashboard_remove_right_now",
161
- "type" => "radio",
162
- "options" => array("1", "0"),
163
- "std" => 0),
164
-
165
- array(
166
- "name" => "Hide 'Activity'",
167
- "desc" => "Hides the activity panel",
168
- "id" => $wlcmsShortName."_dashboard_remove_activity_panel",
169
- "type" => "radio",
170
- "options" => array("1", "0"),
171
- "std" => 0),
172
-
173
- array(
174
- "name" => "Hide 'Recent Comments'",
175
- "desc" => "Hides the comments panel",
176
- "id" => $wlcmsShortName."_dashboard_remove_recent_comments",
177
- "type" => "radio",
178
- "options" => array("1", "0"),
179
- "std" => 1),
180
-
181
- array(
182
- "name" => "Hide Other Dashboard Panels",
183
- "desc" => "These are all the other default dashboard panels",
184
- "id" => $wlcmsShortName."_dashboard_others",
185
- "type" => "radio",
186
- "options" => array("1", "0"),
187
- "std" => 1),
188
-
189
- array(
190
- "name" => "Show Dashboard To Admin",
191
- "desc" => "All panels will appear for the admin",
192
- "id" => $wlcmsShortName."_dashboard_admin",
193
- "type" => "radio",
194
- "options" => array("1", "0"),
195
- "std" => 1),
196
-
197
- array(
198
- "name" => "Remove Empty Dashed Panel",
199
- "desc" => "If you only have 1 dashboard panel then a empty panel will appear with a dashed border. Selecting yes will remove the border.",
200
- "id" => $wlcmsShortName."_dashboard_border",
201
- "type" => "radio",
202
- "options" => array("1", "0"),
203
- "std" => 1),
204
-
205
- array(
206
- "name" => "Add your own Welcome Panel?",
207
- "desc" => "This will appear on the dashboard. We recommend providing your contact details and links to the help files you have made for your client.",
208
- "id" => $wlcmsShortName."_show_welcome",
209
- "type" => "radio",
210
- "options" => array("1", "0"),
211
- "std" => "0" ),
212
-
213
- array( "name" => "Welcome Panel Settings", "type" => "subsectionvars"),
214
-
215
- array(
216
- "name" => "Visible To",
217
- "desc" => "This means the welcome panel will appear for users with roles higher or equal to the one chosen.",
218
- "id" => $wlcmsShortName."_welcome_visible_to",
219
- "type" => "select",
220
- "options"=>wlcms_roles_dropdown(),
221
- "std" => 'editor'),
222
-
223
- array(
224
- "name" => "Title",
225
- "desc" => "The title of your dashboard panel.",
226
- "id" => $wlcmsShortName."_welcome_title",
227
- "type" => "text",
228
- "std" => 'Welcome To Your New Website'),
229
-
230
- array(
231
- "name" => "Description",
232
- "desc" => "Please add the text in html format here.",
233
- "id" => $wlcmsShortName."_welcome_text",
234
- "type" => "textarea",
235
- "std" => ''),
236
-
237
- array( "name" => "Second Panel Settings","type" => "subtitle"),
238
-
239
- array( "name" => "Visible To",
240
- "desc" => "This means the welcome panel will appear for users with roles lesser or equal to the one chosen.",
241
- "id" => $wlcmsShortName."_welcome_visible_to1",
242
- "type" => "select",
243
- "options"=>wlcms_roles_dropdown(),
244
- "std" => ''),
245
-
246
- array( "name" => "Title",
247
- "desc" => "The title of your dashboard panel.",
248
- "id" => $wlcmsShortName."_welcome_title1",
249
- "type" => "text",
250
- "std" => ''),
251
-
252
- array( "name" => "Description",
253
- "desc" => "Please add the text in html format here.",
254
- "id" => $wlcmsShortName."_welcome_text1",
255
- "type" => "textarea",
256
- "std" => ''),
257
-
258
- array( "type" => "closeonce"),
259
-
260
- array(
261
- "name" => "Add an RSS Dashboard panel?",
262
- "desc" => "This will appear on the dashboard. If you want your client to be kept up to date with what your are doing in the your business, set up your RSS feed.",
263
- "id" => $wlcmsShortName."_show_rss_widget",
264
- "type" => "radio",
265
- "options" => array("1", "0"),
266
- "std" => "0" ),
267
-
268
- array( "name" => "RSS Settings", "type" => "subsectionvars"),
269
-
270
- array(
271
- "name" => "RSS Title",
272
- "desc" => "The title of your RSS dashboard panel.",
273
- "id" => $wlcmsShortName."_rss_title",
274
- "type" => "text",
275
- "std" => ''),
276
- array(
277
- "name" => "Add Your Logo (16px x 16px)",
278
- "desc" => "Adds a 16px logo before the title",
279
- "id" => $wlcmsShortName."_rss_logo",
280
- "class" => 'upload_image_button',
281
- "type" => "file",
282
- "std" => ''),
283
- array(
284
- "name" => "RSS Feed",
285
- "desc" => "The RSS feed address. For example feed://www.vitaminseo.com.au/feed/",
286
- "id" => $wlcmsShortName."_rss_value",
287
- "type" => "text",
288
- "std" => ''),
289
- array(
290
- "name" => "Number Items",
291
- "desc" => "Number of RSS items to show",
292
- "id" => $wlcmsShortName."_rss_num_items",
293
- "type" => "selectbox",
294
- "options"=> array(1=>1,2=>2,3=>3,4=>4,5=>5,6=>6,7=>7,8=>8,9=>9,10=>10),
295
- "std" => 2),
296
- array(
297
- "name" => "Show Post Contents",
298
- "desc" => "Show the content of the RSS item. This will display what is in your RSS feed, if this is not what you want, please modify your RSS feed.",
299
- "id" => $wlcmsShortName."_rss_show_intro",
300
- "type" => "selectbox",
301
- "options"=> array('yes'=>'Yes','no'=>'No'),
302
- "std" => 'yes'),
303
- array(
304
- "name" => "RSS Intro",
305
- "desc" => "If you would like to have some text above the RSS items explaining it. Please add the text in html format here.",
306
- "id" => $wlcmsShortName."_rss_intro_html",
307
- "type" => "textarea",
308
- "std" => ''),
309
-
310
-
311
- array( "type" => "closeonce"),
312
-
313
- array( "type" => "close"),
314
-
315
- array( "name" => "Admin Settings", "type" => "section"),
316
- array( "type" => "open"),
317
-
318
- array( "name" => "Enable Login URL Redirect",
319
- "desc" => "Clients can go to /login as well as /wp-login.php only when permalinks are enabled",
320
- "id" => $wlcmsShortName."_enable_login_redirect",
321
- "type" => "radio",
322
- "options" => array("1", "0"),
323
- "std" => 1),
324
-
325
- array( "name" => "Hide Nag Update",
326
- "desc" => "This will hide the Nag Update for out of date versions of WordPress",
327
- "id" => $wlcmsShortName."_dashboard_remove_nag_update",
328
- "type" => "radio",
329
- "options" => array("1", "0"),
330
- "std" => 1),
331
-
332
- array( "name" => "Hide Help Box",
333
- "desc" => "This will hide the Help Box dropdown",
334
- "id" => $wlcmsShortName."_dashboard_remove_help_box",
335
- "type" => "radio",
336
- "options" => array("1", "0"),
337
- "std" => 0),
338
-
339
- array( "name" => "Hide Screen Options",
340
- "desc" => "This will hide the Screen Options dropdown",
341
- "id" => $wlcmsShortName."_dashboard_remove_screen_options",
342
- "type" => "radio",
343
- "options" => array("1", "0"),
344
- "std" => 0),
345
-
346
- array( "name" => "Hide Meta Boxes","type" => "subtitle"),
347
-
348
- array("id"=>'',"type"=>"divopen",'class'=>"wlcms_input"),
349
-
350
- array( "heading" => "Hide Post Meta Boxes",
351
- "desc" => "Choose meta boxes that you want to remove from the Edit Post panel",
352
- "type"=>"headings"),
353
-
354
- array(
355
- "id" => $wlcmsShortName."_hide_post_div",
356
- "type" => "divopen",
357
- 'class'=>$wlcmsShortName."_hide_post_divclass"),
358
- array(
359
- "id" => $wlcmsShortName."_post_meta_box_excerpt",
360
- "type" => "checkbox",
361
- "label"=>"Excerpt",
362
- "std" => 0),
363
- array(
364
- "id" => $wlcmsShortName."_post_meta_box_slug",
365
- "type" => "checkbox",
366
- "label"=>"Slug",
367
- "std" => 0),
368
- array(
369
-
370
- "id" => $wlcmsShortName."_post_meta_box_tags",
371
- "type" => "checkbox",
372
- "label"=>"Tags",
373
- "std" => 0),
374
-
375
- array(
376
- "id" => $wlcmsShortName."_post_meta_box_author",
377
- "type" => "checkbox",
378
- "label"=>"Author",
379
- "std" => 0),
380
- array(
381
-
382
- "id" => $wlcmsShortName."_post_meta_box_comments",
383
- "type" => "checkbox",
384
- "label"=>"Comments",
385
- "std" => 0),
386
- array( "type" => "divclose"),
387
-
388
- array(
389
- "id" => $wlcmsShortName."_hide_post_divnew",
390
- "type" => "divopen",
391
- 'class'=>$wlcmsShortName."_hide_post_divclassnew"),
392
-
393
- array(
394
-
395
- "id" => $wlcmsShortName."_post_meta_box_revisions",
396
- "type" => "checkbox",
397
- "label"=>"Revisions",
398
- "std" => 0),
399
- array(
400
-
401
- "id" => $wlcmsShortName."_post_meta_box_discussions",
402
- "type" => "checkbox",
403
- "label"=>"Discussion",
404
- "std" => 0),
405
- array(
406
-
407
- "id" => $wlcmsShortName."_post_meta_box_categories",
408
- "type" => "checkbox",
409
- "label"=>"Categories",
410
- "std" => 0),
411
-
412
- array(
413
- "id" => $wlcmsShortName."_post_meta_box_custom",
414
- "type" => "checkbox",
415
- "label"=>"Custom Fields",
416
- "std" => 0),
417
-
418
- array(
419
- "id" => $wlcmsShortName."_post_meta_box_send",
420
- "type" => "checkbox",
421
- "label"=>"Send Trackbacks",
422
- "std" => 0),
423
-
424
-
425
-
426
- array("type" => "divclose"),
427
- array("type" => "divclose"),
428
- array('type'=>'clear'),
429
- array('type'=>'space'),
430
-
431
- array(
432
-
433
- "id" => '',
434
- "type" => "divopen",
435
- 'class'=>"wlcms_input"),
436
-
437
- /**/
438
- array( "heading" => "Hide Page Meta Boxes",
439
- "desc" => "Choose meta boxes that you want to remove from the Edit Page panel",
440
- "type"=>"headings"),
441
- array(
442
-
443
- "id" => $wlcmsShortName."_hide_page_divmain",
444
- "type" => "divopen",
445
- 'class'=>$wlcmsShortName."_hide_page_divclassmain"),
446
-
447
- array(
448
-
449
- "id" => $wlcmsShortName."_hide_page_div",
450
- "type" => "divopen",
451
- 'class'=>$wlcmsShortName."_hide_page_divclass"),
452
- array(
453
-
454
- "id" => $wlcmsShortName."_page_meta_box_custom",
455
- "type" => "checkbox",
456
- "label"=>"Custom Fields",
457
- "std" => 0),
458
- array(
459
-
460
- "id" => $wlcmsShortName."_page_meta_box_author",
461
- "type" => "checkbox",
462
- "label"=>"Author",
463
- "std" => 0),
464
-
465
- array(
466
-
467
- "id" => $wlcmsShortName."_page_meta_box_discussions",
468
- "type" => "checkbox",
469
- "label"=>"Discussion",
470
- "std" => 0),
471
- array(
472
-
473
- "id" => $wlcmsShortName."_page_meta_box_revisions",
474
- "type" => "checkbox",
475
- "label"=>"Revisions",
476
- "std" => 0),
477
- array(
478
-
479
-
480
- "type" => "divclose"
481
- ),
482
- array(
483
-
484
- "id" => $wlcmsShortName."_hide_page_divnew",
485
- "type" => "divopen",
486
- 'class'=>$wlcmsShortName."_hide_page_divclassnew"),
487
-
488
- array(
489
-
490
- "id" => $wlcmsShortName."_page_meta_box_page",
491
- "type" => "checkbox",
492
- "label"=>"Page Attributes",
493
- "std" => 0),
494
- array(
495
-
496
- "id" => $wlcmsShortName."_page_meta_box_slug",
497
- "type" => "checkbox",
498
- "label"=>"Slug",
499
- "std" => 0),
500
- array("type" => "divclose"),
501
- array("type" => "divclose"),
502
- array("type" => "divclose"),
503
-
504
- array( "name" => "Custom CSS for Admin",
505
- "desc" => "Override or add to any of the styles in the WordPress admin enter your own custom css here",
506
- "id" => $wlcmsShortName."_custom_css",
507
- "type" => "textarea",
508
- "std" => ''),
509
- array( "name" => "Custom Editor Stylesheet",
510
- "desc" => "Create and upload a custom stylesheet with all style rules prefixed with .mceContentBody to your themes directory and enter the filename",
511
- "id" => $wlcmsShortName."_welcome_stylesheet",
512
- "type" => "textcustom",
513
- "std" => ''),
514
- array( "type" => "close"),
515
-
516
- //*///////////////////////////////////
517
-
518
- array( "name" => "Modify Menus",
519
- "type" => "section"),
520
- array( "type" => "open"),
521
-
522
- array( "name" => "These changes will only effect people with the user role of <strong>Editor</strong>. You are currently logged in as the admin, so you will not see any changes in the menus until you login with a different user role.",
523
- "type" => "message"),
524
-
525
- array("name" => "Choose A CMS Profile","desc" => "Which profile best fits your clients needs?","id" => $wlcmsShortName."_cms_profile","type" => "radioprofile","options" => array("1", "2","3"), "std" => '1'),
526
- //array("name" => "Menus", "type" => "menus"),
527
- array(
528
-
529
- "id" => $wlcmsShortName."_modify_menus",
530
- "type" => "divopen",
531
- 'class'=>$wlcmsShortName."_modify_menu"),
532
- array(
533
- "id" => $wlcmsShortName."_modify_menu_post",
534
- "type" => "divopen",
535
- 'class'=>$wlcmsShortName."_modify_menu"),
536
- /***/
537
- array( "name" => "Hide Posts Menu",
538
- "desc" => "Hides Posts &amp; Comments sections",
539
- "id" => $wlcmsShortName."_hide_posts",
540
- "type" => "checkbox",
541
- "class"=>$wlcmsShortName."_child_label",
542
- "std" => 0),
543
-
544
- array( "name" => "Hide Media Menu",
545
- "desc" => "Hides Media from left menu",
546
- "id" => $wlcmsShortName."_hide_media",
547
- "type" => "checkbox",
548
- "class"=>$wlcmsShortName."_child_label",
549
- "std" => 0),
550
-
551
- array( "name" => "Hide Links Menu",
552
- "desc" => "Hides Links from left menu",
553
- "id" => $wlcmsShortName."_hide_links",
554
- "type" => "checkbox",
555
- "class"=>$wlcmsShortName."_child_label",
556
- "std" => 0),
557
-
558
-
559
- array( "name" => "Hide Pages Menu",
560
- "desc" => "Hides Pages from left menu",
561
- "id" => $wlcmsShortName."_hide_pages",
562
- "type" => "checkbox",
563
- "class"=>$wlcmsShortName."_child_label",
564
- "std" => 0),
565
-
566
- array( "name" => "Hide Comments Menu",
567
- "desc" => "Hides Comments from left menu",
568
- "id" => $wlcmsShortName."_hide_comments",
569
- "type" => "checkbox",
570
- "class" => $wlcmsShortName."_child_label",
571
- "std" => 0),
572
-
573
- array( "name" => "Hide Profile",
574
- "desc" => "Hides Profile menu item from left menu",
575
- "id" => $wlcmsShortName."_hide_profile",
576
- "type" => "checkbox",
577
- "class" => $wlcmsShortName."_child_label",
578
- "std" => 0),
579
-
580
- array( "name" => "Hide Tools",
581
- "desc" => "Hides Tools from left menu",
582
- "id" => $wlcmsShortName."_hide_tools",
583
- "type" => "checkboxlast",
584
- "class" => $wlcmsShortName."_child_label",
585
- "std" => 0),
586
-
587
-
588
-
589
-
590
- array(
591
-
592
- "type" => "divclose"
593
- ),
594
-
595
-
596
- array(
597
-
598
- "type" => "divclose"
599
- ) ,
600
-
601
- );
602
-
603
-
604
- $wlcms_show_appearance_legacy = '0';
605
- $wlcms_show_menus_legacy = '1';
606
- $wlcms_show_widgets_legacy = '1';
607
-
608
- $wlcmsOptions3[] = array( "name" => "The following change will display the Widgets or Menus or Background or Header option in Appearance to users with the role of <strong>Editor</strong>. Please refer to the help tab to understand the consequences of enabling this option. <br /><br />",
609
- "type" => "message2") ;
610
-
611
- $wlcmsOptions3[] = array( "name" => "Access To Appearance Menu",
612
- "desc" => "This will give the editor access to the appearance section. You can customise what they have access to.",
613
- "id" => $wlcmsShortName."_editor_template_access",
614
- "type" => "radio",
615
- "options" => array("1", "0"),
616
- "std" => '0' );
617
-
618
- $wlcmsOptions3[] = array( "name" => "The Appearance Menu", "type" => "subsectionvars");
619
-
620
- foreach($submenu['themes.php'] as $optId=> $optArray) // Build Dynamically the sub options for Appearance tab
621
- {
622
- if ( $optArray[2] != 'theme-editor.php' ) { // Never want to allow Theme Editor Access
623
-
624
- $std='1';
625
-
626
- if($optArray[2] == 'widgets.php') { $std = $wlcms_show_widgets_legacy; }
627
- if($optArray[2] == 'nav-menus.php') { $std = $wlcms_show_menus_legacy; }
628
-
629
- $wlcmsOptions3[] = array( "name" => "Hide {$optArray[0]}",
630
- "desc" => "Removes the {$optArray[0]} option under the Appearance tab.",
631
- "id" => $wlcmsShortName."_subtemplate_hide_".$optId,
632
- "type" => "checkboxlast",
633
- "std" => $std);
634
- }
635
- }
636
-
637
-
638
- $wlcmsOptions3[] = array( "type" => "divclose" );
639
- $wlcmsOptions3[] = array( "type" => "close" );
640
-
641
-
642
-
643
- // To improve the config builder.
644
- // $wlcmsOptions3 = array_merge($wlcmsOptions3);
645
- $wlcmsOptions = array_merge( $wlcmsOptions, $wlcmsOptions2, $wlcmsOptions3 );
646
-
647
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin.view.php DELETED
@@ -1,647 +0,0 @@
1
- <div class="wrap wlcms_wrap" style="width:auto;">
2
- <h2>White Label CMS Settings</h2>
3
-
4
- <div class="wlcms_opts" style="position:relative;">
5
- <div id="wlcms-sidebar" style="position: absolute; top: 0; right: 0; z-index: 2; background-color:#FFFFFF; width: 250px; border: 1px solid #ccc; padding: 20px;">
6
- <img src="<?php echo plugins_url('images/WPElevatoon-WP-Skyscraper-Image-232x337.jpg', dirname(__FILE__)); ?>" alt="Better Clients" title="Better Clients" />
7
- <form method="post" accept-charset="UTF-8" onsubmit="return quickValidate()" action="https://sk199.infusionsoft.com/app/form/process/6903821baa449ff51394d0f57cfd2cdb" target="_blank" name="Better WP ClickFunnels">
8
- <div style="display: none;">
9
- <input name="inf_form_xid" type="hidden" value="6903821baa449ff51394d0f57cfd2cdb" />
10
- <input name="inf_form_name" type="hidden" value="White Label CMS Form" />
11
- <input name="infusionsoft_version" type="hidden" value="1.56.0.55" />
12
- <input name="inf_field_LeadSoruceId" type="hidden" value="148" />
13
- </div>
14
- <table style="text-align:left;margin-left: 20px;">
15
- <tr>
16
- <td><strong>Name: </strong><input id="sub_name" name="inf_field_FirstName" type="text" name="name" class="text" tabindex="500" value="" style="width: 170px;"/></td>
17
- </tr>
18
- <tr>
19
- <td><strong>Email: </strong>&nbsp;<input class="text" id="sub_email" type="text" name="inf_field_Email" tabindex="501" value="" style="width: 170px;" /></td>
20
- </tr>
21
- <tr>
22
- <td style="text-align:center"><span class="submit"><input name="submit" type="image" alt="submit" tabindex="502" src="<?php echo plugins_url('images/WPElevation-WP-Skyscaper-Button-157x40.gif', dirname(__FILE__)); ?>" width="157" height="40" style="background: none; border: 0;" /></span></td>
23
- </tr>
24
- <tr>
25
- <td style="padding-top: 20px;text-align:center;">
26
- <a title="Privacy Policy" href="http://www.wpelevation.com/privacy-policy/" target="_blank"><img src="<?php echo plugins_url('images/privacy.png', dirname(__FILE__)); ?>" alt="" title="" /></a>
27
- </td>
28
- </tr>
29
- </table>
30
- </form>
31
- </div>
32
- <div id="wlcms-container" style="margin-right: 320px;">
33
-
34
- <form method="post" enctype="multipart/form-data" <?php echo admin_url( 'options-general.php?page=wlcms-plugin.php' );?> >
35
- <?php wp_nonce_field( 'wlcms-update_settings' ); ?>
36
- <input type="hidden" name="wlcms_" value="<?php echo WLCMS; ?>" />
37
- <?php foreach ($wlcmsOptions as $value) {
38
- switch ( $value['type'] ) {
39
-
40
- case "open":
41
- ?>
42
-
43
- <?php break;
44
-
45
- case "closeonce":
46
- ?>
47
-
48
- </div>
49
-
50
- <?php break;
51
-
52
- case "close":
53
- ?>
54
-
55
- </div>
56
- </div>
57
- <br />
58
-
59
-
60
- <?php break;
61
-
62
- case "menus":
63
-
64
- global $menu, $submenu;
65
-
66
- //echo '<pre>';print_r($menu); print_r($submenu);
67
-
68
-
69
- echo '<ul id="menus">';
70
-
71
- foreach($menu as $m_key => $menu_item):
72
-
73
- if(!$menu_item[0]) { continue; }
74
-
75
- echo '<li><strong><input type="checkbox" value="1" name="wlcms_o_hide_menu_'.$m_key.'" '.( get_option( 'wlcms_o_hide_menu_'.$m_key ) ? 'checked="checked" ' : '' ).' /> <span>'.$menu_item[0] . ' <em></em></span> </strong>';
76
-
77
- if( isset( $submenu[ $menu_item[2] ] ) ):
78
-
79
- echo '<ul >';
80
-
81
- foreach($submenu[ $menu_item[2] ] as $sm_key => $submenu_item):
82
-
83
- echo '<li><input type="checkbox" value="1" name="wlcms_o_hide_submenu_'.$m_key .'_'.$sm_key.'" '. ( get_option( 'wlcms_o_hide_submenu_'.$m_key .'_'.$sm_key ) ? 'checked="checked" ' : '') .'/> '.$submenu_item[0].'</li>';
84
-
85
- endforeach;
86
-
87
- echo '</ul>';
88
-
89
- endif;
90
-
91
-
92
- echo '</li>';
93
-
94
-
95
- endforeach;
96
-
97
- echo '</ul>';
98
-
99
- break;
100
-
101
- case "title":
102
- ?>
103
- <p><strong>For a detailed explanation of the plugin please refer to the official <a href="http://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=helplink" target="_blank">help page</a>.</strong></p>
104
-
105
- <p><em>Please Note:</em> For any images, if you just put the file name, the image will come from the images directory of your theme/child theme. Use the full url if the image comes from another site. If you upload a image, make sure you click "Use This Image"</p>
106
-
107
- <?php break;
108
-
109
- case 'text':
110
- ?>
111
- <?php if ($value['id']=='wlcms_o_header_custom_logo' || $value['id']=='wlcms_o_footer_custom_logo' ) { ?>
112
-
113
- <div style="border:0;" class="wlcms_input wlcms_text">
114
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
115
- <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?>" class="<?php echo $value['class']; ?>" title="<?php echo $value['title']; ?>"/><?php echo $value['unit']?>
116
- <small><?php echo $value['desc']; ?></small>
117
- <div class="clearfix"></div>
118
-
119
- </div>
120
-
121
- <?php } else { ?>
122
- <div class="wlcms_input wlcms_text">
123
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
124
-
125
- <input
126
- name="<?php echo $value['id']; ?>"
127
- id="<?php echo $value['id']; ?>"
128
- type="<?php echo $value['type']; ?>"
129
- value="<?php if ( get_option( $value['id'] ) != "")
130
- { echo stripslashes(get_option( $value['id']) ); }
131
- else
132
- { echo $value['std']; } ?>"
133
- class="<?php echo (isset($value['class']) ? $value['class'] : '' ); ?>"
134
- title="<?php echo (isset($value['title']) ? $value['title'] : '' ); ?>" />
135
- <?php echo (isset($value['unit']) ? $value['unit'] : '' );?>
136
-
137
- <small><?php echo $value['desc']; ?></small>
138
- <div class="clearfix"></div>
139
-
140
- </div>
141
-
142
- <?php } ?>
143
- <?php break;
144
- ////////////////////////////////////////////////////////////////////////////////************************************************************************//
145
- case 'textcustom':
146
- ?>
147
-
148
- <div class="wlcms_input wlcms_text">
149
-
150
- <label for="<?php echo $value['id']; ?>" title="CSS filename relative from <?php echo get_stylesheet_directory_uri();?>/" ><?php echo $value['name']; ?> </label>
151
-
152
- <input
153
- name="<?php echo $value['id']; ?>"
154
- id="<?php echo $value['id']; ?>"
155
- type="<?php echo $value['type']; ?>"
156
- value="<?php if ( get_option( $value['id'] ) != "")
157
- { echo stripslashes(get_option( $value['id']) ); }
158
- else
159
- { echo $value['std']; } ?>"
160
-
161
- class="<?php echo (isset($value['class']) ? $value['class'] : '' ); ?>"
162
- title="<?php echo (isset($value['title']) ? $value['title'] : '' ); ?>"/>
163
-
164
- <?php echo (isset($value['unit']) ? $value['unit'] : '' );?>
165
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
166
-
167
- </div>
168
-
169
- <?php break;
170
- //********************************************************************/////////////////////////////////////////////////////////////////////////////////////
171
-
172
- case "file":
173
- ?>
174
-
175
- <div class="wlcms_input wlcms_file">
176
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
177
- <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="text" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?>"/>
178
- <input name="upload_image_button" type="button" value="Upload" rel="<?php echo $value['id']; ?>" class="<?php echo $value['class']; ?>"/>
179
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
180
-
181
- </div>
182
- <?php
183
- break;
184
-
185
- case "import_file":
186
- ?>
187
- <div class="wlcms_input import_file">
188
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
189
- <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="file" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?>"/>
190
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
191
-
192
- </div>
193
- <?php
194
- break;
195
-
196
- /******************************************************************/
197
- case "button":
198
- ?>
199
-
200
- <div class="wlcms_input wlcms_file">
201
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
202
-
203
- <input name="export_button" type="submit" value="Export" class="<?php echo $value['class']; ?>"/>
204
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
205
- </div>
206
- <?php
207
- break;
208
-
209
- /*******************************************************************/
210
- case 'textlocalvideo':
211
- ?>
212
-
213
- <div class="wlcms_input_local_video wlcms_text">
214
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
215
- <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="text" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?>" />
216
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
217
-
218
- </div>
219
- <?php break;
220
- case 'message':
221
- ?>
222
- <div class="wlcms_input_message wlcms_text">
223
- <div id="icon-users" class="wlcms-icon32"><br></div><?php echo $value['name']; ?>
224
- </div>
225
- <?php
226
- break;
227
-
228
- case 'message2':
229
- ?>
230
- <div class="wlcms_input_message wlcms_text">
231
- <div id="icon-themes" class="wlcms-icon32"><br></div><?php echo $value['name']; ?>
232
- </div>
233
- <?php
234
- break;
235
- /*************************************/
236
- case 'message3':
237
- ?>
238
- <div class="wlcms_input_message1 wlcms_text">
239
- <?php echo $value['name']; ?>
240
- </div>
241
- <?php
242
- break;
243
- /*************************************/
244
-
245
- case 'textarea':
246
- ?>
247
-
248
- <div class="wlcms_input_welcome_last wlcms_textarea">
249
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
250
- <textarea name="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" cols="" rows=""><?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?></textarea>
251
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
252
- </div>
253
-
254
- <?php
255
- break;
256
- case 'selectbox':
257
- ?>
258
-
259
- <div class="wlcms_input wlcms_select">
260
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
261
-
262
- <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
263
- <?php foreach ($value['options'] as $role => $option) { ?>
264
- <option value="<?php echo $role;?>"<?php if (get_option( $value['id'] ) == $role) { echo 'selected="selected"'; } elseif ($role==$value['std']) {echo 'selected="selected"';} ?>><?php echo $option; ?></option><?php } ?>
265
- </select>
266
-
267
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
268
- </div>
269
- <?php
270
- break;
271
- case 'select':
272
- ?>
273
-
274
- <div class="wlcms_input wlcms_select">
275
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
276
-
277
- <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
278
- <option value="0">choose a role</option>
279
- <?php foreach ($value['options'] as $role => $option) { ?>
280
- <option value="<?php echo $role;?>"<?php if (get_option( $value['id'] ) == $role) { echo 'selected="selected"'; } elseif ($role==$value['std']) {echo 'selected="selected"';} ?>><?php echo $option; ?></option><?php } ?>
281
- </select>
282
-
283
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
284
- </div>
285
- <?php
286
- break;
287
- //////////////////////////////////////////////////
288
- case 'selectnew':
289
- ?>
290
- <div class="wlcms_optsnew">
291
- <div class="wlcms_input wlcms_select">
292
- <label for="<?php echo $value['idname']; ?>"><?php echo $value['name']; ?></label>
293
- <span class="lineup"><input name="<?php echo $value['idname']; ?>" id="<?php echo $value['idname']; ?>" type="text" value="<?php if ( get_option( $value['idname'] ) != "") { echo stripslashes(get_option( $value['idname']) ); } else { echo $value['std']; } ?>" /> <br />
294
- <?php echo $value['label']; ?><br />
295
- <select name="<?php echo $value['idlabel']; ?>" id="<?php echo $value['idlabel']; ?>">
296
- <?php foreach ($value['options'] as $role => $option) { ?>
297
- <option value="<?php echo $role;?>"<?php if (get_option( $value['idlabel'] ) == $role) { echo 'selected="selected"'; } ?>><?php echo $option; ?></option><?php } ?>
298
- </select>
299
- <br />
300
- <input name="add_button" type="submit" value="add" class="<?php echo $value['class']; ?>"/></span> <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
301
- </div>
302
- </div>
303
- <?php
304
- break;
305
- case 'selectnewnew':
306
- ?>
307
- <div class="wlcms_optsnew">
308
- <div class="wlcms_input wlcms_select">
309
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
310
-
311
-
312
- <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
313
- <?php
314
- foreach ($value['options'] as $role => $option) {
315
- ?>
316
- <option value="<?php echo $role;?>"<?php if (get_option( $value['id'] ) == $role) { echo 'selected="selected"'; } ?>><?php echo $option; ?></option>
317
- <?php
318
- }
319
- ?>
320
- </select>
321
-
322
- <input name="delete_button" OnClick="javascript:return confirm('<?php _e('WARNING! Deleting a role can have severe consequences, proceed only if you know what you are doing.','wlcms')?>');" type="submit" value="delete" class="<?php echo $value['class']; ?>"/> <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
323
- </div>
324
- </div>
325
- <?php
326
- break;
327
-
328
- case "headings":
329
- ?>
330
- <label id="<?php echo (isset($value['id']) ? $value['id'] : '' ); ?>"><?php echo $value['heading']; ?> </label>
331
- <small><?php echo (isset($value['desc']) ? $value['desc'] : '' ); ?></small><div class="clearfix"></div>
332
- <?php
333
- break;
334
- ///////////////////////////////////////////////////
335
- case "checkboxlast":
336
- case "checkbox":
337
- ?>
338
-
339
- <div class="<?php if($value['type'] == 'checkbox') { echo 'wlcms_input_local_video'; } else { echo 'wlcms_checkbox_last'; }?> wlcms_checkbox">
340
-
341
- <label id="<?php echo $value['id']; ?>" class="<?php echo (!empty($value['class'])?$value['class']:'');?>"><?php echo (isset($value['name']) ? $value['name'] : ''); ?></label>
342
-
343
- <?php
344
- if(get_option($value['id']))
345
- {
346
- $checked = "checked=\"checked\""; $remChecked = 'wlcms_remChecked';
347
- }
348
- elseif ( ( ! get_option( 'wlcms_o_ver' ) ) && ($value['std'] == '1') )
349
- {
350
- $checked = "checked=\"checked\"";
351
- $remChecked = 'wlcms_remChecked';
352
- }
353
- else
354
- {
355
- $checked = '';
356
- $remChecked = '';
357
- }
358
- ?>
359
- <input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> class="<?php echo $remChecked; ?>" />
360
- <?php echo (isset($value['label']) ? $value['label'] : '' ); ?>
361
-
362
-
363
- <small><?php echo ( isset($value['desc'] ) ? $value['desc'] : '' ); ?></small><div class="clearfix"></div>
364
- </div>
365
- <?php
366
- break;
367
-
368
- case "divopen":
369
- ?>
370
- <div id="<?php echo $value['id']; ?>" class="<?php echo $value['class']; ?>">
371
- <?php
372
- break;
373
-
374
- case "divclose":
375
- ?>
376
- </div>
377
- <?php
378
- break;
379
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
380
- case "checkboxnewnew":
381
- ?>
382
-
383
- <div class="<?php if($value['type'] == 'checkbox') { echo 'wlcms_input_local_video'; } else { echo 'wlcms_checkbox_last'; }?> wlcms_checkbox">
384
-
385
-
386
-
387
- <?php if(get_option($value['id'])){ $checked = "checked=\"checked\""; $remChecked = 'wlcms_remChecked'; }else{ $checked = ""; $remChecked = '';} ?>
388
-
389
-
390
- <table>
391
- <?php
392
- echo $value['options'];
393
- ?></table>
394
-
395
- <small><?php echo (isset($value['desc']) ? $value['desc'] : '' ); ?></small><div class="clearfix"></div>
396
- </div>
397
- <?php
398
- break;
399
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
400
- case "checkboxlastv3":
401
- // only show if version 3 of WordPress or above
402
- global $wp_version;
403
- if (substr($wp_version,0,3) < 3) {
404
- echo '<div class="wlcms_checkbox_last wlcms_checkbox">';
405
- echo '<input type="hidden" name="' . $value['id'] . '" id="' . $value['id'] . '" value="" />';
406
- echo '<div class="clearfix"></div>';
407
- echo '</div>';
408
- } else {
409
-
410
- ?>
411
- <div class="<?php if($value['type'] == 'checkbox') { echo 'wlcms_input_local_video'; } else { echo 'wlcms_checkbox_last'; }?> wlcms_checkbox">
412
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
413
-
414
- <?php if(get_option($value['id'])){ $checked = "checked=\"checked\""; $remChecked = 'wlcms_remChecked'; }else{ $checked = ""; $remChecked = '';} ?>
415
- <input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> class="<?php echo $remChecked; ?>" />
416
-
417
- <?php echo (isset($value['label']) ? $value['label'] : '' ); ?>
418
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
419
- </div>
420
- <?php
421
- }
422
- break;
423
- case "radio":
424
- ?>
425
-
426
- <div class="wlcms_input wlcms_radio" <?php if($value['id'] == 'wlcms_o_show_welcome') { echo ' id="form-show-welcome" '; }?>
427
- <?php if($value['id'] == 'wlcms_o_editor_template_access') { echo ' id="form-show-template" '; }?>
428
- <?php if($value['id'] == 'wlcms_o_show_rss_widget') { echo ' id="form-show-rss" '; }?>
429
- >
430
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
431
-
432
- <?php
433
- $counter = 1;
434
- foreach ($value['options'] as $option) { ?>
435
- <?php $checked=''; if( ( get_option($value['id']) || get_option($value['id']) == '0' ) && (get_option($value['id']) == $option)){ $checked = "checked=\"checked\""; }elseif( (! get_option($value['id']) ) && $option == $value['std']){ $checked = "checked=\"checked\""; } else { $checked = ""; } ?>
436
- <label class="radioyesno"> <?php if ($counter == 1) { echo 'Yes '; } else { echo 'No '; } ?><input type="radio" name="<?php echo $value['id']; ?>" class="<?php echo $value['id']; ?>" value="<?php echo $option; ?>" <?php echo $checked; ?> /></label>
437
- <?php
438
- $counter++;
439
- }
440
- ?>
441
-
442
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
443
- </div>
444
- <?php break;
445
- /************************************************/
446
- case "radionew":
447
- ?>
448
-
449
- <div class="wlcms_radioinput wlcms_radio" <?php if($value['id'] == 'wlcms_o_show_welcome') { echo ' id="form-show-welcome" '; }?> >
450
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
451
-
452
- <?php
453
- $counter = 1;
454
- foreach ($value['options'] as $option) { ?>
455
- <?php if(get_option($value['id']) == $option){ $checked = "checked=\"checked\""; }else{ $checked = ""; } ?>
456
- <label class="radioyesno"><?php if ($counter == 1) { echo 'Yes '; } else { echo 'No '; } ?><input type="radio" name="<?php echo $value['id']; ?>" class="<?php echo $value['id']; ?>" value="<?php echo $option; ?>" <?php echo $checked; ?> /></label>
457
- <?php
458
- $counter++;
459
- }
460
- ?>
461
-
462
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
463
- </div>
464
- <?php break;
465
- /************************************************/
466
- case "radioprofile":
467
- ?>
468
-
469
- <div class="wlcms_input_profile" <?php if($value['id'] == 'wlcms_o_show_welcome') { echo ' id="form-show-welcome" '; }?> >
470
- <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
471
-
472
- <?php
473
- $counter = 1;
474
- foreach ($value['options'] as $option) { ?>
475
- <?php
476
- switch ($counter) {
477
- case 1:
478
- $profileName = 'Custom';
479
- if(get_option($value['id']) == 1){ $checked = "checked=\"checked\""; }else{ $checked = ""; }
480
- break;
481
- case 2:
482
- $profileName = 'Website';
483
- if(get_option($value['id']) == 2){ $checked = "checked=\"checked\""; }else{ $checked = ""; }
484
- break;
485
- case 3:
486
- $profileName = 'Blog';
487
- if(get_option($value['id']) == 3){ $checked = "checked=\"checked\""; }else{ $checked = ""; }
488
- break;
489
- }
490
- ?>
491
- <label class="radio<?php echo $profileName;?>"><?php echo $profileName;?><input type="radio" name="wlcms_o_radio_profiles" class="<?php echo $value['id']; ?>" value="<?php echo $counter; ?>" <?php echo $checked; ?> id="radio<?php echo $profileName; ?>" /></label>
492
- <?php
493
- $counter++;
494
- }
495
- ?>
496
- <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
497
- </div>
498
- <?php break;
499
-
500
- case "subtitle":
501
- ?>
502
- <div class="wlcms_section">
503
- <div class="wlcms_subtitle">
504
- <h3><?php echo $value['name']; ?></h3>
505
- <div class="clearfix"></div>
506
- </div>
507
- </div>
508
- <?php
509
- break;
510
- case "section":
511
-
512
- $i++;
513
- ?>
514
-
515
- <div class="wlcms_section">
516
- <div class="wlcms_title"><h3><img src="<?php echo plugins_url('images/trans.png', dirname(__FILE__)); ?>" class="inactive" alt=""><?php echo $value['name']; ?></h3><span class="submit"><input name="save<?php echo $i; ?>" type="submit" style="font-size:10px" value="Save changes" />
517
- </span><div class="clearfix"></div></div>
518
- <div class="wlcms_options" style="display: none;">
519
-
520
- <?php break;
521
- case "subsection":
522
- ?>
523
- <div id="v<?php echo str_replace(" ", "", $value['name']); ?>" class="video-h">
524
- <h4><?php echo $value['name']; ?> <span class="submit"><input type="submit" value="clear" onclick="clearvid('v<?php echo str_replace(" ", "", $value['name']); ?>');return false;" /></span></h4>
525
- <div class="clearfix"></div>
526
-
527
- <?php break;
528
- case "subsectionvars":
529
- ?>
530
- <div id="v<?php echo str_replace(" ", "", $value['name']); ?>" class="video-h">
531
- <h4><?php echo $value['name']; ?></h4>
532
- <div class="clearfix"></div>
533
-
534
- <?php break;
535
-
536
- }
537
- }
538
- ?>
539
-
540
- <input type="hidden" name="action" value="save" />
541
- </form>
542
- </div>
543
-
544
- <p style="margin-top:0px;" class="submit">
545
- <a href="" onclick="return false;" class="importbtn">Import your settings</a> |
546
- <a href="" onclick="return false;" class="exportbtn">Export your settings</a> |
547
- <a onclick="if(confirm('Are you sure you want to reset?')){return true;}return false;" href="?page=wlcms-plugin.php&amp;action=reset">Reset the plugin </a> </p>
548
-
549
- <form method="post" action="<?php echo admin_url( 'options-general.php?page=wlcms-plugin.php&amp;action=import' );?>" enctype="multipart/form-data" id="importform" style="display:none">
550
- Import File: <input type="file" name="wlcms_import" />
551
- <input type="submit" value="Import" />
552
- <?php echo wp_nonce_field( 'wlcms_import' ); ?>
553
- </form>
554
-
555
- <form method="get" action="<?php echo admin_url( 'options-general.php?page=wlcms-plugin.php' );?>" id="exportopts" style="display:none">
556
- <p>
557
- Do you want to include images that were added using the media upload button? (If you choose yes, the image path will point to this domain)
558
- </p>
559
-
560
- <p>
561
- <input type="radio" name="wlcms_export_imgs" value="yes" /> Yes
562
- <input type="radio" name="wlcms_export_imgs" value="no" checked="checked" /> No
563
- <input type="radio" name="wlcms_export_imgs" value="partial" /> Partial (the domain name will be updated and you will need to upload the images to the new domain)
564
- </p>
565
-
566
- <input type="hidden" name="page" value="wlcms-plugin.php" />
567
- <input type="hidden" name="action" value="export" />
568
-
569
- <input type="submit" value="Export" />
570
-
571
- </form>
572
- </div>
573
-
574
- <script type="text/javascript">
575
-
576
- function quickValidate()
577
- {
578
- if (! jQuery('#sub_name').val() )
579
- {
580
- alert('Your Name is required');
581
- return false;
582
- }
583
- if(! jQuery('#sub_email').val() )
584
- {
585
- alert('Your Email is required');
586
- return false;
587
- }
588
- return true;
589
- }
590
-
591
- jQuery('.importbtn').click(function(){
592
- jQuery('#importform').slideDown();
593
- });
594
-
595
- jQuery('.exportbtn').click(function(){
596
- jQuery('#exportopts').slideDown();
597
- });
598
-
599
- jQuery(document).ready(function($) {
600
- // Upload function goes here
601
-
602
- jQuery('.upload_image_button').click(function() {
603
- formField = jQuery(this).attr('rel');
604
- tb_show('', 'media-upload.php?type=image&wlcms=true&TB_iframe=true');
605
- return false;
606
- });
607
-
608
- window.send_to_editor = function(html) {
609
- var imgurl = '';
610
-
611
- // Parse out the image source
612
- var regex = /<img[^>]+src=['"](.*?)['"]/i;
613
- var matches = regex.exec( html );
614
- if ( matches.length >= 2 ) {
615
- imgurl = matches[ 1 ];
616
- }
617
-
618
- jQuery('#'+formField).val(imgurl);
619
- tb_remove();
620
-
621
- }
622
-
623
- var formfield=null;
624
- window.original_send_to_editor = window.send_to_editor;
625
- window.send_to_editor = function(html){
626
- if (formfield) {
627
- var fileurl = jQuery('img',html).attr('src');
628
- formfield.val(fileurl);
629
- tb_remove();
630
- } else {
631
- window.original_send_to_editor(html);
632
- }
633
- formfield=null;
634
- };
635
-
636
- jQuery('.lu_upload_button').click(function() {
637
- formfield = jQuery(this).parent().parent().find(".text_input");
638
- tb_show('', 'media-upload.php?type=image&wlcms=true&TB_iframe=true');
639
- jQuery('#TB_overlay,#TB_closeWindowButton').bind("click",function(){formfield=null;});
640
- return false;
641
- });
642
- jQuery(document).keyup(function(e) {
643
- if (e.keyCode == 27) formfield=null;
644
- });
645
-
646
- });
647
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/classes/Admin_Core.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WLCMS_Admin_Core
4
+ {
5
+
6
+ function __construct()
7
+ {
8
+ add_action('admin_menu', array($this, 'add_option_menu'));
9
+ }
10
+
11
+ /**
12
+ * Add WLCMS to setting menu
13
+ *
14
+ * @return void
15
+ */
16
+ public function add_option_menu()
17
+ {
18
+ $page = add_options_page(
19
+ __('White Label CMS', 'wlcms'), // Page title
20
+ __('White Label CMS', 'wlcms'), // Menu name
21
+ 'manage_options', // Permissions
22
+ 'wlcms-plugin.php', // Menu slug
23
+ array($this, 'view') // Function callback
24
+ );
25
+
26
+ add_action('load-' . $page, array($this, 'load'));
27
+
28
+ }
29
+
30
+ /**
31
+ * wlcms setting menu page is loaded
32
+ *
33
+ * @return void
34
+ */
35
+ public function load()
36
+ {
37
+
38
+ do_action("wlcms_load-page");
39
+
40
+ // Check if initial setup
41
+ if (!wlcms_field_setting('version') && !isset($_GET['view'])) {
42
+ wp_redirect(wlcms()->admin_url('wizard'));
43
+ exit;
44
+ }
45
+
46
+ // Register scripts
47
+ add_action("admin_enqueue_scripts", array($this, 'enqueue_scripts'));
48
+
49
+ //check store;
50
+ $this->store();
51
+ }
52
+
53
+ public function enqueue_scripts()
54
+ {
55
+
56
+ $setting_js = 'js/admin-settings.js';
57
+
58
+ wp_register_script(
59
+ 'wlcms-admin-settings',
60
+ WLCMS_ASSETS_URL . $setting_js,
61
+ array('jquery', 'select2', 'wp-color-picker', 'jquery-validate'),
62
+ WLCMS_VERSION
63
+ );
64
+
65
+ $jquery_validate = 'js/jquery.validate.min.js';
66
+
67
+ wp_register_script(
68
+ 'jquery-validate',
69
+ WLCMS_ASSETS_URL . $jquery_validate,
70
+ array('jquery'),
71
+ WLCMS_VERSION
72
+ );
73
+
74
+ $ays_before_js = 'js/ays-beforeunload-shim.js';
75
+ wp_register_script(
76
+ 'ays-beforeunload-shim',
77
+ WLCMS_ASSETS_URL . $ays_before_js,
78
+ array('jquery'),
79
+ WLCMS_VERSION
80
+ );
81
+
82
+ $areyousure_js = 'js/jquery-areyousure.js';
83
+ wp_register_script(
84
+ 'jquery-areyousure',
85
+ WLCMS_ASSETS_URL . $areyousure_js,
86
+ array('jquery'),
87
+ WLCMS_VERSION
88
+ );
89
+
90
+ $setting_css = 'css/admin-settings.css';
91
+ wp_register_style(
92
+ 'wlcms-admin-settings',
93
+ WLCMS_ASSETS_URL . $setting_css,
94
+ array('select2', 'wp-color-picker'),
95
+ WLCMS_VERSION
96
+ );
97
+
98
+ wp_register_style('select2', WLCMS_ASSETS_URL . 'css/select2.min.css');
99
+ wp_register_script('select2', WLCMS_ASSETS_URL . 'js/select2.min.js');
100
+
101
+ wp_enqueue_script(array('select2', 'wp-color-picker', 'ays-beforeunload-shim', 'jquery-areyousure', 'wlcms-admin-settings'));
102
+ wp_enqueue_style(array('select2', 'wp-color-picker', 'wlcms-admin-settings'));
103
+
104
+ wp_localize_script(
105
+ 'wlcms-admin-settings',
106
+ 'wlcms_settings',
107
+ array(
108
+ 'loginurl' => site_url("/wp-login.php"),
109
+ 'adminurl' => admin_url("index.php"),
110
+ 'wlcms_ajax_nonce' => wp_create_nonce("wlcms_ajax_nonce")
111
+ )
112
+ );
113
+ }
114
+
115
+ private function store()
116
+ {
117
+ do_action('wlcms_save_before_validation');
118
+
119
+ if (!isset($_POST['wlcms-settings'])) {
120
+ return;
121
+ }
122
+
123
+ if (isset($_POST['wlcms-action']) && $_POST['wlcms-action'] == 'reset') {
124
+ return;
125
+ }
126
+ // nonce checking
127
+ if (!isset($_POST['wlcms-settings_nonce'])
128
+ || !wp_verify_nonce($_POST['wlcms-settings_nonce'], 'wlcms-settings-action')) {
129
+
130
+ print 'Sorry, your nonce did not verify.';
131
+ exit;
132
+ }
133
+
134
+ wlcms()->Settings()->store();
135
+ return;
136
+ }
137
+
138
+ public function view()
139
+ {
140
+ $wlcms = wlcms();
141
+ $view = $wlcms->get_active_view();
142
+ $wlcms->admin_view($view);
143
+ }
144
+ }
145
+
includes/classes/Admin_Dashboard.php ADDED
@@ -0,0 +1,437 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WLCMS_Admin_Dashboard extends WLCMS_Previewable
4
+ {
5
+
6
+ private $is_dashboard_all_hidden;
7
+ private $is_fullwidth;
8
+ private $welcome_title;
9
+ private $welcome_show_title;
10
+ private $welcome_description;
11
+ private $welcome_content;
12
+
13
+ public function __construct()
14
+ {
15
+ //Check and set if it is a preview
16
+ $this->check_preview();
17
+
18
+ add_action('wp_dashboard_setup', array($this, 'dashboard_setup'), 999);
19
+ }
20
+
21
+ public function dashboard_setup()
22
+ {
23
+ $this->add_own_rss_panel();
24
+ $this->dashboard_title();
25
+ $this->set_welcome_metabox();
26
+
27
+ //Old version setting 2.0.2
28
+ if (!wlcms_field_setting('dashboard_role_stat')) {
29
+ if (is_wlcms_admin()) return;
30
+ } else {
31
+ $dashboard_widgets_visibility_roles = wlcms_field_setting('dashboard_widgets_visibility_roles');
32
+ if (!$this->has_current_user_role($dashboard_widgets_visibility_roles))
33
+ return;
34
+ }
35
+
36
+ $this->set_dashboard_all_hidden();
37
+ $this->remove_metaboxes();
38
+ $this->remove_dashed_border();
39
+ }
40
+
41
+ private function set_dashboard_all_hidden()
42
+ {
43
+ $this->is_dashboard_all_hidden = $this->get_settings('hide_all_dashboard_panels');
44
+ }
45
+
46
+ public function is_dashboard_all_hidden()
47
+ {
48
+ return $this->is_dashboard_all_hidden;
49
+ }
50
+
51
+ /**
52
+ * Change Dashboard H1 Title by using js
53
+ *
54
+ * @return void
55
+ */
56
+ private function dashboard_title()
57
+ {
58
+ global $current_screen, $wp_version;
59
+
60
+ $dashboard_title = '';
61
+ if ($icon = $this->get_settings('dashboard_icon')) {
62
+ $dashboard_title .= '<span id=\"wlcms_dashboard_logo\"><img src=\"' . $icon . '\" alt=\"\" /></span>';
63
+
64
+ wlcms_set_css('.index-php #wlcms_dashboard_logo img', array('vertical-align' => 'middle', 'padding-right' => '10px'));
65
+ }
66
+
67
+ if ($title = $this->get_settings('dashboard_title')) {
68
+ $dashboard_title .= '<span id=\"wlcms_dashboard_title\">' . $title . '</span>';
69
+ }
70
+
71
+ if (version_compare($wp_version, '3.8-beta', '>=')) {
72
+ wlcms_add_js('jQuery(".index-php #wpbody-content .wrap h1:eq(0)").html("' . $dashboard_title . '")');
73
+ return;
74
+ }
75
+
76
+ wlcms_add_js('jQuery("#icon-index").html("' . $dashboard_title . '")');
77
+
78
+ return;
79
+ }
80
+
81
+ /**
82
+ * Removed Wordpress Dashboard metaboxes if set to true
83
+ *
84
+ * @return void
85
+ */
86
+ private function remove_metaboxes()
87
+ {
88
+ global $wp_meta_boxes;
89
+
90
+ if ($this->is_dashboard_all_hidden() && ($this->get_settings('hide_at_a_glance') &&
91
+ $this->get_settings('hide_activities') &&
92
+ $this->get_settings('hide_recent_comments') &&
93
+ $this->get_settings('hide_news_and_events') &&
94
+ $this->get_settings('hide_quick_press'))) {
95
+
96
+ if (isset($wp_meta_boxes['dashboard'])) :
97
+ foreach ($wp_meta_boxes['dashboard'] as $key => $widget) {
98
+
99
+ if (isset($wp_meta_boxes['dashboard'][$key]['core'])) :
100
+ foreach ($wp_meta_boxes['dashboard'][$key]['core'] as $dashboard_key => $dashboard) {
101
+ if ($this->remove_dashboard_widget($dashboard_key)) {
102
+ unset($wp_meta_boxes['dashboard'][$key]['core'][$dashboard_key]);
103
+ }
104
+ }
105
+ endif;
106
+ }
107
+ endif;
108
+ return;
109
+ }
110
+
111
+ if ($this->get_settings('hide_at_a_glance')) {
112
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
113
+ }
114
+
115
+ if ($this->get_settings('hide_activities')) {
116
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);
117
+ }
118
+
119
+ if ($this->get_settings('hide_recent_comments')) {
120
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
121
+ }
122
+
123
+ if ($this->get_settings('hide_news_and_events')) {
124
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
125
+ }
126
+
127
+ if ($this->get_settings('hide_quick_press')) {
128
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
129
+ }
130
+ }
131
+ private function remove_dashboard_widget($dashboard_key = false)
132
+ {
133
+ if (!$dashboard_key) return false;
134
+
135
+ if (strpos($dashboard_key, 'custom_help_widget') !== false) return false;
136
+
137
+ return !in_array($dashboard_key, $this->excluded_widgets());
138
+ }
139
+ private function excluded_widgets()
140
+ {
141
+ return array('wlcms_rss_box');
142
+ }
143
+
144
+ /**
145
+ * Add Own Welcome panel if set to true
146
+ *
147
+ * @return void
148
+ */
149
+ private function set_welcome_metabox()
150
+ {
151
+
152
+ $welcome_panels = wlcms_field_setting('welcome_panel');
153
+
154
+ if (!$welcome_panels || !is_array($welcome_panels)) {
155
+ return;
156
+ }
157
+
158
+ if (!count($welcome_panels) === 0) {
159
+ return;
160
+ }
161
+
162
+
163
+ foreach ($welcome_panels as $key => $welcome_panel) {
164
+
165
+ if (!$this->is_welcome_panel_visible($welcome_panel) || !is_array($welcome_panel)) {
166
+
167
+ continue;
168
+ }
169
+
170
+ $this->set_welcome_panel_content($welcome_panel);
171
+ $this->make_welcome_panel($key);
172
+ }
173
+
174
+ wlcms_set_css('.index-php .wlcms-welcome-panel-content', array('margin' => '13px', 'padding-bottom' => '25px!important'));
175
+ add_action('admin_footer', array($this, 'welcome_panel_footer'));
176
+ }
177
+
178
+ private function is_welcome_panel_visible($setting)
179
+ {
180
+
181
+ if (!isset($setting['is_active'])) {
182
+ return false;
183
+ }
184
+
185
+ if ($setting['is_active'] != '1') {
186
+ return false;
187
+ }
188
+
189
+ if (!isset($setting['visible_to'])
190
+ || (isset($setting['visible_to']) && !$setting['visible_to']))
191
+ return false;
192
+
193
+ $roles = $setting['visible_to'];
194
+
195
+ return $this->has_current_user_role($roles);
196
+
197
+ }
198
+
199
+ private function has_current_user_role($roles)
200
+ {
201
+
202
+ $user_role = wlcms_current_user_roles();
203
+
204
+ return in_array($user_role, $roles);
205
+ }
206
+
207
+ private function set_welcome_panel_content($config)
208
+ {
209
+ $this->is_fullwidth = true;
210
+
211
+ $this->welcome_show_title = isset($config['show_title']) && $config['show_title'] == 1;
212
+ $template_type = isset($config['template_type']) ? $config['template_type'] : 'html';
213
+
214
+ if ($template_type == 'Elementor' && wlcms_is_elementor_active()) :
215
+ $id = isset($config['page_id_elementor']) ? $config['page_id_elementor'] : null;
216
+ $desciption = $this->page_builder_elementor($id);
217
+ $title = get_the_title($id);
218
+ elseif ($template_type == 'Beaver Builder' && wlcms_is_beaver_builder_active()) :
219
+ $id = isset($config['page_id_beaver']) ? $config['page_id_beaver'] : null;
220
+ $desciption = $this->page_builder_beaver_builder($id);
221
+ $title = get_the_title($id);
222
+ else :
223
+ $title = isset($config['title']) ? $config['title'] : null;
224
+ $desciption = isset($config['description']) ? $config['description'] : null;
225
+ $this->is_fullwidth = isset($config['is_fullwidth']) ? $config['is_fullwidth'] : false;
226
+ $this->welcome_show_title = true;
227
+ endif;
228
+
229
+ $this->welcome_title = $title;
230
+
231
+ $this->set_welcom_description($desciption);
232
+
233
+ }
234
+
235
+ public function set_welcom_description($des)
236
+ {
237
+ $this->welcome_description = $des;
238
+ }
239
+
240
+ public function get_welcom_description()
241
+ {
242
+ return $this->welcome_description;
243
+ }
244
+
245
+ public function compile_welcome_content($key)
246
+ {
247
+ $title = ($this->welcome_show_title) ? sprintf("<h2>%s</h2>", $this->welcome_title) : '';
248
+ $content = sprintf(
249
+ "<div id=\"welcome-panel%1\$d\" class=\"welcome-panel\" style=\"display:none\"><div class=\"wlcms-welcome-panel-content\">%2\$s<div class=\"welcome-panel-column-container\">%3\$s</div></div></div>",
250
+ $key,
251
+ $title,
252
+ $this->welcome_description
253
+ );
254
+
255
+ $this->welcome_content .= $content;
256
+ }
257
+
258
+ public function welcome_panel_footer()
259
+ {
260
+ echo $this->welcome_content;
261
+ }
262
+
263
+ private function make_welcome_panel($key)
264
+ {
265
+
266
+ if ($this->is_fullwidth) {
267
+ $this->compile_welcome_content($key);
268
+ $welcome = sprintf(";jQuery('#welcome-panel%1\$d').insertBefore('#dashboard-widgets-wrap');jQuery('#welcome-panel%1\$d').show();", $key);
269
+ wlcms_add_js($welcome);
270
+ return;
271
+ }
272
+
273
+ wp_add_dashboard_widget(
274
+ 'custom_help_widget' . $key,
275
+ $this->welcome_title,
276
+ array($this, 'welcome_description'),
277
+ null,
278
+ array('desc' => $this->get_welcom_description())
279
+ );
280
+
281
+ }
282
+
283
+ public function welcome_description($post, $callback_args)
284
+ {
285
+ echo $callback_args['args']['desc'];
286
+ }
287
+
288
+ public function page_builder_beaver_builder($template = false)
289
+ {
290
+ if (!$template) return;
291
+
292
+ add_action('admin_enqueue_scripts', 'FLBuilder::register_layout_styles_scripts');
293
+ return do_shortcode('[fl_builder_insert_layout id="' . $template . '"]');
294
+ }
295
+
296
+ public function page_builder_elementor($template = false)
297
+ {
298
+ if (!$template) return;
299
+
300
+ $elementor = @Elementor\Plugin::instance();
301
+
302
+ $elementor->frontend->register_styles();
303
+ $elementor->frontend->enqueue_styles();
304
+
305
+ $elementor->frontend->register_scripts();
306
+ $elementor->frontend->enqueue_scripts();
307
+ return $elementor->frontend->get_builder_content($template, true);
308
+ }
309
+
310
+ /**
311
+ * Remove Dashboard Border Line if set to true
312
+ *
313
+ * @return void
314
+ */
315
+ private function remove_dashed_border()
316
+ {
317
+ if (!$this->get_settings('remove_empty_dash_panel')) {
318
+ return;
319
+ }
320
+
321
+ wlcms_set_css('.postbox-container .meta-box-sortables.empty-container, .index-php .empty-container', array('border' => '0'));
322
+ }
323
+
324
+ /**
325
+ * Remove Wordpress Core News and Event if set to troe
326
+ *
327
+ * @return void
328
+ */
329
+ public function remove_news_and_events()
330
+ {
331
+ if (!$this->get_settings('hide_news_and_events')) {
332
+ return;
333
+ }
334
+
335
+ remove_meta_box('dashboard_primary', 'dashboard', 'core');
336
+
337
+ wlcms_add_js(';jQuery("#community-events").remove();jQuery(".community-events-footer").remove();jQuery("#dashboard_primary h2 span").remove();');
338
+ }
339
+
340
+ /**
341
+ * Add RSS Dashboard Metabox
342
+ *
343
+ * @return void
344
+ */
345
+ public function add_own_rss_panel()
346
+ {
347
+ if (!$this->get_settings('add_own_rss_panel')) {
348
+ return;
349
+ }
350
+
351
+ if (!$this->get_settings('rss_feed_address')) {
352
+ return;
353
+ }
354
+
355
+
356
+ $title = '';
357
+ $this->get_settings('rss_title');
358
+
359
+ if ($logo = $this->get_settings('rss_logo')) {
360
+ $title .= '<img src="' . $logo . '" height="16" width="16" alt="Logo" style="padding-right:5px;vertical-align:bottom;"/> ';
361
+ }
362
+
363
+ if ($rss_title = $this->get_settings('rss_title')) {
364
+ $title .= $rss_title;
365
+ }
366
+
367
+ wp_add_dashboard_widget(
368
+ 'wlcms_rss_box',
369
+ !empty($title) ? $title : '&nbsp;',
370
+ array($this, 'rss_box')
371
+ );
372
+ }
373
+
374
+ /**
375
+ * Display RSS Metabox to the dashboard
376
+ * called by wp_add_dashboard_widget
377
+ *
378
+ * @return void
379
+ */
380
+ public function rss_box()
381
+ {
382
+ include_once(ABSPATH . WPINC . '/feed.php');
383
+
384
+ $num_items = $this->get_settings('rss_feed_number_of_item');
385
+ $introduction = $this->get_settings('rss_introduction');
386
+ $show_post_content = $this->get_settings('show_post_content');
387
+ $url = $this->get_settings('rss_feed_address');
388
+
389
+ if ($introduction) {
390
+ echo '<p>' . $introduction . '</p>';
391
+ }
392
+
393
+ $rss = fetch_feed($url);
394
+
395
+ if ($error = is_wp_error($rss)) {
396
+ echo '<div class="warning-text">' . $rss->get_error_message() . '</div>';
397
+
398
+ wlcms_set_css(
399
+ '.index-php .warning-text',
400
+ array('color' => 'rgba(240, 116, 95, 0.808)', 'display' => 'block')
401
+ );
402
+ return;
403
+ }
404
+
405
+ $maxitems = $rss->get_item_quantity($num_items);
406
+ $rss_items = $rss->get_items(0, $maxitems);
407
+
408
+ if ($maxitems == 0) {
409
+ echo 'No items.';
410
+ return;
411
+ }
412
+
413
+ $rss_list = '<ul>';
414
+
415
+ foreach ($rss_items as $item) :
416
+
417
+ $rss_list .= sprintf(
418
+ '<li><strong><a href="%s" title="Posted %s target="_blank">%s</a> </strong> <br />',
419
+ esc_url($item->get_permalink()),
420
+ $item->get_date('j F Y | g:i a'),
421
+ esc_html($item->get_title())
422
+ );
423
+
424
+ if ($show_post_content) :
425
+ $rss_list .= preg_replace('/<img[^>]+./', '', $item->get_content());
426
+
427
+ endif;
428
+ $rss_list .= '</li>';
429
+
430
+ endforeach;
431
+
432
+ $rss_list .= '</ul>';
433
+
434
+ echo $rss_list;
435
+ }
436
+
437
+ }
includes/classes/Admin_Menus.php ADDED
@@ -0,0 +1,612 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WLCMS_Admin_Menus
4
+ {
5
+
6
+ private $admin_menus;
7
+ private $admin_bar_menus = array();
8
+ private $is_wlcms_admin = false;
9
+ private $admin_bar_menu_setting = false;
10
+ private $submenu_placeholder = '_wlcms_';
11
+ private $wlcms_admin_bar_menus_option = 'wlcms_admin_bar_menus';
12
+
13
+ public function __construct()
14
+ {
15
+ add_action('init', array($this, 'set_wlcms_admin'), 10);
16
+ add_action('admin_init', array($this, 'admin_init'));
17
+ add_action('wlcms_save_addtional_settings', array($this, 'save'), 12, 1);
18
+ add_action('admin_init', array($this, 'rebuild_user_admin_menu'), 9999999); // rebuild sidebar menu
19
+ add_action('wp_before_admin_bar_render', array($this, 'init_admin_bar_menu'), 9999999); // setup admin bar menu
20
+ }
21
+
22
+ public function admin_init()
23
+ {
24
+ $this->set_admin_bar_menu_setting();
25
+ $this->compile_menus();
26
+ }
27
+
28
+ public function set_wlcms_admin()
29
+ {
30
+ //Remove actions from preview mode
31
+ if (defined('DOING_AJAX') && DOING_AJAX) {
32
+ remove_action('admin_init', array($this, 'admin_init'));
33
+ remove_action('admin_init', array($this, 'rebuild_user_admin_menu'), 9999999);
34
+ return;
35
+ }
36
+
37
+ if (!is_user_logged_in()) {
38
+ return;
39
+ }
40
+
41
+ $wlcms_admin = wlcms_field_setting('wlcms_admin');
42
+
43
+ if (!$wlcms_admin) {
44
+ return;
45
+ }
46
+
47
+ //Check if the current user is editor and with legacy menu
48
+ if ($this->is_legacy_menu_role()) {
49
+ return;
50
+ }
51
+
52
+ $current_user = wp_get_current_user();
53
+
54
+ $this->is_wlcms_admin = in_array($current_user->ID, $wlcms_admin);
55
+ }
56
+
57
+ public function is_legacy_menu_role()
58
+ {
59
+
60
+ if (!wlcms_field_setting('legacy_menu')) {
61
+ return false;
62
+ }
63
+
64
+ $user = wp_get_current_user();
65
+ $role = ( array )$user->roles;
66
+
67
+ if (!in_array('editor', $role, true)) {
68
+ return false;
69
+ }
70
+
71
+ return true;
72
+ }
73
+ /**
74
+ * check current user is wlcms admin or super admin
75
+ *
76
+ * @return boolean
77
+ */
78
+ public function has_visible_roles()
79
+ {
80
+ if (is_multisite() && is_super_admin()) {
81
+ return true;
82
+ }
83
+
84
+ return $this->is_wlcms_admin();
85
+ }
86
+
87
+ public function enable_admin_menu()
88
+ {
89
+ return wlcms_field_setting('enable_wlcms_admin');
90
+ }
91
+
92
+ /**
93
+ * check current user is wlcms admin
94
+ *
95
+ */
96
+ public function is_wlcms_admin()
97
+ {
98
+ return $this->is_wlcms_admin;
99
+ }
100
+
101
+ public function save($settings)
102
+ {
103
+
104
+ if (!isset($_POST['enable_wlcms_admin'])) {
105
+ $settings->remove('admin_menus');
106
+ $settings->remove('admin_bar_menus');
107
+ return;
108
+ }
109
+
110
+ $this->save_sidemenu($settings);
111
+ $this->save_admin_bar_menu($settings);
112
+
113
+ if (!isset($_POST['remove_legacy_menu'])) {
114
+ return;
115
+ }
116
+
117
+ $settings->remove('legacy_menu');
118
+ }
119
+
120
+ private function save_sidemenu($settings)
121
+ {
122
+ $menus = $this->get_admin_menus();
123
+ $db_menu_main = array();
124
+ $db_menu = array();
125
+
126
+ // No menu selected
127
+ if (!isset($_POST['admin_menus'])) {
128
+ $settings->remove('admin_menus');
129
+ return $settings;
130
+ }
131
+
132
+ $post_main_menu = isset($_POST['admin_menus']['main']) ? $_POST['admin_menus']['main'] : array();
133
+ $post_sub_menu = isset($_POST['admin_menus']['sub']) ? $_POST['admin_menus']['sub'] : array();
134
+
135
+ $sidebar_url = sanitize_title(wlcms()->Branding()->sidebar_menu_url());
136
+
137
+ if (is_array($menus) && $menus > 0) :
138
+ foreach ($menus as $main_key => $main_menu) {
139
+
140
+ if ($main_key == $sidebar_url) {
141
+ continue;
142
+ }
143
+
144
+ if (!in_array($main_key, $post_main_menu)) {
145
+ $db_menu['main'][] = $main_key;
146
+ }
147
+
148
+ if (isset($main_menu['submenus']) && is_array($main_menu['submenus']) && count($main_menu['submenus'])) {
149
+ foreach ($main_menu['submenus'] as $sub_key => $submenu) {
150
+ if ($sub_key == $sidebar_url) {
151
+ continue;
152
+ }
153
+ $submenu_value = $submenu['slug'];
154
+
155
+ if (!in_array($submenu_value, $post_sub_menu)) {
156
+ $db_menu['sub'][] = $submenu_value;
157
+ }
158
+ }
159
+ }
160
+ }
161
+ endif;
162
+
163
+ if (count($db_menu)) {
164
+ $settings->set('admin_menus', $db_menu);
165
+ } else {
166
+ $settings->remove('admin_menus');
167
+ }
168
+
169
+ return $settings;
170
+ }
171
+
172
+ private function save_admin_bar_menu($settings)
173
+ {
174
+ $menus = get_option($this->wlcms_admin_bar_menus_option, array());
175
+
176
+ // No menu selected
177
+ if (!isset($_POST['admin_bar_menus'])) {
178
+ $settings->remove('admin_bar_menus');
179
+ return;
180
+ }
181
+
182
+ $post_menu = isset($_POST['admin_bar_menus']) ? $_POST['admin_bar_menus'] : array();
183
+
184
+ $db_menu = array();
185
+ if (is_array($menus) && $menus > 0) :
186
+ foreach ($menus as $menu_key => $menu) {
187
+
188
+ if (!in_array($menu_key, $post_menu)) {
189
+ $db_menu[] = $menu_key;
190
+ }
191
+ }
192
+ endif;
193
+ if (count($db_menu)) {
194
+ $settings->set('admin_bar_menus', $db_menu);
195
+ }
196
+
197
+ }
198
+
199
+ /**
200
+ * Re-organize sidebar menus
201
+ * Combine menu and submenu in single array
202
+ *
203
+ * @return void
204
+ */
205
+ public function compile_menus()
206
+ {
207
+ global $menu, $submenu;
208
+
209
+
210
+ $output = array();
211
+
212
+ $sidebar_url = wlcms()->Branding()->sidebar_menu_url();
213
+
214
+ if (is_array($menu) && count($menu) > 0) {
215
+ foreach ($menu as $menu_item) {
216
+ // some menu items are seperators, skip them
217
+ if ($menu_item[0] == '') {
218
+ continue;
219
+ }
220
+
221
+ if ($menu_item[2] == $sidebar_url) {
222
+ continue;
223
+ }
224
+
225
+ $menu_name = preg_replace('#(<span.*?>).*?(</span>)#', '', $menu_item[0]);
226
+ $menu_key = $menu_item[2];
227
+ $output[$menu_key] = array(
228
+ 'name' => $menu_name,
229
+ 'slug' => $menu_item[2],
230
+ 'submenus' => array()
231
+ );
232
+ }
233
+ }
234
+ if (is_array($submenu) && count($submenu) > 0) :
235
+
236
+ foreach ($submenu as $key => $submenu_item) {
237
+
238
+ $mainmenu_key = $key;
239
+
240
+ // If a submenu does not have a valid parent, skip
241
+ if (!isset($output[$mainmenu_key])) {
242
+ continue;
243
+ }
244
+
245
+ foreach ($submenu_item as $sm_info) {
246
+ $submenu_item = remove_query_arg('return', $sm_info[2]);
247
+ $submenu_key = sanitize_title($submenu_item);
248
+ $menu_name = preg_replace('#(<span.*?>).*?(</span>)#', '', $sm_info[0]);
249
+
250
+ $slug = $mainmenu_key . $this->get_submenu_placeholder() . $submenu_key;
251
+ $output[$key]['submenus'][$submenu_key] = array(
252
+ 'name' => $menu_name,
253
+ 'slug' => $slug
254
+ );
255
+ }
256
+
257
+ }
258
+ endif;
259
+
260
+ $this->admin_menus = $output;
261
+
262
+ }
263
+
264
+ /**
265
+ * Sibar Admin menu getter
266
+ *
267
+ * @return array
268
+ */
269
+ public function get_admin_menus()
270
+ {
271
+ return $this->admin_menus;
272
+ }
273
+
274
+ /**
275
+ * remove sidebar menus that enable by wlcms
276
+ *
277
+ * @return void
278
+ */
279
+ public function rebuild_user_admin_menu()
280
+ {
281
+ global $submenu;
282
+
283
+ if (!$this->enable_admin_menu() && !$this->is_legacy_menu_role()) {
284
+ return;
285
+ }
286
+
287
+ if ($this->has_visible_roles()) {
288
+ return;
289
+ }
290
+
291
+ $setting_admin_menus = wlcms_field_setting('admin_menus');
292
+ if (isset($setting_admin_menus['main']) && is_array($setting_admin_menus['main'])) {
293
+
294
+ foreach ($setting_admin_menus['main'] as $menu_item) {
295
+ $this->remove_menu_page($menu_item);
296
+ }
297
+ }
298
+
299
+ if (isset($setting_admin_menus['sub']) && is_array($setting_admin_menus['sub'])) {
300
+ foreach ($setting_admin_menus['sub'] as $submenu_item) {
301
+ $submenu_list = explode($this->get_submenu_placeholder(), $submenu_item);
302
+ $main_menu = $submenu_list[0];
303
+ $main_submenu = $submenu_list[1];
304
+ $this->remove_submenu_page($main_menu, $main_submenu);
305
+
306
+ }
307
+ }
308
+ }
309
+
310
+ /**
311
+ * Get sidebar sub-menu
312
+ *
313
+ * @return array
314
+ */
315
+ public function get_new_submenus($key)
316
+ {
317
+ return isset($this->admin_menus[$key]) ? $this->admin_menus[$key] : false;
318
+
319
+ }
320
+ /**
321
+ * Remove a top-level admin menu.
322
+ *
323
+ * @global array $menu
324
+ *
325
+ * @param string $menu_slug The slug of the menu.
326
+ * @return array|bool The removed menu on success, false if not found.
327
+ */
328
+ public function remove_menu_page($menu_slug)
329
+ {
330
+ global $menu;
331
+
332
+ if (!is_array($menu)) {
333
+ return false;
334
+ }
335
+
336
+ foreach ($menu as $i => $item) {
337
+
338
+ $menu_item = remove_query_arg('return', $item[2]);
339
+ $menu_item = $menu_item;
340
+
341
+ if ($menu_slug == $menu_item) {
342
+ unset($menu[$i]);
343
+ return $item;
344
+ }
345
+ }
346
+ return false;
347
+ }
348
+
349
+ /**
350
+ * Remove an admin submenu.
351
+ *
352
+ * @global array $submenu
353
+ *
354
+ * @param string $menu_slug The slug for the parent menu.
355
+ * @param string $submenu_slug The slug of the submenu.
356
+ * @return array|bool The removed submenu on success, false if not found.
357
+ */
358
+ function remove_submenu_page($menu_slug, $submenu_slug)
359
+ {
360
+ global $submenu;
361
+
362
+ if (!isset($submenu[$menu_slug]) || !is_array($submenu[$menu_slug]))
363
+ return false;
364
+
365
+ foreach ($submenu[$menu_slug] as $i => $item) {
366
+ $submenu_item = remove_query_arg('return', $item[2]);
367
+ $submenu_item = sanitize_title($submenu_item);
368
+
369
+ if ($submenu_slug == $submenu_item) {
370
+ unset($submenu[$menu_slug][$i]);
371
+ return $item;
372
+ }
373
+ }
374
+
375
+ return false;
376
+ }
377
+
378
+ public function init_admin_bar_menu()
379
+ {
380
+ $this->set_admin_bar_menu();
381
+ $this->buid_new_admin_bar_menu();
382
+ }
383
+
384
+ /**
385
+ * Prepare white label cms admin bar menu and build in multidimentional array
386
+ *
387
+ * @return void
388
+ */
389
+ private function set_admin_bar_menu()
390
+ {
391
+ global $wp_admin_bar;
392
+
393
+ $nodes = $wp_admin_bar->get_nodes();
394
+
395
+ if (!$nodes || !is_array($nodes)) {
396
+ return;
397
+ }
398
+
399
+ // Admin menus is not set from action hoo admin_init
400
+ // Use for saving menus
401
+ if (is_admin()) {
402
+ $screen = get_current_screen();
403
+ if ($screen && $screen->id == WLCMS_SCREEN_ID) {
404
+
405
+ update_option($this->wlcms_admin_bar_menus_option, $nodes, false);
406
+ }
407
+ }
408
+
409
+ $wlcms_admin_bar = $this->_createMenuTree($nodes);
410
+
411
+ $this->admin_bar_menus = $wlcms_admin_bar;
412
+ }
413
+
414
+ /**
415
+ * Add all main menu
416
+ *
417
+ * @param object $flat
418
+ * @param integer $root
419
+ * @return array
420
+ */
421
+ private function _createMenuTree($flat, $root = 0)
422
+ {
423
+ $parents = array();
424
+ $sub_root = array();
425
+ if (is_array($flat) && $flat > 0) :
426
+ foreach ($flat as $a) {
427
+ if ($this->excluded_admin_menu($a->id)) continue;
428
+ $parents[$a->parent][] = $a;
429
+ }
430
+ $sub_root = isset($parents[$root]) ? $parents[$root] : array();
431
+ endif;
432
+
433
+ return $this->_createMenuBranch($parents, $sub_root);
434
+ }
435
+
436
+ /**
437
+ * Add all sub menu to each main menu
438
+ *
439
+ * @param array $parents main menus
440
+ * @param object $children
441
+ * @return array
442
+ */
443
+ private function _createMenuBranch(&$parents, $children)
444
+ {
445
+ $tree = array();
446
+ if (is_array($children) && $children > 0) :
447
+ foreach ($children as $child) {
448
+
449
+ if (isset($parents[$child->id])) {
450
+
451
+ $child->sub = $this->_createMenuBranch($parents, $parents[$child->id]);
452
+
453
+ }
454
+
455
+ $tree[] = $child;
456
+
457
+ }
458
+ endif;
459
+
460
+ return $tree;
461
+ }
462
+
463
+ /**
464
+ * check if the menu is listed from excluded items
465
+ *
466
+ * @param string $menu
467
+ * @return boolean
468
+ */
469
+ private function excluded_admin_menu($menu = '')
470
+ {
471
+ $exclude = array('menu-toggle', 'wlcms-admin-logo', 'wp-logo');
472
+
473
+ return in_array($menu, $exclude);
474
+ }
475
+
476
+ /**
477
+ * Create admin bar menu base from the wlcms settings
478
+ *
479
+ * @return void
480
+ */
481
+ private function buid_new_admin_bar_menu()
482
+ {
483
+ global $wp_admin_bar;
484
+
485
+ if ($this->has_visible_roles()) {
486
+ return;
487
+ }
488
+
489
+ $admin_bar_menu = wlcms_field_setting('admin_bar_menus');
490
+
491
+ if (!$admin_bar_menu || ($admin_bar_menu && !is_array($admin_bar_menu))) {
492
+ return;
493
+ }
494
+
495
+ if (!count($admin_bar_menu)) {
496
+ return;
497
+ }
498
+
499
+
500
+ $nodes = $wp_admin_bar->get_nodes();
501
+
502
+ if (is_array($nodes) && count($nodes) > 0) :
503
+ foreach ($nodes as $menu) {
504
+
505
+ if ($this->excluded_admin_menu($menu->id)) continue;
506
+
507
+ if (in_array($menu->id, $admin_bar_menu)) {
508
+ $wp_admin_bar->remove_menu($menu->id);
509
+ }
510
+ }
511
+ endif;
512
+ }
513
+
514
+ /**
515
+ * Getter of admin bar menus list
516
+ *
517
+ * @return void
518
+ */
519
+ public function get_admin_bar_menus()
520
+ {
521
+ return $this->admin_bar_menus;
522
+ }
523
+
524
+ /**
525
+ * Change menu Title for wlcms settings
526
+ *
527
+ * @param object $menu
528
+ * @return string
529
+ */
530
+ public function get_menu_title($menu)
531
+ {
532
+ if (!isset($menu->title)) {
533
+ return '';
534
+ }
535
+
536
+ $title = trim(wp_strip_all_tags($menu->title));
537
+
538
+ return ((!$title || empty($title)) ? '-' : $title) . ' <small>(' . $menu->id . ')</small>';
539
+ }
540
+
541
+ public function set_admin_bar_menu_setting()
542
+ {
543
+ $this->admin_bar_menu_setting = wlcms_field_setting('admin_bar_menus');
544
+
545
+ }
546
+
547
+ public function get_admin_bar_menu_setting()
548
+ {
549
+ return $this->admin_bar_menu_setting;
550
+ }
551
+
552
+ public function get_admin_bar_menu_html($menu, $depth = 0)
553
+ {
554
+ $out = '';
555
+
556
+ if (!is_array($menu) && $depth > 0) {
557
+ return $out;
558
+ }
559
+
560
+ $ul_class_wrapper = '';
561
+ if ($depth > 0) {
562
+ $out .= '<a href="javascript:void(0)" class="wlcms-toggle-arrow"></a>';
563
+ $ul_class_wrapper = ' class="sub_menu_wrapper"';
564
+ }
565
+ $out .= '<ul' . $ul_class_wrapper . '>';
566
+ $out .= '<input type="hidden" value="top-secondary" name="admin_bar_menus[]">
567
+ <input type="hidden" value="my-account" name="admin_bar_menus[]">
568
+ <input type="hidden" value="user-actions" name="admin_bar_menus[]">
569
+ <input type="hidden" value="logout" name="admin_bar_menus[]">
570
+
571
+ ';
572
+
573
+ foreach ($menu as $menu_props) {
574
+
575
+ $menu_key = $menu_props->id;
576
+ $checked_sub = '';
577
+ $admin_bar_menu_setting = $this->get_admin_bar_menu_setting();
578
+ $checked_sub = ' checked="checked"';
579
+ if ($admin_bar_menu_setting && in_array($menu_key, $admin_bar_menu_setting)) {
580
+ $checked_sub = '';
581
+ }
582
+
583
+ $disabled = '';
584
+ if (in_array($menu_key, array('top-secondary', 'my-account', 'user-actions', 'logout'))) {
585
+ $disabled = ' disabled';
586
+ }
587
+
588
+ $sub_html = (isset($menu_props->sub)) ? $this->get_admin_bar_menu_html($menu_props->sub, ($depth + 1)) : '';
589
+ $out .= sprintf(
590
+ '
591
+ <li><input class="wlcms-toggle wlcms-toggle-light" id="admin_bar_menus_%1$s"%5$s name="admin_bar_menus[]" value="%1$s" type="checkbox" %2$s/>
592
+ <label class="wlcms-toggle-btn%5$s" for="admin_bar_menus_%1$s"></label><label class="toggle-label" for="admin_bar_menus_%1$s">%3$s</label>
593
+ %4$s
594
+ </li>
595
+ ',
596
+ $menu_key,
597
+ $checked_sub,
598
+ $this->get_menu_title($menu_props),
599
+ $sub_html,
600
+ $disabled
601
+ );
602
+ }
603
+
604
+ $out .= '</ul>';
605
+ return $out;
606
+ }
607
+
608
+ public function get_submenu_placeholder()
609
+ {
610
+ return $this->submenu_placeholder;
611
+ }
612
+ }
includes/classes/Admin_Script.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WLCMS_Admin_Script
4
+ {
5
+
6
+ private $css = array();
7
+ private $bulk_css = array();
8
+ private $hidded_elements = array();
9
+ private $js = array();
10
+ private $additional_css;
11
+
12
+ public function __construct()
13
+ {
14
+ add_action('admin_footer', array($this, 'admin_footer'));
15
+ add_action('wp_footer', array($this, 'admin_footer'), 99999);
16
+ add_action('in_admin_header', array($this, 'admin_css'), 99999);
17
+ }
18
+
19
+ public function admin_css()
20
+ {
21
+
22
+ // no need to append scripts for guest users
23
+ if (!is_user_logged_in()) {
24
+ return;
25
+ }
26
+ $scripts = "<!-- WLCMS Style-->\n";
27
+ if (count($this->css) || count($this->hidded_elements) || count($this->bulk_css)) {
28
+ $scripts .= sprintf('<style type="text/css">%s %s</style>', $this->compileCss(), $this->additional_css);
29
+ }
30
+ $scripts .= "\n<!-- WLCMS End Style-->";
31
+ echo $scripts;
32
+
33
+ }
34
+
35
+ public function admin_footer()
36
+ {
37
+ $scripts = '';
38
+
39
+ // no need to append scripts for guest users
40
+ if (!is_user_logged_in()) {
41
+ return;
42
+ }
43
+
44
+ if (count($this->js)) {
45
+ $scripts .= '<script type="text/javascript">';
46
+ $scripts .= '/* <![CDATA[ */';
47
+ $scripts .= ' jQuery(document).ready(function() { ' . $this->compileJs() . ' });';
48
+ $scripts .= '/* ]]> */';
49
+ $scripts .= '</script>';
50
+ }
51
+
52
+ if (!empty($scripts)) {
53
+ $scripts = "<!-- WLCMS Scripts-->\n" . $scripts . "\n<!-- WLCMS End Scripts-->";
54
+ }
55
+
56
+ echo $scripts;
57
+ }
58
+
59
+ public function set_CssHidden($props)
60
+ {
61
+ $this->hidded_elements[] = $props;
62
+ }
63
+
64
+ public function setCss($element, $props = array())
65
+ {
66
+ $this->css[$element] = $props;
67
+ }
68
+
69
+ public function appendCss($css)
70
+ {
71
+ $this->bulk_css[] = $css;
72
+ }
73
+
74
+ private function _setHiddenCss()
75
+ {
76
+ $hidden = implode($this->hidded_elements, ',');
77
+ if (!empty($hidden)) {
78
+ $this->setCss($hidden, array('display' => 'none'));
79
+ }
80
+ }
81
+
82
+ private function _setBulkCss()
83
+ {
84
+ return implode($this->bulk_css, '');
85
+ }
86
+
87
+ public function appendJs($js)
88
+ {
89
+ $this->js[] = $js;
90
+ }
91
+
92
+ function compileJs()
93
+ {
94
+ return implode($this->js, '');
95
+ }
96
+
97
+ function compileCss()
98
+ {
99
+ $this->_setHiddenCss();
100
+
101
+ if (!count($this->css)) {
102
+ return;
103
+ }
104
+
105
+ $css_output = '';
106
+ foreach ($this->css as $element => $props) {
107
+
108
+ $css_output .= $element . '{';
109
+ foreach ($props as $prop => $value) {
110
+ $css_output .= $prop . ':' . $value . ';';
111
+ }
112
+
113
+ $css_output .= '}';
114
+
115
+ }
116
+
117
+ $css_output .= $this->_setBulkCss();
118
+
119
+ return $css_output;
120
+ }
121
+
122
+ public function additional_css($css)
123
+ {
124
+ $this->additional_css .= $css;
125
+ }
126
+
127
+ }
includes/classes/Admin_Settings.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WLCMS_Admin_Settings
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ add_action('admin_menu', array($this, 'admin_menu'), 9999);
9
+ add_action('admin_init', array($this, 'init'), 9999);
10
+ add_filter('mce_css', array($this, 'custom_editor_stylesheet'));
11
+ add_filter('contextual_help', array($this, 'remove_help_tabs'), 999, 3);
12
+ add_action('admin_init', array($this, 'remove_nag_messages'));
13
+ add_action('init', array($this, 'remove_admin_bar'));
14
+ }
15
+
16
+ public function init()
17
+ {
18
+ $this->set_admin_css();
19
+ $this->hide_screen_options();
20
+ }
21
+
22
+ public function remove_admin_bar()
23
+ {
24
+
25
+
26
+ if (!wlcms_field_setting('hide_admin_bar_all')) {
27
+ return;
28
+ }
29
+
30
+ return $this->disable_admin_bar_menu();
31
+
32
+ }
33
+
34
+ private function disable_admin_bar_menu()
35
+ {
36
+ add_filter('show_admin_bar', '__return_false');
37
+
38
+ }
39
+
40
+ public function admin_menu()
41
+ {
42
+ if (!is_admin()) {
43
+ return;
44
+ }
45
+ }
46
+
47
+ public function hide_screen_options()
48
+ {
49
+ if (wlcms_field_setting('hide_screen_options')) {
50
+ add_filter('screen_options_show_screen', '__return_false');
51
+ }
52
+ }
53
+
54
+ public function remove_help_tabs($help, $screen_id, $screen)
55
+ {
56
+ if (wlcms_field_setting('hide_help_box')) {
57
+ $screen->remove_help_tabs();
58
+ }
59
+ return $help;
60
+ }
61
+
62
+ private function set_admin_css()
63
+ {
64
+ if (!$admin_style = wlcms_field_setting('settings_custom_css_admin')) {
65
+ return;
66
+ }
67
+
68
+ wlcms()->Admin_Script()->appendCss($admin_style);
69
+
70
+ }
71
+
72
+ public function custom_editor_stylesheet($mce_css)
73
+ {
74
+ $mce_style = wlcms_field_setting('settings_custom_css_url');
75
+ if (!$mce_style) {
76
+ return $mce_css;
77
+ }
78
+
79
+ if (filter_var($mce_style, FILTER_VALIDATE_URL) === false) {
80
+ $mce_style = get_stylesheet_directory_uri() . '/' . $mce_style;
81
+ }
82
+
83
+ $mce_css .= ',' . $mce_style;
84
+
85
+ return $mce_css;
86
+ }
87
+
88
+ public function remove_nag_messages()
89
+ {
90
+
91
+ if (!wlcms_field_setting('hide_nag_messages')) {
92
+ return;
93
+ }
94
+
95
+ remove_action('admin_notices', 'update_nag', 3);
96
+ remove_action('admin_notices', 'maintenance_nag', 10);
97
+ remove_action('network_admin_notices', 'update_nag', 3);
98
+ }
99
+
100
+ public function wp_version_check()
101
+ {
102
+ remove_action('init', 'wp_version_check');
103
+ }
104
+ }
includes/classes/Branding.php ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WLCMS_Branding extends WLCMS_Previewable
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ //Check and set if it is a preview
9
+ $this->check_preview();
10
+
11
+ add_action('init', array($this, 'init'));
12
+ add_filter('admin_title', array($this, 'admin_title'), 10, 2);
13
+ add_action('admin_bar_menu', array($this, 'admin_bar_logo'));
14
+ add_action('admin_bar_menu', array($this, 'admin_bar_howdy_text'));
15
+ add_filter('admin_footer_text', array($this, 'admin_footer'));
16
+ add_action('admin_menu', array($this, 'admin_menu'), 0);
17
+ add_filter('admin_body_class', array($this, 'admin_body_class'), 12);
18
+ }
19
+
20
+ public function init()
21
+ {
22
+ if ($this->get_settings('hide_wp_version')) {
23
+ add_filter('update_footer', '__return_false', 11);
24
+ }
25
+
26
+ if ($this->get_settings('hide_wordpress_logo_and_links')) {
27
+ wlcms_set_hidden_css('#wp-admin-bar-wp-logo');
28
+ wlcms_set_hidden_css('#wpadminbar .quicklinks li .blavatar');
29
+ }
30
+ }
31
+
32
+ public function admin_title($admin_title)
33
+ {
34
+ if ($custom_admin_title = $this->get_settings('custom_page_title')) {
35
+ $admin_title = str_replace(
36
+ "&#8212; WordPress",
37
+ "&#8212; " . $custom_admin_title,
38
+ $admin_title
39
+ );
40
+ }
41
+
42
+ return $admin_title;
43
+ }
44
+
45
+ public function admin_body_class($classes)
46
+ {
47
+ $classes .= (is_wlcms_admin() ? 'not-': '') . 'wlcms-admin';
48
+
49
+ return $classes;
50
+ }
51
+
52
+ public function admin_bar_logo($wp_admin_bar)
53
+ {
54
+
55
+ $admin_menu_bar_url = $this->get_settings('admin_bar_url');
56
+ $admin_menu_bar_alt_text = $this->get_settings('admin_bar_alt_text');
57
+ $admin_menu_bar_image = $this->get_settings('admin_bar_logo');
58
+
59
+ if (!$admin_menu_bar_image) {
60
+ return;
61
+ }
62
+
63
+ /**
64
+ * Add custom logo to the admin bar menu
65
+ */
66
+ $args = array(
67
+ 'id' => 'wlcms-admin-logo',
68
+ 'href' => $admin_menu_bar_url,
69
+ 'title' => sprintf('<img src="%s" />', $admin_menu_bar_image),
70
+ 'meta' => array('class' => 'wlcms-admin-logo', 'title' => $admin_menu_bar_alt_text, 'target' => '_blank')
71
+ );
72
+ $wp_admin_bar->add_node($args);
73
+
74
+ /**
75
+ * Create css for admin bar custom logo
76
+ */
77
+ $css_args = array();
78
+
79
+ $css_args['vertical-align'] = 'middle!important';
80
+
81
+
82
+ //limit admin logo height
83
+ $css_args['max-height'] = '20px!important';
84
+ $css_args['margin'] = '0 auto';
85
+ $css_args['vertical-align'] = 'middle';
86
+
87
+ wlcms_set_css('.wlcms-admin-logo img', $css_args);
88
+
89
+ wlcms_set_css(
90
+ '.wlcms-admin-logo .ab-item, .wlcms-admin-logo a',
91
+ array(
92
+ 'line-height' => '28px!important',
93
+ 'display' => 'flex',
94
+ 'align-items' => 'center'
95
+ )
96
+ );
97
+
98
+ }
99
+
100
+ public function sidebar_menu_url()
101
+ {
102
+ if ($this->get_settings('use_developer_side_menu_image')) {
103
+ return $this->get_settings('developer_url');
104
+ }
105
+
106
+ $sidebar_url = $this->get_settings('side_menu_link_url');
107
+
108
+ return $sidebar_url;
109
+ }
110
+
111
+ public function admin_menu()
112
+ {
113
+ global $menu;
114
+
115
+ $sidebar_url = $this->get_settings('side_menu_link_url');
116
+ $sidebar_text = $this->get_settings('side_menu_alt_text');
117
+ $sidebar_image = $this->get_settings('side_menu_image');
118
+ $collapsed_sidebar_image = $this->get_settings('collapsed_side_menu_image');
119
+
120
+
121
+ if (!$sidebar_image) {
122
+ return;
123
+ }
124
+
125
+ $logo = sprintf('<img src=\"%s\" title=\"%s\" class=\"large-side-bar-logo\" /><img src=\"%s\" alt=\"%s\" class=\"collapsed-side-bar-logo\" />', $sidebar_image, $sidebar_text, $collapsed_sidebar_image, $sidebar_text);
126
+
127
+ if ($sidebar_url) {
128
+ $logo = sprintf('<a href=\"%s\" target=\"_blank\" title=\"%s\">%s</a>', $sidebar_url, $sidebar_text, $logo);
129
+ }
130
+ wlcms_set_css('.collapsed-side-bar-logo', array('display' => 'none', 'padding' => '5px', 'max-width' => '36px'));
131
+ wlcms_set_css('.folded .collapsed-side-bar-logo', array('display' => 'block', 'margin' => '0 auto', 'max-width' => '25px'));
132
+
133
+ wlcms_set_css('.large-side-bar-logo', array('display' => 'block', 'max-width' => '150px', 'margin' => '0 auto', 'padding' => '5px'));
134
+ wlcms_set_css('.folded .large-side-bar-logo', array('display' => 'none'));
135
+
136
+ wlcms_add_js(sprintf('jQuery("#adminmenuwrap").prepend("<span class=\"wlcms-logo\">%s</span>");', $logo));
137
+
138
+ wlcms()->Admin_Script()->additional_css('
139
+ @media only screen and (max-width: 960px) {
140
+ .wlcms-logo .large-side-bar-logo{
141
+ display:none;
142
+ }
143
+ .wlcms-logo .collapsed-side-bar-logo{
144
+ display:block;
145
+ }
146
+ }');
147
+ }
148
+
149
+ public function admin_bar_howdy_text($wp_admin_bar)
150
+ {
151
+
152
+ $user = wp_get_current_user();
153
+ $user_id = $user->ID;
154
+
155
+ if (0 == $user_id) return;
156
+
157
+ $profile_url = get_edit_profile_url($user_id);
158
+ $admin_bar_howdy_text = $this->get_settings('admin_bar_howdy_text');
159
+
160
+
161
+ if (!$admin_bar_howdy_text) return;
162
+
163
+
164
+ $avatar = get_avatar($user_id, 28);
165
+ $howdy = sprintf(__('%1s %2$s'), $admin_bar_howdy_text, $user->display_name);
166
+ $class = empty($avatar) ? '' : 'with-avatar';
167
+
168
+ $wp_admin_bar->add_menu(
169
+ array(
170
+ 'id' => 'my-account',
171
+ 'parent' => 'top-secondary',
172
+ 'title' => $howdy . $avatar,
173
+ 'href' => $profile_url,
174
+ 'meta' => array(
175
+ 'class' => $class
176
+ )
177
+ )
178
+ );
179
+
180
+ }
181
+
182
+ /**
183
+ * Use custom footer
184
+ *
185
+ * @return mixed
186
+ */
187
+ public function admin_footer($original_text)
188
+ {
189
+
190
+ $footer_html = $this->get_settings('footer_html');
191
+ $footer_url = $this->get_settings('footer_url');
192
+ $footer_text = $this->get_settings('footer_text');
193
+ $footer_image = $this->get_settings('footer_image');
194
+ $developer_name = $this->get_settings('developer_name');
195
+
196
+ if ($footer_html) {
197
+ return $footer_html;
198
+
199
+ }
200
+
201
+ $footer_main_text = "";
202
+
203
+ if ($footer_image) {
204
+ $footer_main_text .= '<img src="' . $footer_image . '" /> ';
205
+ wlcms_set_css('#footer-left img', array('vertical-align' => 'middle', 'max-height' => '50px', 'margin-right' => '5px'));
206
+ wlcms_set_css('#footer-left a', array('text-decoration' => 'none'));
207
+ }
208
+
209
+ if ($footer_text) {
210
+ $footer_main_text .= $footer_text;
211
+ }
212
+
213
+ if (empty($footer_main_text)) {
214
+ return $original_text;
215
+ }
216
+
217
+ if (!$footer_url) {
218
+ return $footer_main_text;
219
+ }
220
+
221
+ $footer_html = '<a href="' . esc_url($footer_url) . '" title="' . $developer_name . '" target="_blank">' . $footer_main_text . '</a>';
222
+
223
+ return $footer_html;
224
+ }
225
+ }
includes/classes/I18n.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Define the internationalization functionality
5
+ *
6
+ * Loads and defines the internationalization files for this plugin
7
+ * so that it is ready for translation.
8
+ */
9
+
10
+ class WLCMS_I18n
11
+ {
12
+ public function load_textdomain()
13
+ {
14
+ load_plugin_textdomain(
15
+ 'wlcms',
16
+ false,
17
+ WLCMS_DIR . '/languages/'
18
+ );
19
+ }
20
+ }
includes/classes/Loader.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WLCMS_Loader
4
+ {
5
+ const CLASS_DIR = 'includes/classes/';
6
+ const VIEW_DIR = 'view/';
7
+
8
+ private $admin_core_class;
9
+ private $wizard_class;
10
+ private $admin_menus_class;
11
+ private $settings_class;
12
+ private $login_class;
13
+ private $branding_class;
14
+ private $admin_script_class;
15
+ private $admin_dashboard_class;
16
+ private $admin_settings_class;
17
+ private $upgrade_class;
18
+
19
+ private $admin_url;
20
+
21
+
22
+ private static $_instance; //The single instance
23
+
24
+
25
+ function __construct()
26
+ {
27
+ $this->loadClasses();
28
+ }
29
+
30
+ public static function getInstance()
31
+ {
32
+ if (!self::$_instance) { // If no instance then make one
33
+ self::$_instance = new self();
34
+ }
35
+
36
+ return self::$_instance;
37
+ }
38
+
39
+ private function loadClasses()
40
+ {
41
+ $this->require_class('Messages');
42
+ $this->require_class('Previewable');
43
+
44
+ $this->require_class('Admin_Core');
45
+ $this->admin_core_class = new WLCMS_Admin_Core();
46
+
47
+ $this->require_class('Wizard');
48
+ $this->wizard_class = new WLCMS_Wizard();
49
+
50
+ $this->require_class('Admin_Script');
51
+ $this->admin_script_class = new WLCMS_Admin_Script();
52
+
53
+ $this->require_class('Settings');
54
+ $this->settings_class = new WLCMS_Settings();
55
+
56
+ $this->require_class('Upgrade');
57
+ $this->upgrade_class = new WLCMS_Upgrades();
58
+
59
+ $this->require_class('Admin_Menus');
60
+ $this->admin_menus_class = new WLCMS_Admin_Menus();
61
+
62
+ $this->require_class('Login');
63
+ $this->login_class = new WLCMS_Login();
64
+
65
+ $this->require_class('Branding');
66
+ $this->branding_class = new WLCMS_Branding();
67
+
68
+ $this->require_class('Admin_Dashboard');
69
+ $this->admin_dashboard_class = new WLCMS_Admin_Dashboard();
70
+
71
+ $this->require_class('Admin_Settings');
72
+ $this->admin_settings_class = new WLCMS_Admin_Settings();
73
+
74
+ }
75
+
76
+ public function Admin_Core()
77
+ {
78
+ return $this->admin_core_class;
79
+ }
80
+
81
+ public function Wizard()
82
+ {
83
+ return $this->wizard_class;
84
+ }
85
+
86
+ public function Settings()
87
+ {
88
+ return $this->settings_class;
89
+ }
90
+
91
+ public function Upgrade()
92
+ {
93
+ return $this->upgrade_class;
94
+ }
95
+
96
+ public function Admin_Dashboard()
97
+ {
98
+ return $this->admin_dashboard_class;
99
+ }
100
+
101
+ public function Admin_Menus()
102
+ {
103
+ return $this->admin_menus_class;
104
+ }
105
+
106
+ public function Login()
107
+ {
108
+ return $this->login_class;
109
+ }
110
+
111
+ public function Branding()
112
+ {
113
+ return $this->branding_class;
114
+ }
115
+
116
+ public function Admin_Script()
117
+ {
118
+ return $this->admin_script_class;
119
+ }
120
+
121
+ public function Admin_Settings()
122
+ {
123
+ return $this->admin_settings_class;
124
+ }
125
+
126
+ public function require_class($file = "")
127
+ {
128
+ return $this->required(self::CLASS_DIR . $file);
129
+ }
130
+
131
+ public function admin_url($view = 'settings')
132
+ {
133
+ return admin_url('options-general.php?page=wlcms-plugin.php&view=' . $view);
134
+ }
135
+
136
+ public function required($file = "")
137
+ {
138
+ $dir = WLCMS_DIR;
139
+
140
+ if (empty($dir) || !is_dir($dir)) {
141
+ return false;
142
+ }
143
+
144
+ $file = path_join($dir, $file . '.php');
145
+
146
+ if (!file_exists($file)) {
147
+ return false;
148
+ }
149
+
150
+ require_once $file;
151
+ }
152
+
153
+ public function get_view($file = "")
154
+ {
155
+ $this->required(self::VIEW_DIR . $file);
156
+ }
157
+
158
+ public function admin_view($file = "")
159
+ {
160
+ $this->get_view('admin/' . $file);
161
+ }
162
+
163
+ public function get_active_view()
164
+ {
165
+ $default = 'settings';
166
+
167
+ if (!isset($_GET['view'])) {
168
+ return $default;
169
+ }
170
+
171
+ $available = array('wizard', 'settings');
172
+ $view = wp_filter_kses($_GET['view']);
173
+
174
+ return (in_array($view, $available)) ? $view : $default;
175
+
176
+ }
177
+ }
includes/classes/Login.php ADDED
@@ -0,0 +1,320 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WLCMS_Login extends WLCMS_Previewable
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ //Check and set if it is a preview
9
+ $this->check_preview();
10
+
11
+ add_action('login_footer', array($this, 'scripts'), 1000);
12
+
13
+ add_action('wlcms_before_save_preview', array($this, 'save_preview_login'), 10, 2);
14
+ add_action('wlcms_save_addtional_settings', array($this, 'save_preview_login'), 10, 2);
15
+
16
+ // Save the preview settings
17
+ add_action('wp_ajax_wlcms_save_login_preview_settings', array($this, 'store_preview'));
18
+
19
+ add_filter('wlcms_setting_fields', array($this, 'setting_fields'), 11, 1);
20
+ }
21
+
22
+ public function save_preview_login($setting, $placeholder)
23
+ {
24
+ // ignore if it has width or height request
25
+ if (isset($_REQUEST['logo_width']) || isset($_REQUEST['logo_height']))
26
+ return;
27
+
28
+ $logo = $setting->get($placeholder . 'login_logo');
29
+
30
+ if ($logo) {
31
+ $imagesize = @getimagesize($logo);
32
+ if ($imagesize) {
33
+ list($width, $height) = $imagesize;
34
+ $setting->set($placeholder . 'logo_width', $width);
35
+ $setting->set($placeholder . 'logo_height', $height);
36
+ }
37
+ }
38
+
39
+ return $setting;
40
+ }
41
+
42
+ public function scripts()
43
+ {
44
+
45
+ wp_print_scripts(array('jquery'));
46
+
47
+ echo '<script>';
48
+ echo 'jQuery(document).ready(function(){';
49
+ echo $this->get_js();
50
+ echo '});';
51
+ echo '</script>';
52
+ echo '<style type="text/css">';
53
+ echo $this->set_custom_css();
54
+ echo $this->set_background_css();
55
+ echo $this->set_logo_css();
56
+ echo $this->set_form_css();
57
+ echo $this->set_links_css();
58
+ echo '</style>';
59
+ }
60
+
61
+ private function get_js()
62
+ {
63
+ $js = 'jQuery("#login").wrap("<div id=\'wlcms-login-wrapper\'></div>");';
64
+ if ($this->get_settings('login_logo')) {
65
+ $js .= ';jQuery(\'#login h1 a\').attr(\'title\',\'' . get_bloginfo('name') . '\');jQuery(\'#login h1 a\').attr(\'href\',\'' . get_bloginfo('url') . '\');';
66
+ }
67
+ return $js;
68
+ }
69
+
70
+ private function set_logo_css()
71
+ {
72
+ $logo_css = '#login h1 a, .login h1 a { ';
73
+ if ($login_logo = $this->get_settings('login_logo')) {
74
+ $logo_css .= 'background-image: url(' . $login_logo . ');';
75
+ }
76
+
77
+ $has_width = false;
78
+ if ($logo_width = $this->get_settings('logo_width')) {
79
+ $logo_css .= 'width:' . wlcms_css_metrics($logo_width) . ';';
80
+ $has_width = true;
81
+ } else {
82
+ $logo_css .= 'width:auto!important;';
83
+ }
84
+
85
+ // Add logo max-width same width with the form
86
+ $logo_css .= 'max-width:100%;';
87
+
88
+ $has_height = false;
89
+ if ($logo_height = $this->get_settings('logo_height')) {
90
+ $has_height = true;
91
+ $logo_css .= 'height:' . wlcms_css_metrics($logo_height) . ';';
92
+ }
93
+
94
+ //Add logo background size
95
+ $logo_css_background_size = 'background-size:contain;background-position-y: center;';
96
+ if ($has_height && $has_width) {
97
+ $logo_css_background_size = sprintf('background-size:%s %s;', wlcms_css_metrics($logo_width), wlcms_css_metrics($logo_height));
98
+ }
99
+ $logo_css .= $logo_css_background_size;
100
+
101
+ if ($logo_bottom_margin = $this->get_settings('logo_bottom_margin')) {
102
+ $logo_css .= 'margin-bottom: ' . $logo_bottom_margin . 'px!important;';
103
+ }
104
+
105
+ $logo_css .= '}'; // close #login h1 a, .login h1 a
106
+
107
+ if ($retina_login_logo = $this->get_settings('retina_login_logo')) {
108
+ $logo_css .= '@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
109
+ #login h1 a, .login h1 a { background-image: url(' . $retina_login_logo . ');}
110
+ }';
111
+
112
+ }
113
+
114
+ return $logo_css;
115
+ }
116
+
117
+ private function set_background_css()
118
+ {
119
+ $body_login = 'body.login{';
120
+
121
+ if ($this->get_settings('full_screen_background_image')) {
122
+ $body_login .= '-webkit-background-size: cover !important;';
123
+ $body_login .= '-moz-background-size: cover !important;';
124
+ $body_login .= '-o-background-size: cover !important;';
125
+ $body_login .= 'background-size: cover !important;';
126
+ }
127
+
128
+ if ($background_color = $this->get_settings('background_color')) {
129
+ $body_login .= 'background-color:' . $background_color . '!important;';
130
+ }
131
+
132
+ if ($background_image = $this->get_settings('background_image')) {
133
+ $body_login .= 'background-image: url(' . $background_image . ');';
134
+ }
135
+
136
+ if ($background_positions = $this->get_settings('background_positions')) {
137
+ $body_login .= 'background-position:' . $background_positions . ';';
138
+ }
139
+
140
+ if ($background_repeat = $this->get_settings('background_repeat')) {
141
+ $body_login .= 'background-repeat:' . $background_repeat . ';';
142
+ }
143
+
144
+ $body_login .= '}';
145
+
146
+ return $body_login;
147
+ }
148
+
149
+ private function set_form_css()
150
+ {
151
+ $form_css = '';
152
+
153
+ if ($form_label_color = $this->get_settings('form_label_color')) {
154
+ $form_css .= '#loginform label{ color:' . $form_label_color . '}';
155
+ }
156
+
157
+ if ($form_background_color = $this->get_settings('form_background_color')) {
158
+ $form_css .= '#loginform{ background-color:' . $form_background_color . '}';
159
+ }
160
+
161
+ /**
162
+ * Submit Button css
163
+ */
164
+ $form_button_text_color = $this->get_settings('form_button_text_color');
165
+ $form_button_color = $this->get_settings('form_button_color');
166
+
167
+ if ($form_button_text_color || $form_button_color) {
168
+ $form_css .= '#loginform input[type=submit],#loginform .submit input[type=button]{ ';
169
+ if ($form_button_text_color) {
170
+ $form_css .= 'color:' . $form_button_text_color . '!important;';
171
+ $form_css .= 'text-shadow: none;';
172
+ $form_css .= 'border-color: none;';
173
+ $form_css .= 'box-shadow: none;';
174
+ }
175
+
176
+ if ($form_button_color) {
177
+ $form_css .= 'background-color:' . $form_button_color . '!important; border: 0;box-shadow:none';
178
+ }
179
+
180
+ $form_css .= '}';
181
+ }
182
+
183
+ /**
184
+ * Submit Button Hover
185
+ */
186
+ $form_button_text_hover_color = $this->get_settings('form_button_text_hover_color');
187
+ $form_button_hover_color = $this->get_settings('form_button_hover_color');
188
+
189
+ if ($form_button_hover_color || $form_button_text_hover_color) {
190
+ $form_css .= '#loginform input[type=submit]:hover,#loginform .submit input[type=button]:hover{ ';
191
+ if ($form_button_text_hover_color) {
192
+ $form_css .= 'color:' . $form_button_text_hover_color . '!important;';
193
+ }
194
+
195
+ if ($form_button_hover_color) {
196
+ $form_css .= 'background-color:' . $form_button_hover_color . '!important;';
197
+ }
198
+
199
+ $form_css .= '}';
200
+ }
201
+
202
+ return $form_css;
203
+ }
204
+
205
+ private function set_links_css()
206
+ {
207
+ $form_css = '';
208
+ if ($this->get_settings('hide_register_lost_password')) {
209
+ $form_css .= 'p#nav{display:none;}';
210
+ }
211
+
212
+ if ($this->get_settings('hide_back_to_link')) {
213
+ $form_css .= 'p#backtoblog{display:none;}';
214
+ }
215
+
216
+ if ($back_to_register_link_color = $this->get_settings('back_to_register_link_color')) {
217
+ $form_css .= 'p#backtoblog a, p#nav a{color:' . $back_to_register_link_color . '!important;}';
218
+ }
219
+
220
+ if ($back_to_register_link_hover_color = $this->get_settings('back_to_register_link_hover_color')) {
221
+ $form_css .= 'p#backtoblog a:hover, p#nav a:hover{color:' . $back_to_register_link_hover_color . '!important;}';
222
+ }
223
+
224
+ if ($privacy_policy_link_color = $this->get_settings('privacy_policy_link_color')) {
225
+ $form_css .= 'a.privacy-policy-link{color:' . $privacy_policy_link_color . '!important;text-decoration:none}';
226
+ }
227
+
228
+ if ($privacy_policy_link_hover_color = $this->get_settings('privacy_policy_link_hover_color')) {
229
+ $form_css .= 'a.privacy-policy-link:hover{color:' . $privacy_policy_link_hover_color . '!important;}';
230
+ }
231
+
232
+ return $form_css;
233
+ }
234
+
235
+ private function set_custom_css()
236
+ {
237
+ return $this->get_settings('login_custom_css');
238
+ }
239
+
240
+ public function settings()
241
+ {
242
+ if ($this->saving_preview_section() == 'wizard') {
243
+ return $this->wizard_settings();
244
+ }
245
+
246
+ return $this->complete_settings();
247
+ }
248
+
249
+ /**
250
+ * Settings to be stored in preview mode
251
+ *
252
+ * @return array
253
+ */
254
+ private function wizard_settings()
255
+ {
256
+ $settings = array(
257
+ 'login_logo' => '',
258
+ 'add_retina_logo' => false,
259
+ 'retina_login_logo' => '',
260
+ );
261
+
262
+ return $settings;
263
+ }
264
+
265
+ /**
266
+ * Settings to be included to the overall setting
267
+ * it includes fields from preview mode
268
+ * @return void
269
+ */
270
+ public function complete_settings()
271
+ {
272
+
273
+ $settings = array(
274
+ 'logo_bottom_margin' => 0,
275
+ 'logo_width' => false,
276
+ 'logo_height' => false,
277
+ 'background_color' => '#ffffff',
278
+ 'background_image' => '',
279
+ 'full_screen_background_image' => false,
280
+ 'background_positions' => 'center center',
281
+ 'background_repeat' => 'no-repeat',
282
+ 'hide_register_lost_password' => false,
283
+ 'hide_back_to_link' => false,
284
+ 'form_background_color' => '',
285
+ 'form_label_color' => '',
286
+ 'form_button_color' => '',
287
+ 'form_button_text_color' => '',
288
+ 'form_button_hover_color' => '',
289
+ 'form_button_text_hover_color' => '',
290
+ 'back_to_register_link_color' => '',
291
+ 'back_to_register_link_hover_color' => '',
292
+ 'privacy_policy_link_color' => '',
293
+ 'privacy_policy_link_hover_color' => '',
294
+ 'login_custom_css' => ''
295
+ );
296
+
297
+ return array_merge($settings, $this->wizard_settings());
298
+ }
299
+
300
+ public function saving_preview_section()
301
+ {
302
+ $sections = array('wizard', 'settings');
303
+
304
+ if (!isset($_REQUEST['form_section'])) {
305
+ return;
306
+ }
307
+
308
+ if (!in_array($_REQUEST['form_section'], $sections)) {
309
+ return;
310
+ }
311
+
312
+ return wp_filter_kses($_REQUEST['form_section']);
313
+ }
314
+
315
+ public function setting_fields($settings)
316
+ {
317
+ return array_merge($settings, $this->complete_settings());
318
+ }
319
+
320
+ }
includes/classes/Messages.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WLCMS_Messages
4
+ {
5
+ public static function queue($message, $class = '')
6
+ {
7
+ $default_allowed_classes = array('error', 'warning', 'success', 'info');
8
+ $allowed_classes = apply_filters('wlcms_messages_allowed_classes', $default_allowed_classes);
9
+ $default_class = apply_filters('wlcms_messages_default_class', 'success');
10
+
11
+ if (!in_array($class, $allowed_classes)) {
12
+ $class = $default_class;
13
+ }
14
+
15
+ $messages = maybe_unserialize(get_option('_wlcms_messages', array()));
16
+ $messages[$class][] = $message;
17
+
18
+ update_option('_wlcms_messages', $messages);
19
+ }
20
+
21
+ public static function show()
22
+ {
23
+ $group_messages = maybe_unserialize(get_option('_wlcms_messages'));
24
+ if (!$group_messages) {
25
+ return;
26
+ }
27
+
28
+ $errors = "";
29
+ if (is_array($group_messages)) {
30
+
31
+ foreach ($group_messages as $class => $messages) {
32
+ $errors .= '<div class="notice notice-' . $class . ' is-dismissible"">';
33
+ foreach ($messages as $message) {
34
+ $errors .= '<p>' . $message . '</p>';
35
+
36
+ }
37
+ $errors .= '</div>';
38
+ }
39
+ }
40
+
41
+ delete_option('_wlcms_messages');
42
+
43
+ echo $errors;
44
+ }
45
+ }
46
+
47
+ if (class_exists('WLCMS_Messages') && !function_exists('WLCMS_Queue')) {
48
+ function WLCMS_Queue($message, $class = null)
49
+ {
50
+ WLCMS_Messages::queue($message, $class);
51
+ }
52
+ }
53
+
54
+ add_action('admin_notices', array('WLCMS_Messages', 'show'));
includes/classes/Previewable.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WLCMS_Previewable
4
+ {
5
+
6
+ public $is_preview = false;
7
+ public $preview_setting_key_placeholder = '_';
8
+ public $preview_section;
9
+
10
+ public function check_preview()
11
+ {
12
+ if (!isset($_GET['wlcms-action'])) {
13
+ return;
14
+ }
15
+
16
+ if ($_GET['wlcms-action'] != 'preview') {
17
+ return;
18
+ }
19
+
20
+ $this->is_preview = true;
21
+ $this->preview_section = isset($_GET['preview_section']) ? wp_filter_kses($_GET['preview_section']) : '';
22
+
23
+ }
24
+
25
+ public function place_holder()
26
+ {
27
+ return ($this->is_preview) ? $this->preview_setting_key_placeholder : '';
28
+ }
29
+
30
+ public function get_placeholder_key()
31
+ {
32
+ return $this->preview_setting_key_placeholder;
33
+ }
34
+
35
+ public function store_preview()
36
+ {
37
+
38
+ check_ajax_referer('wlcms_ajax_nonce');
39
+
40
+ $settings = wlcms()->Settings();
41
+
42
+ foreach ($this->settings() as $key => $default) {
43
+ $setting_value = (isset($_POST[$key])) ? wlcms_kses($_POST[$key]) : $default;
44
+ $settings->set($this->preview_setting_key_placeholder . $key, $setting_value);
45
+ }
46
+
47
+ do_action('wlcms_before_save_preview', $settings, $this->preview_setting_key_placeholder);
48
+
49
+ $settings->save();
50
+ exit;
51
+ }
52
+
53
+ public function preview_section()
54
+ {
55
+ return $this->preview_section;
56
+ }
57
+
58
+ public function get_settings($key)
59
+ {
60
+ // Prepend "_" placeholder if in preview mode to get the preview login settings
61
+ if ($this->is_preview) {
62
+ $key = $this->preview_setting_key_placeholder . $key;
63
+ }
64
+
65
+ return wlcms_field_setting($key);
66
+ }
67
+ }
includes/classes/Settings.php ADDED
@@ -0,0 +1,384 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WLCMS_Settings
4
+ {
5
+ private $settings;
6
+
7
+ function __construct()
8
+ {
9
+ $this->init_settings();
10
+ add_filter('wp_kses_allowed_html', array($this, 'kses_allowed_html'), 10, 2);
11
+ add_action('init', array($this, 'init'));
12
+ add_action('wlcms_after_body', array($this, 'add_import_html'));
13
+ }
14
+
15
+ public function init()
16
+ {
17
+
18
+ // check or initiate import
19
+ $this->import();
20
+
21
+ if (!isset($_GET['wlcms-action'])) {
22
+ return;
23
+ }
24
+
25
+ // check or initiate reset
26
+ $this->reset_plugin();
27
+
28
+ // check or initiate export
29
+ $this->export();
30
+
31
+ }
32
+
33
+ public function kses_allowed_html($tags, $context)
34
+ {
35
+
36
+ if ('post' === $context) {
37
+
38
+ $tags['iframe'] = array(
39
+ 'align' => true,
40
+ 'width' => true,
41
+ 'height' => true,
42
+ 'frameborder' => true,
43
+ 'name' => true,
44
+ 'src' => true,
45
+ 'id' => true,
46
+ 'class' => true,
47
+ 'style' => true,
48
+ 'scrolling' => true,
49
+ 'marginwidth' => true,
50
+ 'marginheight' => true,
51
+ 'allowfullscreen' => true,
52
+ 'mozallowfullscreen' => true,
53
+ 'webkitallowfullscreen' => true,
54
+ );
55
+
56
+ $tags['embed'] = array(
57
+ 'src' => true,
58
+ 'height' => true,
59
+ 'width' => true,
60
+ 'style' => true,
61
+ 'type' => true,
62
+ );
63
+ }
64
+
65
+ return $tags;
66
+ }
67
+
68
+ public function get($key = "", $default = false)
69
+ {
70
+ if (!isset($this->settings[$key])) {
71
+ return $default;
72
+ }
73
+
74
+ $value = wlcms_removeslashes($this->settings[$key]);
75
+ if (empty($value) || is_null($value)) {
76
+ return false;
77
+ }
78
+
79
+ if (is_array($value) && count($value) == 0) {
80
+ return false;
81
+ }
82
+
83
+ return $value;
84
+ }
85
+
86
+ public function reset()
87
+ {
88
+ $this->settings = array();
89
+ }
90
+
91
+ public function setAll($value)
92
+ {
93
+ $this->settings = $value;
94
+ }
95
+
96
+ public function getAll()
97
+ {
98
+ return $this->settings;
99
+ }
100
+
101
+ public function set($key, $value)
102
+ {
103
+ $this->settings[$key] = $value;
104
+ }
105
+
106
+ public function remove($key)
107
+ {
108
+ if (isset($this->settings[$key])) {
109
+ unset($this->settings[$key]);
110
+ }
111
+ }
112
+
113
+ public function save()
114
+ {
115
+ update_option("wlcms_options", $this->settings);
116
+ }
117
+
118
+ public function store()
119
+ {
120
+ do_action('wlcms_before_saving', $this);
121
+ $this->reset();
122
+ $this->set('version', WLCMS_VERSION);
123
+
124
+ foreach ($this->keys() as $key) {
125
+ $setting_value = '';
126
+ if (isset($_POST[$key])) {
127
+ $setting_value = wlcms_kses($_POST[$key]);
128
+ }
129
+ $this->set($key, $setting_value);
130
+ }
131
+
132
+ $placeholder = ''; // use the same method used by preview wizard
133
+ do_action('wlcms_save_addtional_settings', $this, $placeholder);
134
+
135
+ $this->save();
136
+
137
+ do_action('wlcms_after_saving', $this);
138
+
139
+ WLCMS_Queue('Settings saved.');
140
+ wp_redirect(wlcms()->admin_url());
141
+ exit;
142
+ }
143
+
144
+ public function init_settings()
145
+ {
146
+ $settings = get_option("wlcms_options", false);
147
+
148
+ if (!$settings) {
149
+ $settings = $this->default_options();
150
+ }
151
+
152
+ $this->settings = $settings;
153
+ }
154
+
155
+ public function add_import_html()
156
+ {
157
+ wlcms()->admin_view('parts/import-settings');
158
+ }
159
+
160
+ public function import()
161
+ {
162
+ if (!isset($_POST['wlcms-settings_nonce'])) return;
163
+
164
+ if (!is_admin() && !current_user_can('manage_options')) {
165
+ return;
166
+ }
167
+
168
+ if (!isset($_POST['wlcms-settings']) && !isset($_FILES['import_file'])) {
169
+ return;
170
+ }
171
+
172
+ if (!isset($_FILES['import_file'])) {
173
+ return;
174
+ }
175
+
176
+ if ($_FILES['import_file']['size'] == 0 && $_FILES['import_file']['name'] == '') {
177
+ return;
178
+ }
179
+
180
+ // check nonce
181
+ if (!wp_verify_nonce($_POST['wlcms-settings_nonce'], 'wlcms-settings-action')) {
182
+
183
+ WLCMS_Queue('Sorry, your nonce did not verify.', 'error');
184
+ wp_redirect(wlcms()->admin_url());
185
+ exit;
186
+ }
187
+
188
+ $import_field = 'import_file';
189
+ $temp_file_raw = $_FILES[$import_field]['tmp_name'];
190
+ $temp_file = esc_attr($temp_file_raw);
191
+ $arr_file_type = $_FILES[$import_field];
192
+ $uploaded_file_type = $arr_file_type['type'];
193
+ $allowed_file_types = array('application/json');
194
+
195
+ //Check if legacy
196
+ $this->legacy_import($temp_file, $uploaded_file_type);
197
+
198
+ if (!in_array($uploaded_file_type, $allowed_file_types)) {
199
+ WLCMS_Queue('Upload a valid .json file.', 'error');
200
+ wp_redirect(wlcms()->admin_url());
201
+ exit;
202
+ }
203
+
204
+ $settings = (array)json_decode(
205
+ file_get_contents($temp_file),
206
+ true
207
+ );
208
+
209
+ unlink($temp_file);
210
+
211
+ if (!$settings) {
212
+
213
+ WLCMS_Queue('Nothing to import, please check your json file format.', 'error');
214
+ wp_redirect(wlcms()->admin_url());
215
+ exit;
216
+
217
+ }
218
+
219
+ $this->setAll($settings);
220
+ $this->save();
221
+
222
+ WLCMS_Queue('Your Import has been completed.');
223
+
224
+ wp_redirect(wlcms()->admin_url());
225
+ exit;
226
+ }
227
+
228
+ function legacy_import($temp_file, $uploaded_file_type)
229
+ {
230
+ global $wpdb;
231
+
232
+ if (!in_array($uploaded_file_type, array('text/plain'))) {
233
+ return false;
234
+ }
235
+
236
+ $import = file_get_contents($temp_file);
237
+ $import = preg_replace_callback('/s:([0-9]+):\"(.*?)\";/', 'vum_fix_json', $import);
238
+ $import = unserialize($import);
239
+
240
+ if (!is_array($import)) {
241
+ return false;
242
+ }
243
+
244
+
245
+ delete_option("wlcms_options");
246
+ $wpdb->get_results("DELETE FROM $wpdb->options WHERE option_name LIKE 'wlcms_o_%'");
247
+
248
+ $site_url = get_bloginfo('url');
249
+
250
+ foreach ($import as $name => $value) {
251
+
252
+ // If the value includes this shortcode, replace it.
253
+ $val = str_replace('{SITEURL}', $site_url, $value);
254
+
255
+ // Check that our option key starts with WLCMS
256
+ if (strpos($name, 'wlcms_o') === 0) {
257
+ update_option($name, $val);
258
+ } else {
259
+ wp_die(__('<strong>Error!</strong> During the import process we almost imported a non White Label CMS setting - please ensure you uploaded the correct file and try again.'));
260
+ }
261
+ }
262
+
263
+ WLCMS_Queue('Your Import has been completed.');
264
+ wp_redirect(wlcms()->admin_url());
265
+ exit;
266
+ }
267
+
268
+ public function export()
269
+ {
270
+ if (!isset($_GET['wlcms-action']) || (isset($_GET['wlcms-action']) && $_GET['wlcms-action'] != 'export')) {
271
+ return;
272
+ }
273
+
274
+ $settings = $this->getAll();
275
+
276
+ if (!is_array($settings)) {
277
+ $settings = array();
278
+ }
279
+
280
+ $settings = json_encode($settings);
281
+
282
+ header('Content-disposition: attachment; filename=wlcms-settings.json');
283
+ header('Content-type: application/json');
284
+ echo $settings;
285
+ exit;
286
+ }
287
+
288
+ public function reset_plugin()
289
+ {
290
+ global $wpdb;
291
+
292
+ if ($_GET['wlcms-action'] != 'reset') {
293
+ return;
294
+ }
295
+
296
+ delete_option("wlcms_options");
297
+ $wpdb->get_results("DELETE FROM $wpdb->options WHERE option_name LIKE 'wlcms_o_%'");
298
+
299
+ WLCMS_Queue('Settings reset.');
300
+ wp_redirect(wlcms()->admin_url());
301
+ exit;
302
+ }
303
+
304
+ public function keys()
305
+ {
306
+ return array_keys($this->default_options());
307
+ }
308
+
309
+ public function get_default_option($key)
310
+ {
311
+ $settings = $this->default_options();
312
+ return isset($settings[$key]) ? $settings[$key] : null;
313
+ }
314
+
315
+ public function default_options()
316
+ {
317
+
318
+ $settings = array(
319
+ 'developer_icon' => '',
320
+ 'use_developer_icon_footer' => 1,
321
+ 'developer_icon_footer_url' => '',
322
+ 'developer_side_menu_image' => '',
323
+ 'developer_icon_admin_bar' => false,
324
+ 'developer_branding_footer' => false,
325
+ 'use_developer_side_menu_image' => false,
326
+ 'hide_wordpress_logo_and_links' => false,
327
+ 'hide_wp_version' => false,
328
+ 'admin_bar_logo' => '',
329
+ 'admin_bar_logo_width' => 15,
330
+ 'admin_bar_alt_text' => '',
331
+ 'admin_bar_howdy_text' => '',
332
+ 'admin_bar_url' => '',
333
+ 'side_menu_image' => '',
334
+ 'collapsed_side_menu_image' => '',
335
+ 'side_menu_link_url' => '',
336
+ 'side_menu_alt_text' => '',
337
+ 'footer_image' => '',
338
+ 'footer_url' => '',
339
+ 'footer_html' => '',
340
+ 'dashboard_icon' => '',
341
+ 'dashboard_title' => 'Dashboard',
342
+ 'dashboard_role_stat' => false,
343
+ 'dashboard_widgets_visibility_roles' => array('administrator', 'editor', 'author', 'contributor', 'subscriber'),
344
+ 'hide_all_dashboard_panels' => false,
345
+ 'hide_at_a_glance' => false,
346
+ 'hide_activities' => false,
347
+ 'hide_recent_comments' => false,
348
+ 'hide_quick_press' => false,
349
+ 'hide_news_and_events' => false,
350
+ 'remove_empty_dash_panel' => false,
351
+ 'welcome_panel' => array(
352
+ array(
353
+ 'is_active' => false,
354
+ 'show_title' => false,
355
+ 'template_type' => 'html',
356
+ 'visible_to' => array('administrator', 'editor', 'author', 'contributor', 'subscriber'),
357
+ ), array(
358
+ 'is_active' => false,
359
+ 'show_title' => false,
360
+ 'template_type' => 'html',
361
+ 'visible_to' => array('administrator', 'editor', 'author', 'contributor', 'subscriber'),
362
+ )
363
+ ),
364
+ 'add_own_rss_panel' => false,
365
+ 'rss_feed_number_of_item' => 3,
366
+ 'show_post_content' => false,
367
+ 'rss_introduction' => '',
368
+ 'rss_logo' => '',
369
+ 'rss_title' => '',
370
+ 'wlcms_admin' => false,
371
+ 'admin_menus' => false,
372
+ 'enable_wlcms_admin' => false,
373
+ 'admin_bar_menus' => false,
374
+ 'hide_admin_bar_all' => false,
375
+ 'hide_help_box' => false,
376
+ 'hide_screen_options' => false,
377
+ 'hide_nag_messages' => false,
378
+ 'settings_custom_css_admin' => '',
379
+ 'settings_custom_css_url' => ''
380
+ );
381
+ return apply_filters('wlcms_setting_fields', $settings);
382
+
383
+ }
384
+ }
includes/classes/Upgrade.php ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WLCMS_Upgrades
4
+ {
5
+
6
+ private $menu_class;
7
+ private $legacy_menus = array();
8
+ private $legacy_submenus = array();
9
+ private $legacy_db_setting = array();
10
+ private $settings;
11
+
12
+ public function __construct()
13
+ {
14
+ add_action('admin_init', array($this, 'upgrader_process_complete'), 999999);
15
+ }
16
+
17
+ public function upgrader_process_complete()
18
+ {
19
+ global $wpdb;
20
+
21
+ $this->settings = wlcms()->Settings();
22
+
23
+ $legacy_version = get_option('wlcms_o_ver', false);
24
+
25
+ if (!$legacy_version) {
26
+ return;
27
+ }
28
+
29
+ $new_wlcms_options = get_option('wlcms_options', false);
30
+ if ($legacy_version && $new_wlcms_options) {
31
+ return;
32
+ }
33
+
34
+ $newdbsetting = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->options WHERE option_name = 'wlcms_options'");
35
+
36
+ if ($legacy_version && $newdbsetting) {
37
+ return;
38
+ }
39
+
40
+ $this->do_import();
41
+ }
42
+
43
+ public function do_import()
44
+ {
45
+ $this->get_settings();
46
+ $this->perform();
47
+ }
48
+
49
+ private function get_settings()
50
+ {
51
+ global $wpdb;
52
+
53
+ // Get all WLCMS vals from options table
54
+ $results = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE 'wlcms_o_%'");
55
+
56
+ // Are there any options to grab?
57
+ if (!$results) return;
58
+
59
+ // Loop through results and prep array.
60
+ foreach ($results as $result) :
61
+ if ($result->option_value == '') continue;
62
+
63
+ $this->legacy_db_setting[$result->option_name] = $result->option_value;
64
+ endforeach;
65
+ }
66
+
67
+ public function upgrade_reset()
68
+ {
69
+ $this->settings = wlcms()->Settings();
70
+ }
71
+
72
+ private function perform()
73
+ {
74
+ $admin_bar_menu = array();
75
+
76
+ $this->upgrade_reset();
77
+
78
+ $this->settings->reset();
79
+ $this->settings->set('version', WLCMS_VERSION);
80
+
81
+ foreach ($this->legacy_mapping() as $key => $setting_key) {
82
+
83
+ if ($new_setting = $this->get_legacy_setting($setting_key)) {
84
+ if ($new_setting == 'true')
85
+ $new_setting = 1;
86
+
87
+ $this->settings->set($key, $new_setting);
88
+ }
89
+
90
+ }
91
+ $this->settings->set('legacy_menu', '1');
92
+
93
+ $this->menu_class = wlcms()->Admin_Menus();
94
+
95
+ //Post
96
+ $this->get_legacy_menu_settings('wlcms_o_hide_posts', 'edit.php');
97
+ if (!$this->get_legacy_setting('wlcms_o_hide_posts')) {
98
+ $admin_bar_menu[] = 'new-post';
99
+ }
100
+
101
+ //Media
102
+ $this->get_legacy_menu_settings('wlcms_o_hide_media', 'upload.php');
103
+ if (!$this->get_legacy_setting('wlcms_o_hide_media')) {
104
+ $admin_bar_menu[] = 'new-media';
105
+ }
106
+
107
+ //Pages
108
+ $this->get_legacy_menu_settings('wlcms_o_hide_pages', 'edit.php?post_type=page');
109
+ if (!$this->get_legacy_setting('wlcms_o_hide_pages')) {
110
+ $admin_bar_menu[] = 'new-page';
111
+ }
112
+
113
+ //Comments
114
+ $this->get_legacy_menu_settings('wlcms_o_hide_comments', 'edit-comments.php');
115
+ if (!$this->get_legacy_setting('wlcms_o_hide_comments')) {
116
+ $admin_bar_menu[] = 'comments';
117
+ }
118
+
119
+ //User
120
+ $this->get_legacy_menu_settings('wlcms_o_hide_profile', 'users.php');
121
+ if (!$this->get_legacy_setting('wlcms_o_hide_profile')) {
122
+ $admin_bar_menu[] = 'new-user';
123
+ }
124
+
125
+ //Tools
126
+ $this->get_legacy_menu_settings('wlcms_o_hide_tools', 'tools.php');
127
+
128
+ if (count($admin_bar_menu)) {
129
+ $this->settings->set('admin_bar_menus', $admin_bar_menu);
130
+ }
131
+
132
+ $this->hide_sidebar_menu('plugins.php');
133
+ $this->hide_sidebar_menu('options-general.php');
134
+
135
+ //Appearance
136
+ $this->get_legacy_appearance_menu_settings();
137
+ $this->settings->set('admin_menus', array('main' => $this->legacy_menus, 'sub' => $this->legacy_submenus));
138
+
139
+ //Set Admin users to be wlcms admin
140
+ $adminusers = get_users('role=administrator');
141
+
142
+ if (count($adminusers)) :
143
+
144
+ $wlcms_admin = array();
145
+ foreach ($adminusers as $user) :
146
+ $wlcms_admin[] = $user->user_email;
147
+ endforeach;
148
+
149
+ $this->settings->set('wlcms_admin', $wlcms_admin);
150
+
151
+ endif;
152
+
153
+ //Welcome Dashboard
154
+ $welcome = array();
155
+ if ($this->get_legacy_setting('wlcms_o_show_welcome')) {
156
+ $welcome[] = array(
157
+ 'is_active' => true,
158
+ 'template_type' => 'html',
159
+ 'show_title' => true,
160
+ 'is_fullwidth' => false,
161
+ 'visible_to' => $this->get_legacy_roles($this->get_legacy_setting('wlcms_o_welcome_visible_to')),
162
+ 'title' => $this->get_legacy_setting('wlcms_o_welcome_title'),
163
+ 'description' => $this->get_legacy_setting('wlcms_o_welcome_text'),
164
+
165
+ );
166
+ }
167
+
168
+ //Second Panel
169
+ if ($this->get_legacy_setting('wlcms_o_welcome_text1')) {
170
+ $welcome[] = array(
171
+ 'is_active' => true,
172
+ 'template_type' => 'html',
173
+ 'show_title' => true,
174
+ 'is_fullwidth' => false,
175
+ 'visible_to' => $this->get_legacy_roles($this->get_legacy_setting('wlcms_o_welcome_visible_to1')),
176
+ 'title' => $this->get_legacy_setting('wlcms_o_welcome_title1'),
177
+ 'description' => $this->get_legacy_setting('wlcms_o_welcome_text1'),
178
+ );
179
+ }
180
+
181
+ $this->settings->set('welcome_panel', $welcome);
182
+
183
+ if ($this->get_legacy_setting('wlcms_o_login_custom_logo')) {
184
+ $this->settings->set('logo_width', false);
185
+ $this->settings->set('logo_height', false);
186
+ }
187
+
188
+ if ($this->get_legacy_setting('wlcms_o_loginbg_white')) {
189
+ $this->settings->set('background_color', '#FFF');
190
+ }
191
+
192
+ //Delete all legacy options
193
+ $this->delete_legacy_settings();
194
+
195
+ //Save new settings
196
+ $this->settings->save();
197
+
198
+ $redirect_url = admin_url();
199
+ if (current_user_can('manage_options')) {
200
+ $redirect_url = wlcms()->admin_url();
201
+ }
202
+
203
+ wp_redirect($redirect_url);
204
+ exit;
205
+ }
206
+
207
+ private function get_legacy_setting($key)
208
+ {
209
+ return isset($this->legacy_db_setting[$key]) ? $this->legacy_db_setting[$key] : false;
210
+ }
211
+
212
+ private function get_legacy_appearance_menu_settings()
213
+ {
214
+ $menus = array();
215
+ $new_sub_menus = array();
216
+ $get_submenu_placeholder = $this->menu_class->get_submenu_placeholder();
217
+ $url = 'themes.php';
218
+ $count_sub_menus = 0;
219
+
220
+ /*
221
+ 'wlcms_o_hide_links', //////
222
+ 'wlcms_o_subtemplate_hide_16', = Hide Header
223
+ 'wlcms_o_subtemplate_hide_15', = Hide Header
224
+ 'wlcms_o_subtemplate_hide_10', = Hide Menus
225
+ 'wlcms_o_subtemplate_hide_7', = Hide Widgets
226
+ 'wlcms_o_subtemplate_hide_6', = Hide Customize
227
+ 'wlcms_o_subtemplate_hide_5', = Hide Themes
228
+ */
229
+
230
+ $theme_subs = array(
231
+ 'wlcms_o_subtemplate_hide_16' => 'custom-header',
232
+ 'wlcms_o_subtemplate_hide_15' => 'customize-php038autofocus%5bcontrol%5dheader_image',
233
+ 'wlcms_o_subtemplate_hide_10' => 'nav-menus-php',
234
+ 'wlcms_o_subtemplate_hide_7' => 'widgets-php',
235
+ 'wlcms_o_subtemplate_hide_6' => 'customize-php',
236
+ 'wlcms_o_subtemplate_hide_5' => 'themes-php'
237
+ );
238
+
239
+ if ($this->get_legacy_setting('wlcms_o_editor_template_access') == 0) {
240
+ $theme_subs['wlcms_o_subtemplate_hide_theme-php'] = 'themes-php';
241
+
242
+ foreach ($theme_subs as $theme_sub_key => $theme_sub) {
243
+ $this->legacy_submenus[] = $url . $get_submenu_placeholder . $theme_sub;
244
+ $count_sub_menus++;
245
+ }
246
+
247
+ $this->legacy_menus[] = $url;
248
+
249
+ return;
250
+ }
251
+
252
+ if ($this->get_legacy_setting('wlcms_o_editor_template_access') == 1) {
253
+
254
+ $submenus = $this->menu_class->get_new_submenus($url);
255
+
256
+ if ($submenus) {
257
+
258
+ $count_sub_menus = 0;
259
+
260
+ foreach ($theme_subs as $theme_sub_key => $theme_sub) {
261
+ if ($this->get_legacy_setting($theme_sub_key)) {
262
+ $this->legacy_submenus[] = $url . $get_submenu_placeholder . $theme_sub;
263
+ $count_sub_menus++;
264
+ }
265
+ }
266
+
267
+ if ($count_sub_menus == count($submenus['submenus'])) {
268
+ $this->legacy_menus[] = $url;
269
+ }
270
+ }
271
+ }
272
+ }
273
+
274
+ private function get_legacy_menu_settings($option = "", $url = "")
275
+ {
276
+ if (!$this->get_legacy_setting($option)) {
277
+ return;
278
+ }
279
+
280
+ $this->hide_sidebar_menu($url);
281
+ }
282
+
283
+ private function hide_sidebar_menu($url)
284
+ {
285
+
286
+ $this->legacy_menus[] = $url;
287
+
288
+ $submenus = $this->menu_class->get_new_submenus($url);
289
+
290
+ if (!$submenus) {
291
+ return;
292
+ }
293
+
294
+ foreach ($submenus['submenus'] as $submenu) {
295
+ $this->legacy_submenus[] = $submenu['slug'];
296
+ }
297
+ }
298
+
299
+ private function get_legacy_roles($key)
300
+ {
301
+ $roles = array('administrator', 'editor', 'author', 'contributor', 'subscriber');
302
+ $allowed_roles = array();
303
+ foreach ($roles as $role) {
304
+
305
+ $allowed_roles[] = $role;
306
+
307
+ if ($key == $role) {
308
+ break;
309
+ }
310
+ }
311
+
312
+ return $allowed_roles;
313
+ }
314
+
315
+ private function delete_legacy_settings()
316
+ {
317
+ global $wpdb;
318
+
319
+ delete_option('wlcms_o_ver');
320
+ $wpdb->get_results("DELETE FROM $wpdb->options WHERE option_name = 'wlcms_o_ver'");
321
+ }
322
+
323
+ private function legacy_settings()
324
+ {
325
+ return array_flip($this->legacy_mapping());
326
+ }
327
+
328
+ public function legacy_mapping()
329
+ {
330
+ return array(
331
+ 'developer_name' => 'wlcms_o_developer_name',
332
+ 'developer_url' => 'wlcms_o_developer_url',
333
+ 'developer_icon' => 'wlcms_o_adminbar_custom_logo',
334
+ 'admin_bar_alt_text' => 'wlcms_o_developer_name',
335
+ 'admin_bar_url' => 'wlcms_o_developer_url',
336
+ 'hide_wordpress_logo_and_links' => 'wlcms_o_hide_wp_adminbar',
337
+ 'hide_wp_version' => 'wlcms_o_hide_wpversion',
338
+ 'custom_page_title' => 'wlcms_o_admin_page_title',
339
+ 'admin_bar_logo' => 'wlcms_o_adminbar_custom_logo',
340
+ 'footer_image' => 'wlcms_o_footer_custom_logo',
341
+ 'footer_text' => 'wlcms_o_developer_name',
342
+ 'footer_url' => 'wlcms_o_developer_url',
343
+ 'login_logo' => 'wlcms_o_login_custom_logo',
344
+ 'retina_login_logo' => 'wlcms_o_login_custom_logo',
345
+ 'background_color' => 'wlcms_o_loginbg_white',
346
+ 'login_custom_css' => 'wlcms_o_login_bg_css',
347
+ 'dashboard_icon' => 'wlcms_o_header_custom_logo',
348
+ 'dashboard_title' => 'wlcms_o_dashboard_override',
349
+ 'hide_all_dashboard_panels' => 'wlcms_o_dashboard_others',
350
+ 'hide_at_a_glance' => 'wlcms_o_dashboard_remove_right_now',
351
+ 'hide_activities' => 'wlcms_o_dashboard_remove_activity_panel',
352
+ 'hide_recent_comments' => 'wlcms_o_dashboard_remove_recent_comments',
353
+ 'remove_empty_dash_panel' => 'wlcms_o_dashboard_border',
354
+ 'own_welcome_panel' => 'wlcms_o_show_welcome',
355
+ 'own_welcome_panel_visible_to' => 'wlcms_o_welcome_visible_to',
356
+ 'own_welcome_panel_title' => 'wlcms_o_welcome_title',
357
+ 'welcome_panel_description' => 'wlcms_o_welcome_text',
358
+ 'second_panel_title' => 'wlcms_o_welcome_title1',
359
+ 'second_panel_visible_to' => 'wlcms_o_welcome_visible_to1',
360
+ 'second_panel_description' => 'wlcms_o_welcome_text1',
361
+ 'add_own_rss_panel' => 'wlcms_o_show_rss_widget',
362
+ 'rss_feed_number_of_item' => 'wlcms_o_rss_num_items',
363
+ 'show_post_content' => 'wlcms_o_rss_show_intro',
364
+ 'rss_introduction' => 'wlcms_o_rss_intro_html',
365
+ 'rss_feed_address' => 'wlcms_o_rss_value',
366
+ 'rss_logo' => 'wlcms_o_rss_logo',
367
+ 'rss_title' => 'wlcms_o_rss_title',
368
+ 'hide_help_box' => 'wlcms_o_dashboard_remove_help_box',
369
+ 'hide_screen_options' => 'wlcms_o_dashboard_remove_screen_options',
370
+ 'hide_nag_messages' => 'wlcms_o_dashboard_remove_nag_update',
371
+ 'settings_custom_css_admin' => 'wlcms_o_custom_css',
372
+ 'settings_custom_css_url' => 'wlcms_o_welcome_stylesheet'
373
+ );
374
+ }
375
+ }
includes/classes/Wizard.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WLCMS_Wizard extends WLCMS_Previewable
4
+ {
5
+ public function __construct()
6
+ {
7
+ //Check and set if it is a preview
8
+ $this->check_preview();
9
+
10
+ add_filter('wlcms_setting_fields', array($this, 'setting_fields'), 10, 1);
11
+
12
+ // add_action('wlcms_before_saving', array($this, 'store'));
13
+ add_action('wp_ajax_wlcms_save_dashboard_preview_settings', array($this, 'store_preview'));
14
+ add_action('wlcms_save_addtional_settings', array($this, 'before_save'), 10, 2);
15
+ add_action('wlcms_before_save_preview', array($this, 'before_save'), 10, 2);
16
+
17
+ }
18
+
19
+ public function before_save($settings, $placeholder)
20
+ {
21
+ if (!isset($_POST['wlcms_wizzard'])) {
22
+ return $settings;
23
+ }
24
+ if (isset($_POST['wizard_developer_name'])) {
25
+ $developer_name = wlcms_kses($_POST['wizard_developer_name']);
26
+ $settings->set($placeholder . 'developer_name', $developer_name);
27
+ $settings->set($placeholder . 'admin_bar_alt_text', $developer_name);
28
+ $settings->set($placeholder . 'side_menu_alt_text', $developer_name);
29
+ $settings->set($placeholder . 'rss_title', $developer_name);
30
+ }
31
+
32
+ if (isset($_POST['wizard_developer_url'])) {
33
+ $developer_url = wlcms_kses($_POST['wizard_developer_url']);
34
+ $settings->set($placeholder . 'admin_bar_url', $developer_url);
35
+ $settings->set($placeholder . 'side_menu_link_url', $developer_url);
36
+ $settings->set($placeholder . 'footer_url', $developer_url);
37
+ }
38
+
39
+ if (isset($_POST['client_business_name'])) {
40
+ $custom_page_title = wlcms_kses($_POST['client_business_name']);
41
+ $settings->set($placeholder . 'custom_page_title', $custom_page_title);
42
+ $settings->set($placeholder . 'dashboard_title', $custom_page_title);
43
+ }
44
+
45
+ if (isset($_POST['rss_feed_address']) && !empty($_POST['rss_feed_address'])) {
46
+ $settings->set($placeholder . 'add_own_rss_panel', true);
47
+ }
48
+
49
+ $settings->set($placeholder . 'welcome_panel', array(
50
+ array(
51
+ 'is_active' => false,
52
+ 'show_title' => false,
53
+ 'template_type' => 'html',
54
+ 'visible_to' => array('administrator', 'editor', 'author', 'contributor', 'subscriber'),
55
+ ), array(
56
+ 'is_active' => false,
57
+ 'show_title' => false,
58
+ 'template_type' => 'html',
59
+ 'visible_to' => array('administrator', 'editor', 'author', 'contributor', 'subscriber'),
60
+ )
61
+ ));
62
+
63
+ return $settings;
64
+ }
65
+
66
+ public function settings()
67
+ {
68
+ $settings = $this->wizard_settings();
69
+ $wizard_settings = array(
70
+ 'version' => WLCMS_VERSION,
71
+ 'use_developer_side_menu_image' => false,
72
+ 'developer_icon_admin_bar' => false,
73
+ 'developer_branding_footer' => false,
74
+ 'hide_wordpress_logo_and_links' => true,
75
+ 'hide_at_a_glance' => true,
76
+ 'hide_activities' => true,
77
+ 'hide_recent_comments' => true,
78
+ 'hide_quick_press' => true,
79
+ 'hide_news_and_events' => true,
80
+ 'remove_empty_dash_panel' => true,
81
+ 'hide_wp_version' => true,
82
+ 'rss_title' => '&nbsp;'
83
+ );
84
+
85
+ return array_merge($wizard_settings, $settings);
86
+ }
87
+
88
+ public function wizard_settings()
89
+ {
90
+ return array(
91
+ 'developer_name' => '',
92
+ 'footer_text' => '',
93
+ 'rss_feed_address' => '',
94
+ 'custom_page_title' => '',
95
+ );
96
+ }
97
+
98
+ public function setting_fields($settings)
99
+ {
100
+ return array_merge($settings, $this->wizard_settings());
101
+ }
102
+ }
includes/classes/index.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ die('Access denied.');
4
+ }
includes/conditionals.php DELETED
@@ -1,143 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * CONDITIONAL ACTIONS
5
- */
6
-
7
-
8
- if(get_option('wlcms_o_footer_custom_logo'))
9
- {
10
- add_filter('admin_footer_text', 'wlcms_remove_footer_admin');
11
- }
12
- elseif(get_option('wlcms_o_developer_name'))
13
- {
14
- add_filter('admin_footer_text', 'wlcms_developer_link');
15
- }
16
-
17
- if (get_option('wlcms_o_dashboard_remove_right_now') == 1)
18
- {
19
- add_action('wp_dashboard_setup', 'wlcms_remove_right_now');
20
- }
21
-
22
- if (get_option('wlcms_o_dashboard_remove_activity_panel') == 1)
23
- {
24
- add_action('wp_dashboard_setup', 'wlcms_remove_activity_panel');
25
- }
26
-
27
- if (get_option('wlcms_o_dashboard_remove_recent_comments') == 1)
28
- {
29
- add_action('wp_dashboard_setup', 'wlcms_remove_recent_comments');
30
- }
31
-
32
- if (get_option('wlcms_o_dashboard_others') == 1)
33
- {
34
- add_action('wp_dashboard_setup', 'wlcms_remove_others');
35
- }
36
-
37
- if (get_option('wlcms_o_dashboard_remove_nag_update') == 1)
38
- {
39
- add_action( 'admin_init', 'wlcms_remove_update_nag');
40
- }
41
-
42
- if (get_option('wlcms_o_hide_admin_bar') == 1)
43
- {
44
- add_filter( 'show_admin_bar', '__return_false' );
45
- }
46
-
47
- if (get_option('wlcms_o_hide_wpversion') == 1)
48
- {
49
- add_filter( 'update_footer', 'remove_footer_version', 9999 );
50
- add_action( 'admin_head', 'wlcms_hide_wp_version');
51
- }
52
-
53
- function wlcms_remove_update_nag() {
54
- remove_action('admin_notices', 'update_nag', 3);
55
- remove_action('admin_notices', 'maintenance_nag', 10);
56
- }
57
-
58
- /*
59
- * ADDITIONAL HEADER CSS
60
- */
61
-
62
- function wlcms_custom_css()
63
- {
64
-
65
- $wlcms_header_css = '';
66
-
67
- if(get_option('wlcms_o_custom_css')!="")
68
- {
69
- $wlcms_header_css .= wp_specialchars_decode( stripslashes( get_option('wlcms_o_custom_css') ), 1, 0, 1 );
70
- }
71
-
72
- if (get_option('wlcms_o_dashboard_remove_help_box') == 1)
73
- {
74
- $wlcms_header_css .= '#contextual-help-link-wrap { display: none; }';
75
- $wlcms_header_css .= '#contextual-help-link { display: none; }';
76
- }
77
-
78
- if (get_option('wlcms_o_post_meta_box_slug'))
79
- {
80
- $wlcms_header_css .= '#slugdiv, #edit-slug-box { display: none; } ';
81
- }
82
-
83
- if (get_option('wlcms_o_dashboard_remove_screen_options') == 1)
84
- {
85
- $wlcms_header_css .= '#screen-options-link-wrap { display: none; }';
86
- }
87
-
88
- if (!current_user_can('activate_plugins'))
89
- {
90
- if (get_option('wlcms_o_hide_admin_bar_option') == 1)
91
- {
92
- $wlcms_header_css .= '.show-admin-bar { display: none; }';
93
- }
94
-
95
- if (get_option('wlcms_o_inherit_hide_menus') == 1)
96
- {
97
- if (get_option('wlcms_o_hide_posts'))
98
- {
99
- $wlcms_header_css .= '#wp-admin-bar-new-post { display: none; }';
100
- }
101
- if (get_option('wlcms_o_hide_pages'))
102
- {
103
- $wlcms_header_css .= '#wp-admin-bar-new-page { display: none; }';
104
- }
105
- if (get_option('wlcms_o_hide_media'))
106
- {
107
- $wlcms_header_css .= '#wp-admin-bar-new-media { display: none; }';
108
- }
109
- if (get_option('wlcms_o_hide_links'))
110
- {
111
- $wlcms_header_css .= '#wp-admin-bar-new-link { display: none; }';
112
- }
113
- if (get_option('wlcms_o_hide_comments'))
114
- {
115
- $wlcms_header_css .= '#wp-admin-bar-comments { display: none; }';
116
- }
117
- if (!get_option('wlcms_o_show_widgets'))
118
- {
119
- $wlcms_header_css .= '#wp-admin-bar-widgets { display: none; }';
120
- }
121
- if (!get_option('wlcms_o_show_appearance'))
122
- {
123
- $wlcms_header_css .='#wp-admin-bar-menus { display: none; }';
124
- }
125
- if (!get_option('wlcms_o_show_background'))
126
- {
127
- $wlcms_header_css .= '#wp-admin-bar-background { display: none; }';
128
- }
129
- if (!get_option('wlcms_o_show_header'))
130
- {
131
- $wlcms_header_css .= '#wp-admin-bar-header { display: none; }';
132
- }
133
- }
134
- }
135
-
136
-
137
- echo '<style type="text/css">';
138
- echo $wlcms_header_css;
139
- echo '</style>';
140
- }
141
-
142
-
143
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/index.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ die('Access denied.');
4
+ }
includes/plugin_deactivate.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
-
3
- function wlcms_plugin_deactivate()
4
- {
5
-
6
- include('admin.config.php');
7
- // Delete all the options that are defined in config
8
- foreach($wlcmsOptions as $opt):
9
- if( isset($opt['id']) ):
10
- delete_option($opt['id']);
11
- endif;
12
- endforeach;
13
-
14
-
15
- wlcmsUpdateCaps(); // Restores other caps back to default
16
-
17
- // remove editor changes
18
- $role = get_role( 'editor');
19
- $role->remove_cap( 'switch_themes');
20
- $role->remove_cap( 'edit_theme_options');
21
-
22
- } // end :: function :: plugin_cleanup
23
-
24
-
25
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
index.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ die('Access denied.');
4
+ }
readme.txt CHANGED
@@ -3,33 +3,51 @@
3
  Contributors: VideoUserManuals
4
  Plugin Name: White Label CMS
5
  Plugin URI: http://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
6
- Tags: cms, custom, admin, branding, dashboard, administration, plugin, login, client, menu, navigation, appearance, menus, widgets
7
  Author URI: http://www.videousermanuals.com/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
8
  Author: Video User Manuals
9
  Requires at least: 3.3
10
- Tested up to: 4.9.5
11
- Stable tag: 1.6.2
 
12
 
13
- Customize dashboard panels and branding, remove menus, give editors access to widgets plus lots more.
14
 
15
  == Description ==
16
- The White Label CMS plugin is for developers who want to give their clients a more personalised and less confusing content management system
17
 
18
- For a video overview of the changes in 1.5 and how this affects WordPress 3.4 please visit the [White Label CMS](http://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=description "White Label CMS") home hosted on the [WordPress Manual Plugin](http://www.videousermanuals.com/?utm_campaign=wlcms&utm_medium=plugin&utm_source=description "WordPress Manual Plugin") website.
19
 
20
- WordPress 3.3's new admin bar has restricted the type of branding you can have for clients, which is why we have introduced the ability to brand the dashboard.
 
 
 
 
 
21
 
22
- You also have the ability to choose which menus are visible. We have 3 CMS profiles available as presets: Website, Blog or Custom so you can modify the menu system to suit the CMS purpose. These only apply to the user role of Editor and below. Admins will see all menus.
 
23
 
24
- You can also give Editors access to the Menu and Widgets, but the switch theme option will not appear.
25
 
26
- White Label CMS allows you to remove all the panels from the WordPress dashboard and insert your own panel, which you can use to write 2 personalised messages to your client and link to the important elements in the CMS.
 
27
 
28
- It also allows you to add custom logos to the header and footer as well as the all important login page, giving your client a better branded experience of their new website.
 
29
 
30
- There is also the option to hide the nag update as well.
 
 
 
 
 
 
 
 
 
 
31
 
32
- No longer will you have to tell your clients to ignore the dashboard!
33
 
34
  == Installation ==
35
  1. Download the White Label CMS plugin
@@ -37,147 +55,51 @@ No longer will you have to tell your clients to ignore the dashboard!
37
  3. Go to the plugins directory and activate the plugin
38
  4. Go to Settings->White Label CMS and use the menu system to change the default values.
39
 
40
- Please note:
41
- We have updated the way images now work. There are 3 options:
42
- You can either just add the filename, and this will look inside your theme/child theme's images folder for the file.
43
- You can put the full url of the image, if you want it to load from an external site
44
- You can use the WordPress uploader, but please make sure you click "insert image"
45
-
46
- == Upgrade Notice ==
47
- Updates for WordPress 3.3
48
- More Bug Fixes for WLCMS 1.4 and improved support for other languages.
49
- You can now brand the dashboard as well as the admin bar.
50
- !You must save the new settings if you are upgrading from 1.3!
51
-
52
  == Screenshots ==
53
- 1. An example of a custom login
54
- 2. An example of how your clients dashboard could look
55
- 3. Customize which menus appear for editors
56
- 4. Simple menu options
57
- 5. Customize the homepage
 
 
58
 
59
  == Changelog ==
60
 
61
- = 1.6.2 =
62
- Fixed deprecated php function
63
-
64
- = 1.6.1 =
65
- Fixed Import for php5.2
66
-
67
- = 1.6 =
68
- Fixed Import
69
-
70
- = 1.5.9 =
71
- Minor changes
72
-
73
- = 1.5.8 =
74
- Fixed minor bugs
75
-
76
- = 1.5.7 =
77
- Fixed issue with importer
78
-
79
- = 1.5.6 =
80
- Fixed bug with dashboard panels in wp-admin
81
-
82
- = 1.5.5 =
83
- WordPress v4.4.1 Compatibility
84
-
85
- = 1.5.4 =
86
- Fixed conflict with WP Mandrill plugin
87
- Added option to hide the activity panel in the dashboard
88
- Renamed Right Now widget to At a Glance
89
-
90
- = 1.5.3 =
91
- Security release. Better use of WordPress nonces and enhanced validation on import functionality. Disclosed by g0blin.
92
-
93
- = 1.5.2 =
94
- Login Logo width fixed for version WordPress 3.8
95
- fixed 16px logo in admin bar on front end
96
- Fixed advert on wlcms advert on the settings page
97
- Fixed Dashboard logo not appear on dashboard for WP 3.8
98
- Fixed Footer logo does not line up properly WP 3.8
99
- Fixed Hide WordPress Logos from admin bar
100
-
101
-
102
- = 1.5.1 =
103
- Security patch - added nonce to admin form for better security. Props PC SJJ.
104
-
105
- = 1.5 =
106
- Added Custom RSS Feeds as new option
107
- Added Import/Export of settings feature.
108
- Updated CSS rules for wp-login.
109
- Minor bug fixes
110
-
111
- = 1.4.7 =
112
- Minor Bug introduced with WordPress 3.4 and custom login images.
113
- Also added conditionals to prevent any errors with user capabilities.
114
-
115
- = 1.4.6 =
116
- Patch submitted by Chris @ iThemes. Better support for users of iThemes.
117
-
118
- = 1.4.5 =
119
- Changed how media menu is hidden to allow both hiding the menu and still able to add content. (Small bug)
120
-
121
- = 1.4.4 =
122
- Better support for other languages, deactivating the plugin does not remove options, only deleting it will run the uninstall script. Other minor fixes.
123
-
124
- = 1.4.3 =
125
- Minor Bug Fixes and some improvements on how forms are saved.
126
-
127
- = 1.4.2 =
128
- Bug Fixes, hopefully the last ones for this version
129
-
130
- = 1.4.1 =
131
- Bug Fixes for radio buttons, media uploader and login style
132
-
133
- = 1.4 =
134
- Changes for WordPress 3.3
135
- Ability to brand the dashboard
136
- Lots of new changes and bug fixes
137
-
138
- = 1.3 =
139
- Changes for WordPress 3.2
140
- Restructure of menus
141
- Added classic header and footer for 3.2 to improve branding
142
- Header logo as site link
143
- Admin can view dashboards but hide them from editors
144
- Hide browser nag
145
-
146
- Bug fixes
147
-
148
- = 1.2 =
149
- Ability to show Menu & Widgets menu for Editors
150
- Removed WordPress link and ALT text from login page.
151
- Custom css for forgotten link on login page.
152
- Tested on multi user sites.
153
- Fixed a bug which was stopping the Profile from appearing.
154
-
155
- = 1.1 =
156
- Ability to remove menus
157
- Added widths for header and footer logos.
158
-
159
- = 1.0.5 =
160
- Updated terminology
161
-
162
- = 1.0.4 =
163
- Updated custom login image file height
164
-
165
- = 1.0.3 =
166
- Updated logo filename
167
-
168
- = 1.0.2 =
169
- Added update log!
170
 
171
  == Frequently Asked Questions ==
172
  = Who is this plugin for?=
173
  For developers who handover websites to their clients and use WordPress as a CMS.
174
 
175
- =How to I add links to my own panel?=
176
  Your custom panel accepts html, so just write the markup as you normally would in html.
177
 
178
- =How do I remove menu items?=
179
- Click on the Remove Menus section and either choose a CMS profile, or manually select which menu items to be removed. Please not this will only effect user roles of Editor and below. So you will need to logout in order to see the difference.
180
-
181
  =How do you recommend using this plugin?=
182
  We have been using this for a number of months now, and we have found clients respond best when it is set up in the following fashion:
183
 
@@ -187,25 +109,5 @@ We have been using this for a number of months now, and we have found clients re
187
  * Remove all panels from the dashboard (they have a lot of information that just confuses the client)
188
  * Add your own panel. Personalise the experience for your client by welcoming them to their website. Provide links to the most relevant elements in the CMS. Provide a link back to your support system if you have one.
189
 
190
- =Appearance Menu=
191
- With WordPress 3 comes the much need Menus option. However, this sits inside the Appearance menu which is hidden to editors. You can you make the Menus and Widgets menus available to editors, but can keep the switch theme menu removed.
192
-
193
- Please note: The plugin works by granting Editor's the 'switch_themes' and 'edit_theme_options' privilege which gives them access to the Appearance menu, but removes the switch themes menu from the Appearance menu and the WordPress 3 Right Now dashboard. However it could still be possible for a Editor to switch themes, if they knew the direct url path. Unlikely, but you should be aware of this before you choose to enable these options.
194
-
195
- Menus is only available to WordPress 3 users.
196
-
197
- If you see menus like background or header, then you must modify your theme in order to remove them.
198
-
199
- When the plugin is uninstalled, the Editor privileges are reset to their original values.
200
-
201
- =How do I use it on Multi Site?=
202
- * You must install the plugin network wide in order for it to work on all sites.
203
- * You must save the options on each new site in order for the default options to appear.
204
- * You can have separate login logos for each mini site. Simply change the filename, and upload it to the relevant theme.
205
-
206
- =Troubleshooting=
207
- I installed the plugin and the logos disappear?: You need to upload your logos to you current themes images directory.
208
-
209
- The menus have not changes?: Make sure you are logged in as the editor
210
-
211
- Lost Password CSS not working?: Make sure you use the example format. The color must be the last css style and it must not have a closing ; as !important is appended to the end of the style to overwrite and existing style.
3
  Contributors: VideoUserManuals
4
  Plugin Name: White Label CMS
5
  Plugin URI: http://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
6
+ Tags: cms, custom, admin, branding, dashboard, administration, plugin, login, client, menu, navigation, appearance, menus, widgets, custom login, custom login logo, custom wp-login, login customizer, wp login
7
  Author URI: http://www.videousermanuals.com/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
8
  Author: Video User Manuals
9
  Requires at least: 3.3
10
+ Requires PHP: 5.4
11
+ Tested up to: 5.1
12
+ Stable tag: 2.0.2.2
13
 
14
+ Customise dashboard panels and branding, hide menus plus lots more.
15
 
16
  == Description ==
17
+ The White Label CMS plugin is for developers who want to give their clients a more personalised and less confusing content management system.
18
 
19
+ For a overview of the changes in 2.0 version of the plugin please visit the Video User Manuals website.
20
 
21
+ = Features =
22
+ - Customize the login page
23
+ - Add your branding to the header and footer
24
+ - Customize the dashboard
25
+ - Control which menus appear for your client
26
+ - Setting up a customized dashboard can be done in seconds using the White Label CMS Wizard
27
 
28
+ = Customize The Login Page =
29
+ Impress your clients with a branded login page. Add yours or your client's logo, add a background image and even control the CSS if you wish. Personalising the back end of WordPress will give your client the feeling that this is their website, not a generic website.
30
 
31
+ [youtube https://www.youtube.com/watch?v=LESxAuRdjBw]
32
 
33
+ = Add Your Branding to the Header and Footer =
34
+ Stay top of mind with your client by adding your branding to the admin bar, menu or footer.
35
 
36
+ = Customize the Dashboard =
37
+ Are you tired of telling your clients to ignore everything on the Dashboard, but then still receive questions because they're confused or have broken something?
38
 
39
+ With White Label CMS you can clear everything from the dashboard and add in your own dashboard panel. You can even add your own RSS feed so your clients can be kept up to date with what you are doing in your business. Which is much more relevant to your client than where and when the next WordPress Meetup is.
40
+
41
+ Add your own welcome dashboard, and now you can use an Elementor or Beaver Builder template to make it look beautiful.
42
+
43
+ = Control with Menus Appear for Your Client =
44
+ We have created a new feature called the White Label CMS admin which allows you to hide menus for other users. Setup is simple and gives clients admin access with some restrictions making it harder for them to stumble across settings and mess up the site.
45
+
46
+ = Setup a Site in Seconds Using the Wizard =
47
+ Setting up a customized dashboard is easy and quick using the White Label CMS Wizard. With just a few clicks, you can add your branding and your client's details and be up and running in seconds.
48
+
49
+ There is so much that you can do with White Label CMS, but we want the experience to be simple. The Wizard allows you to set up a clutter-free, customized dashboard without having to scroll through all of the options that are available to you.
50
 
 
51
 
52
  == Installation ==
53
  1. Download the White Label CMS plugin
55
  3. Go to the plugins directory and activate the plugin
56
  4. Go to Settings->White Label CMS and use the menu system to change the default values.
57
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  == Screenshots ==
59
+ 1. An example of how your clients dashboard could look
60
+ 2. White Label CMS Setting: Branding
61
+ 3. White Label CMS Setting: Login
62
+ 4. White Label CMS Setting: Dashboard
63
+ 5. White Label CMS Setting: Menus
64
+ 6. White Label CMS Setting: Settings
65
+ 7. An example of a custom login
66
 
67
  == Changelog ==
68
 
69
+ = 2.0.2.2 =
70
+ * Use space to remove howdy
71
+ * Change login logo url if custom logo setup
72
+ * Moved wlcms style to header
73
+ * Hiding Dashboard widgets can now configured by user role
74
+ * Minor fixes
75
+
76
+ = 2.0.2.1 =
77
+
78
+ * Bug fixed involving object cache which is causing redirect loop
79
+ * Fixed unable to upgrade themes and plugins
80
+ * Fixed legacy custom welcome dashboard
81
+ * Fixed legacy import
82
+ * Minor fixes
83
+
84
+ = 2.0 =
85
+
86
+ **Major Enhancements**
87
+ * Re-designed Setting form
88
+ * Added a wizard setting
89
+ * Added Side Menu logo
90
+ * Added more design control on the login form
91
+ * Login live preview
92
+ * Custom Welcome Panel now supports Elementor and Beaver Builder Pro Templates
93
+ * Revised menus system visibility
94
+ * Added Hide Front-end Admin Bar
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
 
96
  == Frequently Asked Questions ==
97
  = Who is this plugin for?=
98
  For developers who handover websites to their clients and use WordPress as a CMS.
99
 
100
+ =How do I add links to my own panel?=
101
  Your custom panel accepts html, so just write the markup as you normally would in html.
102
 
 
 
 
103
  =How do you recommend using this plugin?=
104
  We have been using this for a number of months now, and we have found clients respond best when it is set up in the following fashion:
105
 
109
  * Remove all panels from the dashboard (they have a lot of information that just confuses the client)
110
  * Add your own panel. Personalise the experience for your client by welcoming them to their website. Provide links to the most relevant elements in the CMS. Provide a link back to your support system if you have one.
111
 
112
+ = Feature Requests =
113
+ Got a feature request for WLCMS, let us know [here](https://www.videousermanuals.com/about/).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
screenshot-1.png DELETED
Binary file
screenshot-2.png DELETED
Binary file
screenshot-3.png DELETED
Binary file
screenshot-4.png DELETED
Binary file
screenshot-5.png DELETED
Binary file
scripts/wlcms_script.js DELETED
@@ -1,271 +0,0 @@
1
- function wlcms_menus() {
2
- // Set initial open/close
3
- jQuery('#menus > li').each(function() {
4
- var submenu = jQuery('ul',this);
5
-
6
- if(jQuery(submenu).length>0) {
7
- jQuery(submenu).slideDown(500);
8
- jQuery("em",this).text("↓");
9
- }
10
-
11
- if(jQuery('input:eq(0)',this).is(':checked')) {
12
- if(jQuery(submenu).length>0) {
13
- jQuery(submenu).slideDown(500);
14
- jQuery("em",this).text("↑");
15
- }
16
- } else {
17
- if(jQuery(submenu).length>0) {
18
- jQuery(submenu).hide();
19
- jQuery("em",this).text("↓");
20
- }
21
- }
22
- });
23
-
24
- // On click
25
- jQuery('#menus span').click(function() {
26
- var parent = jQuery(this).parent().parent();
27
- var submenu = jQuery('ul',parent);
28
- jQuery(submenu).slideToggle(500,function() {
29
- var parent = jQuery(this).parent();
30
- jQuery("em",parent).text(jQuery(submenu).is(':visible') ? "↑" : "↓");
31
- });
32
- });
33
-
34
- // On click
35
- jQuery('#menus input').click(function() {
36
- var parent = jQuery(this).parent().parent();
37
- var submenu = jQuery('ul',parent);
38
- if(jQuery(this).is(':checked')) {
39
- if(jQuery(submenu).length>0) {
40
- jQuery(submenu).slideDown(500);
41
- jQuery('li',submenu).each(function() {
42
- jQuery('input',this).attr('checked','checked');
43
- });
44
- }
45
- } else {
46
- if(jQuery(submenu).length>0) {
47
- jQuery(submenu).slideUp(500);
48
- jQuery('li',submenu).each(function() {
49
- jQuery('input',this).removeAttr('checked');
50
- });
51
- }
52
- }
53
- });
54
- }
55
-
56
- jQuery(document).ready(function($){
57
- wlcms_menus();
58
-
59
-
60
- $('#wlcms_o_edit_role').parent().css('borderTop','0');
61
- $('#roles_capabilities').parent().css('paddingLeft','30px').css('paddingRight','30px').css('paddingBottom','10px');
62
-
63
- jQuery('.edit_role_name').hide();
64
- jQuery('#wlcms_o_head_cap').hide();
65
- /**/
66
- jQuery('.wlcms_o_modify_sub_menu').hide();
67
-
68
- /**/
69
- /*jQuery('#footer-left').remove();*/
70
-
71
- jQuery('.wlcms_options').slideUp();
72
-
73
- jQuery('.video-h').hover(function() {
74
- jQuery(this).addClass('pretty-hover');
75
- }, function() {
76
- jQuery(this).removeClass('pretty-hover');
77
- });
78
-
79
- var showHideWelcome;
80
- var showHideAppearance;
81
- var formField;
82
-
83
- //Showhide RSS
84
- showHideRSS = jQuery('.wlcms_opts form #form-show-rss input:radio:checked').val();
85
- if(showHideRSS == 0) {
86
- jQuery('#vRSSSettings').hide();
87
- }
88
-
89
- jQuery('.wlcms_opts form #form-show-rss input:radio').click(function() {
90
- showHideRSS = jQuery('.wlcms_opts form #form-show-rss input:radio:checked').val();
91
- if(showHideRSS == 0) {
92
- jQuery('#vRSSSettings').hide();
93
- } else {
94
- jQuery('#vRSSSettings').show();
95
- }
96
- });
97
-
98
- // Showhide Welcome
99
- showHideWelcome = jQuery('.wlcms_opts form #form-show-welcome input:radio:checked').val();
100
- if(showHideWelcome == 0) {
101
- jQuery('#vWelcomePanelSettings').hide();
102
- }
103
-
104
- jQuery('.wlcms_opts form #form-show-welcome input:radio').click(function() {
105
- showHideWelcome = jQuery('.wlcms_opts form #form-show-welcome input:radio:checked').val();
106
- if(showHideWelcome == 0) {
107
- jQuery('#vWelcomePanelSettings').hide();
108
- } else {
109
- jQuery('#vWelcomePanelSettings').show();
110
- }
111
- });
112
-
113
- // Showhide Appearance Menu
114
- showHideAppearance = jQuery('.wlcms_opts form #form-show-template input:radio:checked').val();
115
- if(showHideAppearance == 0) {
116
- jQuery('#vTheAppearanceMenu').hide();
117
- }
118
-
119
- jQuery('.wlcms_opts form #form-show-template input:radio').click(function() {
120
- showHideWelcome = jQuery('.wlcms_opts form #form-show-template input:radio:checked').val();
121
- if(showHideWelcome == 0) {
122
- jQuery('#vTheAppearanceMenu').hide();
123
- } else {
124
- jQuery('#vTheAppearanceMenu').show();
125
- }
126
- });
127
-
128
-
129
- jQuery('.wlcms_section h3').click(function(){
130
- if(jQuery(this).parent().next('.wlcms_options').css('display')=='none')
131
- { jQuery(this).removeClass('inactive');
132
- jQuery(this).addClass('active');
133
- jQuery(this).children('img').removeClass('inactive');
134
- jQuery(this).children('img').addClass('active');
135
-
136
- }
137
- else
138
- { jQuery(this).removeClass('active');
139
- jQuery(this).addClass('inactive');
140
- jQuery(this).children('img').removeClass('active');
141
- jQuery(this).children('img').addClass('inactive');
142
- }
143
-
144
- jQuery(this).parent().next('.wlcms_options').slideToggle('slow');
145
- });
146
-
147
- jQuery('#radioWebsite').click(function() {
148
- jQuery('input[name=wlcms_o_hide_posts]').attr('checked', true);
149
- jQuery('input[name=wlcms_o_hide_media]').attr('checked', false);
150
- jQuery('input[name=wlcms_o_hide_links]').attr('checked', true);
151
- jQuery('input[name=wlcms_o_hide_pages]').attr('checked', false);
152
- jQuery('input[name=wlcms_o_hide_comments]').attr('checked', true);
153
- jQuery('input[name=wlcms_o_hide_users]').attr('checked', true);
154
- jQuery('input[name=wlcms_o_hide_tools]').attr('checked', true);
155
- jQuery('input[name=wlcms_o_hide_separator2]').attr('checked', true);
156
- jQuery('input[name=wlcms_o_show_appearance]').attr('checked', false);
157
- jQuery('input[name=wlcms_o_show_widgets]').attr('checked', false);
158
- });
159
-
160
- jQuery('#radioBlog').click(function() {
161
- jQuery('input[name=wlcms_o_hide_posts]').attr('checked', false);
162
- jQuery('input[name=wlcms_o_hide_media]').attr('checked', false);
163
- jQuery('input[name=wlcms_o_hide_links]').attr('checked', true);
164
- jQuery('input[name=wlcms_o_hide_pages]').attr('checked', false);
165
- jQuery('input[name=wlcms_o_hide_comments]').attr('checked', false);
166
- jQuery('input[name=wlcms_o_hide_users]').attr('checked', true);
167
- jQuery('input[name=wlcms_o_hide_tools]').attr('checked', true);
168
- jQuery('input[name=wlcms_o_hide_separator2]').attr('checked', true);
169
- jQuery('input[name=wlcms_o_show_appearance]').attr('checked', false);
170
- jQuery('input[name=wlcms_o_show_widgets]').attr('checked', false);
171
- });
172
-
173
- jQuery('.wlcms_input_local_video').click(function() {
174
- if(jQuery('label',this).hasClass('wlcms_o_parent_label_active')) {
175
- jQuery('.wlcms_o_parent_label_active',this).removeClass('wlcms_o_parent_label_active');
176
- } else {
177
- jQuery('.wlcms_o_parent_label',this).addClass('wlcms_o_parent_label_active');
178
- }
179
-
180
- jQuery(this).next('.wlcms_o_modify_sub_menu').slideToggle('slow');
181
- });
182
-
183
- jQuery('#radioCustom').click(function() {
184
- if (jQuery('#wlcms_o_hide_posts').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_posts]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_posts]').attr('checked', false); }
185
- if (jQuery('#wlcms_o_hide_media').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_media]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_media]').attr('checked', false); }
186
- if (jQuery('#wlcms_o_hide_links').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_links]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_links]').attr('checked', false); }
187
- if (jQuery('#wlcms_o_hide_pages').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_pages]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_pages]').attr('checked', false); }
188
- if (jQuery('#wlcms_o_hide_comments').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_comments]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_comments]').attr('checked', false); }
189
- if (jQuery('#wlcms_o_hide_users').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_users]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_users]').attr('checked', false); }
190
- if (jQuery('#wlcms_o_hide_tools').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_tools]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_tools]').attr('checked', false); }
191
- if (jQuery('#wlcms_o_hide_separator2').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_separator2]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_separator2]').attr('checked', false); }
192
- if (jQuery('#wlcms_o_show_appearance').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_show_appearance]').attr('checked', true); } else { jQuery('input[name=wlcms_o_show_appearance]').attr('checked', false); }
193
- if (jQuery('#wlcms_o_show_widgets').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_show_widgets]').attr('checked', true); } else { jQuery('input[name=wlcms_o_show_widgets]').attr('checked', false); }
194
-
195
- });
196
-
197
-
198
- // Set default value
199
-
200
- jQuery(".default-text").focus(function(srcc){
201
- if (jQuery(this).val() == jQuery(this)[0].title){
202
- jQuery(this).val("");
203
- }
204
- });
205
-
206
- jQuery(".default-text").blur(function(){
207
- if (jQuery(this).val() == "" || isNaN(jQuery(this).val())){
208
- jQuery(this).val(jQuery(this)[0].title);
209
- }
210
- });
211
- /***********************************************************************************/
212
- jQuery(".add").click(function(){
213
- if (jQuery("#wlcms_o_role_name").val() == ""){
214
- alert("must fill role name");
215
- return false;
216
-
217
- }
218
-
219
- });
220
-
221
- /*hide roles_capabilities*/
222
- var roleName;
223
-
224
-
225
- jQuery('#wlcms_o_edit_role').change(function() {
226
- jQuery('.edit_role_name').hide();
227
- jQuery('#wlcms_o_head_cap').show();
228
- roleName=jQuery("#wlcms_o_edit_role").val();
229
- if(roleName==0)
230
- jQuery('#wlcms_o_head_cap').hide();
231
-
232
- jQuery('#roles_'+roleName).show();
233
-
234
- });
235
-
236
- /**/
237
-
238
- /***********************************************************************************/
239
-
240
- jQuery(".default-text").blur();
241
-
242
-
243
- // Add http with devoloper url if not exist
244
-
245
- jQuery("#wlcms_o_developer_url").blur(function() {
246
- var input = jQuery(this);
247
- var val = input.val();
248
- if (val && !val.match(/^http([s]?):\/\/.*/)) {
249
- input.val('http://' + val);
250
- }
251
- });
252
-
253
-
254
-
255
-
256
-
257
-
258
- // Ajax function goes here
259
-
260
-
261
- /*$.ajax({
262
- url: "wlcms-plugin.php",
263
- context: document.body,
264
- success: function update_function(){
265
- alert("hai";
266
- $(this).addClass("done");
267
- }
268
- });*/
269
- ////////////////////////////////////////////////
270
- });
271
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
uninstall.php CHANGED
@@ -1,17 +1,7 @@
1
  <?php
2
 
3
- if( WP_UNINSTALL_PLUGIN ):
 
 
4
 
5
- global $wpdb;
6
-
7
- $x = "DELETE FROM $wpdb->options WHERE option_name LIKE 'wlcms_o_%' ";
8
- $wpdb->query($x);
9
-
10
- $role = get_role( 'editor' );
11
- $role->remove_cap( 'switch_themes' ); // Legacy
12
- $role->remove_cap( 'edit_themes' ); // Legacy
13
- $role->remove_cap( 'edit_theme_options' );
14
-
15
- endif;
16
-
17
- ?>
1
  <?php
2
 
3
+ if ( !defined('ABSPATH') && !defined('WP_UNINSTALL_PLUGIN') ) {
4
+ exit();
5
+ }
6
 
7
+ delete_option('wlcms_options' );
 
 
 
 
 
 
 
 
 
 
 
 
view/admin/index.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ die('Access denied.');
4
+ }
view/admin/parts/advert.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-advert-wrapper">
2
+ <a href="http://wplinks.io/workshop-wlcms" target="_blank">
3
+ <picture>
4
+ <source srcset="<?php echo WLCMS_ASSETS_URL ?>images/Better-Clients-Banner-white-label-cms-m.jpg" media="(max-width: 480px)">
5
+ <img srcset="<?php echo WLCMS_ASSETS_URL ?>images/Better-Clients-Banner.jpg" alt="3 secrets to Better Client, Better Projects & Better Fees">
6
+ </picture>
7
+ </a>
8
+ </div>
view/admin/parts/branding-admin-bar.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="wlcms-input-group">
3
+ <?php echo wlcms_form_upload_field('Admin Bar Logo', 'admin_bar_logo', 'Replace the WordPress logo in the admin bar. Max height 20px') ?>
4
+ </div>
5
+
6
+ <div class="wlcms-input-group">
7
+ <label><?php _e('Admin Bar Alt Text', 'wlcms') ?></label>
8
+ <div class="wlcms-input">
9
+ <input type="text" name="admin_bar_alt_text" value="<?php echo wlcms_field_setting('admin_bar_alt_text') ?>" />
10
+ </div>
11
+ <div class="wlcms-help">
12
+ <?php _e('Replace the "WordPress" Alt text.', 'wlcms') ?>
13
+ </div>
14
+ </div>
15
+
16
+ <div class="wlcms-input-group">
17
+ <label><?php _e('Replace Howdy Text', 'wlcms') ?></label>
18
+ <div class="wlcms-input">
19
+ <input type="text" name="admin_bar_howdy_text" value="<?php echo wlcms_field_setting('admin_bar_howdy_text') ?>" />
20
+ </div>
21
+ <div class="wlcms-help">
22
+ <?php _e('Add a space to completely remove it from the admin bar. Or replace it with something like: "Hi,"', 'wlcms') ?>
23
+ </div>
24
+ </div>
25
+
26
+ <div class="wlcms-input-group">
27
+ <label><?php _e('Admin Bar URL', 'wlcms') ?></label>
28
+ <div class="wlcms-input">
29
+ <input type="url" name="admin_bar_url" value="<?php echo wlcms_field_setting('admin_bar_url') ?>" />
30
+ </div>
31
+ <div class="wlcms-help">
32
+ <?php _e('Replace the link to WordPress.org.', 'wlcms') ?>
33
+ </div>
34
+ </div>
view/admin/parts/branding-developer.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="wlcms-input-group">
3
+ <label><?php _e('Developer Name', 'wlcms') ?></label>
4
+ <div class="wlcms-input">
5
+ <input type="text" name="developer_name" value="<?php echo wlcms_field_setting('developer_name') ?>" />
6
+ </div>
7
+ <div class="wlcms-help">
8
+ <?php _e('For use in footer and ALT text\'s.', 'wlcms') ?>
9
+ </div>
10
+ </div>
11
+
12
+ <div class="wlcms-input-group">
13
+ <label><?php _e('Developer URL', 'wlcms') ?></label>
14
+ <div class="wlcms-input">
15
+ <input type="url" name="developer_url" value="<?php echo wlcms_field_setting('developer_url') ?>" />
16
+ </div>
17
+ <div class="wlcms-help">
18
+ <?php _e('For use in footer and admin bar.', 'wlcms') ?>
19
+ </div>
20
+ </div>
21
+
22
+ <div class="wlcms-input-group">
23
+ <?php echo wlcms_form_upload_field('Developer Icon', 'developer_icon', 'We recommend at 16 x 16 image') ?>
24
+ </div>
25
+
26
+ <div class="wlcms-input-group toggle-group">
27
+ <div class="wlcms-input">
28
+ <input class="wlcms-toggle wlcms-toggle-light main-toggle" id="use_developer_icon_footer" value="1" name="use_developer_icon_footer" <?php checked(wlcms_field_setting('use_developer_icon_footer'), 1, true) ?> type="checkbox"/>
29
+ <label class="wlcms-toggle-btn" for="use_developer_icon_footer"></label><label class="toggle-label" for="use_developer_icon_footer"><?php _e('Use Developer Icon in Footer');?></label>
30
+ </div>
31
+ <div class="wlcms-help">
32
+ <?php _e('If you wish to use a different image for the footer, you can.', 'wlcms') ?>
33
+ </div>
34
+
35
+ <div class="sub-fields">
36
+ <div class="wlcms-input-group">
37
+ <?php echo wlcms_form_upload_field('Developer Footer Icon', 'developer_icon_footer_url', 'Image will appear in footer menu.') ?>
38
+ </div>
39
+
40
+ </div>
41
+ </div>
42
+
43
+ <div class="wlcms-input-group">
44
+ <?php echo wlcms_form_upload_field('Developer Side Menu Image', 'developer_side_menu_image', 'Image will appear in side menu.') ?>
45
+ </div>
view/admin/parts/branding-footer.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-input-group">
2
+ <?php echo wlcms_form_upload_field('Footer Image', 'footer_image', 'Image which will appear in the footer replacing "Thank you for creating with WordPress. Max height 50px') ?>
3
+ </div>
4
+
5
+ <div class="wlcms-input-group">
6
+ <label><?php _e('Footer Text', 'wlcms') ?></label>
7
+ <div class="wlcms-input">
8
+ <input type="text" name="footer_text" value="<?php echo wlcms_field_setting('footer_text') ?>" />
9
+ </div>
10
+ <div class="wlcms-help">
11
+ <?php _e('Text which will appear to the right of the Footer Image.', 'wlcms') ?>
12
+ </div>
13
+ </div>
14
+
15
+ <div class="wlcms-input-group">
16
+ <label><?php _e('Footer URL', 'wlcms') ?></label>
17
+ <div class="wlcms-input">
18
+ <input type="url" name="footer_url" value="<?php echo wlcms_field_setting('footer_url') ?>" />
19
+ </div>
20
+ <div class="wlcms-help">
21
+ <?php _e('Replace WordPress in the page titles.', 'wlcms') ?>
22
+ </div>
23
+ </div>
24
+
25
+ <div class="wlcms-input-group">
26
+ <label><?php _e('or use HTML', 'wlcms') ?></label>
27
+ <div class="wlcms-input">
28
+ <textarea name="footer_html" class="textarea-full" id="footer_html"><?php echo wlcms_field_setting('footer_html') ?></textarea>
29
+ </div>
30
+ <div class="wlcms-help">
31
+ <?php _e('If you would like more control over what appears in the footer, add your own HTML.<br/>
32
+ Note: this will overwrite anything set in the Footer Image, Footer Text and Footer URL.', 'wlcms') ?>
33
+ </div>
34
+ </div>
view/admin/parts/branding-side-menu.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-input-group">
2
+ <?php echo wlcms_form_upload_field('Side Menu Image', 'side_menu_image', 'Image will appear at the top of the side menu. Max width 160px') ?>
3
+ </div>
4
+
5
+ <div class="wlcms-input-group">
6
+ <?php echo wlcms_form_upload_field('Collapsed Side Menu Image', 'collapsed_side_menu_image', 'Image will appear at the top of the side menu when it is collapsed. Max width 36px') ?>
7
+ </div>
8
+ <div class="wlcms-input-group">
9
+ <label><?php _e('Side Menu Link URL', 'wlcms') ?></label>
10
+ <div class="wlcms-input">
11
+ <input type="url" name="side_menu_link_url" value="<?php echo wlcms_field_setting('side_menu_link_url') ?>" />
12
+ </div>
13
+ <div class="wlcms-help">
14
+ <?php _e('URL the Side Menu Image will link to.', 'wlcms') ?>
15
+ </div>
16
+ </div>
17
+ <div class="wlcms-input-group">
18
+ <label><?php _e('Side Menu Alt Text', 'wlcms') ?></label>
19
+ <div class="wlcms-input">
20
+ <input type="text" name="side_menu_alt_text" value="<?php echo wlcms_field_setting('side_menu_alt_text') ?>" />
21
+ </div>
22
+ <div class="wlcms-help">
23
+ <?php _e('Alt text for the Side Menu Image link.', 'wlcms') ?>
24
+ </div>
25
+ </div>
view/admin/parts/branding-wordpress.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="wlcms-input-group">
3
+ <div class="wlcms-input">
4
+ <input class="wlcms-toggle wlcms-toggle-light" name="hide_wordpress_logo_and_links" value="1" id="hide_wordpress_logo_and_links" type="checkbox" <?php checked(wlcms_field_setting('hide_wordpress_logo_and_links'), 1, true) ?>/>
5
+ <label class="wlcms-toggle-btn" for="hide_wordpress_logo_and_links"></label><label class="toggle-label" for="hide_wordpress_logo_and_links"><?php _e('Hide WordPress Logo and Links', 'wlcms') ?></label>
6
+ </div>
7
+ <div class="wlcms-help">
8
+ <?php _e('Hide mentions of WordPress and hide the links to WordPress.org.', 'wlcms') ?>
9
+ </div>
10
+ </div>
11
+
12
+ <div class="wlcms-input-group">
13
+ <div class="wlcms-input">
14
+ <input class="wlcms-toggle wlcms-toggle-light" id="hide_wp_version" name="hide_wp_version" value="1" type="checkbox" <?php checked(wlcms_field_setting('hide_wp_version'), 1, true) ?>/>
15
+ <label class="wlcms-toggle-btn" for="hide_wp_version"></label><label class="toggle-label" for="hide_wp_version"><?php _e('Hide WP Version', 'wlcms') ?></label>
16
+ </div>
17
+ <div class="wlcms-help">
18
+ <?php _e('Hide version number of WordPress which appears in the footer.', 'wlcms') ?>
19
+ </div>
20
+ </div>
21
+
22
+ <div class="wlcms-input-group">
23
+ <label><?php _e('Custom Page Titles', 'wlcms') ?></label>
24
+ <div class="wlcms-input">
25
+ <input type="text" name="custom_page_title" value="<?php echo wlcms_field_setting('custom_page_title') ?>" />
26
+ </div>
27
+ <div class="wlcms-help">
28
+ <?php _e('Replace WordPress in the page titles.', 'wlcms') ?>
29
+ </div>
30
+ </div>
view/admin/parts/branding.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-body-wrapper">
2
+ <div class="wlcms-body-header">
3
+ <h2><?php _e('WordPress Branding', 'wlcms') ?></h2>
4
+ </div>
5
+ <div class="wlcms-body-main">
6
+ <?php wlcms()->admin_view('parts/branding-wordpress'); ?>
7
+ </div>
8
+ </div>
9
+ <div class="wlcms-body-wrapper">
10
+ <div class="wlcms-body-header">
11
+ <h2><?php _e('Admin Bar Branding', 'wlcms') ?></h2>
12
+ </div>
13
+ <div class="wlcms-body-main">
14
+ <?php wlcms()->admin_view('parts/branding-admin-bar'); ?>
15
+ </div>
16
+ </div>
17
+ <div class="wlcms-body-wrapper">
18
+ <div class="wlcms-body-header">
19
+ <h2><?php _e('Side Menu Branding', 'wlcms') ?></h2>
20
+ </div>
21
+ <div class="wlcms-body-main">
22
+ <?php wlcms()->admin_view('parts/branding-side-menu'); ?>
23
+ </div>
24
+ </div>
25
+ <div class="wlcms-body-wrapper">
26
+ <div class="wlcms-body-header">
27
+ <h2><?php _e('Footer Branding', 'wlcms') ?></h2>
28
+ </div>
29
+ <div class="wlcms-body-main">
30
+ <?php wlcms()->admin_view('parts/branding-footer'); ?>
31
+ </div>
32
+ </div>
view/admin/parts/dashboard-custom-welcome-dashboard-panel.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- Own Welcome Panel -->
2
+ <?php
3
+ $welcome_panel_is_active = wlcms_welcome_value(0, 'is_active');
4
+ ?>
5
+ <div class="wlcms-input-group toggle-group">
6
+ <div class="wlcms-help">
7
+ <?php _e('Add your own Welcome Panel to the Dashboard page. This will appear on the dashboard. We recommend providing your contact details and links to the help files you have made for your client.', 'wlcms') ?>
8
+ </div>
9
+ <div class="wlcms-input">
10
+ <input class="wlcms-toggle wlcms-toggle-light main-toggle" id="welcome_panel" data-revised="1" name="welcome_panel[0][is_active]" value="1" type="checkbox" <?php checked($welcome_panel_is_active, 1, true) ?>/>
11
+ <label class="wlcms-toggle-btn" for="welcome_panel"></label><label class="toggle-label" for="welcome_panel"><?php _e('Add Your Own Welcome Panel', 'wlcms') ?></label>
12
+ </div>
13
+ <div class="wlcms-help">
14
+ <?php _e('You can add your own welcome panel.', 'wlcms') ?>
15
+ </div>
16
+ <div class="sub-fields">
17
+ <div class="wlcms-help"></div>
18
+ <label><?php _e('Select the Roles the Welcome Panel Will Be Visible To', 'wlcms') ?></label>
19
+
20
+ <?php
21
+ echo wlcms_select_roles(array('name' => 'welcome_panel[0][visible_to]', 'class' => 'wlcms_visible_to wlcms-select2'), wlcms_welcome_value(0, 'visible_to'));
22
+ ?>
23
+ <div class="wlcms-help">
24
+ <?php _e('Select the user roles this will be visible to.', 'wlcms') ?>
25
+ </div>
26
+ <?php
27
+ $checked_welcome_type = wlcms_welcome_value(0, 'template_type');
28
+
29
+ $beaver_args = array(
30
+ 'post_type' => 'fl-builder-template',
31
+ 'posts_per_page' => '-1',
32
+ 'tax_query' => array(
33
+ array(
34
+ 'taxonomy' => 'fl-builder-template-type',
35
+ 'field' => 'slug',
36
+ 'terms' => array( 'layout', 'row' )
37
+ )
38
+ )
39
+ );
40
+ $elementor_args = array(
41
+ 'post_type' => 'elementor_library',
42
+ 'posts_per_page' => '-1',
43
+ 'post_status' => 'publish'
44
+ );
45
+
46
+ $is_basic = ( ! $checked_welcome_type ) || ($checked_welcome_type == 'html') ? true : false;
47
+
48
+ ?>
49
+ <div class="wlcms-input-group">
50
+ <label><?php _e('Template Type', 'wlcms') ?></label>
51
+ <div class="wlcms-input">
52
+ <input class="wlcms-toggle wlcms-toggle-light template_type template_type1" data-template_type="1" data-page_type="html" id="template_type_basic" value="html" name="welcome_panel[0][template_type]" <?php checked($is_basic, true, true) ?> type="radio"/>
53
+ <label class="wlcms-toggle-btn" for="template_type_basic"></label><label class="toggle-label" for="template_type_basic"><?php _e('Basic HTML');?></label>
54
+
55
+ <input class="wlcms-toggle wlcms-toggle-light template_type template_type1" data-template_type="1" data-page_type="elementor"<?php echo !wlcms_is_elementor_active() ? ' disabled':''?> id="template_type_elementor" value="Elementor" name="welcome_panel[0][template_type]" <?php checked($checked_welcome_type, 'Elementor', true) ?> type="radio"/>
56
+ <label class="wlcms-toggle-btn<?php echo !wlcms_is_elementor_active() ? ' disabled':''?>" for="template_type_elementor"></label><label class="toggle-label<?php echo !wlcms_is_elementor_active() ? ' disabled':''?>" for="template_type_elementor"><?php _e('Elementor');?></label>
57
+ <input class="wlcms-toggle wlcms-toggle-light template_type template_type1" data-template_type="1" data-page_type="beaver"<?php echo !wlcms_is_beaver_builder_active() ? ' disabled':''?> id="template_type_beaver" value="Beaver Builder" name="welcome_panel[0][template_type]" <?php checked($checked_welcome_type, 'Beaver Builder', true) ?> type="radio"/>
58
+ <label class="wlcms-toggle-btn<?php echo !wlcms_is_beaver_builder_active() ? ' disabled':''?>" for="template_type_beaver"></label><label class="toggle-label<?php echo !wlcms_is_beaver_builder_active() ? ' disabled':''?>" for="template_type_beaver"><?php _e('Beaver Builder Pro');?></label>
59
+ </div>
60
+ </div>
61
+
62
+ <div class="welcome-page1">
63
+ <label><?php _e('Template', 'wlcms') ?></label>
64
+ <div class="wlcms-input">
65
+ <?php
66
+ echo wlcms_select_pages(array('name' => 'welcome_panel[0][page_id_elementor]', 'class' => 'wlcms_visible_to wlcms-select2 elementor_page1'), wlcms_welcome_value(0, 'page_id_elementor'), $elementor_args);
67
+ echo wlcms_select_pages(array('name' => 'welcome_panel[0][page_id_beaver]', 'class' => 'wlcms_visible_to wlcms-select2 beaver_page1'), wlcms_welcome_value(0, 'page_id_beaver'), $beaver_args);
68
+ ?>
69
+ </div>
70
+ </div>
71
+ <div class="welcome-basicHtml1">
72
+ <label><?php _e('Title of Welcome Panel', 'wlcms') ?></label>
73
+ <div class="wlcms-input">
74
+ <input type="text" name="welcome_panel[0][title]" value="<?php echo wlcms_welcome_value(0, 'title') ?>" />
75
+ </div>
76
+ <div class="wlcms-help">
77
+ <?php _e('Title of the Welcome Panel', 'wlcms') ?>
78
+ </div>
79
+ </div>
80
+
81
+ <div class="welcome-basicHtml1">
82
+ <label><?php _e('Welcome Panel Description HTML', 'wlcms') ?></label>
83
+ <div class="wlcms-input">
84
+ <textarea class="textarea-full" name="welcome_panel[0][description]"><?php echo wlcms_welcome_value(0, 'description') ?></textarea>
85
+ </div>
86
+ <div class="wlcms-help"><?php _e('You can add any HTML to the welcome panel.', 'wlcms') ?></div>
87
+ </div>
88
+
89
+ <div class="welcome-basicHtml1">
90
+ <div class="wlcms-input">
91
+ <input class="wlcms-toggle wlcms-toggle-light" id="own_welcome_panel_fullwidth" value="1" name="welcome_panel[0][is_fullwidth]" <?php checked(wlcms_welcome_value(0 , 'is_fullwidth'), 1, true) ?> type="checkbox"/>
92
+ <label class="wlcms-toggle-btn" for="own_welcome_panel_fullwidth"></label><label class="toggle-label" for="own_welcome_panel_fullwidth"><?php _e('Make full-width');?></label>
93
+ </div>
94
+ </div>
95
+ <?php if( wlcms_has_pagebuilder() ):?>
96
+ <div class="welcome-page1">
97
+ <div class="wlcms-input">
98
+ <input class="wlcms-toggle wlcms-toggle-light" id="own_welcome_panel_show_title" value="1" name="welcome_panel[0][show_title]" <?php checked(wlcms_welcome_value(0 , 'show_title'), 1, true) ?> type="checkbox"/>
99
+ <label class="wlcms-toggle-btn" for="own_welcome_panel_show_title"></label><label class="toggle-label" for="own_welcome_panel_show_title"><?php _e('Show Title');?></label>
100
+ </div>
101
+ </div>
102
+ <?php
103
+ endif;
104
+ ?>
105
+ </div>
106
+ </div>
107
+
108
+ <!-- Second Panel -->
109
+ <?php
110
+ $welcome_panel_is_active = wlcms_welcome_value(1, 'is_active');
111
+ ?>
112
+ <div class="wlcms-input-group toggle-group">
113
+ <div class="wlcms-input">
114
+ <input class="wlcms-toggle wlcms-toggle-light main-toggle" id="add_second_panel" data-revised="1" name="welcome_panel[1][is_active]" value="1" type="checkbox" <?php checked($welcome_panel_is_active, 1, true) ?>/>
115
+ <label class="wlcms-toggle-btn" for="add_second_panel"></label><label class="toggle-label" for="add_second_panel"><?php _e('Add Second Panel', 'wlcms') ?></label>
116
+ </div>
117
+ <div class="wlcms-help">
118
+ <?php _e('Add a second custom panel to the Dashboard.', 'wlcms') ?>
119
+ </div>
120
+ <div class="sub-fields">
121
+ <div class="wlcms-help"></div>
122
+ <label><?php _e('Select the Roles the Welcome Panel Will Be Visible To', 'wlcms') ?></label>
123
+ <div class="wlcms-input">
124
+ <?php
125
+ echo wlcms_select_roles(array('name' => 'welcome_panel[1][visible_to]', 'class' => 'wlcms_visible_to wlcms-select2'), wlcms_welcome_value(1, 'visible_to'));
126
+ ?>
127
+ </div>
128
+ <div class="wlcms-help">
129
+ <?php _e('Select the user roles this will be visible to.', 'wlcms') ?>
130
+ </div>
131
+
132
+ <?php
133
+ $checked_welcome_type = wlcms_welcome_value(1, 'template_type');
134
+
135
+ $is_basic = ( ! $checked_welcome_type ) || ($checked_welcome_type == 'html') ? true : false;
136
+
137
+ ?>
138
+ <div class="wlcms-input-group">
139
+ <label><?php _e('Template', 'wlcms') ?></label>
140
+ <div class="wlcms-input">
141
+ <input class="wlcms-toggle wlcms-toggle-light template_type template_type2" data-template_type="2" data-page_type="html" id="template_type_basic2" value="html" name="welcome_panel[1][template_type]" <?php checked($is_basic, true, true) ?> type="radio"/>
142
+ <label class="wlcms-toggle-btn" for="template_type_basic2"></label><label class="toggle-label" for="template_type_basic2"><?php _e('Basic HTML');?></label>
143
+ <input class="wlcms-toggle wlcms-toggle-light template_type template_type2" data-template_type="2" data-page_type="elementor" id="template_type_elementor2"<?php echo !wlcms_is_elementor_active() ? ' disabled':''?> value="Elementor" name="welcome_panel[1][template_type]" <?php checked($checked_welcome_type, 'Elementor', true) ?> type="radio"/>
144
+ <label class="wlcms-toggle-btn<?php echo !wlcms_is_elementor_active() ? ' disabled':''?>" for="template_type_elementor2"></label><label class="toggle-label<?php echo !wlcms_is_elementor_active() ? ' disabled':''?>" for="template_type_elementor2"><?php _e('Elementor');?></label>
145
+ <input class="wlcms-toggle wlcms-toggle-light template_type template_type2" data-template_type="2" data-page_type="beaver" id="template_type_beaver2"<?php echo !wlcms_is_beaver_builder_active() ? ' disabled':''?> value="Beaver Builder" name="welcome_panel[1][template_type]" <?php checked($checked_welcome_type, 'Beaver Builder', true) ?> type="radio"/>
146
+ <label class="wlcms-toggle-btn<?php echo !wlcms_is_beaver_builder_active() ? ' disabled':''?>" for="template_type_beaver2"></label><label class="toggle-label<?php echo !wlcms_is_beaver_builder_active() ? ' disabled':''?>" for="template_type_beaver2"><?php _e('Beaver Builder Pro');?></label>
147
+ </div>
148
+ </div>
149
+
150
+ <div class="welcome-page2">
151
+ <label><?php _e('Page Template', 'wlcms') ?></label>
152
+ <div class="wlcms-input">
153
+ <?php
154
+ echo wlcms_select_pages(array('name' => 'welcome_panel[1][page_id_elementor]', 'class' => 'wlcms_visible_to wlcms-select2 elementor_page2'), wlcms_welcome_value(1, 'page_id_elementor'), $elementor_args);
155
+ echo wlcms_select_pages(array('name' => 'welcome_panel[1][page_id_beaver]', 'class' => 'wlcms_visible_to wlcms-select2 beaver_page2'), wlcms_welcome_value(1, 'page_id_beaver'), $beaver_args);
156
+ ?>
157
+ </div>
158
+ </div>
159
+ <div class="welcome-basicHtml2">
160
+ <label><?php _e('Title of Second Panel', 'wlcms') ?></label>
161
+ <div class="wlcms-input">
162
+ <input type="text" name="welcome_panel[1][title]" value="<?php echo wlcms_welcome_value(1, 'title') ?>" />
163
+ </div>
164
+ <div class="wlcms-help">
165
+ <?php _e('Title of the Second Panel', 'wlcms') ?>
166
+ </div>
167
+ </div>
168
+
169
+ <div class="welcome-basicHtml2">
170
+ <label><?php _e('Second Panel Description (HTML)', 'wlcms') ?></label>
171
+ <div class="wlcms-input">
172
+ <textarea class="textarea-full" name="welcome_panel[1][description]"><?php echo wlcms_welcome_value(1, 'description') ?></textarea>
173
+ </div>
174
+ <div class="wlcms-help"><?php _e('You can add any HTML to the second panel.', 'wlcms') ?></div>
175
+ </div>
176
+
177
+ <div class="welcome-basicHtml2">
178
+ <div class="wlcms-input">
179
+ <input class="wlcms-toggle wlcms-toggle-light" id="second_welcome_panel_fullwidth" value="1" name="welcome_panel[1][is_fullwidth]" <?php checked(wlcms_welcome_value(1, 'is_fullwidth'), 1, true) ?> type="checkbox"/>
180
+ <label class="wlcms-toggle-btn" for="second_welcome_panel_fullwidth"></label><label class="toggle-label" for="second_welcome_panel_fullwidth"><?php _e('Make full-width');?></label>
181
+ </div>
182
+ <div class="wlcms-help">
183
+ <?php _e('', 'wlcms') ?>
184
+ </div>
185
+ </div>
186
+
187
+ <?php if( wlcms_has_pagebuilder() ):?>
188
+ <div class="welcome-page2">
189
+ <div class="wlcms-input">
190
+ <input class="wlcms-toggle wlcms-toggle-light" id="second_welcome_panel_show_title" value="1" name="welcome_panel[1][show_title]" <?php checked(wlcms_welcome_value(1 , 'show_title'), 1, true) ?> type="checkbox"/>
191
+ <label class="wlcms-toggle-btn" for="second_welcome_panel_show_title"></label><label class="toggle-label" for="second_welcome_panel_show_title"><?php _e('Show Title');?></label>
192
+ </div>
193
+ </div>
194
+ <?php
195
+ endif;
196
+ ?>
197
+ </div>
198
+ </div>
view/admin/parts/dashboard-default-panels.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $default_settings = wlcms()->Settings()->get_default_option('dashboard_widgets_visibility_roles');
3
+ $dashboard_role_stat = wlcms_field_setting('dashboard_role_stat');
4
+ $dashboard_widgets_visibility_roles = wlcms_field_setting('dashboard_widgets_visibility_roles');
5
+ if( ! $dashboard_role_stat) {
6
+ $dashboard_widgets_visibility_roles = $default_settings;
7
+ }
8
+ ?>
9
+ <div class="wlcms-input-group">
10
+ <?php echo wlcms_form_upload_field('Dashboard Icon', 'dashboard_icon', 'Add a logo to the Dashboard. Suggested height 40px') ?>
11
+ </div>
12
+
13
+ <div class="wlcms-input-group">
14
+ <label><?php _e('Dashboard Title', 'wlcms') ?></label>
15
+ <div class="wlcms-input">
16
+ <input type="text" name="dashboard_title" value="<?php echo wlcms_field_setting('dashboard_title') ?>" />
17
+ </div>
18
+ <div class="wlcms-help">
19
+ <?php _e('Change the heading for the Dashboard', 'wlcms') ?>
20
+ </div>
21
+ </div>
22
+ <div class="wlcms-input-group">
23
+ <label><?php _e('Select the Roles the Dashboard Panels Will Be Hidden To', 'wlcms') ?></label>
24
+ <?php
25
+ echo wlcms_select_roles(array('name' => 'dashboard_widgets_visibility_roles', 'class' => 'dashboard_widgets_visibility_roles wlcms-select2'), $dashboard_widgets_visibility_roles);
26
+ ?>
27
+ <div class="wlcms-help">
28
+ <?php _e('Select the user roles this will be hidden to.', 'wlcms') ?>
29
+ </div>
30
+ </div>
31
+ <div class="wlcms-input-group toggle-group">
32
+ <ul>
33
+ <li>
34
+ <input type="hidden" value="1" name="dashboard_role_stat" />
35
+ <input class="wlcms-toggle wlcms-toggle-light main-toggle main-toggle-reverse" id="hide_all_dashboard_panels" name="hide_all_dashboard_panels" value="1" type="checkbox" <?php checked(wlcms_field_setting('hide_all_dashboard_panels'), 1, true) ?>/>
36
+ <label class="wlcms-toggle-btn" for="hide_all_dashboard_panels"></label><label class="toggle-label" for="hide_all_dashboard_panels"><?php _e('Hide All Dashboard Panels', 'wlcms')?></label>
37
+ <div class="wlcms-help">
38
+ <?php _e('This will hide all the WordPress default dashboard panels. Or you can specify which panels should appear.', 'wlcms') ?>
39
+ </div>
40
+ <ul class="sub-fields">
41
+ <li>
42
+ <input class="wlcms-toggle wlcms-toggle-light" id="hide_at_a_glance" name="hide_at_a_glance" value="1" type="checkbox" <?php checked(wlcms_field_setting('hide_at_a_glance'), 1, true) ?>/>
43
+ <label class="wlcms-toggle-btn" for="hide_at_a_glance"></label><label class="toggle-label" for="hide_at_a_glance"><?php _e('Hide \'At a Glance\'', 'wlcms')?></label>
44
+ </li>
45
+ <li>
46
+ <input class="wlcms-toggle wlcms-toggle-light" id="hide_activities" name="hide_activities" value="1" type="checkbox" <?php checked(wlcms_field_setting('hide_activities'), 1, true) ?>/>
47
+ <label class="wlcms-toggle-btn" for="hide_activities"></label><label class="toggle-label" for="hide_activities"><?php _e('Hide \'Activity\'', 'wlcms')?></label>
48
+ </li>
49
+ <li>
50
+ <input class="wlcms-toggle wlcms-toggle-light" id="hide_recent_comments" name="hide_recent_comments" value="1" type="checkbox" <?php checked(wlcms_field_setting('hide_recent_comments'), 1, true) ?>/>
51
+ <label class="wlcms-toggle-btn" for="hide_recent_comments"></label><label class="toggle-label" for="hide_recent_comments"><?php _e('Hide \'Recent Comments\'', 'wlcms') ?></label>
52
+ </li>
53
+ <li>
54
+ <input class="wlcms-toggle wlcms-toggle-light" id="hide_quick_press" name="hide_quick_press" value="1" type="checkbox" <?php checked(wlcms_field_setting('hide_quick_press'), 1, true) ?>/>
55
+ <label class="wlcms-toggle-btn" for="hide_quick_press"></label><label class="toggle-label" for="hide_quick_press"><?php _e('Remove \'Quick Draft\'', 'wlcms')?></label>
56
+ </li>
57
+ <li>
58
+ <input class="wlcms-toggle wlcms-toggle-light" id="hide_news_and_events" name="hide_news_and_events" value="1" type="checkbox" <?php checked(wlcms_field_setting('hide_news_and_events'), 1, true) ?>/>
59
+ <label class="wlcms-toggle-btn" for="hide_news_and_events"></label><label class="toggle-label" for="hide_news_and_events"><?php _e('Remove WordPress Events and News Widget', 'wlcms')?></label>
60
+ </li>
61
+ <li>
62
+ <input class="wlcms-toggle wlcms-toggle-light" id="remove_empty_dash_panel" name="remove_empty_dash_panel" value="1" type="checkbox" <?php checked(wlcms_field_setting('remove_empty_dash_panel'), 1, true) ?>/>
63
+ <label class="wlcms-toggle-btn" for="remove_empty_dash_panel"></label><label class="toggle-label" for="remove_empty_dash_panel"><?php _e('Remove Empty Dashboard Panel', 'wlcms')?></label>
64
+ </li>
65
+ </ul>
66
+ </li>
67
+ </ul>
68
+ </div>
view/admin/parts/dashboard-rss-dashboard-panel.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-input-group toggle-group">
2
+ <div class="wlcms-input">
3
+ <input class="wlcms-toggle wlcms-toggle-light main-toggle" data-revised="1" id="add_own_rss_panel" name="add_own_rss_panel" value="1" type="checkbox" <?php checked(wlcms_field_setting('add_own_rss_panel'), 1, true) ?>/>
4
+ <label class="wlcms-toggle-btn" for="add_own_rss_panel"></label><label class="toggle-label" for="add_own_rss_panel"><?php _e('Add Your Own RSS Panel', 'wlcms') ?></label>
5
+ </div>
6
+ <div class="wlcms-help">
7
+ <?php _e('This will appear on the dashboard. If you want your client to be kept up to date with what you are doing in your business, set up your RSS feed.', 'wlcms') ?>
8
+ </div>
9
+ <div class="sub-fields">
10
+
11
+ <div class="wlcms-input">
12
+ <div class="wlcms-input-group">
13
+ <label><?php _e('RSS Title', 'wlcms') ?></label>
14
+ <div class="wlcms-input">
15
+ <input type="text" name="rss_title" value="<?php echo wlcms_field_setting('rss_title') ?>" />
16
+ </div>
17
+ <div class="wlcms-help">
18
+ <?php _e('The title of the RSS Panel', 'wlcms') ?>
19
+ </div>
20
+ </div>
21
+
22
+ <div class="wlcms-input-group">
23
+ <?php echo wlcms_form_upload_field('Add Your Logo', 'rss_logo', 'Add a logo to appear on the panel before the title.') ?>
24
+ </div>
25
+
26
+ <div class="wlcms-input-group">
27
+ <label><?php _e('RSS Feed', 'wlcms') ?></label>
28
+ <div class="wlcms-input">
29
+ <input type="text" id="rss_feed_address" name="rss_feed_address" value="<?php echo wlcms_field_setting('rss_feed_address') ?>" />
30
+ </div>
31
+ <div class="wlcms-help">
32
+ <?php _e('The RSS feed address. For example feed://' . wlcms_site_domain() . '/feed/', 'wlcms') ?>
33
+ </div>
34
+ </div>
35
+
36
+ <div class="wlcms-input-group">
37
+ <label><?php _e('Number of Items to appear', 'wlcms') ?></label>
38
+ <div class="wlcms-input">
39
+ <select name="rss_feed_number_of_item">
40
+ <?php
41
+ $item_setting = wlcms_field_setting('rss_feed_number_of_item');
42
+ for($item = 1; $item <= 10; $item++) {?>
43
+ <option value="<?php echo $item?>" <?php echo ($item == $item_setting) ? ' selected="selected"' : '' ?>><?php echo $item?></option>
44
+ <?php }?>
45
+ </select>
46
+ </div>
47
+ <div class="wlcms-help">
48
+ <?php _e('Number of RSS items to show.', 'wlcms') ?>
49
+ </div>
50
+ </div>
51
+
52
+ <div class="wlcms-input-group">
53
+ <div class="wlcms-input">
54
+ <input class="wlcms-toggle wlcms-toggle-light" id="show_post_content" value="1" name="show_post_content" <?php checked(wlcms_field_setting('show_post_content'), 1, true) ?> type="checkbox"/>
55
+ <label class="wlcms-toggle-btn" for="show_post_content"></label><label class="toggle-label" for="show_post_content"><?php _e('Show Post Contents');?></label>
56
+ </div>
57
+ <div class="wlcms-help">
58
+ <?php _e('', 'wlcms') ?>
59
+ </div>
60
+ </div>
61
+
62
+ <div class="wlcms-input-group">
63
+ <label><?php _e('Introduction HTML', 'wlcms') ?></label>
64
+ <div class="wlcms-input">
65
+ <textarea class="textarea-full" name="rss_introduction"><?php echo wlcms_field_setting('rss_introduction') ?></textarea>
66
+ </div>
67
+ <div class="wlcms-help">
68
+ <?php _e('Add introduction text to appear above the RSS items. You can use HTML.', 'wlcms') ?>
69
+ </div>
70
+ </div>
71
+ </div>
72
+ </div>
73
+ </div>
view/admin/parts/dashboard.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-body-wrapper">
2
+ <div class="wlcms-body-header">
3
+ <h2><?php _e('Default Panels', 'wlcms') ?></h2>
4
+ </div>
5
+ <div class="wlcms-body-main">
6
+ <?php wlcms()->admin_view('parts/dashboard-default-panels'); ?>
7
+ </div>
8
+ </div>
9
+ <div class="wlcms-body-wrapper">
10
+ <div class="wlcms-body-header">
11
+ <h2><?php _e('Custom Welcome Dashboard Panel', 'wlcms') ?></h2>
12
+ </div>
13
+ <div class="wlcms-body-main">
14
+ <?php wlcms()->admin_view('parts/dashboard-custom-welcome-dashboard-panel'); ?>
15
+ </div>
16
+ </div>
17
+ <div class="wlcms-body-wrapper">
18
+ <div class="wlcms-body-header">
19
+ <h2><?php _e('RSS Dashboard Panel', 'wlcms') ?></h2>
20
+ </div>
21
+ <div class="wlcms-body-main">
22
+ <?php wlcms()->admin_view('parts/dashboard-rss-dashboard-panel'); ?>
23
+ </div>
24
+ </div>
view/admin/parts/import-settings.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <section class="tab-import-settings" id="import-settings">
2
+ <div class="wlcms-body-wrapper">
3
+ <div class="wlcms-body-header">
4
+ <h2><?php _e('Import Settings', 'wlcms') ?></h2>
5
+ </div>
6
+ <div class="wlcms-body-main">
7
+ <div class="wlcms-input-group">
8
+ <div class="wlcms-input">
9
+ <input type="file" name="import_file" id="import_file" />
10
+ </div>
11
+ <div class="wlcms-help">
12
+ <?php _e('To import the settings from another website', 'wlcms') ?>
13
+ </div>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ </section>
view/admin/parts/index.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ die('Access denied.');
4
+ }
view/admin/parts/live-preview.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <div class="lightbox short-animate" id="wlcms-preview-content">
2
+
3
+ </div>
4
+ <div id="lightbox-controls" class="short-animate">
5
+ <a id="close-lightbox" class="long-animate" href="#">Close Preview</a>
6
+ </div>
view/admin/parts/login-advanced.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-input-group">
2
+ <div class="wlcms-input">
3
+
4
+ <input class="wlcms-toggle wlcms-toggle-light" id="hide_register_lost_password" name="hide_register_lost_password" value="1" type="checkbox" <?php checked(wlcms_field_setting('hide_register_lost_password'), 1, true) ?>/>
5
+ <label class="wlcms-toggle-btn" for="hide_register_lost_password"></label><label class="toggle-label" for="hide_register_lost_password"><?php _e('Hide "Register / Lost your password?" link', 'wlcms') ?></label>
6
+ </div>
7
+ <div class="wlcms-help">
8
+ <?php _e('Hide the "Register / Lost your password?" link which appears below the login form.', 'wlcms') ?>
9
+ </div>
10
+ </div>
11
+ <div class="wlcms-input-group">
12
+ <div class="wlcms-input">
13
+ <input class="wlcms-toggle wlcms-toggle-light" id="hide_back_to_link" name="hide_back_to_link" value="1" type="checkbox" <?php checked(wlcms_field_setting('hide_back_to_link'), 1, true) ?>/>
14
+ <label class="wlcms-toggle-btn" for="hide_back_to_link"></label><label class="toggle-label" for="hide_back_to_link"><?php _e('Hide "Back to" link', 'wlcms') ?></label>
15
+ </div>
16
+ <div class="wlcms-help">
17
+ <?php _e('Hide the "Back to" link which appears below the login form.', 'wlcms') ?>
18
+ </div>
19
+ </div>
20
+
21
+ <div class="wlcms-input-group">
22
+ <label><?php _e('Form Background Color', 'wlcms') ?></label>
23
+ <div class="wlcms-input">
24
+ <input type="text" name="form_background_color" class="wlcms-color-field" value="<?php echo wlcms_field_setting('form_background_color') ?>" />
25
+ </div>
26
+ <div class="wlcms-help">
27
+ <?php _e('Background color of the login form', 'wlcms') ?>
28
+ </div>
29
+ </div>
30
+
31
+ <div class="wlcms-input-group">
32
+ <label><?php _e('Form Label Color', 'wlcms') ?></label>
33
+ <div class="wlcms-input">
34
+ <input type="text" name="form_label_color" class="wlcms-color-field" value="<?php echo wlcms_field_setting('form_label_color') ?>" />
35
+ </div>
36
+ <div class="wlcms-help">
37
+ <?php _e('Color of the labels on the login form', 'wlcms') ?>
38
+ </div>
39
+ </div>
40
+
41
+ <div class="wlcms-input-group">
42
+ <label><?php _e('Form Button Color', 'wlcms') ?></label>
43
+ <div class="wlcms-input">
44
+ <input type="text" name="form_button_color" class="wlcms-color-field" value="<?php echo wlcms_field_setting('form_button_color') ?>" />
45
+ </div>
46
+ <div class="wlcms-help">
47
+ <?php _e('Color of the button on the login form', 'wlcms') ?>
48
+ </div>
49
+ </div>
50
+
51
+ <div class="wlcms-input-group">
52
+ <label><?php _e('Form Button Hover Color', 'wlcms') ?></label>
53
+ <div class="wlcms-input">
54
+ <input type="text" name="form_button_hover_color" class="wlcms-color-field" value="<?php echo wlcms_field_setting('form_button_hover_color') ?>" />
55
+ </div>
56
+ <div class="wlcms-help">
57
+ <?php _e('Hover color of the button on the login form', 'wlcms') ?>
58
+ </div>
59
+ </div>
60
+
61
+ <div class="wlcms-input-group">
62
+ <label><?php _e('Form Button Text Color', 'wlcms') ?></label>
63
+ <div class="wlcms-input">
64
+ <input type="text" name="form_button_text_color" class="wlcms-color-field" value="<?php echo wlcms_field_setting('form_button_text_color') ?>" />
65
+ </div>
66
+ <div class="wlcms-help">
67
+ <?php _e('Color of the text on the button on the login form', 'wlcms') ?>
68
+ </div>
69
+ </div>
70
+
71
+ <div class="wlcms-input-group">
72
+ <label><?php _e('Form Button Text Hover Color', 'wlcms') ?></label>
73
+ <div class="wlcms-input">
74
+ <input type="text" name="form_button_text_hover_color" class="wlcms-color-field" value="<?php echo wlcms_field_setting('form_button_text_hover_color') ?>" />
75
+ </div>
76
+ <div class="wlcms-help">
77
+ <?php _e('Hover color of the text on the button on the login form', 'wlcms') ?>
78
+ </div>
79
+ </div>
80
+
81
+ <div class="wlcms-input-group">
82
+ <label><?php _e('Back to / Register Link Color', 'wlcms') ?></label>
83
+ <div class="wlcms-input">
84
+ <input type="text" name="back_to_register_link_color" class="wlcms-color-field" value="<?php echo wlcms_field_setting('back_to_register_link_color') ?>" />
85
+ </div>
86
+ <div class="wlcms-help">
87
+ <?php _e('Color of the link text of Back to / Register', 'wlcms') ?>
88
+ </div>
89
+ </div>
90
+
91
+ <div class="wlcms-input-group">
92
+ <label><?php _e('Back to / Register Link Hover Color', 'wlcms') ?></label>
93
+ <div class="wlcms-input">
94
+ <input type="text" name="back_to_register_link_hover_color" class="wlcms-color-field" value="<?php echo wlcms_field_setting('back_to_register_link_hover_color') ?>" />
95
+ </div>
96
+ <div class="wlcms-help">
97
+ <?php _e('Hover color of the link text of Back to / Register', 'wlcms') ?>
98
+ </div>
99
+ </div>
100
+
101
+ <div class="wlcms-input-group">
102
+ <label><?php _e('Privacy Policy Link Color', 'wlcms') ?></label>
103
+ <div class="wlcms-input">
104
+ <input type="text" name="privacy_policy_link_color" class="wlcms-color-field" value="<?php echo wlcms_field_setting('privacy_policy_link_color') ?>" />
105
+ </div>
106
+ <div class="wlcms-help">
107
+ <?php _e('Color of the link text of Privacy Policy', 'wlcms') ?>
108
+ </div>
109
+ </div>
110
+
111
+ <div class="wlcms-input-group">
112
+ <label><?php _e('Privacy Policy Link Hover Color', 'wlcms') ?></label>
113
+ <div class="wlcms-input">
114
+ <input type="text" name="privacy_policy_link_hover_color" class="wlcms-color-field" value="<?php echo wlcms_field_setting('privacy_policy_link_hover_color') ?>" />
115
+ </div>
116
+ <div class="wlcms-help">
117
+ <?php _e('Hover color of the link text of Privacy Policy', 'wlcms') ?>
118
+ </div>
119
+ </div>
120
+ <?php if( !is_multisite() ):?>
121
+ <p align="center"><a href="#wlcms-preview-content" class="wlcms-preview-link"><?php _e('Live Preview', 'wlcms') ?></a></p>
122
+ <?php endif;?>
view/admin/parts/login-custom-css.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-input-group">
2
+ <div class="wlcms-input">
3
+ <textarea class="textarea-full wlcms-css" name="login_custom_css"><?php echo esc_textarea(wlcms_field_setting('login_custom_css')) ?></textarea>
4
+ </div>
5
+ <div class="wlcms-help">
6
+ <p><?php _e('Completely customise the login page by entering your own CSS.', 'wlcms') ?></p>
7
+ <p><?php _e('For example', 'wlcms') ?>:<br/>
8
+ .login form { background-color: #0013FF }<br/>
9
+ .login #login p#nav a { color: #333 !important }<br/>
10
+ </p>
11
+ <p>
12
+ <?php _e('Or if you want to get fancy', 'wlcms') ?>:<br/>
13
+ #wlcms-login-wrapper{ background: url('wp-content/plugins/white-label-cms/images/footergrass.jpg') repeat-x fixed center bottom transparent; display: block; height: 100%; left: 0; overflow: auto; position: absolute; top: 0; width: 100%;}
14
+ </p>
15
+ </div>
16
+ </div>
17
+ <?php if( !is_multisite() ):?>
18
+ <p align="center"><a href="#wlcms-preview-content" class="wlcms-preview-link"><?php _e('Live Preview', 'wlcms') ?></a></p>
19
+ <?php endif;?>
view/admin/parts/login-live-preview.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <div class="lightbox short-animate" id="wlcms-login">
2
+
3
+ </div>
4
+ <div id="lightbox-controls" class="short-animate">
5
+ <a id="close-lightbox" class="long-animate" href="#login">Close Login</a>
6
+ </div>
view/admin/parts/login-logo-and-background.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-input-group">
2
+ <?php echo wlcms_form_upload_field('Login Logo', 'login_logo', 'Replace the WordPress logo on the login page. Max width 320px') ?>
3
+ </div>
4
+
5
+ <div class="wlcms-input-group">
6
+ <?php echo wlcms_form_upload_field('Retina Login Logo', 'retina_login_logo', 'Replace the Retina WordPress logo on the login page. Please make sure you use the standard retina format of x2') ?>
7
+ </div>
8
+
9
+ <div class="wlcms-input-group">
10
+ <label><?php _e('Logo Width', 'wlcms') ?></label>
11
+ <div class="wlcms-input">
12
+ <input type="number" name="logo_width" class="wlcms-upload-input" value="<?php echo wlcms_field_setting('logo_width', '') ?>" />px
13
+ </div>
14
+ <div class="wlcms-help">
15
+ <?php _e('Add a width to your Login Logo. Max width 320px', 'wlcms') ?>
16
+ </div>
17
+ </div>
18
+ <div class="wlcms-input-group">
19
+ <label><?php _e('Logo Height', 'wlcms') ?></label>
20
+ <div class="wlcms-input">
21
+ <input type="number" name="logo_height" class="wlcms-upload-input" value="<?php echo wlcms_field_setting('logo_height', '') ?>" />px
22
+ </div>
23
+ <div class="wlcms-help">
24
+ <?php _e('Add a height to your Login Logo.', 'wlcms') ?>
25
+ </div>
26
+ </div>
27
+
28
+ <div class="wlcms-input-group">
29
+ <label><?php _e('Logo Bottom Margin', 'wlcms') ?></label>
30
+ <div class="wlcms-input">
31
+ <input type="number" name="logo_bottom_margin" class="wlcms-upload-input" value="<?php echo wlcms_field_setting('logo_bottom_margin') ?>" />px
32
+ </div>
33
+ <div class="wlcms-help">
34
+ <?php _e('Add a bottom margin to your Login Logo.', 'wlcms') ?>
35
+ </div>
36
+ </div>
37
+
38
+ <div class="wlcms-input-group">
39
+ <label><?php _e('Background Color', 'wlcms') ?></label>
40
+ <div class="wlcms-input">
41
+ <input type="text" name="background_color" class="wlcms-color-field" value="<?php echo wlcms_field_setting('background_color') ?>" />
42
+ </div>
43
+ <div class="wlcms-help">
44
+ <?php _e('Background color for the login page. Changing to White will help your logo standout.', 'wlcms') ?>
45
+ </div>
46
+ </div>
47
+
48
+ <div class="wlcms-input-group">
49
+ <?php echo wlcms_form_upload_field('Background Image', 'background_image', 'Adds a background image to the login page.') ?>
50
+ </div>
51
+
52
+ <div class="wlcms-input-group">
53
+ <div class="wlcms-input">
54
+ <input class="wlcms-toggle wlcms-toggle-light" id="full_screen_background_image" name="full_screen_background_image" value="1" type="checkbox" <?php checked(wlcms_field_setting('full_screen_background_image'), 1, true) ?>/>
55
+ <label class="wlcms-toggle-btn" for="full_screen_background_image"></label><label class="toggle-label" for="full_screen_background_image"><?php _e('Full Screen Background Image', 'wlcms') ?></label>
56
+ </div>
57
+ <div class="wlcms-help">
58
+ <?php _e('Stretch the background image to appear full screen.', 'wlcms') ?>
59
+ </div>
60
+ </div>
61
+
62
+ <div class="wlcms-input-group">
63
+ <label><?php _e('Background Position', 'wlcms') ?></label>
64
+ <div class="wlcms-input">
65
+ <select class="wlcms-select" name="background_positions">
66
+ <option value="center center" <?php selected(wlcms_field_setting('background_positions'), 'center center', true) ?>>Center Center</option>
67
+ <option value="center top" <?php selected(wlcms_field_setting('background_positions'), 'center top', true) ?>>Center Top</option>
68
+ <option value="center bottom" <?php selected(wlcms_field_setting('background_positions'), 'center bottom', true) ?>>Center Bottom</option>
69
+ <option value="left top" <?php selected(wlcms_field_setting('background_positions'), 'left top', true) ?>>Left Top</option>
70
+ <option value="left center" <?php selected(wlcms_field_setting('background_positions'), 'left center', true) ?>>Left Center</option>
71
+ <option value="left bottom" <?php selected(wlcms_field_setting('background_positions'), 'left bottom', true) ?>>Left Bottom</option>
72
+ <option value="right top" <?php selected(wlcms_field_setting('background_positions'), 'right top', true) ?>>Right Top</option>
73
+ <option value="right center" <?php selected(wlcms_field_setting('background_positions'), 'right center', true) ?>>Right Center</option>
74
+ <option value="right bottom" <?php selected(wlcms_field_setting('background_positions'), 'right bottom', true) ?>>Right Bottom</option>
75
+ </select>
76
+ </div>
77
+ <div class="wlcms-help">
78
+ <?php _e('Specify the CSS background position.', 'wlcms') ?>
79
+ </div>
80
+ </div>
81
+
82
+ <div class="wlcms-input-group">
83
+ <label><?php _e('Background Repeat', 'wlcms') ?></label>
84
+ <div class="wlcms-input">
85
+ <select class="wlcms-select" name="background_repeat">
86
+ <option value="repeat" <?php selected(wlcms_field_setting('background_repeat'), 'repeat', true) ?>>repeat</option>
87
+ <option value="repeat-y" <?php selected(wlcms_field_setting('background_repeat'), 'repeat-y', true) ?>>repeat-y</option>
88
+ <option value="no-repeat" <?php selected(wlcms_field_setting('background_repeat'), 'no-repeat', true) ?>>no-repeat</option>
89
+ </select>
90
+ </div>
91
+ <div class="wlcms-help">
92
+ <?php _e('Specify the CSS background-repeat.', 'wlcms') ?>
93
+ </div>
94
+ </div>
95
+ <?php if( !is_multisite() ):?>
96
+ <p align="center"><a href="#wlcms-preview-content" class="wlcms-preview-link"><?php _e('Live Preview', 'wlcms') ?></a></p>
97
+ <?php endif;?>
view/admin/parts/login.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-body-wrapper">
2
+ <div class="wlcms-body-header">
3
+ <h2><?php _e('Logo and Background', 'wlcms') ?></h2>
4
+ </div>
5
+ <div class="wlcms-body-main">
6
+ <input type="hidden" name="form_section" value="setting" />
7
+ <?php wlcms()->admin_view('parts/login-logo-and-background'); ?>
8
+ </div>
9
+ </div>
10
+
11
+ <div class="wlcms-body-wrapper">
12
+ <div class="wlcms-body-header">
13
+ <h2><?php _e('Advanced', 'wlcms') ?></h2>
14
+ </div>
15
+ <div class="wlcms-body-main">
16
+ <?php wlcms()->admin_view('parts/login-advanced'); ?>
17
+ </div>
18
+ </div>
19
+
20
+ <div class="wlcms-body-wrapper">
21
+ <div class="wlcms-body-header">
22
+ <h2><?php _e('Custom CSS', 'wlcms') ?></h2>
23
+ </div>
24
+ <div class="wlcms-body-main">
25
+ <?php wlcms()->admin_view('parts/login-custom-css'); ?>
26
+ </div>
27
+ </div>
28
+
29
+ <div class="login-live-preview">
30
+ <?php wlcms()->admin_view('parts/live-preview'); ?>
31
+ </div>
view/admin/parts/menus-admin-bar-menus.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-input-group wlcms-toggle-wrapper wlcms-menus-settings">
2
+ <div class="wlcms-help">
3
+ <p><?php _e('Admin Bar Menus will be hidden to all User Roles up to and including Admins with the exception of White Label CMS Admins and Super Admins', 'wlcms') ?></p>
4
+ </div>
5
+ <?php
6
+
7
+ $menu_class = wlcms()->Admin_Menus();
8
+ $admin_bar_menu_setting = wlcms_field_setting('admin_bar_menus');
9
+
10
+ if ($admin_bar_menus = $menu_class->get_admin_bar_menus()) {
11
+
12
+ echo $menu_class->get_admin_bar_menu_html($admin_bar_menus);
13
+
14
+ }
15
+ ?>
16
+ </div>
view/admin/parts/menus-legacy.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $legacy = wlcms_field_setting('legacy_menu');
3
+ if($legacy) {
4
+ ?>
5
+ <div class="wlcms-body-wrapper">
6
+ <div class="wlcms-body-header">
7
+ <h2><?php _e('White Label CMS Legacy Menus', 'wlcms') ?></h2>
8
+ </div>
9
+ <div class="wlcms-body-main">
10
+ <div class="wlcms-input-group">
11
+ <div class="wlcms-help">
12
+ <p><i><?php _e('You are seeing this because you have installed version 1 of the plugin in the past.', 'wlcms') ?></i></p>
13
+ <p><i><?php _e('In version 1 you could only change the menus for Editors.', 'wlcms') ?></i></p>
14
+ <p><i><?php _e('We recommend using the new White Label CMS Admin to manage the menus and in order to do so you must reset the menus to the WordPress Defaults. If you do this, this section will disappear.', 'wlcms') ?></i></p>
15
+ </div>
16
+ <div class="wlcms-input">
17
+ <input class="wlcms-toggle wlcms-toggle-light" name="remove_legacy_menu" value="1" id="remove_legacy_menu" type="checkbox" <?php checked(wlcms_field_setting('remove_legacy_menu'), 1, true) ?>/>
18
+ <label class="wlcms-toggle-btn" for="remove_legacy_menu"></label><label class="toggle-label" for="remove_legacy_menu"><?php _e('Use the new version', 'wlcms') ?></label>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ <?php }
view/admin/parts/menus-menus.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-input-group wlcms-toggle-wrapper wlcms-menus-settings">
2
+ <div class="wlcms-help">
3
+ <p><?php _e('Menus will be hidden to all User Roles up to and including Admins (with the exception of White Label CMS Admins and Super Admins).', 'wlcms') ?></p>
4
+ <p><?php _e('Select which menus you want to appear.', 'wlcms') ?></p>
5
+ </div>
6
+ <input type="hidden" value="index.php" name="admin_menus[main][]">
7
+ <input type="hidden" value="index.php_wlcms_index-php" name="admin_menus[sub][]">
8
+ <?php
9
+
10
+ $menu_class = wlcms()->Admin_Menus();
11
+ $admin_menu = wlcms_field_setting('admin_menus');
12
+ $sidebar_url = sanitize_title(wlcms()->Branding()->sidebar_menu_url());
13
+ $setting_admin_menus = wlcms_field_setting('admin_menus');
14
+
15
+ if( $admin_menus = $menu_class->get_admin_menus() ):
16
+ echo '<ul>';
17
+
18
+ foreach ($admin_menus as $main_key => $main_menu):
19
+
20
+ if( $main_key == $sidebar_url ) {
21
+ continue;
22
+ }
23
+ $main_menu_checked = ' checked="checked"';
24
+ $menu_name = $main_menu['name'];
25
+ $menu_slug = $main_menu['slug'];
26
+ if( is_array($setting_admin_menus) && isset($setting_admin_menus['main']) && in_array($menu_slug, $setting_admin_menus['main'] )) {
27
+ $main_menu_checked = '';
28
+ }
29
+
30
+ $disabled = '';
31
+ if( $main_key == 'index.php' ) {
32
+ $disabled = ' disabled';
33
+ }
34
+
35
+ ?>
36
+ <li>
37
+ <input class="wlcms-toggle wlcms-toggle-light main-toggle"<?php echo $disabled?> id="admin_menus_<?php echo $main_key?>" name="admin_menus[main][]" value="<?php echo $menu_slug ?>" type="checkbox"<?php echo $main_menu_checked?>/>
38
+ <label class="wlcms-toggle-btn<?php echo $disabled?>" for="admin_menus_<?php echo $main_key?>"></label><label class="toggle-label" for="admin_menus_<?php echo $main_key?>"><?php _e( $menu_name , 'wlcms') ?></label>
39
+ <?php
40
+ if( isset($main_menu['submenus']) && count( $main_menu['submenus'] )):
41
+ echo '<a href="javascript:void(0)" class="wlcms-toggle-arrow"></a><ul class="sub_menu_wrapper">';
42
+ $submenus = $main_menu['submenus'];
43
+
44
+ foreach ($submenus as $submenu_key => $sub_menu):
45
+
46
+ $sub_menu_name = $sub_menu['name'];
47
+ $checked_sub = ' checked="checked"';
48
+ $submenu_value = $sub_menu['slug'];
49
+ $disabled = '';
50
+ if( $submenu_key == 'index-php' ) {
51
+ $disabled = ' disabled';
52
+ }elseif( $submenu_key == 'wlcms-plugin-php') {
53
+ continue;
54
+ }
55
+
56
+ if( is_array($setting_admin_menus) && (isset($setting_admin_menus['sub']) && in_array($submenu_value, $setting_admin_menus['sub'] ) )) {
57
+ $checked_sub = '';
58
+ }
59
+ ?>
60
+ <li>
61
+ <input class="wlcms-toggle wlcms-toggle-light sub-toggle"<?php echo $disabled?> id="admin_sub_menus_<?php echo $submenu_key?>" name="admin_menus[sub][]" value="<?php echo $submenu_value ?>" type="checkbox" <?php echo $checked_sub ?>/>
62
+ <label class="wlcms-toggle-btn<?php echo $disabled?>" for="admin_sub_menus_<?php echo $submenu_key?>"></label><label class="toggle-label" for="admin_sub_menus_<?php echo $submenu_key?>"><?php _e( $sub_menu_name , 'wlcms') ?></label>
63
+ </li>
64
+ <?php
65
+ endforeach;
66
+ echo '</ul>';
67
+ endif;
68
+ ?>
69
+ </li>
70
+ <?php
71
+ endforeach;
72
+ echo '</ul>';
73
+ endif;?>
74
+ </div>
view/admin/parts/menus-white-label-cms-admin.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $current_user = wp_get_current_user();
3
+ ?>
4
+ <div class="wlcms-input-group toggle-group wlcms_admin_wrapper">
5
+ <div class="wlcms-input">
6
+ <label class="toggle-label" for="enable_wlcms_admin"><?php _e('Want to hide menus for your client?', 'wlcms') ?></label>
7
+ <input class="wlcms-toggle wlcms-toggle-light main-toggle" data-revised="1" id="enable_wlcms_admin" name="enable_wlcms_admin" value="1" type="checkbox" <?php checked(wlcms_field_setting('enable_wlcms_admin'), 1, true) ?>/>
8
+ <label class="wlcms-toggle-btn" for="enable_wlcms_admin"></label>
9
+ </div>
10
+ <div class="sub-fields">
11
+ <p><?php _e('You are now a White Label CMS Admin. This allows you to modify the menus that other people will see.', 'wlcms') ?></p>
12
+ <p><?php echo sprintf('<strong>%s: %s</strong>', __('You', 'wlcms'), $current_user->user_email); ?></p>
13
+
14
+ <input name="wlcms_admin[]" value="<?php echo $current_user->ID ?>" type="hidden"/>
15
+ <?php
16
+ $admin_args = array(
17
+ 'role' => 'administrator',
18
+ 'exclude' => $current_user->ID,
19
+ );
20
+ $adminusers = get_users( $admin_args );
21
+ $wlcms_admin_setting = wlcms_field_setting('wlcms_admin');
22
+
23
+ if( count( $adminusers ) ):
24
+ echo sprintf('<label>%s</label>', __('Other Admins:', 'wlcms'));
25
+ echo '<div class="wlcms-other-admins">';
26
+ foreach ( $adminusers as $user ) { ?>
27
+ <div class="wlcms-input">
28
+ <input class="wlcms-toggle wlcms-toggle-light wlcms_admin_users" id="wlcms_admin_<?php echo $user->ID?>" name="wlcms_admin[]" value="<?php echo $user->ID ?>" type="checkbox" <?php
29
+ if( $wlcms_admin_setting && in_array( $user->ID, $wlcms_admin_setting ) ):
30
+ ?>checked="checked"<?php
31
+ endif;?>/>
32
+ <label class="wlcms-toggle-btn" for="wlcms_admin_<?php echo $user->ID?>"></label>&nbsp;&nbsp;<label class="toggle-label" for="wlcms_admin_<?php echo $user->ID?>"><?php echo $user->user_email ?></label>
33
+ </div>
34
+ <?php
35
+ }
36
+ echo '</div>';
37
+ endif;
38
+ ?>
39
+ <div class="wlcms-help">
40
+ <p><?php _e('By selecting a White Label CMS Admin it means that only the selected Admins will be able to modify the settings for White Label CMS, as it won\'t be visible in the menu to anybody else. <a href="https://www.videousermanuals.com/white-label-cms/" target="_blank">Learn more about this feature</a>.', 'wlcms') ?></p>
41
+ </div>
42
+ </div>
43
+ </div>
view/admin/parts/menus.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php wlcms()->admin_view('parts/menus-legacy'); ?>
2
+ <div class="wlcms-body-wrapper">
3
+ <div class="wlcms-body-header">
4
+ <h2><?php _e('White Label CMS Admin', 'wlcms') ?></h2>
5
+ </div>
6
+ <div class="wlcms-body-main">
7
+ <?php wlcms()->admin_view('parts/menus-white-label-cms-admin'); ?>
8
+ </div>
9
+ </div>
10
+ <div class="wlcms-body-wrapper menu-admin-wrapper">
11
+ <div class="wlcms-body-header">
12
+ <h2><?php _e('Menus', 'wlcms') ?></h2>
13
+ </div>
14
+ <div class="wlcms-body-main">
15
+ <?php wlcms()->admin_view('parts/menus-menus'); ?>
16
+ </div>
17
+ </div>
18
+ <div class="wlcms-body-wrapper menu-admin-wrapper">
19
+ <div class="wlcms-body-header">
20
+ <h2><?php _e('Admin Bar Menus', 'wlcms') ?></h2>
21
+ </div>
22
+ <div class="wlcms-body-main">
23
+ <?php wlcms()->admin_view('parts/menus-admin-bar-menus'); ?>
24
+ </div>
25
+ </div>
view/admin/parts/settings-admin-bar-setting.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="wlcms-input-group">
3
+ <div class="wlcms-input">
4
+ <input class="wlcms-toggle wlcms-toggle-light" id="hide_admin_bar_all" value="1" name="hide_admin_bar_all" <?php checked(wlcms_field_setting('hide_admin_bar_all'), 1, true) ?> type="checkbox"/>
5
+ <label class="wlcms-toggle-btn" for="hide_admin_bar_all"></label><label class="toggle-label" for="hide_admin_bar_all"><?php _e('Hide Front-end Admin Bar'); ?></label>
6
+ </div>
7
+ <div class="wlcms-help">
8
+ <?php _e('This will disable the admin bar on the front-end for all logged in users', 'wlcms') ?>
9
+ </div>
10
+ </div>
view/admin/parts/settings-admin-settings.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="wlcms-input-group">
3
+ <div class="wlcms-input">
4
+ <input class="wlcms-toggle wlcms-toggle-light" id="hide_help_box" name="hide_help_box" value="1" type="checkbox" <?php checked(wlcms_field_setting('hide_help_box'), 1, true) ?>/>
5
+ <label class="wlcms-toggle-btn" for="hide_help_box"></label><label class="toggle-label" for="hide_help_box"><?php _e('Hide Help Box', 'wlcms') ?></label>
6
+ </div>
7
+ <div class="wlcms-help">
8
+ <?php _e('Hide the help tab which appears in the top right', 'wlcms') ?>
9
+ </div>
10
+ </div>
11
+
12
+ <div class="wlcms-input-group">
13
+ <div class="wlcms-input">
14
+ <input class="wlcms-toggle wlcms-toggle-light" id="hide_screen_options" name="hide_screen_options" value="1" type="checkbox" <?php checked(wlcms_field_setting('hide_screen_options'), 1, true) ?>/>
15
+ <label class="wlcms-toggle-btn" for="hide_screen_options"></label><label class="toggle-label" for="hide_screen_options"><?php _e('Hide Screen Options', 'wlcms') ?></label>
16
+ </div>
17
+ <div class="wlcms-help">
18
+ <?php _e('Hide the screen options which appear in the top right', 'wlcms') ?>
19
+ </div>
20
+ </div>
view/admin/parts/settings-custom-css-for-admin.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <div class="wlcms-input-group">
2
+ <div class="wlcms-input">
3
+ <textarea class="textarea-full" name="settings_custom_css_admin"><?php echo wlcms_field_setting('settings_custom_css_admin') ?></textarea>
4
+ </div>
5
+ <div class="wlcms-help"><?php _e('Override or add to any of the styles in the WordPress admin enter your own custom css here', 'wlcms') ?></div>
6
+ </div>
view/admin/parts/settings-custom-editor-stylesheet.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-input-group">
2
+ <label><?php _e('Custom Stylesheet URL', 'wlcms') ?></label>
3
+ <div class="wlcms-input">
4
+ <input type="text" name="settings_custom_css_url" value="<?php echo wlcms_field_setting('settings_custom_css_url') ?>" />
5
+ </div>
6
+ <div class="wlcms-help">
7
+ <?php _e('Create and upload a custom stylesheet with all style rules prefixed with .mceContentBody to your themes directory and enter the filename', 'wlcms') ?>
8
+ </div>
9
+ </div>
view/admin/parts/settings-hide-page-meta-boxes.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $meta_boxes = array(
3
+ 'custom_fields' => 'Custom Fields',
4
+ 'author' => 'Author',
5
+ 'discussion' => 'Discussion',
6
+ 'revisions' => 'Revisions',
7
+ 'page_attributes' => 'Page Attributes',
8
+ 'slug' => 'Slug'
9
+ );
10
+ ?>
11
+ <div class="wlcms-input-group">
12
+ <ul>
13
+ <?php
14
+ foreach ($meta_boxes as $box_key => $box_value) {
15
+ ?>
16
+ <li>
17
+ <div class="wlcms-input">
18
+ <input class="wlcms-toggle wlcms-toggle-light" id="metabox_page_<?php echo $box_key ?>" name="metabox_page_<?php echo $box_key ?>" value="1" type="checkbox" <?php checked(wlcms_field_setting('metabox_page_' . $box_key ), 1, true) ?>/>
19
+ <label class="wlcms-toggle-btn" for="metabox_page_<?php echo $box_key ?>"></label><label class="toggle-label" for="metabox_page_<?php echo $box_key ?>"><?php _e($box_value, 'wlcms') ?></label>
20
+ </div>
21
+ </li>
22
+ <?php
23
+ }
24
+ ?>
25
+ </ul>
26
+ </div>
view/admin/parts/settings-hide-post-meta-boxes.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $meta_boxes = array(
3
+ 'excerpt' => 'Excerpt',
4
+ 'slug' => 'Slug',
5
+ 'tags' => 'Tags',
6
+ 'author' => 'Author',
7
+ 'comments' => 'Comments',
8
+ 'revisions' => 'Revisions',
9
+ 'discussion' => 'Discussion',
10
+ 'categories' => 'Categories',
11
+ 'custom_fields' => 'Custom Fields',
12
+ 'send_trackbacks' => 'Send Trackbacks'
13
+ );
14
+ ?>
15
+ <div class="wlcms-input-group">
16
+ <ul>
17
+ <?php
18
+ foreach ($meta_boxes as $box_key => $box_value) {
19
+ ?>
20
+ <li>
21
+ <div class="wlcms-input">
22
+ <input class="wlcms-toggle wlcms-toggle-light" id="metabox_post_<?php echo $box_key ?>" name="metabox_post_<?php echo $box_key ?>" value="1" type="checkbox" <?php checked(wlcms_field_setting('metabox_post_' . $box_key ), 1, true) ?>/>
23
+ <label class="wlcms-toggle-btn" for="metabox_post_<?php echo $box_key ?>"></label><label class="toggle-label" for="metabox_post_<?php echo $box_key ?>"><?php _e($box_value, 'wlcms') ?></label>
24
+ </div>
25
+ </li>
26
+ <?php
27
+ }
28
+ ?>
29
+ </ul>
30
+ </div>
view/admin/parts/settings-nag-messages.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-input-group">
2
+ <div class="wlcms-help">
3
+ <?php _e('Nag Messages will be hidden to all User Roles up to and including Admins', 'wlcms') ?>
4
+ </div>
5
+ <div class="wlcms-input">
6
+ <input class="wlcms-toggle wlcms-toggle-light" id="hide_nag_messages" value="1" name="hide_nag_messages" <?php checked(wlcms_field_setting('hide_nag_messages'), 1, true) ?> type="checkbox"/>
7
+ <label class="wlcms-toggle-btn" for="hide_nag_messages"></label><label class="toggle-label" for="hide_nag_messages"><?php _e('Nag Update Messages'); ?></label>
8
+ </div>
9
+ </div>
view/admin/parts/settings.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-body-wrapper">
2
+ <div class="wlcms-body-header">
3
+ <h2><?php _e('Admin Bar', 'wlcms') ?></h2>
4
+ </div>
5
+ <div class="wlcms-body-main">
6
+ <?php wlcms()->admin_view('parts/settings-admin-bar-setting'); ?>
7
+ </div>
8
+ </div>
9
+ <div class="wlcms-body-wrapper">
10
+ <div class="wlcms-body-header">
11
+ <h2><?php _e('Admin Settings', 'wlcms') ?></h2>
12
+ </div>
13
+ <div class="wlcms-body-main">
14
+ <?php wlcms()->admin_view('parts/settings-admin-settings'); ?>
15
+ </div>
16
+ </div>
17
+ <div class="wlcms-body-wrapper">
18
+ <div class="wlcms-body-header">
19
+ <h2><?php _e('Nag Messages', 'wlcms') ?></h2>
20
+ </div>
21
+ <div class="wlcms-body-main">
22
+ <?php wlcms()->admin_view('parts/settings-nag-messages'); ?>
23
+ </div>
24
+ </div>
25
+ <div class="wlcms-body-wrapper">
26
+ <div class="wlcms-body-header">
27
+ <h2><?php _e('Custom CSS for Admin', 'wlcms') ?></h2>
28
+ </div>
29
+ <div class="wlcms-body-main">
30
+ <?php wlcms()->admin_view('parts/settings-custom-css-for-admin'); ?>
31
+ </div>
32
+ </div>
33
+ <div class="wlcms-body-wrapper">
34
+ <div class="wlcms-body-header">
35
+ <h2><?php _e('Custom Editor Stylesheet', 'wlcms') ?></h2>
36
+ </div>
37
+ <div class="wlcms-body-main">
38
+ <?php wlcms()->admin_view('parts/settings-custom-editor-stylesheet'); ?>
39
+ </div>
40
+ </div>
view/admin/parts/wizard-step-1.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <input type="hidden" name="hide_wordpress_logo_and_links" value="1" />
2
+ <input type="hidden" name="hide_all_dashboard_panels" value="1" />
3
+ <input type="hidden" name="hide_at_a_glance" value="1" />
4
+ <input type="hidden" name="hide_activities" value="1" />
5
+ <input type="hidden" name="hide_recent_comments" value="1" />
6
+ <input type="hidden" name="hide_quick_press" value="1" />
7
+ <input type="hidden" name="hide_news_and_events" value="1" />
8
+ <input type="hidden" name="remove_empty_dash_panel" value="1" />
9
+ <input type="hidden" name="hide_wp_version" value="1" />
10
+ <input type="hidden" name="wlcms_wizzard" value="1" />
11
+
12
+ <div class="wlcms-body-wrapper">
13
+ <div class="wlcms-body-header">
14
+ <h2><?php _e('Developer Branding', 'wlcms') ?></h2>
15
+ </div>
16
+ <div class="wlcms-body-main wizard-step1">
17
+ <p>You can set up White Label CMS quickly by adding your details below, and on the next page it will ask you about your clients details. Or you can click the Skip button and add these details later.</p>
18
+ <div class="wlcms-input-group">
19
+ <label><?php _e('Developer Name', 'wlcms') ?></label>
20
+ <div class="wlcms-input">
21
+ <input type="text" name="wizard_developer_name" value="<?php echo wlcms_field_setting('developer_name') ?>" />
22
+ </div>
23
+ <div class="wlcms-help">
24
+ <?php _e('For use in footer and ALT text\'s.', 'wlcms') ?>
25
+ </div>
26
+ </div>
27
+
28
+ <div class="wlcms-input-group">
29
+ <label><?php _e('Developer URL', 'wlcms') ?></label>
30
+ <div class="wlcms-input">
31
+ <input type="url" name="wizard_developer_url" value="<?php echo wlcms_field_setting('developer_url') ?>" />
32
+ </div>
33
+ <div class="wlcms-help">
34
+ <?php _e('For use in footer and admin bar.', 'wlcms') ?>
35
+ </div>
36
+ </div>
37
+
38
+ <div class="wlcms-input-group">
39
+ <label><?php _e('Footer Text', 'wlcms') ?></label>
40
+ <div class="wlcms-input">
41
+ <input type="text" name="footer_text" value="<?php echo wlcms_field_setting('footer_text') ?>" />
42
+ </div>
43
+ <div class="wlcms-help">
44
+ <?php _e('Text which will appear to the right of the Footer Image.', 'wlcms') ?>
45
+ </div>
46
+ </div>
47
+
48
+ <div class="wlcms-input-group">
49
+ <label><?php _e('RSS Feed', 'wlcms') ?></label>
50
+ <div class="wlcms-input">
51
+ <input type="url" name="rss_feed_address" value="<?php echo wlcms_field_setting('rss_feed_address') ?>" />
52
+ </div>
53
+ <div class="wlcms-help">
54
+ <?php _e('The RSS feed address. For example http://' . wlcms_site_domain() . '/feed/', 'wlcms') ?>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ </div>
view/admin/parts/wizard-step-2.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms-body-wrapper">
2
+ <div class="wlcms-body-header">
3
+ <h2><?php _e('Clients Branding', 'wlcms') ?></h2>
4
+ </div>
5
+ <div class="wlcms-body-main">
6
+ <input type="hidden" name="form_section" value="wizard" />
7
+ <!-- Start wlcms-body-main -->
8
+ <div class="wlcms-input-group">
9
+ <label><?php _e('Clients Business Name', 'wlcms') ?></label>
10
+ <div class="wlcms-input">
11
+ <input type="text" name="client_business_name" value="<?php echo wlcms_field_setting('client_business_name') ?>" />
12
+ </div>
13
+ <div class="wlcms-help">
14
+ <?php _e('For use in Admin Page Title and Dashboard Title.', 'wlcms') ?>
15
+ </div>
16
+ </div>
17
+
18
+ <div class="wlcms-input-group">
19
+ <?php echo wlcms_form_upload_field('Login Logo', 'login_logo', 'Replace the WordPress logo on the login page. Max width 320px') ?>
20
+ </div>
21
+ <div class="wlcms-input-group toggle-group">
22
+ <div class="wlcms-input">
23
+ <input class="wlcms-toggle wlcms-toggle-light main-toggle" data-revised="1" id="add_retina_logo" name="add_retina_logo" value="1" <?php checked(wlcms_field_setting('add_retina_logo'), 1, true) ?> type="checkbox"/>
24
+ <label class="wlcms-toggle-btn" for="add_retina_logo"></label><label class="toggle-label" for="add_retina_logo"><?php _e('Retina Login Logo', 'wlcms') ?></label>
25
+ </div>
26
+ <div class="sub-fields">
27
+ <div class="wlcms-input-group">
28
+ <?php echo wlcms_form_upload_field('Upload Login Logo', 'retina_login_logo', 'Replace the Retina WordPress logo on the login page. Please make sure you use the standard retina format of x2') ?>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ <!-- End wlcms-body-main -->
33
+ </div>
34
+ </div>
view/admin/settings.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $views = array(
3
+ "branding" => __('Branding'),
4
+ "login" => __('Login'),
5
+ "dashboard" => __('Dashboard'),
6
+ "menus" => __('Menus'),
7
+ "settings" => __('Settings')
8
+ );
9
+ ?>
10
+ <div class="wlcms_wrapper">
11
+ <div class="wlcms_messages">
12
+ <?php do_action("wlcms_messages");?>
13
+ <span></span>
14
+ </div>
15
+ <form method="post" enctype="multipart/form-data" class="wlcms-form" action="<?php echo wlcms()->admin_url(); ?>" >
16
+ <?php wp_nonce_field('wlcms-settings-action', 'wlcms-settings_nonce'); ?>
17
+ <div class="wlcms_header">
18
+ <h1 class="wlcms_page_title"><img src="<?php echo WLCMS_ASSETS_URL ?>images/wlcms-logo.png"><?php _e("White Label CMS", 'wlcms'); ?></h1>
19
+ </div>
20
+ <div class="wlcms-navigation navigation">
21
+ <ul>
22
+ <?php
23
+ foreach($views as $slug => $view):
24
+ ?>
25
+ <li>
26
+ <a href="#tab-<?php echo $slug ?>" data-tab="tab-<?php echo $slug ?>" id="wlcms_tab-<?php echo $slug ?>"<?php $slug == 'branding' ? ' class="current"' : ''?>><?php echo $view ?></a>
27
+ </li>
28
+ <?php
29
+ endforeach;
30
+ ?>
31
+ <?php do_action("wlcms_after_menu_tab"); ?>
32
+ </ul>
33
+ <span class="wlcms-pull-right">
34
+ <input type="submit" value="Save" class="button button-primary button-large" name="wlcms-settings" />
35
+ </span>
36
+ </div>
37
+ <div class="wlcms_content">
38
+ <?php
39
+
40
+ do_action("wlcms_before_body");
41
+
42
+ foreach ($views as $slug => $view) :
43
+ echo '<section class="tab-'. $slug .'" id="'. $slug .'">';
44
+ wlcms()->admin_view( 'parts/' . $slug);
45
+ echo '</section>';
46
+ endforeach;
47
+
48
+ do_action("wlcms_after_body");
49
+ ?>
50
+ </div>
51
+ </form>
52
+ <?php wlcms()->admin_view( 'parts/advert');?>
53
+ <div class="wlcms_footer">
54
+ <?php do_action("wlcms_footer"); ?>
55
+ <div class="wlcms-navigation">
56
+ <ul>
57
+ <li><a href="#tab-import-settings" data-tab="tab-import-settings" id="wlcms_tab_import-settings"><?php _e('Import Settings')?></a></li>
58
+ <li><a href="<?php echo admin_url('options-general.php?page=wlcms&wlcms-action=export') ?>" class="wlcms-ignore"><?php _e('Export Settings') ?></a></li>
59
+ <li><a href="<?php echo admin_url('options-general.php?page=wlcms&wlcms-action=reset') ?>" class="wlcms-ignore reset-confirm"><?php _e('Reset Plugin')?></a></li>
60
+ </ul>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ <?php
65
+ wp_enqueue_media();
view/admin/wizard.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wlcms_wrapper">
2
+ <?php do_action("wlcms_messages"); ?>
3
+ <form method="post" enctype="multipart/form-data" class="wlcms-form" action="<?php echo wlcms()->admin_url(); ?>" >
4
+ <?php wp_nonce_field('wlcms-settings-action', 'wlcms-settings_nonce'); ?>
5
+ <div class="wlcms_header">
6
+ <h1 class="wlcms_page_title"><img src="<?php echo WLCMS_ASSETS_URL ?>images/wlcms-logo.png"><?php _e("White Label CMS", 'wlcms'); ?></h1>
7
+ </div>
8
+ <div class="navigation wizard-steps">
9
+ <ul>
10
+ <li id="wlcms_tab_step-1">
11
+ <?php _e('Quick Setup Wizard: Step 1 of 2 - Developers Branding', 'wlcms')?>
12
+ <span class="wlcms-pull-right">
13
+ <a href="<?php echo wlcms()->admin_url() ?>" class="button button-large"><?php _e('Skip', 'wlcms')?></a>
14
+ <input type="button" value="Next" class="button button-primary button-large wlcms-next-step" name="wlcms-settings" />
15
+ </span>
16
+ </li>
17
+ <li id="wlcms_tab_step-2" style="display:none"><?php _e('Quick Setup Wizard: Step 2 of 2 - Clients Branding', 'wlcms')?>
18
+ <span class="wlcms-pull-right">
19
+ <input type="button" value="Back to step 1" class="button wlcms-prev-step button-large" name="wlcms-settings" />
20
+ <input type="submit" value="Save" class="button button-primary button-large" name="wlcms-settings" />
21
+ </span>
22
+ </li>
23
+ </ul>
24
+ </div>
25
+ <div class="wlcms_content">
26
+ <section id="tab-step-1" class="current">
27
+ <?php
28
+ wlcms()->admin_view('parts/wizard-step-1');
29
+ ?>
30
+ </section>
31
+ <section id="tab-step-2" style="display:none">
32
+ <?php
33
+ wlcms()->admin_view('parts/wizard-step-2');
34
+ ?>
35
+ </section>
36
+
37
+ <div class="wizard-live-preview">
38
+ <?php wlcms()->admin_view('parts/live-preview'); ?>
39
+ </div>
40
+ </div>
41
+ </form>
42
+ </div>
43
+ <?php
44
+ wp_enqueue_media();
view/index.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ die('Access denied.');
4
+ }
wlcms-plugin.php CHANGED
@@ -3,955 +3,36 @@
3
  Plugin Name: White Label CMS
4
  Plugin URI: http://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
5
  Description: A plugin that allows you to brand WordPress CMS as your own
6
- Version: 1.6.2
7
  Author: www.videousermanuals.com
8
  Author URI: http://www.videousermanuals.com/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
9
- */
10
 
11
- define('WLCMS','1.6.2');
12
 
13
- if ( ! defined('ABSPATH') ) {
14
- die('Please do not load this file directly.');
15
- }
16
 
 
 
 
 
 
 
17
 
18
- global $wpdbb_content_dir;
19
 
20
- $wpdbb_content_dir = ( defined('WP_CONTENT_DIR') ) ? WP_CONTENT_DIR : ABSPATH . 'wp-content';
 
21
 
22
- if ( ! defined('WP_BACKUP_DIR') ) {
23
- define('WP_BACKUP_DIR', $wpdbb_content_dir . '/');
24
- }
25
 
26
- //if(!function_exists('wp_get_current_user')) {
27
- // include(ABSPATH . "wp-includes/pluggable.php");
28
- //}
29
-
30
- include('includes/conditionals.php');
31
-
32
- add_action('init', 'wlcms_check_for_login');
33
- add_action('admin_menu', 'wlcms_add_menu');
34
- add_action('admin_init', 'wlcms_add_init');
35
- add_action('admin_menu', 'wlcms_add_admin');
36
- add_action('admin_head', 'wlcms_custom_css');
37
- add_action('login_head', 'wlcms_custom_login_logo');
38
- add_action('admin_head', 'wlcms_hide_switch_theme');
39
- add_action('admin_menu', 'wlcms_remove_default_post_metaboxes');
40
- add_action('admin_init', 'wlcms_remove_admin_menus');
41
- add_action('admin_menu', 'wlcms_remove_default_page_metaboxes');
42
- add_action('admin_head', 'wlcms_dashboard_mod');
43
- add_action('admin_head-media-upload-popup', 'wlcms_iframe_mod');
44
- add_action('wp_before_admin_bar_render', 'wlcms_adminbar', 0);
45
- add_action('wp_before_admin_bar_render', 'wlcms_admin_bar', 0);
46
- add_action('wp_dashboard_setup', 'wlcms_add_dashboard_widget_custom' );
47
-
48
- add_filter( 'admin_title', 'wlcms_admin_title', 10, 2);
49
- add_filter( 'mce_css', 'wlcms_custom_editor_stylesheet' );
50
-
51
- function wlcms_check_for_login()
52
- {
53
- if( get_option('wlcms_o_enable_login_redirect') ):
54
- $segments = explode('/' , $_SERVER['REQUEST_URI'] );
55
- if ( $segments[ (count($segments) - 1) ] == 'login' ):
56
- wp_redirect( get_bloginfo('url') . '/wp-login.php' );
57
- exit;
58
- endif;
59
- endif;
60
- }
61
-
62
-
63
- function wlcms_dashboard_mod()
64
- {
65
- global $current_screen, $wp_version;
66
- if( isset($current_screen) && ($current_screen->id == 'dashboard' ) ):
67
-
68
- if( get_option('wlcms_o_dashboard_override') || get_option('wlcms_o_dashboard_override') == '' ) :
69
-
70
- if ( get_option('wlcms_o_dashboard_override') != __('Dashboard') ) :
71
-
72
- $val = (get_option('wlcms_o_dashboard_override') == '' ? '&nbsp;' : get_option('wlcms_o_dashboard_override') );
73
- echo '
74
- <script type="text/javascript">
75
- jQuery(document).ready(function($) {
76
- $("#wpbody-content .wrap h1:eq(0)").html("'.$val.'");
77
- // $("#wpbody-content .wrap h1").css("visibility","visible");
78
- });
79
- </script>';
80
-
81
- endif;
82
-
83
- endif;
84
-
85
- if( get_option('wlcms_o_header_custom_logo') ):
86
-
87
- $background = get_option('wlcms_o_header_custom_logo');
88
-
89
- if(!preg_match("@^https?://@", $background)){
90
- $background = get_bloginfo('stylesheet_directory').'/images/'.$background;
91
- }
92
-
93
- echo '<style type="text/css">
94
- #icon-index {background:transparent;height:auto;width:auto;visibility: hidden;}
95
- #dashboard-widgets-wrap {clear:both}
96
- </style>';
97
- echo '<script type="text/javascript">
98
- jQuery(document).ready(function($) {';
99
- if ( version_compare( $wp_version, '3.8-beta', '>=' ) )
100
- {
101
- echo '$(".index-php #wpbody-content .wrap h1:eq(0)").prepend("<span id=\"wlcms_dashboard_logo\"><img src=\"'.$background.'\" alt=\"\" /></span>");
102
- $("#wlcms_dashboard_logo").css({"visibility":"visible", "display": "block", "float" : "left", "margin": "-2px 8px 0px 0px"});';
103
- }else{
104
- echo '$("#icon-index").html("<img src=\"'.$background.'\" alt=\"\" />");
105
- $("#icon-index").css({"visibility":"visible", "display": "block", "float" : "left", "margin": "7px 8px 0px 0px"});';
106
- }
107
- echo'});
108
- </script>';
109
- endif;
110
-
111
- endif;
112
-
113
- }
114
-
115
- // set admin screen
116
- function wlcms_add_menu()
117
- {
118
- $hook_name = add_options_page('White Label CMS','White Label CMS','manage_options','wlcms-plugin.php','wlcms_admin');
119
- add_action( "admin_print_scripts-$hook_name", 'wlcms_add_admin_scripts' );
120
- }
121
-
122
- function wlcmsUserCompare($needsToBe,$current)
123
- {
124
- if($needsToBe == '0' || $needsToBe == '')
125
- return;
126
-
127
- $roles = array( 'administrator' => 25 , 'editor' => 20, 'author' => 15, 'contributor' => 10, 'subscriber' => 5 );
128
-
129
- $needsToBe = $roles[$needsToBe];
130
- $current = $roles[$current];
131
-
132
- if($current >= $needsToBe ):
133
- return true;
134
- else:
135
- return false;
136
- endif;
137
- }
138
-
139
- function wlcms_remove_others() {
140
-
141
- if( get_option('wlcms_o_dashboard_admin') && current_user_can('activate_plugins') ) { return; }
142
-
143
- global $wp_meta_boxes;
144
- unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
145
- unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
146
- unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
147
- unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
148
- unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
149
- unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
150
- unset($wp_meta_boxes['dashboard']['normal']['core']['custom_help_widget']);
151
- unset($wp_meta_boxes['dashboard']['normal']['core']['my_dashboard_widget']);
152
-
153
- }
154
-
155
- function wlcms_remove_activity_panel()
156
- {
157
- if( get_option('wlcms_o_dashboard_admin') && current_user_can('activate_plugins') ) { return; }
158
- global $wp_meta_boxes;
159
- unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);
160
- }
161
-
162
- function wlcms_remove_right_now()
163
- {
164
- if( get_option('wlcms_o_dashboard_admin') && current_user_can('activate_plugins') ) { return; }
165
- global $wp_meta_boxes;
166
- unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
167
- }
168
-
169
- function wlcms_remove_recent_comments()
170
- {
171
- if( get_option('wlcms_o_dashboard_admin') && current_user_can('activate_plugins') ) { return; }
172
- global $wp_meta_boxes;
173
- unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
174
- }
175
-
176
- function wlcms_output()
177
- {
178
- global $userdata;
179
- $WP_Roles = new WP_Roles();
180
- $role_names = $WP_Roles->get_names();
181
- unset($role_names['administrator']);
182
- $all_caps = wlcms_get_all_caps_from_wp_roles();
183
-
184
- sort($all_caps);
185
- $output = "<div id=\"roles_capabilities\">";
186
-
187
- foreach($role_names as $role_id => $role_name)
188
- {
189
- $output .= "<div id=\"roles_$role_id\" class=\"edit_role_name\">";
190
- $output .= "<ul class=\"role_name_editor\">";
191
-
192
- foreach($all_caps as $capability)
193
- {
194
- $checked = isset($WP_Roles->roles[$role_id]['capabilities'][$capability])&&$WP_Roles->roles[$role_id]['capabilities'] [$capability]==1?'checked="checked"':'';
195
- $output .= "<li><input type=\"checkbox\" $checked name=\"ROLES[$role_id][$capability]\" value=1 />&nbsp;".ucfirst(str_replace("_"," ",$capability))."</li>&nbsp; ";
196
- }
197
-
198
- $output .= "</ul>"; $output .= "</div>";
199
- }
200
- $output .= "</div>";
201
- return $output;
202
- }
203
-
204
- function wlcms_get_all_caps_from_wp_roles()
205
- {
206
- $WP_Roles = new WP_Roles();
207
- $role_names = $WP_Roles->get_names();
208
- $all_caps = array();
209
- if(count($WP_Roles->roles)>0)
210
  {
211
- foreach($WP_Roles->roles as $role_id => $row)
212
- {
213
- foreach($row['capabilities'] as $capability => $allowed)
214
- {
215
- $all_caps[$capability]=$capability;
216
- }
217
- }
218
- }
219
- return $all_caps;
220
- }
221
-
222
- function wlcms_roles_dropdown($params = array())
223
- {
224
- $wp_roles = new WP_Roles();
225
- // remove unwanted roles
226
- if(!empty($params['remove_role']))
227
- unset($wp_roles->role_names[$params['remove_role']]);
228
-
229
- return $wp_roles->role_names;
230
- }
231
-
232
- function wlcms_adminbar()
233
- {
234
- global $wp_version;
235
-
236
- if(get_option('wlcms_o_dashboard_border')):
237
- echo '<style type="text/css"> .postbox-container .meta-box-sortables.empty-container, #side-sortables.empty-container{border:0;} </style>';
238
- endif;
239
- if( get_option('wlcms_o_hide_wp_adminbar') ):
240
- echo " \n\n <style type=\"text/css\">#wp-admin-bar-wp-logo { display:none; } #wpadminbar #wp-admin-bar-site-name > .ab-item:before { content: normal;}</style> \n\n";
241
- else:
242
- echo " \n\n <style type=\"text/css\">#wp-admin-bar-wp-logo { display:block!important; }</style> \n\n";
243
- endif;
244
-
245
- if( get_option('wlcms_o_adminbar_custom_logo') ):
246
- $background = get_option('wlcms_o_adminbar_custom_logo');
247
- if(!preg_match("@^https?://@", $background))
248
- $background = get_bloginfo('stylesheet_directory').'/images/'.$background;
249
-
250
- echo '<script type="text/javascript"> jQuery(document).ready(function(){ ';
251
- echo 'jQuery("#wp-admin-bar-root-default").prepend(" <li id=\"wlcms_admin_logo\"> <span style=\"float:left;height:28px;line-height:28px;vertical-align:middle;text-align:center;width:28px\"><img src=\"'.$background.'\" width=\"16\" height=\"16\" alt=\"Login\" style=\"height:16px;width:16px;vertical-align:middle\" /> </span> </li> "); ';
252
- echo ' }); ';
253
- echo '</script> ';
254
-
255
- endif;
256
-
257
- $style = '<style type="text/css">';
258
-
259
- if(get_option('wlcms_o_header_custom_logo') != "")
260
- {
261
- $background = get_option('wlcms_o_header_custom_logo');
262
 
263
- if(!preg_match("@^https?://@", $background))
264
- $background = get_bloginfo('stylesheet_directory').'/images/'.$background;
265
 
266
- $style .= '#header-logo { background-image: url('.$background . ') !important; ';
267
- $css_width = get_option('wlcms_o_header_custom_logo_width');
268
-
269
- if ($css_width != '')
270
- {
271
- $style .= 'width: ' . get_option('wlcms_o_header_custom_logo_width') . 'px; ';
272
- }
273
- else
274
- {
275
- if (( version_compare( $wp_version, '3.2', '>=' ) ) && (!empty($customHFHeight)))
276
- {
277
- $style .= 'height: '.$customHFHeight.'px; ';
278
- }
279
- }
280
- $style .= '} ';
281
- }
282
-
283
- if (( version_compare( $wp_version, '3.2', '>=' ) ) && (!empty($customHFHeight))) {
284
- $style .= ' #wphead { height: '.$customHFHeight.'px; }
285
- #wphead h1 { font-size: 22px; padding: 10px 8px 5px; }
286
- #header-logo { height: 32px; }
287
- #user_info { padding-top: 8px }
288
- #user_info_arrow { margin-top: 8px; }
289
- #user_info_links { top: 8px; }
290
- #footer p { padding-top: 15px; }
291
- #wlcms-footer-container { padding-top: 10px; line-height: 30px;} '."\n";
292
- }
293
-
294
- if (( version_compare( $wp_version, '3.2', '<' ) ) && (empty($customHFHeight))) {
295
- $style .= '#wlcms-footer-container { padding-top: 10px; line-height: 30px; }';
296
- }
297
-
298
- if (get_option('wlcms_o_header_logo_link') == 1) {
299
- $style .= '#site-heading { display: none; } ';
300
- }
301
-
302
- $style .= '</style>';
303
-
304
- echo $style;
305
-
306
-
307
- if (get_option('wlcms_o_header_logo_link') == 1) {
308
- echo '<script type="text/javascript">';
309
- echo "jQuery(function($){ $('#header-logo').wrap('<a href=\"" . site_url() . "\" alt=\"" . get_bloginfo('name') . "\" title=\"" . get_bloginfo('name') . "\">'); });";
310
- echo '</script>';
311
  }
312
- }
313
-
314
- // add footer logo
315
- function wlcms_remove_footer_admin() {
316
- $footer_logo = get_option('wlcms_o_footer_custom_logo');
317
- if($footer_logo)
318
- if(!preg_match("@^https?://@", $footer_logo))
319
- $footer_logo = get_bloginfo('stylesheet_directory').'/images/'.$footer_logo;
320
-
321
- echo '<span id="footer-thankyou">';
322
- if (get_option('wlcms_o_developer_url')) {
323
-
324
- echo '<a target="_blank" href="' . get_option('wlcms_o_developer_url') . '">';
325
-
326
- if (get_option('wlcms_o_footer_custom_logo_width')) {
327
- echo '<img style="width:' . get_option('wlcms_o_footer_custom_logo_width') . 'px;" ';
328
- } else {
329
- echo '<img ';
330
- }
331
- echo ' src="'.$footer_logo. '" id="wlcms-footer-logo"> </a> <span> <a target="_blank" href="' . get_option('wlcms_o_developer_url') . '">' . stripslashes(get_option('wlcms_o_developer_name')) . '</a> </span>';
332
- } else {
333
- if (get_option('wlcms_o_footer_custom_logo_width')) {
334
- echo '<img style="width:' . get_option('wlcms_o_footer_custom_logo_width') . 'px;" ';
335
- } else {
336
- echo '<img ';
337
- }
338
- echo ' src="'.$footer_logo . '" id="wlcms-footer-logo"> <span>' . stripslashes(get_option('wlcms_o_developer_name')).'</span>';
339
- }
340
- echo '</span>';
341
- }
342
-
343
- function wlcms_developer_link()
344
- {
345
- echo '<span id="footer-thankyou">';
346
- echo ( get_option('wlcms_o_developer_url') ? '<a target="_blank" href="' . get_option('wlcms_o_developer_url') . '">' : '' );
347
- echo stripslashes(get_option('wlcms_o_developer_name'));
348
- echo ( get_option('wlcms_o_developer_url') ? '</a>' : '' );
349
- echo '</span>';
350
- }
351
-
352
-
353
- // custom logo login
354
- function wlcms_custom_login_logo()
355
- {
356
- wp_print_scripts( array( 'jquery' ) );
357
-
358
- $login_custom_logo = get_option('wlcms_o_login_custom_logo');
359
-
360
- if(!preg_match("@^https?://@", $login_custom_logo))
361
- $login_custom_logo = get_bloginfo('stylesheet_directory').'/images/'.$login_custom_logo;
362
-
363
- echo '<style type="text/css">';
364
- echo stripslashes( get_option('wlcms_o_login_bg_css') );
365
-
366
- if (get_option('wlcms_o_login_custom_logo')):
367
- echo ' .login h1 a { display:all; background: url('.$login_custom_logo . ') no-repeat bottom center !important; margin-bottom: 10px; background-size: auto; } ';
368
-
369
- if(get_option('wlcms_o_loginbg_white') ):
370
- echo ' body.login {background: #fff } ';
371
- endif;
372
- echo '.login h1 a { width :auto!important;} ';
373
- echo '</style> ';
374
- ;
375
-
376
- echo '<script type="text/javascript">
377
- jQuery(document).ready(function()
378
- {
379
- jQuery(\'#login h1 a\').attr(\'title\',\'' . get_bloginfo('name') . '\');
380
- jQuery(\'#login h1 a\').attr(\'href\',\'' . get_bloginfo('url') . '\');
381
- });
382
- </script>';
383
-
384
- elseif( get_option('wlcms_o_login_bg_css') ):
385
-
386
- echo stripslashes( get_option('wlcms_o_login_bg_css') );
387
- echo '</style> ';
388
- else:
389
- echo '</style> ';
390
- endif;
391
-
392
- if(get_option('wlcms_o_login_bg_css')):
393
- echo '<script type="text/javascript"> jQuery(document).ready(function(){ jQuery("#login").wrap("<div id=\'wlcms-login-wrapper\'></div>"); }); </script> ';
394
- endif;
395
-
396
- }
397
-
398
- function wlcms_custom_dashboard_help()
399
- {
400
- echo stripslashes(get_option('wlcms_o_welcome_text'));
401
- }
402
- function wlcms_custom_dashboard_help_new()
403
- {
404
- echo stripslashes(get_option('wlcms_o_welcome_text1'));
405
- }
406
-
407
- function wlcms_add_dashboard_widget_custom()
408
- {
409
- if ( get_option('wlcms_o_show_rss_widget') ):
410
- $img = ( get_option('wlcms_o_rss_logo') ? get_option('wlcms_o_rss_logo') : '' );
411
- if($img)
412
- $img = '<img src="'.$img.'" height="16" width="16" alt="Logo" style="padding-right:5px;vertical-align:bottom;"/>';
413
-
414
- wp_add_dashboard_widget('wlcms_rss_box', $img . get_option('wlcms_o_rss_title'), 'wlcms_rss_box');
415
- endif;
416
-
417
- if ( get_option('wlcms_o_show_welcome') ):
418
- if ( wlcmsUserCompare( strtolower(get_option('wlcms_o_welcome_visible_to')), strtolower( wlcms_get_current_user_role() ) ) ):
419
- wp_add_dashboard_widget('custom_help_widget', get_option('wlcms_o_welcome_title'), 'wlcms_custom_dashboard_help');
420
- endif;
421
-
422
- if ( wlcmsUserCompare( strtolower(get_option('wlcms_o_welcome_visible_to1')), strtolower( wlcms_get_current_user_role() ) ) ):
423
- wp_add_dashboard_widget('my_dashboard_widget', get_option('wlcms_o_welcome_title1'), 'wlcms_custom_dashboard_help_new');
424
- endif;
425
- endif;
426
- }
427
-
428
- function remove_footer_version()
429
- {
430
- return '';
431
- }
432
-
433
- function wlcms_rss_box()
434
- {
435
- if(!get_option('wlcms_o_rss_value'))
436
- return;
437
-
438
- include_once(ABSPATH . WPINC . '/feed.php');
439
- $num_items = get_option('wlcms_o_rss_num_items');
440
- $rss = fetch_feed( get_option('wlcms_o_rss_value') );
441
-
442
- if (!is_wp_error( $rss ) ) : // Checks that the object is created correctly
443
- $maxitems = $rss->get_item_quantity($num_items);
444
- $rss_items = $rss->get_items(0, $maxitems);
445
- endif;
446
-
447
- if( get_option('wlcms_o_rss_intro_html') ):
448
- echo wpautop ( stripslashes( get_option('wlcms_o_rss_intro_html') ) );
449
- endif;
450
- ?>
451
-
452
- <ul>
453
- <?php if ($maxitems == 0) echo '<li>No items.</li>';
454
- else
455
- // Loop through each feed item and display each item as a hyperlink.
456
-
457
- foreach ( $rss_items as $item ) : ?>
458
- <li>
459
- <strong> <a href='<?php echo esc_url( $item->get_permalink() ); ?>'
460
- title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>' target='_blank'>
461
- <?php echo esc_html( $item->get_title() ); ?></a> </strong> <br />
462
-
463
- <?php if(get_option('wlcms_o_rss_show_intro') == 'yes'):
464
- echo $item->get_content();
465
- endif; ?>
466
-
467
- </li>
468
- <?php endforeach; ?>
469
- </ul>
470
-
471
- <?php
472
-
473
- }
474
-
475
- function wlcms_hide_wp_version()
476
- {
477
- echo '<style type="text/css">#wp-version-message { display: none;}</style>';
478
- }
479
-
480
- function wlcms_get_current_user_role() {
481
- global $wp_roles;
482
- $current_user = wp_get_current_user();
483
- $roles = $current_user->roles;
484
- $role = array_shift($roles);
485
- return isset($wp_roles->role_names[$role]) ? $wp_roles->role_names[$role] : false;
486
- }
487
-
488
- function wlcms_custom_editor_stylesheet($url)
489
- {
490
-
491
- if( get_option('wlcms_o_welcome_stylesheet')):
492
- $url = get_stylesheet_directory_uri() . '/' ;
493
- $url .= get_option('wlcms_o_welcome_stylesheet');
494
- endif;
495
-
496
- return $url;
497
- }
498
-
499
- function wlcms_hide_switch_theme()
500
- {
501
- if(!current_user_can( 'manage_options' ) ):
502
- echo '<style type="text/css">
503
- #dashboard_right_now .versions p, #dashboard_right_now .versions #wp-version-message { display: none; }
504
- </style>
505
- ';
506
- endif;
507
- }
508
 
509
- function wlcms_admin_title($admin_title)
510
- {
511
- if( get_option('wlcms_o_admin_page_title') ):
512
- return str_replace (
513
- "&#8212; WordPress",
514
- get_option('wlcms_o_admin_page_title'),
515
- $admin_title
516
- );
517
- else:
518
- return $admin_title;
519
- endif;
520
- }
521
-
522
- function wlcms_admin_bar()
523
- {
524
- // Show all to admin
525
- if (current_user_can('activate_plugins'))
526
- return;
527
-
528
- global $wp_admin_bar;
529
-
530
- if (get_option('wlcms_o_hide_posts'))
531
- $wp_admin_bar->remove_menu('new-post', 'new-content');
532
- if (get_option('wlcms_o_hide_comments'))
533
- $wp_admin_bar->remove_menu('comments');
534
- if (get_option('wlcms_o_hide_media'))
535
- $wp_admin_bar->remove_menu('media');
536
-
537
- $wp_admin_bar->remove_menu('appearance');
538
-
539
- }
540
-
541
- function wlcms_remove_admin_menus () {
542
-
543
- global $menu, $submenu;
544
-
545
- $exclude[0] = '';
546
-
547
- if (get_option('wlcms_o_hide_posts'))
548
- array_push($exclude,__('Posts','default'));
549
- if (get_option('wlcms_o_hide_media'))
550
- array_push($exclude,__('Media','default'));
551
- if (get_option('wlcms_o_hide_comments'))
552
- array_push($exclude,__('Comments','default'));
553
- if (get_option('wlcms_o_hide_tools'))
554
- array_push($exclude,__('Tools','default'));
555
- if (get_option('wlcms_o_hide_profile'))
556
- array_push($exclude,__('Profile','default'));
557
-
558
-
559
-
560
-
561
- unset($exclude[0]);
562
-
563
- // print_r($exclude);die;
564
-
565
- if (sizeof($exclude) > 0):
566
- if (!current_user_can('activate_plugins')):
567
- if( isset($menu) && is_array($menu) ):
568
- foreach($menu as $mId=>$menuArray):
569
- $tmp = explode(' ',$menuArray[0]);
570
- if(in_array( $tmp[0] , $exclude )):
571
- unset($menu[$mId]);
572
- endif;
573
- endforeach;
574
- endif;
575
- endif;
576
- endif;
577
-
578
- if(isset($submenu['themes.php'])):
579
- if (!current_user_can('activate_plugins')):
580
- foreach( $submenu['themes.php'] as $k=>$v):
581
- if(get_option('wlcms_o_subtemplate_hide_'.$k) ):
582
- unset($submenu['themes.php'][$k]);
583
- endif;
584
- endforeach;
585
- endif;
586
- endif;
587
-
588
- }
589
-
590
- function wlcms_custom_pages_columns($defaults)
591
- {
592
- if (get_option('wlcms_o_page_meta_box_comments'))
593
- unset($defaults['comments']);
594
- if (get_option('wlcms_o_page_meta_box_author'))
595
- unset($defaults['author']);
596
- return $defaults;
597
- }
598
-
599
- function wlcms_remove_default_page_metaboxes()
600
- {
601
- add_filter('manage_pages_columns', 'wlcms_custom_pages_columns');
602
-
603
- if (get_option('wlcms_o_page_meta_box_custom'))
604
- remove_meta_box( 'postcustom','page','normal' );
605
- if (get_option('wlcms_o_page_meta_box_author'))
606
- remove_meta_box( 'authordiv','page','normal' );
607
- if (get_option('wlcms_o_page_meta_box_discussions'))
608
- remove_meta_box( 'commentstatusdiv','page','normal' );
609
- if (get_option('wlcms_o_page_meta_box_slug'))
610
- remove_meta_box( 'slugdiv','page','normal' );
611
- if (get_option('wlcms_o_page_meta_box_revisions'))
612
- remove_meta_box( 'revisionsdiv','page','normal' );
613
- if (get_option('wlcms_o_page_meta_box_page'))
614
- remove_meta_box( 'pageparentdiv','page','normal' );
615
- if (get_option('wlcms_o_page_meta_box_comments'))
616
- remove_meta_box( 'commentsdiv','page','normal' );
617
- }
618
-
619
- function wlcms_custom_post_columns($defaults)
620
- {
621
- if (get_option('wlcms_o_post_meta_box_comments'))
622
- unset($defaults['comments']);
623
- if (get_option('wlcms_o_post_meta_box_author'))
624
- unset($defaults['author']);
625
- if (get_option('wlcms_o_post_meta_box_categories'))
626
- unset($defaults['categories']);
627
- return $defaults;
628
- }
629
-
630
- function wlcms_manage_my_category_columns($defaults)
631
- {
632
- if (get_option('wlcms_o_post_meta_box_slug'))
633
- unset($defaults['slug']);
634
- return $defaults;
635
- }
636
-
637
- function wlcms_remove_default_post_metaboxes()
638
- {
639
- add_filter('manage_posts_columns', 'wlcms_custom_post_columns');
640
- add_filter('manage_edit-post_tag_columns','wlcms_manage_my_category_columns');
641
- add_filter('manage_edit-category_columns','wlcms_manage_my_category_columns');
642
-
643
- if (get_option('wlcms_o_post_meta_box_custom'))
644
- remove_meta_box( 'postcustom','post','normal' );
645
- if (get_option('wlcms_o_post_meta_box_excerpt'))
646
- remove_meta_box( 'postexcerpt','post','normal' );
647
- if (get_option('wlcms_o_post_meta_box_discussions'))
648
- remove_meta_box( 'commentstatusdiv','post','normal' );
649
- if (get_option('wlcms_o_post_meta_box_send'))
650
- remove_meta_box( 'trackbacksdiv','post','normal' );
651
- if (get_option('wlcms_o_post_meta_box_slug'))
652
- remove_meta_box( 'slugdiv','post','normal' );
653
- if (get_option('wlcms_o_post_meta_box_author'))
654
- remove_meta_box( 'authordiv','post','normal');
655
- if (get_option('wlcms_o_post_meta_box_revisions'))
656
- remove_meta_box( 'revisionsdiv','post','normal' );
657
- if (get_option('wlcms_o_post_meta_box_tags'))
658
- remove_meta_box( 'tagsdiv-post_tag','post','normal' );
659
- if (get_option('wlcms_o_post_meta_box_categories'))
660
- remove_meta_box( 'categorydiv','post','normal' );
661
- if (get_option('wlcms_o_post_meta_box_comments'))
662
- remove_meta_box( 'commentsdiv','post','normal' );
663
- }
664
-
665
- function wlcms_add_admin()
666
- {
667
-
668
- global $wlcmsThemeName, $wlcmsShortName, $menu, $submenu;
669
-
670
- if ( isset($_GET['page']) && $_GET['page'] == 'wlcms-plugin.php')
671
- {
672
- if ( isset($_REQUEST['action']) && 'save' == $_REQUEST['action'] )
673
- {
674
- add_action('admin_init', 'wlcmsSave');
675
- }
676
- elseif( isset($_REQUEST['action']) && 'reset' == $_REQUEST['action'] )
677
- {
678
- add_action('admin_init', 'wlcmsReset');
679
- }
680
- elseif( isset($_REQUEST['action']) && 'export' == $_REQUEST['action'] )
681
- {
682
- add_action('admin_init', 'wlcmsExport');
683
- }
684
- elseif( isset($_REQUEST['action']) && 'import' == $_REQUEST['action'] )
685
- {
686
- // Only run the import function if we pass a nonce
687
- if( check_admin_referer( 'wlcms_import' ) ) {
688
- add_action('admin_init', 'wlcmsImport');
689
- } else {
690
- wp_die( 'Failed the WLCMS Import Nonce' );
691
- }
692
- }
693
- }
694
- }
695
-
696
- function vum_fix_json($matches) {
697
- return "s:".strlen($matches[2]).':"'.$matches[2].'";';
698
- }
699
-
700
- function wlcmsImport()
701
- {
702
- if ($_FILES['wlcms_import']['error'] == UPLOAD_ERR_OK
703
- && is_uploaded_file($_FILES['wlcms_import']['tmp_name'])):
704
-
705
- $import = file_get_contents($_FILES['wlcms_import']['tmp_name']);
706
- $import = preg_replace_callback( '/s:([0-9]+):\"(.*?)\";/', 'vum_fix_json', $import );
707
- $import = unserialize($import);
708
-
709
- if( ! is_array($import) )
710
- {
711
- // Not an array some how? Rather than pressing on, just return.
712
- header("Location: admin.php?page=wlcms-plugin.php&import=false&error=noArray");
713
- }
714
-
715
- // Reset all WLCMS settings;
716
- wlcmsReset(true);
717
-
718
- $site_url = get_bloginfo('url');
719
-
720
- foreach ( $import as $name => $value ) {
721
-
722
- // If the value includes this shortcode, replace it.
723
- $val = str_replace( '{SITEURL}', $site_url, $value );
724
-
725
- // Check that our option key starts with WLCMS
726
- if ( strpos( $name, 'wlcms_o' ) === 0 ) {
727
- add_option( $name, $val );
728
- } else {
729
- wp_die( __('<strong>Error!</strong> During the import process we almost imported a non White Label CMS setting - please ensure you uploaded the correct file and try again.' ) );
730
- }
731
- }
732
-
733
- header("Location: admin.php?page=wlcms-plugin.php&import=true");
734
- exit;
735
-
736
- endif;
737
-
738
- header("Location: admin.php?page=wlcms-plugin.php&import=false");
739
- die;
740
- }
741
-
742
- function wlcmsExport()
743
- {
744
- global $wpdb;
745
- $export=array();
746
- $site_url = get_bloginfo('url');
747
-
748
- // Get all WLCMS vals from options table
749
- $results = $wpdb->get_results("select * from $wpdb->options where option_name like 'wlcms_o_%'");
750
-
751
- // Are there any options to grab?
752
- if($results):
753
- // Loop through results and prep array.
754
- foreach($results as $result):
755
-
756
- if($result->option_value=='') continue; // Ignore empty values
757
-
758
- // Does the blog URL exist in this option value?
759
- if ( strpos( $result->option_value ,$site_url) !== false ):
760
-
761
- // Do we want to keep the full URL?
762
- if( $_GET['wlcms_export_imgs'] == 'yes' ):
763
- $export[$result->option_name] = $result->option_value;
764
-
765
- // If we do a partial - that means we str replace the SITEURL.
766
- elseif( $_GET['wlcms_export_imgs'] == 'partial' ):
767
- $val = str_replace( $site_url, '{SITEURL}', $result->option_value );
768
- $export[$result->option_name] = $val;
769
-
770
- endif;
771
-
772
- // Otherwise they will have selected no, in which case, we dont
773
- // add them to the $export array.
774
-
775
- else:
776
-
777
- // Add non-url matched items to our $export array
778
- $export[$result->option_name] = $result->option_value;
779
-
780
- endif;
781
-
782
- endforeach;
783
-
784
- endif;
785
-
786
- $export=serialize($export);
787
-
788
- header("Content-Disposition: attachment; filename=\"wlcms-backup-" . date('Y-m-d') . ".txt\"");
789
- header("Content-Type: application/force-download");
790
- header("Content-Length: " . strlen($export));
791
- header("Connection: close");
792
- echo $export;
793
- exit;
794
- }
795
-
796
- function wlcmsSave()
797
- {
798
- check_admin_referer( 'wlcms-update_settings' );
799
-
800
- include('includes/admin.config.php');
801
-
802
- update_option('wlcms_o_ver', WLCMS);
803
- foreach ($wlcmsOptions as $value):
804
- if( isset( $value['id'] ) && isset( $_REQUEST[ $value['id'] ] ) ):
805
- update_option( $value['id'], $_REQUEST[ $value['id'] ] );
806
- elseif( isset( $value['id'] ) && (!isset($_REQUEST[$value['id']])) ):
807
- delete_option( $value['id'] );
808
- endif;
809
- endforeach;
810
-
811
- wlcmsUpdateCaps();
812
-
813
- if($_REQUEST['wlcms_o_editor_template_access'] == "1")
814
- {
815
- $role = get_role( 'editor' );
816
- $role->add_cap( 'edit_theme_options' );
817
- }
818
- elseif($_REQUEST['wlcms_o_editor_template_access'] == "0")
819
- {
820
- $role = get_role( 'editor' );
821
- $role->remove_cap( 'switch_themes' ); // Legacy
822
- $role->remove_cap( 'edit_themes' ); // Legacy
823
- $role->remove_cap( 'edit_theme_options' );
824
- }
825
-
826
- header("Location: admin.php?page=wlcms-plugin.php&saved=true");
827
- die;
828
- }
829
-
830
- function wlcmsReset($return=false)
831
- {
832
- include('includes/admin.config.php');
833
- foreach ($wlcmsOptions as $value):
834
- if(isset($value['id'])):
835
- delete_option( $value['id'] );
836
- endif;
837
- endforeach;
838
-
839
- if($return) return;
840
-
841
- header("Location: admin.php?page=wlcms-plugin.php&reset=true");
842
- die;
843
- }
844
-
845
- function wlcmsUpdateCaps()
846
- {
847
- $config = array(
848
- /* array(
849
- 'key' => 'wlcms_o_hide_posts',
850
- 'caps' => array('edit_posts', 'manage_categories')
851
- ),*/
852
- array(
853
- 'key' => 'wlcms_o_hide_pages',
854
- 'caps' => array('edit_pages')
855
- ),
856
- array(
857
- 'key' => 'wlcms_o_hide_media',
858
- 'caps' => array('upload_files')
859
- ),
860
- array(
861
- 'key' => 'wlcms_o_hide_links',
862
- 'caps' => array('manage_links')
863
- )
864
- );
865
-
866
- foreach($config as $opts):
867
- if(isset( $_POST[ $opts['key'] ] )):
868
-
869
- if( $opts['key'] == 'wlcms_o_hide_media')
870
- continue;
871
-
872
- $role = get_role( 'editor' );
873
- foreach($opts['caps'] as $cap):
874
- if(is_object($role) && method_exists($role,'add_cap'))
875
- {
876
- $role->remove_cap( $cap );
877
- }
878
-
879
- endforeach;
880
- else:
881
- $role = get_role( 'editor' );
882
- foreach($opts['caps'] as $cap):
883
- if(is_object($role) && method_exists($role,'add_cap'))
884
- {
885
- $role->add_cap( $cap );
886
- }
887
-
888
- endforeach;
889
- endif;
890
- endforeach;
891
- }
892
-
893
-
894
-
895
- function wlcms_add_init()
896
- {
897
- global $wlcmsThemeName, $wlcmsShortName, $menu, $submenu;
898
-
899
- if(! get_option('wlcms_o_welcome_title') )
900
- {
901
- include('includes/admin.config.php');
902
- foreach ($wlcmsOptions as $value):
903
- if ( isset($value['id']) && $value['id'] != '' && isset($value['std']) ):
904
- add_option( $value['id'], $value['std'] );
905
- endif;
906
- endforeach;
907
- }
908
-
909
- }
910
- function wlcms_add_admin_scripts() {
911
- wp_enqueue_script('wlcms-script', plugins_url('scripts/wlcms_script.js', __FILE__), array('media-upload'), WLCMS);
912
- wp_enqueue_style('thickbox');
913
- wp_enqueue_style('wlcms-style', plugins_url('css/wlcms_style.css', __FILE__), false, WLCMS);
914
- }
915
- function wlcms_admin()
916
- {
917
- global $menu, $submenu;
918
- $i=0;
919
- include('includes/admin.config.php');
920
-
921
- if ( isset($_REQUEST['saved']) && $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong> Settings saved.</strong></p></div>';
922
- if ( isset($_REQUEST['reset']) && $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong> Settings reset.</strong></p></div>';
923
- if ( isset($_REQUEST['import']) && $_REQUEST['import'] == 'true' ) echo '<div id="message" class="updated fade"><p><strong> Your Import has been completed.</strong></p></div>';
924
-
925
- require('includes/admin.view.php');
926
- }
927
-
928
- function wlcms_iframe_mod()
929
- {
930
- if( (isset($_GET['wlcms']) ) || isset( $_GET["post_id"] ) && ( $_GET['post_id'] == '0' ) )
931
- { ?>
932
- <style type="text/css">
933
- #media-upload-header #sidemenu li#tab-type_url,
934
- #media-upload-header #sidemenu li#tab-gallery {display: none;}
935
- #media-items tr.url,#media-items tr.align,#media-items tr.image_alt,
936
- #media-items tr.post_title, #media-items tr.image-size,
937
- #media-items tr.post_excerpt,#media-items tr.post_content,
938
- #media-items tr.image_alt p, #media-items table thead input.button,
939
- #media-items table thead img.imgedit-wait-spin,
940
- #media-items tr.submit a.wp-post-thumbnail {display: none;}
941
- </style>
942
- <script type="text/javascript">
943
- (function($){
944
- $(document).ready(function(){
945
- $('#media-items').bind('DOMNodeInserted',function(){
946
- $('input[value="Insert into Post"]').each(function(){
947
- $(this).attr('value','Use This Image');
948
- });
949
- });
950
- });
951
-
952
- })(jQuery);
953
- </script>
954
- <?php
955
- }
956
- }
957
- ?>
3
  Plugin Name: White Label CMS
4
  Plugin URI: http://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
5
  Description: A plugin that allows you to brand WordPress CMS as your own
6
+ Version: 2.0.2.2
7
  Author: www.videousermanuals.com
8
  Author URI: http://www.videousermanuals.com/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
9
+ */
10
 
 
11
 
12
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
 
 
13
 
14
+ define('WLCMS_VERSION', '2.0.2.2');
15
+ define("WLCMS_DIR", plugin_dir_path(__FILE__));
16
+ define("WLCMS_ASSETS_URL", plugin_dir_url(__FILE__) . 'assets/');
17
+ define("WLCMS_BASENAME", plugin_basename(__FILE__));
18
+ define("WLCMS_ASSETS_DIR", WLCMS_DIR . 'assets/');
19
+ define("WLCMS_SCREEN_ID", 'settings_page_wlcms-plugin');
20
 
 
21
 
22
+ include_once(WLCMS_DIR . 'includes/classes/Loader.php');
23
+ include_once(WLCMS_DIR . 'includes/Functions.php');
24
 
25
+ global $wlcms;
 
 
26
 
27
+ if (!function_exists('wlcms')) :
28
+ function wlcms()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  {
30
+ global $wlcms;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
+ $wlcms = WLCMS_Loader::getInstance();
 
33
 
34
+ return $wlcms;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
+ endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
+ wlcms();