initial
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
.warning-text{color:#f0745fce;display:block}.not-wlcms-admin .update-plugins,.not-wlcms-admin tr[data-slug*=white-label-cms]{display:none!important}.wlcms-welcome-panel{display:none}.wlcms-welcome-panel .welcome-panel-content>h2{width:95%;padding-bottom:21px}#wpfooter img{max-height:60px}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die('Access denied.');
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 92 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die('Access denied.');
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die('Access denied.');
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
window.wlcms_iframe_height=function(t){try{var e=t.contentDocument||t.contentWindow.document;t.style.height=e.body.scrollHeight+"px";var o=e.querySelectorAll("a");o.forEach(function(c){c.hasAttribute("target")||c.setAttribute("target","_top")})}catch{t.style.height="500px"}};window.addEventListener("message",function(t){if(t.data&&typeof t.data.wlcmsHeight=="number"){var e=document.querySelectorAll("iframe.responsive-iframe");e.forEach(function(o){try{o.contentWindow===t.source&&(o.style.height=t.data.wlcmsHeight+"px")}catch{}})}});
|
||||
@@ -0,0 +1,13 @@
|
||||
/*!
|
||||
* An experimental shim to partially emulate onBeforeUnload on iOS.
|
||||
* Part of https://github.com/codedance/jquery.AreYouSure/
|
||||
*
|
||||
* Copyright (c) 2012-2014, Chris Dance and PaperCut Software http://www.papercut.com/
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Author: chris.dance@papercut.com
|
||||
* Date: 19th May 2014
|
||||
*/jQuery(function(){navigator.userAgent.toLowerCase().match(/iphone|ipad|ipod|opera/)&&$("a").bind("click",function(e){var r=$(e.target).closest("a").attr("href");if(r!==void 0&&!(r.match(/^#/)||r.trim()=="")){var a=$(window).triggerHandler("beforeunload",a);if(a&&a!=""){var t=a+`
|
||||
|
||||
Press OK to leave this page or Cancel to stay.`;if(!confirm(t))return!1}return window.location.href=r,!1}})});
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die('Access denied.');
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/*!
|
||||
* jQuery Plugin: Are-You-Sure (Dirty Form Detection)
|
||||
* https://github.com/codedance/jquery.AreYouSure/
|
||||
*
|
||||
* Copyright (c) 2012-2014, Chris Dance and PaperCut Software http://www.papercut.com/
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Author: chris.dance@papercut.com
|
||||
* Version: 1.9.0
|
||||
* Date: 13th August 2014
|
||||
*/(function(i){i.fn.areYouSure=function(g){var a=i.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])"},g),u=function(e){if(e.hasClass("ays-ignore")||e.hasClass("aysIgnore")||e.attr("data-ays-ignore")||e.attr("name")===void 0)return null;if(e.is(":disabled"))return"ays-disabled";var t,r=e.attr("type");switch(e.is("select")&&(r="select"),r){case"checkbox":case"radio":t=e.is(":checked");break;case"select":t="",e.find("option").each(function(c){var s=i(this);s.is(":selected")&&(t+=s.val())});break;default:t=e.val()}return t},d=function(e){e.data("ays-orig",u(e))},o=function(e){var t=function(f){var h=f.data("ays-orig");return h===void 0?!1:u(f)!=h},r=i(this).is("form")?i(this):i(this).parents("form");if(t(i(e.target))){n(r,!0);return}if($fields=r.find(a.fieldSelector),a.addRemoveFieldsMarksDirty){var c=r.data("ays-orig-field-count");if(c!=$fields.length){n(r,!0);return}}var s=!1;$fields.each(function(){if($field=i(this),t($field))return s=!0,!1}),n(r,s)},l=function(e){var t=e.find(a.fieldSelector);i(t).each(function(){d(i(this))}),i(t).unbind(a.fieldEvents,o),i(t).bind(a.fieldEvents,o),e.data("ays-orig-field-count",i(t).length),n(e,!1)},n=function(e,t){var r=t!=e.hasClass(a.dirtyClass);e.toggleClass(a.dirtyClass,t),r&&(a.change&&a.change.call(e,e),t&&e.trigger("dirty.areYouSure",[e]),t||e.trigger("clean.areYouSure",[e]),e.trigger("change.areYouSure",[e]))},v=function(){var e=i(this),t=e.find(a.fieldSelector);i(t).each(function(){var r=i(this);r.data("ays-orig")||(d(r),r.bind(a.fieldEvents,o))}),e.trigger("checkform.areYouSure")},y=function(){l(i(this))};return!a.silent&&!window.aysUnloadSet&&(window.aysUnloadSet=!0,i(window).bind("beforeunload",function(){if($dirtyForms=i("form").filter("."+a.dirtyClass),$dirtyForms.length!=0){if(navigator.userAgent.toLowerCase().match(/msie|chrome/)){if(window.aysHasPrompted)return;window.aysHasPrompted=!0,window.setTimeout(function(){window.aysHasPrompted=!1},900)}return a.message}})),this.each(function(e){if(i(this).is("form")){var t=i(this);t.submit(function(){t.removeClass(a.dirtyClass)}),t.bind("reset",function(){n(t,!1)}),t.bind("rescan.areYouSure",v),t.bind("reinitialize.areYouSure",y),t.bind("checkform.areYouSure",o),l(t)}})}})(jQuery);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,249 @@
|
||||
== Changelog ==
|
||||
|
||||
= 2.7.12 =
|
||||
* Security fix reported by @asaini
|
||||
|
||||
= 2.7.9 =
|
||||
* Minor reported bug fixes
|
||||
|
||||
= 2.7.8 =
|
||||
* Minor bug fixes
|
||||
|
||||
= 2.7.7 =
|
||||
* Minor bug fixes
|
||||
|
||||
= 2.7.6 =
|
||||
* Minor bug fixes
|
||||
|
||||
= 2.7.5 =
|
||||
* Added compatibility with WordPress 6.6.1
|
||||
* Improved: Plugin security. Thanks to Rafie Muhammad (Patchstack)
|
||||
|
||||
= 2.7.4 =
|
||||
* Improved: Plugin security. Thanks to Krzysztof Zając and Wordfence
|
||||
|
||||
= 2.7.3 =
|
||||
* Bug fix
|
||||
|
||||
= 2.7.2 =
|
||||
* Added a Page Template Type option for Custom Welcome Dashboard Panel
|
||||
|
||||
= 2.7 =
|
||||
* Fixed PHP compatibility issues
|
||||
* Minor bug fixes
|
||||
|
||||
= 2.6 =
|
||||
* Bug Fix: Fixed exit icon. Props to @tessawatkinsllc
|
||||
* Minor bug fixes
|
||||
|
||||
= 2.5 =
|
||||
* Security Patch: Discontinuing the support for legacy import reported by @Animesh of Automattic
|
||||
|
||||
= 2.4 =
|
||||
* Improved: Improved Web Accessibility reported by @jflds
|
||||
* Minor fixes
|
||||
|
||||
= 2.3 =
|
||||
* Improved: Hiding of Dashboard Widgets. Props to @tanohex
|
||||
* Bug Fix: Fixed hiding WooCommerce Home
|
||||
|
||||
= 2.2.9 =
|
||||
* Improved: Plugin security. Thanks to Krzysztof Zając and WPScan
|
||||
* Improved: Custom Dashboard for HTML wrapper justify-content
|
||||
|
||||
= 2.2.8 =
|
||||
* Improved: Plugin security. Thanks to Erwan of WPScan
|
||||
|
||||
= 2.2.7 =
|
||||
* Fixed Custom Welcome Dashboard Panel on WordPress 5.9
|
||||
|
||||
= 2.2.6 =
|
||||
* Fixed WooCommerce Analytics reported by @evaldash
|
||||
|
||||
= 2.2.5 =
|
||||
* Fixed WooCommerce Home issue
|
||||
* Fixed Yoast Menu issue reported by @davidbawiec
|
||||
* Fixed the hiding of default footer link when "Hide WordPress Logo and Links" enabled
|
||||
|
||||
= 2.2.4 =
|
||||
* Fixed javascript error reported by @davidbawiec
|
||||
|
||||
= 2.2.3 =
|
||||
* Fixed Dashboard RSS feed missing quotation marks reported by @carterfromsl
|
||||
* Changing WordPress Logo for Gutenberg fullscreen mode close button reported by @techiechic
|
||||
* Fixed PHP Deprecated optional parameter reported by @pagehub
|
||||
* Fixed woocommerce-product-addons plugin conflict reported by @Colin
|
||||
* Minor bug fixes
|
||||
|
||||
= 2.2.2 =
|
||||
* WooCommerce Analytics menu patch
|
||||
* Side Menu Link URL opening in a new tab when external link was added. Requested by @Kosta X
|
||||
* WordPress 5.6.2 tested
|
||||
|
||||
= 2.2.1 =
|
||||
* Refactoring / Security fixes reported by @twd
|
||||
* Fixed override footer action reported by @simebern
|
||||
* Custom Welcome Dashboard fixes
|
||||
|
||||
= 2.2 =
|
||||
* Custom Welcome Dashboard fixes
|
||||
|
||||
= 2.1.3 =
|
||||
* Added compatibility with WordPress 5.4
|
||||
|
||||
= 2.1.2 =
|
||||
* Support fonts import
|
||||
* Added custom javascript for the login page
|
||||
* Fixed PHP implode function compatibility
|
||||
* Minor fixes
|
||||
|
||||
= 2.1.1 =
|
||||
* Fixed Dashboard for Beaver Builder margin and padding
|
||||
|
||||
= 2.1 =
|
||||
* Support Internationalization
|
||||
* Added a body class to differentiate WLCMS Admin or not, by adding body.not-wlcms-admin or and body.wlcms-admin
|
||||
* Minor fixes
|
||||
|
||||
= 2.0.2.2 =
|
||||
* 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
|
||||
|
||||
= 2.0.2.1 =
|
||||
|
||||
* Bug fixed involving object cache which is causing redirect loop
|
||||
* Fixed unable to upgrade themes and plugins
|
||||
* Fixed legacy custom welcome dashboard
|
||||
* Fixed legacy import
|
||||
* Minor fixes
|
||||
|
||||
= 2.0 =
|
||||
|
||||
**Major Enhancements**
|
||||
* Re-designed Setting form
|
||||
* Added a wizard setting
|
||||
* Added Side Menu logo
|
||||
* Added more design control on the login form
|
||||
* Login live preview
|
||||
* Custom Welcome Panel now supports Elementor and Beaver Builder Pro Templates
|
||||
* Revised menus system visibility
|
||||
* Added Hide Front-end Admin Bar
|
||||
|
||||
= 1.6.4 =
|
||||
Update images directory
|
||||
|
||||
= 1.6.3 =
|
||||
Removed opt-in form
|
||||
|
||||
= 1.6.2 =
|
||||
Fixed deprecated php function
|
||||
|
||||
= 1.6.1 =
|
||||
Fixed Import for php5.2
|
||||
|
||||
= 1.6 =
|
||||
Fixed Import
|
||||
|
||||
= 1.5.9 =
|
||||
Minor changes
|
||||
|
||||
= 1.5.8 =
|
||||
Fixed minor bugs
|
||||
|
||||
= 1.5.7 =
|
||||
Fixed issue with importer
|
||||
|
||||
= 1.5.6 =
|
||||
Fixed bug with dashboard panels in wp-admin
|
||||
|
||||
= 1.5.5 =
|
||||
WordPress v4.4.1 Compatibility
|
||||
|
||||
= 1.5.4 =
|
||||
Fixed conflict with WP Mandrill plugin
|
||||
Added option to hide the activity panel in the dashboard
|
||||
Renamed Right Now widget to At a Glance
|
||||
|
||||
= 1.5.3 =
|
||||
Security release. Better use of WordPress nonces and enhanced validation on import functionality. Disclosed by g0blin.
|
||||
|
||||
= 1.5.2 =
|
||||
Login Logo width fixed for version WordPress 3.8
|
||||
fixed 16px logo in admin bar on front end
|
||||
Fixed advert on wlcms advert on the settings page
|
||||
Fixed Dashboard logo not appear on dashboard for WP 3.8
|
||||
Fixed Footer logo does not line up properly WP 3.8
|
||||
Fixed Hide WordPress Logos from admin bar
|
||||
|
||||
|
||||
= 1.5.1 =
|
||||
Security patch - added nonce to admin form for better security. Props PC SJJ.
|
||||
|
||||
= 1.5 =
|
||||
Added Custom RSS Feeds as new option
|
||||
Added Import/Export of settings feature.
|
||||
Updated CSS rules for wp-login.
|
||||
Minor bug fixes
|
||||
|
||||
= 1.4.7 =
|
||||
Minor Bug introduced with WordPress 3.4 and custom login images.
|
||||
Also added conditionals to prevent any errors with user capabilities.
|
||||
|
||||
= 1.4.6 =
|
||||
Patch submitted by Chris @ iThemes. Better support for users of iThemes.
|
||||
|
||||
= 1.4.5 =
|
||||
Changed how media menu is hidden to allow both hiding the menu and still able to add content. (Small bug)
|
||||
|
||||
= 1.4.4 =
|
||||
Better support for other languages, deactivating the plugin does not remove options, only deleting it will run the uninstall script. Other minor fixes.
|
||||
|
||||
= 1.4.3 =
|
||||
Minor Bug Fixes and some improvements on how forms are saved.
|
||||
|
||||
= 1.4.2 =
|
||||
Bug Fixes, hopefully the last ones for this version
|
||||
|
||||
= 1.4.1 =
|
||||
Bug Fixes for radio buttons, media uploader and login style
|
||||
|
||||
= 1.4 =
|
||||
Changes for WordPress 3.3
|
||||
Ability to brand the dashboard
|
||||
Lots of new changes and bug fixes
|
||||
|
||||
= 1.3 =
|
||||
Changes for WordPress 3.2
|
||||
Restructure of menus
|
||||
Added classic header and footer for 3.2 to improve branding
|
||||
Header logo as site link
|
||||
Admin can view dashboards but hide them from editors
|
||||
Hide browser nag
|
||||
|
||||
Bug fixes
|
||||
|
||||
= 1.2 =
|
||||
Ability to show Menu & Widgets menu for Editors
|
||||
Removed WordPress link and ALT text from login page.
|
||||
Custom css for forgotten link on login page.
|
||||
Tested on multi user sites.
|
||||
Fixed a bug which was stopping the Profile from appearing.
|
||||
|
||||
= 1.1 =
|
||||
Ability to remove menus
|
||||
Added widths for header and footer logos.
|
||||
|
||||
= 1.0.5 =
|
||||
Updated terminology
|
||||
|
||||
= 1.0.4 =
|
||||
Updated custom login image file height
|
||||
|
||||
= 1.0.3 =
|
||||
Updated logo filename
|
||||
|
||||
= 1.0.2 =
|
||||
Added update log!
|
||||
@@ -0,0 +1,372 @@
|
||||
<?php
|
||||
if (!function_exists('wlcms_field_setting')) {
|
||||
function wlcms_field_setting($key = "", $default = false)
|
||||
{
|
||||
if (isset($_POST)) {
|
||||
if (isset($_POST['wlcms'][$key])) {
|
||||
return $_POST['wlcms'][$key];
|
||||
}
|
||||
}
|
||||
|
||||
return wlcms_db_field_setting($key, $default);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_db_field_setting')) {
|
||||
function wlcms_db_field_setting($key = "", $default = false)
|
||||
{
|
||||
return wlcms()->Settings()->get($key, $default);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_welcome_value')) {
|
||||
function wlcms_welcome_value($key = 0, $field = 'title', $default = false)
|
||||
{
|
||||
$welcome_panel = wlcms_field_setting('welcome_panel');
|
||||
|
||||
return isset($welcome_panel[$key][$field]) ? $welcome_panel[$key][$field] : $default;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_array_value')) {
|
||||
function wlcms_array_value($data = array(), $default = false)
|
||||
{
|
||||
return isset($data) ? $data : $default;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_site_domain')) {
|
||||
function wlcms_site_domain()
|
||||
{
|
||||
$site = get_site_url();
|
||||
$scheme = '#^http(s)?://#';
|
||||
return preg_replace($scheme, "", $site);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_sanitize_text_field')) {
|
||||
function wlcms_sanitize_text_field($value)
|
||||
{
|
||||
if (!is_array($value)) {
|
||||
return wp_kses_post($value);
|
||||
}
|
||||
|
||||
foreach ($value as $key => $array_value) {
|
||||
$value[$key] = wlcms_sanitize_text_field($array_value);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
if (!function_exists('wlcms_esc_html_deep')) {
|
||||
function wlcms_esc_html_deep($value)
|
||||
{
|
||||
if (!is_array($value)) {
|
||||
return esc_html($value);
|
||||
}
|
||||
|
||||
foreach ($value as $key => $array_value) {
|
||||
$value[$key] = wlcms_esc_html_deep($array_value);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_esc_html_e')) {
|
||||
function wlcms_esc_html_e($value)
|
||||
{
|
||||
return wlcms_sanitize_text_field($value);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_removeslashes')) {
|
||||
function wlcms_removeslashes($value)
|
||||
{
|
||||
return stripslashes_deep($value);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_set_css')) {
|
||||
function wlcms_set_css($element, $props)
|
||||
{
|
||||
wlcms()->Admin_Script()->setCss($element, $props);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_set_hidden_css')) {
|
||||
function wlcms_set_hidden_css($element)
|
||||
{
|
||||
wlcms()->Admin_Script()->set_CssHidden($element);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_add_js')) {
|
||||
function wlcms_add_js($js)
|
||||
{
|
||||
wlcms()->Admin_Script()->appendJs($js);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('is_wlcms_super_admin')) {
|
||||
function is_wlcms_super_admin()
|
||||
{
|
||||
if (!current_user_can('manage_options')) return false;
|
||||
|
||||
$enable_wlcms_admin = (bool) wlcms_field_setting('enable_wlcms_admin');
|
||||
if (!is_wlcms_admin() && $enable_wlcms_admin) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('is_wlcms_admin')) {
|
||||
function is_wlcms_admin()
|
||||
{
|
||||
return wlcms()->Admin_Menus()->has_visible_roles();
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_current_user_roles')) {
|
||||
function wlcms_current_user_roles()
|
||||
{
|
||||
$user = wp_get_current_user();
|
||||
$roles = (array) $user->roles;
|
||||
$role = $roles[0] ?? '';
|
||||
|
||||
/**
|
||||
* Allow overriding the "primary" role used by WLCMS when user has multiple roles.
|
||||
*
|
||||
* @param string $role Selected role (default: first role).
|
||||
* @param string[] $roles All user roles.
|
||||
* @param WP_User $user Current user.
|
||||
*/
|
||||
return apply_filters('wlcms_primary_role', $role, $roles, $user);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_select_roles')) {
|
||||
/**
|
||||
* add role select element
|
||||
*
|
||||
* @param array $args
|
||||
* @param string $selected
|
||||
* @return string
|
||||
*/
|
||||
function wlcms_select_roles($args = array(), $selected = array())
|
||||
{
|
||||
|
||||
global $wp_roles;
|
||||
|
||||
$return = '<select name="' . $args['name'] . '[]" id="' . $args['name'] . '" multiple="multiple" class="' . $args['class'] . '">';
|
||||
$return .= '<option value=""> </option>';
|
||||
foreach ($wp_roles->role_names as $key => $title) {
|
||||
$selected_val = '';
|
||||
|
||||
if (is_array($selected) && in_array($key, $selected)) {
|
||||
$selected_val = ' selected';
|
||||
}
|
||||
$return .= '<option value="' . $key . '" ' . $selected_val . '>' . $title . '</option>';
|
||||
}
|
||||
$return .= '</select>';
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_select_pages')) {
|
||||
/**
|
||||
* add role select element
|
||||
*
|
||||
* @param array $args
|
||||
* @param string $selected
|
||||
* @return string
|
||||
*/
|
||||
function wlcms_select_pages($args = array(), $selected = '', $query = false)
|
||||
{
|
||||
|
||||
if (!$query) {
|
||||
$post_type = array(
|
||||
'post_type' => 'page',
|
||||
'posts_per_page' => '-1',
|
||||
'post_status' => 'publish'
|
||||
);
|
||||
}
|
||||
$pages = get_posts($query);
|
||||
|
||||
$return = '<select name="' . $args['name'] . '" id="' . $args['name'] . '" class="' . $args['class'] . '">';
|
||||
$return .= '<option value=""> </option>';
|
||||
if ($pages) :
|
||||
foreach ($pages as $page) {
|
||||
$selected_val = '';
|
||||
$key = $page->ID;
|
||||
$title = $page->post_title;
|
||||
|
||||
if ($selected == $key) {
|
||||
$selected_val = ' selected';
|
||||
}
|
||||
$return .= '<option value="' . $key . '" ' . $selected_val . '>' . $title . '</option>';
|
||||
}
|
||||
endif;
|
||||
$return .= '</select>';
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_kses')) {
|
||||
function wlcms_kses($value, $callback = 'wp_kses_post')
|
||||
{
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $index => $item) {
|
||||
$value[$index] = wlcms_kses($item, $callback);
|
||||
}
|
||||
} elseif (is_object($value)) {
|
||||
$object_vars = get_object_vars($value);
|
||||
foreach ($object_vars as $property_name => $property_value) {
|
||||
$value->$property_name = wlcms_kses($property_value, $callback);
|
||||
}
|
||||
} else {
|
||||
$value = call_user_func($callback, $value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('vum_fix_json')) {
|
||||
function vum_fix_json($matches)
|
||||
{
|
||||
return "s:" . strlen($matches[2]) . ':"' . $matches[2] . '";';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_form_upload_field')) {
|
||||
/**
|
||||
* Upload image field generator
|
||||
*
|
||||
* @param string $label
|
||||
* @param string $key
|
||||
* @param string $help
|
||||
* @return string
|
||||
*/
|
||||
function wlcms_form_upload_field($label = '', $key = '', $help = '')
|
||||
{
|
||||
$html = '<label>' . $label . '</label>
|
||||
<div class="wlcms-upload-thumbnail">';
|
||||
|
||||
$key_setting = wlcms_field_setting($key);
|
||||
if ($key_setting) {
|
||||
$html .= '<img src="' . esc_url($key_setting) . '" alt="" /><span class="dashicons dashicons-dismiss wlcms-remove-img"></span>';
|
||||
}
|
||||
|
||||
$html .= '</div>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="' . $key . '" class="wlcms-upload-input" value="' . esc_url($key_setting) . '" />
|
||||
<a href="#" class="wlcms_upload">Upload</a>
|
||||
</div>
|
||||
<div class="wlcms-help">' . $help . '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_is_elementor_active')) {
|
||||
function wlcms_is_elementor_active()
|
||||
{
|
||||
if (!version_compare(PHP_VERSION, '5.4', '>=')) {
|
||||
return false;
|
||||
}
|
||||
return (function_exists('_is_elementor_installed') && _is_elementor_installed()) || defined('ELEMENTOR_VERSION');
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_is_beaver_builder_active')) {
|
||||
function wlcms_is_beaver_builder_active()
|
||||
{
|
||||
if (!version_compare(PHP_VERSION, '5.4', '>=')) {
|
||||
return false;
|
||||
}
|
||||
return class_exists('FLBuilder');
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_has_pagebuilder')) {
|
||||
function wlcms_has_pagebuilder()
|
||||
{
|
||||
return (wlcms_is_beaver_builder_active() || wlcms_is_elementor_active());
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('wlcms_css_metrics')) {
|
||||
function wlcms_css_metrics($value = 'auto')
|
||||
{
|
||||
if ($value == 'auto') return $value;
|
||||
|
||||
if (strpos($value, '%') !== false) return $value;
|
||||
|
||||
if (strpos($value, 'px') !== false) return $value;
|
||||
|
||||
return $value . 'px';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['preview_section']) && $_GET['preview_section'] == 'login') {
|
||||
if (!function_exists('wp_clear_auth_cookie')) {
|
||||
|
||||
/**
|
||||
* Multisite login hack to avoid redirecting to the dashboard while in preview mode
|
||||
* By adding &reauth=1 from the param WordPress will act as force show login form.
|
||||
* This will replace the pluggable function wp_clear_auth_cookie to avoid removing of cookies
|
||||
* @return void
|
||||
*/
|
||||
function wp_clear_auth_cookie()
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('wlcms_get_pages_by_ids')) {
|
||||
function wlcms_get_pages_by_ids(array $ids)
|
||||
{
|
||||
$query = new \WP_Query([
|
||||
'post__in' => $ids,
|
||||
'post_type' => ['page'],
|
||||
'posts_per_page' => -1
|
||||
]);
|
||||
|
||||
$result = [];
|
||||
if ($query->have_posts()) {
|
||||
|
||||
while ($query->have_posts()) : $query->the_post();
|
||||
$result[] = ['id' => get_the_ID(), 'text' => get_the_title()];
|
||||
endwhile;
|
||||
}
|
||||
|
||||
wp_reset_postdata();
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('wlcms_search_pages')) {
|
||||
function wlcms_search_pages($q = '')
|
||||
{
|
||||
$query = new \WP_Query([
|
||||
's' => wlcms_sanitize_text_field($q),
|
||||
'post_type' => ['page'],
|
||||
'posts_per_page' => 50
|
||||
]);
|
||||
$result = [];
|
||||
if ($query->have_posts()) {
|
||||
|
||||
while ($query->have_posts()) : $query->the_post();
|
||||
$result[] = ['id' => get_the_ID(), 'text' => get_the_title()];
|
||||
endwhile;
|
||||
}
|
||||
wp_reset_postdata();
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
class WLCMS_Admin_Core
|
||||
{
|
||||
private function asset_version($file) {
|
||||
$path = WLCMS_ASSETS_DIR . $file;
|
||||
return file_exists($path) ? (string) filemtime($path) : WLCMS_VERSION;
|
||||
}
|
||||
|
||||
function __construct()
|
||||
{
|
||||
add_action('admin_menu', array($this, 'add_option_menu'));
|
||||
add_action( 'admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add WLCMS to setting menu
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add_option_menu()
|
||||
{
|
||||
$page = add_options_page(
|
||||
__('White Label CMS', 'white-label-cms'), // Page title
|
||||
__('White Label CMS', 'white-label-cms'), // Menu name
|
||||
'manage_options', // Permissions
|
||||
'wlcms-plugin.php', // Menu slug
|
||||
array($this, 'view') // Function callback
|
||||
);
|
||||
|
||||
add_action('load-' . $page, array($this, 'load'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* wlcms setting menu page is loaded
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function load()
|
||||
{
|
||||
|
||||
if(!is_wlcms_super_admin()) {
|
||||
wp_redirect(admin_url());
|
||||
exit;
|
||||
}
|
||||
|
||||
do_action("wlcms_load-page");
|
||||
|
||||
// Check if initial setup
|
||||
if (!wlcms_field_setting('version') && !isset($_GET['view'])) {
|
||||
wp_redirect(wlcms()->admin_url('wizard'));
|
||||
exit;
|
||||
}
|
||||
|
||||
// Register scripts
|
||||
add_action("admin_enqueue_scripts", array($this, 'enqueue_scripts'));
|
||||
|
||||
//check store;
|
||||
$this->store();
|
||||
}
|
||||
|
||||
public function admin_enqueue_scripts()
|
||||
{
|
||||
|
||||
$setting_js = 'js/admin.js';
|
||||
|
||||
wp_register_script(
|
||||
'wlcms-admin',
|
||||
WLCMS_ASSETS_URL . $setting_js,
|
||||
array('jquery'),
|
||||
$this->asset_version($setting_js)
|
||||
);
|
||||
wp_enqueue_script(['wlcms-admin']);
|
||||
}
|
||||
|
||||
public function enqueue_scripts()
|
||||
{
|
||||
|
||||
$setting_js = 'js/admin-settings.js';
|
||||
|
||||
wp_register_script(
|
||||
'wlcms-admin-settings',
|
||||
WLCMS_ASSETS_URL . $setting_js,
|
||||
array('jquery', 'select2', 'wp-color-picker', 'jquery-validate'),
|
||||
$this->asset_version($setting_js)
|
||||
);
|
||||
|
||||
$jquery_validate = 'js/jquery.validatev1.19.5.min.js';
|
||||
|
||||
wp_register_script(
|
||||
'jquery-validate',
|
||||
WLCMS_ASSETS_URL . $jquery_validate,
|
||||
array('jquery'),
|
||||
$this->asset_version($jquery_validate)
|
||||
);
|
||||
|
||||
$ays_before_js = 'js/ays-beforeunload-shim.js';
|
||||
wp_register_script(
|
||||
'ays-beforeunload-shim',
|
||||
WLCMS_ASSETS_URL . $ays_before_js,
|
||||
array('jquery'),
|
||||
$this->asset_version($ays_before_js)
|
||||
);
|
||||
|
||||
$areyousure_js = 'js/jquery-areyousure.js';
|
||||
wp_register_script(
|
||||
'jquery-areyousure',
|
||||
WLCMS_ASSETS_URL . $areyousure_js,
|
||||
array('jquery'),
|
||||
$this->asset_version($areyousure_js)
|
||||
);
|
||||
|
||||
$setting_css = 'css/admin-settings.css';
|
||||
wp_register_style(
|
||||
'wlcms-admin-settings',
|
||||
WLCMS_ASSETS_URL . $setting_css,
|
||||
array('select2', 'wp-color-picker'),
|
||||
$this->asset_version($setting_css)
|
||||
);
|
||||
|
||||
wp_register_style('select2', WLCMS_ASSETS_URL . 'css/select2.min.css');
|
||||
wp_register_script('select2', WLCMS_ASSETS_URL . 'js/select2.min.js');
|
||||
|
||||
wp_enqueue_script(array('select2', 'wp-color-picker', 'ays-beforeunload-shim', 'jquery-areyousure', 'wlcms-admin-settings'));
|
||||
wp_enqueue_style(array('select2', 'wp-color-picker', 'wlcms-admin-settings'));
|
||||
|
||||
wp_localize_script(
|
||||
'wlcms-admin-settings',
|
||||
'wlcms_settings',
|
||||
array(
|
||||
'loginurl' => site_url("/wp-login.php"),
|
||||
'adminurl' => admin_url("index.php"),
|
||||
'wlcms_ajax_nonce' => wp_create_nonce("wlcms_ajax_nonce")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
private function store()
|
||||
{
|
||||
do_action('wlcms_save_before_validation');
|
||||
|
||||
if (!isset($_POST['wlcms-settings'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isset($_POST['wlcms-action']) && $_POST['wlcms-action'] == 'reset') {
|
||||
return;
|
||||
}
|
||||
|
||||
// nonce checking
|
||||
if (!isset($_POST['wlcms-settings_nonce'])
|
||||
|| !wp_verify_nonce($_POST['wlcms-settings_nonce'], 'wlcms-settings-action')) {
|
||||
|
||||
print 'Sorry, your nonce did not verify.';
|
||||
exit;
|
||||
}
|
||||
|
||||
wlcms()->Settings()->store();
|
||||
return;
|
||||
}
|
||||
|
||||
public function view()
|
||||
{
|
||||
$wlcms = wlcms();
|
||||
$view = $wlcms->get_active_view();
|
||||
$wlcms->admin_view($view);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,529 @@
|
||||
<?php
|
||||
|
||||
class WLCMS_Admin_Dashboard extends WLCMS_Previewable
|
||||
{
|
||||
|
||||
private $is_dashboard_all_hidden;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
//Check and set if it is a preview
|
||||
$this->check_preview();
|
||||
|
||||
add_action('wp_dashboard_setup', array($this, 'dashboard_setup'), 999);
|
||||
add_action("wp_ajax_hide_vum_dashboard", array($this, "hide_vum_dashboard"));
|
||||
add_action("admin_init", array($this, "reset_welcome_dashboard"));
|
||||
add_action("init", array($this, "init"));
|
||||
}
|
||||
public function init()
|
||||
{
|
||||
|
||||
$welcome_panels = wlcms_field_setting('welcome_panel');
|
||||
|
||||
if (!$welcome_panels || !is_array($welcome_panels)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!count($welcome_panels) === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$pages = [];
|
||||
foreach ($welcome_panels as $panel) {
|
||||
if ($panel && is_array($panel) && isset($panel['template_type']) && $panel['template_type'] == 'page' && isset($panel['page_id_page'])) {
|
||||
$pages[] = (int) $panel['page_id_page'];
|
||||
}
|
||||
}
|
||||
|
||||
if (count($pages) > 0) {
|
||||
wlcms()->require_class("Welcome_Messages/Welcome_Messages_Page");
|
||||
$template = new Welcome_Messages_Page();
|
||||
$template->init($pages);
|
||||
}
|
||||
}
|
||||
|
||||
public function dashboard_setup()
|
||||
{
|
||||
$this->reset_dashboard_style();
|
||||
$this->add_own_rss_panel();
|
||||
$this->dashboard_title();
|
||||
$this->set_welcome_metabox();
|
||||
|
||||
//Old version setting 2.0.2
|
||||
if (!wlcms_field_setting('dashboard_role_stat')) {
|
||||
if (is_wlcms_admin()) return;
|
||||
} else {
|
||||
$dashboard_widgets_visibility_roles = wlcms_esc_html_deep(wlcms_field_setting('dashboard_widgets_visibility_roles'));
|
||||
if (!$dashboard_widgets_visibility_roles) return;
|
||||
if (!$this->has_current_user_role($dashboard_widgets_visibility_roles))
|
||||
return;
|
||||
}
|
||||
|
||||
$this->set_dashboard_all_hidden();
|
||||
$this->remove_metaboxes();
|
||||
$this->remove_dashed_border();
|
||||
}
|
||||
|
||||
private function reset_dashboard_style()
|
||||
{
|
||||
|
||||
wlcms_set_css(
|
||||
'.wlcms-welcome-panel .elementor div,
|
||||
.wlcms-welcome-panel .elementor h1,
|
||||
.wlcms-welcome-panel .elementor h2,
|
||||
.wlcms-welcome-panel .elementor h3,
|
||||
.wlcms-welcome-panel .elementor h4,
|
||||
.wlcms-welcome-panel .elementor h5,
|
||||
.wlcms-welcome-panel .fl-builder-content p,
|
||||
.wlcms-welcome-panel p',
|
||||
array(
|
||||
'border' => '0',
|
||||
'font-size' => '100%',
|
||||
'font' => 'inherit',
|
||||
'line-height' => 'inherit',
|
||||
'vertical-align' => 'baseline',
|
||||
'color' => 'unset'
|
||||
)
|
||||
);
|
||||
|
||||
wlcms_set_css(
|
||||
'.wlcms-welcome-panel .welcome-panel-content > h2',
|
||||
array(
|
||||
'width' => '95%',
|
||||
'padding' => '0 21px'
|
||||
)
|
||||
);
|
||||
wlcms_set_css(
|
||||
'.wlcms-welcome-panel .wlcms-welcome-content',
|
||||
array(
|
||||
'padding' => '20px'
|
||||
)
|
||||
);
|
||||
wlcms_set_css(
|
||||
'.wlcms-welcome-panel .welcome-panel-content',
|
||||
array(
|
||||
'max-width' => 'none!important',
|
||||
'margin-left' => '0!important',
|
||||
'justify-content' => 'flex-start',
|
||||
'min-height' => 'auto'
|
||||
)
|
||||
);
|
||||
|
||||
wlcms_set_css(
|
||||
'.wlcms-welcome-panel .elementor-section-full_width',
|
||||
array(
|
||||
'width' => '100%!important',
|
||||
'left' => '0!important'
|
||||
)
|
||||
);
|
||||
|
||||
wlcms_set_css('.wlcms-welcome-panel', array(
|
||||
'position' => 'relative',
|
||||
"border" => "1px solid #c3c4c7",
|
||||
"box-shadow" => "0 1px 1px rgb(0 0 0 / 4%)",
|
||||
"background" => "#fff",
|
||||
"font-size" => "13px",
|
||||
"line-height" => "1.7",
|
||||
"margin" => "16px 0"
|
||||
));
|
||||
|
||||
wlcms_set_css('.wlcms-welcome-panel .welcome-panel-close:before', array(
|
||||
"background" => "0 0",
|
||||
"color" => "#787c82",
|
||||
"content" => '"\f153"',
|
||||
"display" => "block",
|
||||
"font" => "normal 16px/20px dashicons",
|
||||
"speak" => "never",
|
||||
"height" => "20px",
|
||||
"text-align" => "center",
|
||||
"width" => "20px",
|
||||
"-webkit-font-smoothing" => "antialiased",
|
||||
"-moz-osx-font-smoothing" => "grayscale",
|
||||
"position" => "absolute",
|
||||
"top" => "8px",
|
||||
"left" => "0",
|
||||
"transition" => "all .1s ease-in-out",
|
||||
));
|
||||
|
||||
wlcms_set_css('.wlcms-welcome-panel, .wlcms-welcome-panel .welcome-panel-content', array(
|
||||
'padding' => '0!important',
|
||||
));
|
||||
|
||||
wlcms_set_css('.wlcms-welcome-panel a', array(
|
||||
"color" => "#2271b1",
|
||||
));
|
||||
wlcms_set_css(
|
||||
'.wlcms-welcome-panel .welcome-panel-close',
|
||||
array(
|
||||
'top' => '0!important',
|
||||
'right' => '0!important',
|
||||
'background' => 'white!important',
|
||||
'z-index' => '1000',
|
||||
"position" => "absolute",
|
||||
"top" => "0",
|
||||
"right" => "0",
|
||||
"padding" => "10px 15px 10px 24px",
|
||||
"font-size" => "13px",
|
||||
"line-height" => "1.23076923",
|
||||
"text-decoration" => "none"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
private function set_dashboard_all_hidden()
|
||||
{
|
||||
$this->is_dashboard_all_hidden = (bool) $this->get_settings('hide_all_dashboard_panels');
|
||||
}
|
||||
|
||||
public function is_dashboard_all_hidden()
|
||||
{
|
||||
return $this->is_dashboard_all_hidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change Dashboard H1 Title by using js
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function dashboard_title()
|
||||
{
|
||||
global $wp_version;
|
||||
|
||||
$dashboard_title = '';
|
||||
if ($icon = $this->get_settings('dashboard_icon')) {
|
||||
$dashboard_title .= '<span id=\"wlcms_dashboard_logo\"><img src=\"' . esc_url($icon) . '\" alt=\"\" /></span>';
|
||||
|
||||
wlcms_set_css('.index-php #wlcms_dashboard_logo img', array('vertical-align' => 'middle', 'padding-right' => '10px'));
|
||||
}
|
||||
|
||||
if ($title = $this->get_settings('dashboard_title')) {
|
||||
$dashboard_title .= '<span id=\"wlcms_dashboard_title\">' . esc_attr($title) . '</span>';
|
||||
}
|
||||
|
||||
if (version_compare($wp_version, '3.8-beta', '>=')) {
|
||||
wlcms_add_js('jQuery(".index-php #wpbody-content .wrap h1:eq(0)").html("' . $dashboard_title . '")');
|
||||
return;
|
||||
}
|
||||
|
||||
wlcms_add_js('jQuery("#icon-index").html("' . $dashboard_title . '")');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removed Wordpress Dashboard metaboxes if set to true
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function remove_metaboxes()
|
||||
{
|
||||
global $wp_meta_boxes;
|
||||
|
||||
$wlcms_widgets = wlcms_esc_html_deep($this->get_settings('dashboard_widgets'));
|
||||
|
||||
if (!(isset($wp_meta_boxes['dashboard']) && is_array($wp_meta_boxes['dashboard']))) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($wp_meta_boxes['dashboard'] as $section_key => $section) {
|
||||
if (!is_array($section)) {
|
||||
continue;
|
||||
}
|
||||
foreach ($section as $position_key => $position) {
|
||||
if (!is_array($position)) {
|
||||
continue;
|
||||
}
|
||||
foreach ($position as $widget_id => $widget) {
|
||||
if ($this->is_wlcms_widget($widget_id)) {
|
||||
continue;
|
||||
} elseif (!$this->is_dashboard_all_hidden()) {
|
||||
if ($wlcms_widgets && is_array($wlcms_widgets) && count($wlcms_widgets) > 0) {
|
||||
if (!in_array($widget_id, $wlcms_widgets)) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
unset($wp_meta_boxes['dashboard'][$section_key][$position_key][$widget_id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function is_wlcms_widget($dashboard_key = false)
|
||||
{
|
||||
if (!$dashboard_key) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (strpos($dashboard_key, 'custom_vum_widget') !== false) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return in_array($dashboard_key, $this->excluded_widgets());
|
||||
}
|
||||
|
||||
private function excluded_widgets()
|
||||
{
|
||||
return apply_filters('wlcms_exclude_dashboard_metaboxes', array('wlcms_rss_box'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Own Welcome panel if set to true
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function set_welcome_metabox()
|
||||
{
|
||||
|
||||
$user_id = get_current_user_id();
|
||||
if ($user_id == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$welcome_panels = wlcms_field_setting('welcome_panel');
|
||||
|
||||
if (!$welcome_panels || !is_array($welcome_panels)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!count($welcome_panels) === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$admin_Dashboard_Welcome_Message = wlcms()->require_class("Admin_Dashboard_Welcome_Message");
|
||||
$admin_Dashboard_Welcome_Message = new Admin_Dashboard_Welcome_Message();
|
||||
|
||||
foreach ($welcome_panels as $key => $welcome_panel) {
|
||||
if (!$this->is_welcome_panel_visible($welcome_panel) || !is_array($welcome_panel)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$welcome_content_hidden = get_user_meta($user_id, 'vum_hide_dashboard' . $key, true);
|
||||
|
||||
if ($welcome_content_hidden && isset($welcome_panel['dismissible'])) {
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$admin_Dashboard_Welcome_Message->set($welcome_panel, $key);
|
||||
$admin_Dashboard_Welcome_Message->handle();
|
||||
}
|
||||
|
||||
$admin_Dashboard_Welcome_Message->make_welcome_panel($welcome_panels);
|
||||
|
||||
wlcms_set_css('.index-php .wlcms-welcome-panel-content', array('margin' => '13px', 'padding-bottom' => '25px!important'));
|
||||
}
|
||||
|
||||
private function is_welcome_panel_visible($setting)
|
||||
{
|
||||
|
||||
if (!isset($setting['is_active'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($setting['is_active'] != '1') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
!isset($setting['visible_to'])
|
||||
|| (isset($setting['visible_to']) && !$setting['visible_to'])
|
||||
)
|
||||
return false;
|
||||
|
||||
$roles = $setting['visible_to'];
|
||||
|
||||
return $this->has_current_user_role($roles);
|
||||
}
|
||||
|
||||
private function has_current_user_role($roles)
|
||||
{
|
||||
|
||||
$user_role = wlcms_current_user_roles();
|
||||
|
||||
return in_array($user_role, $roles);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Dashboard Border Line if set to true
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function remove_dashed_border()
|
||||
{
|
||||
if (!$this->get_settings('remove_empty_dash_panel')) {
|
||||
return;
|
||||
}
|
||||
|
||||
wlcms_set_css('body.index-php #dashboard-widgets .postbox-container .empty-container', array('border' => '0', 'visibility' => 'hidden'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Wordpress Core News and Event if set to troe
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function remove_news_and_events()
|
||||
{
|
||||
if (!$this->get_settings('hide_news_and_events')) {
|
||||
return;
|
||||
}
|
||||
|
||||
remove_meta_box('dashboard_primary', 'dashboard', 'core');
|
||||
|
||||
wlcms_add_js(';jQuery("#community-events").remove();jQuery(".community-events-footer").remove();jQuery("#dashboard_primary h2 span").remove();');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add RSS Dashboard Metabox
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add_own_rss_panel()
|
||||
{
|
||||
if (!$this->get_settings('add_own_rss_panel')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$this->get_settings('rss_feed_address')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$title = '';
|
||||
$this->get_settings('rss_title');
|
||||
|
||||
if ($logo = $this->get_settings('rss_logo')) {
|
||||
$title .= '<img src="' . esc_url($logo) . '" height="16" width="16" alt="Logo" style="padding-right:5px;vertical-align:bottom;"/> ';
|
||||
}
|
||||
|
||||
if ($rss_title = $this->get_settings('rss_title')) {
|
||||
$title .= $rss_title;
|
||||
}
|
||||
|
||||
wp_add_dashboard_widget(
|
||||
'wlcms_rss_box',
|
||||
!empty($title) ? $title : ' ',
|
||||
array($this, 'rss_box')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display RSS Metabox to the dashboard
|
||||
* called by wp_add_dashboard_widget
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function rss_box()
|
||||
{
|
||||
include_once(ABSPATH . WPINC . '/feed.php');
|
||||
|
||||
$num_items = $this->get_settings('rss_feed_number_of_item');
|
||||
$introduction = $this->get_settings('rss_introduction');
|
||||
$show_post_content = $this->get_settings('show_post_content');
|
||||
$url = $this->get_settings('rss_feed_address');
|
||||
|
||||
if ($introduction) {
|
||||
echo '<p>' . wp_kses_post($introduction) . '</p>';
|
||||
}
|
||||
|
||||
$rss = fetch_feed($url);
|
||||
|
||||
if ($error = is_wp_error($rss)) {
|
||||
echo '<div class="warning-text">' . esc_html($rss->get_error_message()) . '</div>';
|
||||
|
||||
wlcms_set_css(
|
||||
'.index-php .warning-text',
|
||||
array('color' => 'rgba(240, 116, 95, 0.808)', 'display' => 'block')
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$maxitems = $rss->get_item_quantity($num_items);
|
||||
$rss_items = $rss->get_items(0, $maxitems);
|
||||
|
||||
if ($maxitems == 0) {
|
||||
echo 'No items.';
|
||||
return;
|
||||
}
|
||||
|
||||
$rss_list = '<ul>';
|
||||
|
||||
foreach ($rss_items as $item) :
|
||||
|
||||
$rss_list .= sprintf(
|
||||
'<li><strong><a href="%s" title="Posted %s" target="_blank">%s</a> </strong> <br />',
|
||||
esc_url($item->get_permalink()),
|
||||
$item->get_date('j F Y | g:i a'),
|
||||
esc_html($item->get_title())
|
||||
);
|
||||
|
||||
if ($show_post_content) :
|
||||
$rss_list .= wp_kses_post($item->get_content());
|
||||
|
||||
endif;
|
||||
$rss_list .= '</li>';
|
||||
|
||||
endforeach;
|
||||
|
||||
$rss_list .= '</ul>';
|
||||
|
||||
echo $rss_list;
|
||||
}
|
||||
|
||||
public function hide_vum_dashboard()
|
||||
{
|
||||
if (!wp_verify_nonce($_REQUEST['nonce'], "vum_hide_dashboard_nonce")) {
|
||||
exit("No naughty business please");
|
||||
}
|
||||
$user_id = get_current_user_id();
|
||||
if ($user_id == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$key = sanitize_text_field($_POST['key']);
|
||||
update_user_meta($user_id, 'vum_hide_dashboard' . $key, 1);
|
||||
echo json_encode(array('type' => 'success'));
|
||||
exit;
|
||||
}
|
||||
|
||||
public function reset_welcome_dashboard()
|
||||
{
|
||||
if (!isset($_GET['wlcms-action'])) return;
|
||||
|
||||
if ($_GET['wlcms-action'] !== 'reset-welcome-dashboard') return;
|
||||
|
||||
if (!isset($_GET['dashboard'])) return;
|
||||
|
||||
if (!is_wlcms_super_admin()) return;
|
||||
|
||||
$key = sanitize_text_field($_GET['dashboard']);
|
||||
|
||||
delete_metadata('user', 0, 'vum_hide_dashboard' . $key, '', true);
|
||||
|
||||
WLCMS_Queue('Welcome dashboard message successfully reset.');
|
||||
}
|
||||
|
||||
public function widgets()
|
||||
{
|
||||
global $wp_meta_boxes;
|
||||
|
||||
if (isset($wp_meta_boxes['dashboard']) && is_array($wp_meta_boxes['dashboard'])) {
|
||||
return $wp_meta_boxes['dashboard'];
|
||||
}
|
||||
|
||||
require_once ABSPATH . '/wp-admin/includes/dashboard.php';
|
||||
|
||||
set_current_screen('dashboard');
|
||||
//remove wlcms hook
|
||||
remove_action('wp_dashboard_setup', array($this, 'dashboard_setup'), 999);
|
||||
wp_dashboard_setup();
|
||||
//re-apply wlcms hook
|
||||
add_action('wp_dashboard_setup', array($this, 'dashboard_setup'), 999);
|
||||
set_current_screen(get_current_screen());
|
||||
return $wp_meta_boxes['dashboard'];
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
class Admin_Dashboard_Welcome_Message
|
||||
{
|
||||
private $settings, $key;
|
||||
|
||||
public function set($settings, $key)
|
||||
{
|
||||
$this->settings = $settings;
|
||||
$this->key = $key;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
|
||||
if ( !(isset($this->settings['template_type']) && $this->settings['template_type']) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$type = $this->settings['template_type'];
|
||||
wlcms()->require_class("Welcome_Messages/Welcome_Messages_Elementor");
|
||||
wlcms()->require_class("Welcome_Messages/Welcome_Messages_Html");
|
||||
wlcms()->require_class("Welcome_Messages/Welcome_Messages_Beaver_Builder");
|
||||
wlcms()->require_class("Welcome_Messages/Welcome_Messages_Page");
|
||||
|
||||
if( $type == 'Elementor' ){
|
||||
$template = new Welcome_Messages_Elementor();
|
||||
}elseif( $type == 'Beaver Builder' ){
|
||||
$template = new Welcome_Messages_Beaver_Builder();
|
||||
}elseif( $type == 'page' ){
|
||||
$template = new Welcome_Messages_Page();
|
||||
}else {
|
||||
$template = new Welcome_Messages_Html();
|
||||
}
|
||||
|
||||
$template->process($this->settings, $this->key);
|
||||
|
||||
}
|
||||
|
||||
public function make_welcome_panel()
|
||||
{
|
||||
|
||||
$nonce = wp_create_nonce("vum_hide_dashboard_nonce");
|
||||
$link = admin_url('admin-ajax.php');
|
||||
|
||||
$welcome = sprintf(";jQuery('.wlcms-welcome-panel a.welcome-panel-close').on('click', function(e){
|
||||
e.preventDefault();
|
||||
var vum_panel = jQuery(this).parent('.wlcms-welcome-panel');
|
||||
jQuery.ajax({
|
||||
type : 'post',
|
||||
dataType : 'json',
|
||||
url : '%s',
|
||||
data : {action: 'hide_vum_dashboard', key : vum_panel.data('welcome_key'), nonce: '%s'},
|
||||
success: function(response) {
|
||||
if(response.type == 'success') {
|
||||
vum_panel.hide();
|
||||
}
|
||||
}
|
||||
})
|
||||
});", $link, $nonce);
|
||||
wlcms_add_js($welcome);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,669 @@
|
||||
<?php
|
||||
|
||||
class WLCMS_Admin_Menus
|
||||
{
|
||||
|
||||
private $admin_menus;
|
||||
private $admin_bar_menus = array();
|
||||
private $is_wlcms_admin = false;
|
||||
private $admin_bar_menu_setting = false;
|
||||
private $submenu_placeholder = '_wlcms_';
|
||||
private $wlcms_admin_bar_menus_option = 'wlcms_admin_bar_menus';
|
||||
private $hide_woo_home = false;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
add_action('init', array($this, 'set_wlcms_admin'), 10);
|
||||
add_action('admin_init', array($this, 'admin_init'));
|
||||
add_action('wlcms_save_addtional_settings', array($this, 'save'), 12, 1);
|
||||
add_action('admin_menu', array($this, 'rebuild_user_admin_menu'), 9999999); // rebuild sidebar menu
|
||||
add_action('wp_before_admin_bar_render', array($this, 'init_admin_bar_menu'), 9999999); // setup admin bar menu
|
||||
}
|
||||
|
||||
public function admin_init()
|
||||
{
|
||||
$this->set_admin_bar_menu_setting();
|
||||
$this->compile_menus();
|
||||
}
|
||||
|
||||
public function set_wlcms_admin()
|
||||
{
|
||||
//Remove actions from preview mode
|
||||
if (defined('DOING_AJAX') && DOING_AJAX) {
|
||||
remove_action('admin_init', array($this, 'admin_init'));
|
||||
remove_action('admin_init', array($this, 'rebuild_user_admin_menu'), 9999999);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_user_logged_in()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wlcms_admin = wlcms_field_setting('wlcms_admin');
|
||||
|
||||
if (!$wlcms_admin) {
|
||||
return;
|
||||
}
|
||||
|
||||
//Check if the current user is editor and with legacy menu
|
||||
if ($this->is_legacy_menu_role()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$current_user = wp_get_current_user();
|
||||
|
||||
$this->is_wlcms_admin = in_array($current_user->ID, $wlcms_admin);
|
||||
}
|
||||
|
||||
public function is_legacy_menu_role()
|
||||
{
|
||||
|
||||
if (!wlcms_field_setting('legacy_menu')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$user = wp_get_current_user();
|
||||
$role = (array)$user->roles;
|
||||
|
||||
if (!in_array('editor', $role, true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* check current user is wlcms admin or super admin
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function has_visible_roles()
|
||||
{
|
||||
if (is_multisite() && is_super_admin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->is_wlcms_admin();
|
||||
}
|
||||
|
||||
public function enable_admin_menu()
|
||||
{
|
||||
return wlcms_field_setting('enable_wlcms_admin');
|
||||
}
|
||||
|
||||
/**
|
||||
* check current user is wlcms admin
|
||||
*
|
||||
*/
|
||||
public function is_wlcms_admin()
|
||||
{
|
||||
return $this->is_wlcms_admin;
|
||||
}
|
||||
|
||||
public function save($settings)
|
||||
{
|
||||
|
||||
if (!isset($_POST['enable_wlcms_admin'])) {
|
||||
$settings->remove('admin_menus');
|
||||
$settings->remove('admin_bar_menus');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->save_sidemenu($settings);
|
||||
$this->save_admin_bar_menu($settings);
|
||||
|
||||
if (!isset($_POST['remove_legacy_menu'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$settings->remove('legacy_menu');
|
||||
}
|
||||
|
||||
private function save_sidemenu($settings)
|
||||
{
|
||||
$menus = $this->get_admin_menus();
|
||||
$db_menu_main = array();
|
||||
$db_menu = array();
|
||||
|
||||
// No menu selected
|
||||
if (!isset($_POST['admin_menus'])) {
|
||||
$settings->remove('admin_menus');
|
||||
return $settings;
|
||||
}
|
||||
|
||||
$post_main_menu = isset($_POST['admin_menus']['main']) ? $_POST['admin_menus']['main'] : array();
|
||||
$post_sub_menu = isset($_POST['admin_menus']['sub']) ? $_POST['admin_menus']['sub'] : array();
|
||||
|
||||
$sidebar_url = wlcms()->Branding()->sidebar_menu_url();
|
||||
|
||||
if (is_array($menus) && $menus > 0) :
|
||||
foreach ($menus as $main_key => $main_menu) {
|
||||
|
||||
if ($main_key == $sidebar_url) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!in_array($main_key, $post_main_menu)) {
|
||||
$db_menu['main'][] = $main_key;
|
||||
}
|
||||
|
||||
if (isset($main_menu['submenus']) && is_array($main_menu['submenus']) && count($main_menu['submenus'])) {
|
||||
foreach ($main_menu['submenus'] as $sub_key => $submenu) {
|
||||
if ($sub_key == $sidebar_url) {
|
||||
continue;
|
||||
}
|
||||
$submenu_value = $submenu['slug'];
|
||||
|
||||
if (!in_array($submenu_value, $post_sub_menu)) {
|
||||
$db_menu['sub'][] = $submenu_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
endif;
|
||||
|
||||
if (count($db_menu)) {
|
||||
$settings->set('admin_menus', $db_menu);
|
||||
} else {
|
||||
$settings->remove('admin_menus');
|
||||
}
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
||||
private function save_admin_bar_menu($settings)
|
||||
{
|
||||
$menus = get_option($this->wlcms_admin_bar_menus_option, array());
|
||||
|
||||
// No menu selected
|
||||
if (!isset($_POST['admin_bar_menus'])) {
|
||||
$settings->remove('admin_bar_menus');
|
||||
return;
|
||||
}
|
||||
|
||||
$post_menu = isset($_POST['admin_bar_menus']) ? $_POST['admin_bar_menus'] : array();
|
||||
|
||||
$db_menu = array();
|
||||
if (is_array($menus) && $menus > 0) :
|
||||
foreach ($menus as $menu_key => $menu) {
|
||||
|
||||
if (!in_array($menu_key, $post_menu)) {
|
||||
$db_menu[] = $menu_key;
|
||||
}
|
||||
}
|
||||
endif;
|
||||
if (count($db_menu)) {
|
||||
$settings->set('admin_bar_menus', $db_menu);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-organize sidebar menus
|
||||
* Combine menu and submenu in single array
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function compile_menus()
|
||||
{
|
||||
global $menu, $submenu;
|
||||
|
||||
|
||||
$output = array();
|
||||
|
||||
$sidebar_url = wlcms()->Branding()->sidebar_menu_url();
|
||||
|
||||
if (is_array($menu) && count($menu) > 0) {
|
||||
foreach ($menu as $menu_item) {
|
||||
|
||||
if (!isset($menu_item[0], $menu_item[2])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// some menu items are seperators, skip them
|
||||
if ($menu_item[0] == '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($menu_item[2] == $sidebar_url) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$menu_name = preg_replace('#(<span.*?>).*?(</span>)#', '', $menu_item[0]);
|
||||
$menu_key = $menu_item[2];
|
||||
$output[$menu_key] = array(
|
||||
'name' => $menu_name,
|
||||
'slug' => $menu_item[2],
|
||||
'submenus' => array()
|
||||
);
|
||||
}
|
||||
}
|
||||
if (is_array($submenu) && count($submenu) > 0) :
|
||||
|
||||
foreach ($submenu as $key => $submenu_item) {
|
||||
|
||||
$mainmenu_key = $key;
|
||||
|
||||
// If a submenu does not have a valid parent, skip
|
||||
if (!isset($output[$mainmenu_key])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($submenu_item as $sm_info) {
|
||||
$submenu_item = remove_query_arg('return', $sm_info[2]);
|
||||
$submenu_key = sanitize_title($submenu_item);
|
||||
$menu_name = '';
|
||||
if (isset($sm_info[0]) && $sm_info[0] != '' && !is_null($sm_info[0])) {
|
||||
$menu_name = preg_replace('#(<span.*?>).*?(</span>)#', '', $sm_info[0]);
|
||||
}
|
||||
|
||||
$slug = $mainmenu_key . $this->get_submenu_placeholder() . $submenu_key;
|
||||
$output[$key]['submenus'][$submenu_key] = array(
|
||||
'name' => $menu_name,
|
||||
'slug' => $slug
|
||||
);
|
||||
}
|
||||
}
|
||||
endif;
|
||||
|
||||
$this->admin_menus = $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sibar Admin menu getter
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_admin_menus()
|
||||
{
|
||||
return $this->admin_menus;
|
||||
}
|
||||
|
||||
/**
|
||||
* remove sidebar menus that enable by wlcms
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function rebuild_user_admin_menu()
|
||||
{
|
||||
global $submenu;
|
||||
|
||||
if (!$this->enable_admin_menu() && !$this->is_legacy_menu_role()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->has_visible_roles()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$setting_admin_menus = wlcms_field_setting('admin_menus');
|
||||
if (isset($setting_admin_menus['main']) && is_array($setting_admin_menus['main'])) {
|
||||
|
||||
foreach ($setting_admin_menus['main'] as $menu_item) {
|
||||
$this->remove_menu_page($menu_item);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($setting_admin_menus['sub']) && is_array($setting_admin_menus['sub'])) {
|
||||
foreach ($setting_admin_menus['sub'] as $submenu_item) {
|
||||
$submenu_list = explode($this->get_submenu_placeholder(), $submenu_item);
|
||||
$main_menu = $submenu_list[0];
|
||||
$main_submenu = $submenu_list[1];
|
||||
$this->remove_submenu_page($main_menu, $main_submenu);
|
||||
}
|
||||
|
||||
$this->fix_woocommerce();
|
||||
$this->fix_yoast($setting_admin_menus['sub']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sidebar sub-menu
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_new_submenus($key)
|
||||
{
|
||||
return isset($this->admin_menus[$key]) ? $this->admin_menus[$key] : false;
|
||||
}
|
||||
/**
|
||||
* Remove a top-level admin menu.
|
||||
*
|
||||
* @global array $menu
|
||||
*
|
||||
* @param string $menu_slug The slug of the menu.
|
||||
* @return array|bool The removed menu on success, false if not found.
|
||||
*/
|
||||
public function remove_menu_page($menu_slug)
|
||||
{
|
||||
global $menu;
|
||||
|
||||
if (!is_array($menu)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($menu as $i => $item) {
|
||||
|
||||
$menu_item = remove_query_arg('return', $item[2]);
|
||||
$menu_item = urldecode($menu_item);
|
||||
|
||||
if ($menu_slug == $menu_item) {
|
||||
unset($menu[$i]);
|
||||
return $item;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an admin submenu.
|
||||
*
|
||||
* @global array $submenu
|
||||
*
|
||||
* @param string $menu_slug The slug for the parent menu.
|
||||
* @param string $submenu_slug The slug of the submenu.
|
||||
* @return array|bool The removed submenu on success, false if not found.
|
||||
*/
|
||||
function remove_submenu_page($menu_slug, $submenu_slug)
|
||||
{
|
||||
global $submenu;
|
||||
|
||||
if (!isset($submenu[$menu_slug]) || !is_array($submenu[$menu_slug]))
|
||||
return false;
|
||||
|
||||
foreach ($submenu[$menu_slug] as $i => $item) {
|
||||
$submenu_item = remove_query_arg('return', $item[2]);
|
||||
$submenu_item = sanitize_title($submenu_item);
|
||||
|
||||
//Patch whitelist
|
||||
if (in_array($submenu_slug, array('wc-admin'))) {
|
||||
$this->hide_woo_home = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($submenu_slug == $submenu_item) {
|
||||
unset($submenu[$menu_slug][$i]);
|
||||
return $item;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function fix_woocommerce()
|
||||
{
|
||||
global $submenu;
|
||||
|
||||
|
||||
if (!isset($submenu) || !$this->hide_woo_home) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isset($submenu['woocommerce'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$home = $submenu['woocommerce'][0];
|
||||
$home[1] = 'manage_woocommerce';
|
||||
unset($submenu['woocommerce'][0]);
|
||||
$count = count($submenu['woocommerce']);
|
||||
|
||||
if ($count == 0) {
|
||||
wlcms_set_hidden_css('li.toplevel_page_woocommerce');
|
||||
}
|
||||
|
||||
|
||||
$submenu['woocommerce'] = array_values($submenu['woocommerce']);
|
||||
$home[0] = '';
|
||||
$home[3] = '';
|
||||
$submenu['woocommerce'][$count] = $home;
|
||||
|
||||
wlcms_set_hidden_css('li.toplevel_page_woocommerce li > a:empty');
|
||||
}
|
||||
|
||||
public function fix_yoast($sub)
|
||||
{
|
||||
global $menu;
|
||||
|
||||
if (array_search('wpseo_dashboard_wlcms_wpseo_workouts', $sub) === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($menu as $key => $item) {
|
||||
if ($item[2] == 'wpseo_workouts') {
|
||||
unset($menu[$key]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function init_admin_bar_menu()
|
||||
{
|
||||
$this->set_admin_bar_menu();
|
||||
$this->buid_new_admin_bar_menu();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare white label cms admin bar menu and build in multidimentional array
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function set_admin_bar_menu()
|
||||
{
|
||||
global $wp_admin_bar;
|
||||
|
||||
$nodes = $wp_admin_bar->get_nodes();
|
||||
|
||||
if (!$nodes || !is_array($nodes)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Admin menus is not set from action hoo admin_init
|
||||
// Use for saving menus
|
||||
if (is_admin()) {
|
||||
$screen = get_current_screen();
|
||||
if ($screen && $screen->id == WLCMS_SCREEN_ID) {
|
||||
|
||||
update_option($this->wlcms_admin_bar_menus_option, $nodes, false);
|
||||
}
|
||||
}
|
||||
|
||||
$wlcms_admin_bar = $this->_createMenuTree($nodes);
|
||||
|
||||
$this->admin_bar_menus = $wlcms_admin_bar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all main menu
|
||||
*
|
||||
* @param object $flat
|
||||
* @param integer $root
|
||||
* @return array
|
||||
*/
|
||||
private function _createMenuTree($flat, $root = 0)
|
||||
{
|
||||
$parents = array();
|
||||
$sub_root = array();
|
||||
if (is_array($flat) && $flat > 0) :
|
||||
foreach ($flat as $a) {
|
||||
if ($this->excluded_admin_menu($a->id)) continue;
|
||||
$menu_parent = ($a->parent == '') ? false : $a->parent;
|
||||
$parents[$menu_parent][] = $a;
|
||||
}
|
||||
$sub_root = isset($parents[$root]) ? $parents[$root] : array();
|
||||
endif;
|
||||
|
||||
return $this->_createMenuBranch($parents, $sub_root);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all sub menu to each main menu
|
||||
*
|
||||
* @param array $parents main menus
|
||||
* @param object $children
|
||||
* @return array
|
||||
*/
|
||||
private function _createMenuBranch(&$parents, $children)
|
||||
{
|
||||
$tree = array();
|
||||
if (is_array($children) && $children > 0) :
|
||||
foreach ($children as $child) {
|
||||
|
||||
if (isset($parents[$child->id])) {
|
||||
|
||||
$child->sub = $this->_createMenuBranch($parents, $parents[$child->id]);
|
||||
}
|
||||
|
||||
$tree[] = $child;
|
||||
}
|
||||
endif;
|
||||
|
||||
return $tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the menu is listed from excluded items
|
||||
*
|
||||
* @param string $menu
|
||||
* @return boolean
|
||||
*/
|
||||
private function excluded_admin_menu($menu = '')
|
||||
{
|
||||
$exclude = array('menu-toggle', 'wlcms-admin-logo', 'wp-logo');
|
||||
|
||||
return in_array($menu, $exclude);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create admin bar menu base from the wlcms settings
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function buid_new_admin_bar_menu()
|
||||
{
|
||||
global $wp_admin_bar;
|
||||
|
||||
if ($this->has_visible_roles()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$admin_bar_menu = wlcms_field_setting('admin_bar_menus');
|
||||
|
||||
if (!$admin_bar_menu || ($admin_bar_menu && !is_array($admin_bar_menu))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!count($admin_bar_menu)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$nodes = $wp_admin_bar->get_nodes();
|
||||
|
||||
if (is_array($nodes) && count($nodes) > 0) :
|
||||
foreach ($nodes as $menu) {
|
||||
|
||||
if ($this->excluded_admin_menu($menu->id)) continue;
|
||||
|
||||
if (in_array($menu->id, $admin_bar_menu)) {
|
||||
$wp_admin_bar->remove_menu($menu->id);
|
||||
}
|
||||
}
|
||||
endif;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter of admin bar menus list
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function get_admin_bar_menus()
|
||||
{
|
||||
return $this->admin_bar_menus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change menu Title for wlcms settings
|
||||
*
|
||||
* @param object $menu
|
||||
* @return string
|
||||
*/
|
||||
public function get_menu_title($menu)
|
||||
{
|
||||
if (!isset($menu->title)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$title = trim(wp_strip_all_tags($menu->title));
|
||||
|
||||
return ((!$title || empty($title)) ? '-' : $title) . ' <small>(' . $menu->id . ')</small>';
|
||||
}
|
||||
|
||||
public function set_admin_bar_menu_setting()
|
||||
{
|
||||
$this->admin_bar_menu_setting = wlcms_field_setting('admin_bar_menus');
|
||||
}
|
||||
|
||||
public function get_admin_bar_menu_setting()
|
||||
{
|
||||
return $this->admin_bar_menu_setting;
|
||||
}
|
||||
|
||||
public function get_admin_bar_menu_html($menu, $depth = 0)
|
||||
{
|
||||
$out = '';
|
||||
|
||||
if (!is_array($menu) && $depth > 0) {
|
||||
return $out;
|
||||
}
|
||||
|
||||
$ul_class_wrapper = '';
|
||||
if ($depth > 0) {
|
||||
$out .= '<a href="javascript:void(0)" class="wlcms-toggle-arrow"></a>';
|
||||
$ul_class_wrapper = ' class="sub_menu_wrapper"';
|
||||
}
|
||||
$out .= '<ul' . $ul_class_wrapper . '>';
|
||||
$out .= '<input type="hidden" value="top-secondary" name="admin_bar_menus[]">
|
||||
<input type="hidden" value="my-account" name="admin_bar_menus[]">
|
||||
<input type="hidden" value="user-actions" name="admin_bar_menus[]">
|
||||
<input type="hidden" value="logout" name="admin_bar_menus[]">
|
||||
';
|
||||
|
||||
foreach ($menu as $menu_props) {
|
||||
|
||||
$menu_key = $menu_props->id;
|
||||
$checked_sub = '';
|
||||
$admin_bar_menu_setting = $this->get_admin_bar_menu_setting();
|
||||
$checked_sub = ' checked="checked"';
|
||||
if ($admin_bar_menu_setting && in_array($menu_key, $admin_bar_menu_setting)) {
|
||||
$checked_sub = '';
|
||||
}
|
||||
|
||||
$disabled = '';
|
||||
if (in_array($menu_key, array('top-secondary', 'my-account', 'user-actions', 'logout'))) {
|
||||
$disabled = ' disabled';
|
||||
}
|
||||
|
||||
$sub_html = (isset($menu_props->sub)) ? $this->get_admin_bar_menu_html($menu_props->sub, ($depth + 1)) : '';
|
||||
$out .= sprintf(
|
||||
'
|
||||
<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/>
|
||||
<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>
|
||||
%4$s
|
||||
</li>
|
||||
',
|
||||
$menu_key,
|
||||
$checked_sub,
|
||||
$this->get_menu_title($menu_props),
|
||||
$sub_html,
|
||||
$disabled
|
||||
);
|
||||
}
|
||||
|
||||
$out .= '</ul>';
|
||||
return $out;
|
||||
}
|
||||
|
||||
public function get_submenu_placeholder()
|
||||
{
|
||||
return $this->submenu_placeholder;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
|
||||
class WLCMS_Admin_Script
|
||||
{
|
||||
|
||||
private $css = array();
|
||||
private $admin_css = '';
|
||||
private $bulk_css = array();
|
||||
private $hidded_elements = array();
|
||||
private $js = array();
|
||||
private $additional_css;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
add_action('admin_footer', array($this, 'footer_script'));
|
||||
add_action('wp_footer', array($this, 'footer_script'), 99999);
|
||||
add_action('in_admin_header', array($this, 'header_css'), 99999);
|
||||
add_action('wp_head', array($this, 'header_css'), 99999);
|
||||
}
|
||||
|
||||
public function header_css()
|
||||
{
|
||||
|
||||
// no need to append scripts for guest users
|
||||
if (!is_user_logged_in()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$scripts = "<!-- WLCMS Style-->\n";
|
||||
if (count($this->css) || count($this->hidded_elements) || count($this->bulk_css) || !empty($this->admin_css)) {
|
||||
$scripts .= sprintf('<style type="text/css">%s</style>', $this->compiled_header_css());
|
||||
}
|
||||
|
||||
$scripts .= "\n<!-- WLCMS End Style-->";
|
||||
echo $scripts;
|
||||
}
|
||||
|
||||
private function compiled_header_css()
|
||||
{
|
||||
$content = $this->admin_css . $this->compileCss() . $this->additional_css;
|
||||
$content = wp_kses($content, array('\'', '\"'));
|
||||
$content = str_replace('>', '>', $content);
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function footer_script()
|
||||
{
|
||||
$scripts = '';
|
||||
|
||||
// no need to append scripts for guest users
|
||||
if (!is_user_logged_in()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (count($this->js)) {
|
||||
$scripts .= '<script type="text/javascript">';
|
||||
$scripts .= '/* <![CDATA[ */';
|
||||
$scripts .= ' jQuery(document).ready(function() { ' . $this->compileJs() . ' });';
|
||||
$scripts .= '/* ]]> */';
|
||||
$scripts .= '</script>';
|
||||
}
|
||||
|
||||
if (!empty($scripts)) {
|
||||
$scripts = "<!-- WLCMS Scripts-->\n" . $scripts . "\n<!-- WLCMS End Scripts-->";
|
||||
}
|
||||
|
||||
echo $scripts;
|
||||
}
|
||||
|
||||
public function set_CssHidden($props)
|
||||
{
|
||||
$this->hidded_elements[] = $props;
|
||||
}
|
||||
|
||||
public function setCss($element, $props = array())
|
||||
{
|
||||
$this->css[$element] = $props;
|
||||
}
|
||||
|
||||
public function appendCss($css)
|
||||
{
|
||||
$this->bulk_css[] = $css;
|
||||
}
|
||||
|
||||
private function _setHiddenCss()
|
||||
{
|
||||
$hidden = implode(',', $this->hidded_elements);
|
||||
if (!empty($hidden)) {
|
||||
$this->setCss($hidden, array('display' => 'none!important'));
|
||||
}
|
||||
}
|
||||
|
||||
private function _setBulkCss()
|
||||
{
|
||||
return implode('', $this->bulk_css);
|
||||
}
|
||||
|
||||
public function appendJs($js)
|
||||
{
|
||||
$this->js[] = $js;
|
||||
}
|
||||
|
||||
function compileJs()
|
||||
{
|
||||
return implode('', $this->js);
|
||||
}
|
||||
|
||||
function appendAdminCss($admin_css)
|
||||
{
|
||||
$this->admin_css = $admin_css;
|
||||
}
|
||||
|
||||
function compileCss()
|
||||
{
|
||||
$this->_setHiddenCss();
|
||||
|
||||
if (!count($this->css) && !$this->bulk_css) {
|
||||
return;
|
||||
}
|
||||
|
||||
$css_output = '';
|
||||
foreach ($this->css as $element => $props) {
|
||||
|
||||
$css_output .= $element . '{';
|
||||
foreach ($props as $prop => $value) {
|
||||
$css_output .= $prop . ':' . $value . ';';
|
||||
}
|
||||
|
||||
$css_output .= '}';
|
||||
}
|
||||
|
||||
$css_output .= $this->_setBulkCss();
|
||||
|
||||
return $css_output;
|
||||
}
|
||||
|
||||
public function additional_css($css)
|
||||
{
|
||||
$this->additional_css .= $css;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
<?php
|
||||
|
||||
class WLCMS_Admin_Settings
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
add_action('admin_menu', array($this, 'admin_menu'), 9999);
|
||||
add_action('admin_init', array($this, 'init'), 9999);
|
||||
add_filter('mce_css', array($this, 'custom_editor_stylesheet'));
|
||||
add_action('admin_init', array($this, 'admin_init'));
|
||||
add_action('init', array($this, 'remove_admin_bar'));
|
||||
add_action("wp_ajax_wlcms_inital_search", [$this, "search_initial_pages"]);
|
||||
add_action("wp_ajax_wlcms_search_pages", [$this, "search_pages"]);
|
||||
}
|
||||
|
||||
public function admin_init()
|
||||
{
|
||||
$this->remove_nag_messages();
|
||||
$this->remove_editor_wp_logo();
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->set_admin_css();
|
||||
$this->hide_screen_options();
|
||||
}
|
||||
|
||||
public function remove_editor_wp_logo()
|
||||
{
|
||||
if (!wlcms_field_setting('hide_wordpress_logo_and_links')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$image = $this->get_editor_wp_logo();
|
||||
|
||||
wlcms_set_hidden_css('.edit-post-header .edit-post-fullscreen-mode-close svg');
|
||||
wlcms_set_css('.editor-header__back-button:has(.wlcms_icon)', array('background' => '#000'));
|
||||
wlcms_add_js(' var wlcms_change_back = setInterval(function() {if(jQuery(".edit-post-fullscreen-mode-close .wlcms_icon").length == 0 ){ jQuery(".edit-post-fullscreen-mode-close").html("' . $image . '");}if(jQuery(".edit-post-fullscreen-mode-close_site-icon").length > 0){jQuery(".edit-post-fullscreen-mode-close_site-icon").remove();}}, 1000);');
|
||||
|
||||
}
|
||||
|
||||
private function get_editor_wp_logo()
|
||||
{
|
||||
$gutenberg_exit_icon = wlcms_field_setting('gutenberg_exit_icon');
|
||||
$admin_bar_logo = wlcms_field_setting('admin_bar_logo');
|
||||
|
||||
if ($gutenberg_exit_icon) {
|
||||
$icon = "";
|
||||
if ($gutenberg_exit_icon == 'admin-bar-logo') {
|
||||
$icon = wlcms_field_setting('admin_bar_logo');
|
||||
} elseif ($gutenberg_exit_icon == 'custom-icon') {
|
||||
$icon = wlcms_field_setting('gutenberg_exit_custom_icon');
|
||||
} else {
|
||||
return '<span class=\"wlcms_icon dashicons dashicons-exit\"></span>';
|
||||
}
|
||||
|
||||
return '<span id=\"wlcms_dashboard_logo\" class=\"wlcms_icon\"><img src=\"' . esc_url($icon) . '\" alt=\"\" /></span>';
|
||||
}
|
||||
|
||||
if ($admin_bar_logo) {
|
||||
return '<span id=\"wlcms_dashboard_logo\" class=\"wlcms_icon\"><img src=\"' . esc_url($admin_bar_logo) . '\" alt=\"\" /></span>';
|
||||
}
|
||||
|
||||
return '<span class=\"wlcms_icon wlcms_dashboard_exitdashicons dashicons-exit\"></span>';
|
||||
}
|
||||
|
||||
public function remove_admin_bar()
|
||||
{
|
||||
|
||||
if (!wlcms_field_setting('hide_admin_bar_all')) {
|
||||
return;
|
||||
}
|
||||
|
||||
return $this->disable_admin_bar_menu();
|
||||
}
|
||||
|
||||
private function disable_admin_bar_menu()
|
||||
{
|
||||
add_filter('show_admin_bar', '__return_false');
|
||||
}
|
||||
|
||||
public function admin_menu()
|
||||
{
|
||||
if (!is_admin()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public function hide_screen_options()
|
||||
{
|
||||
if (wlcms_field_setting('hide_screen_options')) {
|
||||
add_filter('screen_options_show_screen', '__return_false');
|
||||
}
|
||||
}
|
||||
|
||||
private function set_admin_css()
|
||||
{
|
||||
|
||||
if (wlcms_field_setting('hide_help_box')) {
|
||||
wlcms_set_hidden_css("#contextual-help-link-wrap");
|
||||
}
|
||||
|
||||
if (!$admin_style = wlcms_field_setting('settings_custom_css_admin')) {
|
||||
return;
|
||||
}
|
||||
|
||||
wlcms()->Admin_Script()->appendAdminCss($admin_style);
|
||||
}
|
||||
|
||||
public function custom_editor_stylesheet($mce_css)
|
||||
{
|
||||
$mce_style = wlcms_field_setting('settings_custom_css_url');
|
||||
if (!$mce_style) {
|
||||
return $mce_css;
|
||||
}
|
||||
|
||||
if (filter_var($mce_style, FILTER_VALIDATE_URL) === false) {
|
||||
$mce_style = get_stylesheet_directory_uri() . '/' . $mce_style;
|
||||
}
|
||||
|
||||
$mce_css .= ',' . esc_url($mce_style);
|
||||
|
||||
return $mce_css;
|
||||
}
|
||||
|
||||
private function remove_nag_messages()
|
||||
{
|
||||
|
||||
if (!wlcms_field_setting('hide_nag_messages')) {
|
||||
return;
|
||||
}
|
||||
|
||||
remove_action('admin_notices', 'update_nag', 3);
|
||||
remove_action('admin_notices', 'maintenance_nag', 10);
|
||||
remove_action('network_admin_notices', 'update_nag', 3);
|
||||
}
|
||||
|
||||
public function wp_version_check()
|
||||
{
|
||||
remove_action('init', 'wp_version_check');
|
||||
}
|
||||
public function search_initial_pages()
|
||||
{
|
||||
|
||||
$ids = [(int) $_GET['q']];
|
||||
$data = wlcms_get_pages_by_ids($ids);
|
||||
|
||||
wp_send_json([
|
||||
'initials' => reset($data)
|
||||
]);
|
||||
wp_die();
|
||||
}
|
||||
|
||||
public function search_pages()
|
||||
{
|
||||
|
||||
$q = isset($_GET['q']) ? $_GET['q'] : '';
|
||||
wp_send_json([
|
||||
'results' => wlcms_search_pages($q),
|
||||
'pagination' => ['more' => false]
|
||||
]);
|
||||
wp_die();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,231 @@
|
||||
<?php
|
||||
|
||||
class WLCMS_Branding extends WLCMS_Previewable
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
//Check and set if it is a preview
|
||||
$this->check_preview();
|
||||
|
||||
add_action('init', array($this, 'init'));
|
||||
add_filter('admin_title', array($this, 'admin_title'), 10, 2);
|
||||
add_action('admin_bar_menu', array($this, 'admin_bar_logo'));
|
||||
add_action('admin_bar_menu', array($this, 'admin_bar_howdy_text'), 10000);
|
||||
add_filter('admin_footer_text', array($this, 'admin_footer'), 2000);
|
||||
add_action('admin_menu', array($this, 'admin_menu'), 0);
|
||||
add_filter('admin_body_class', array($this, 'admin_body_class'), 12);
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
if ($this->get_settings('hide_wp_version')) {
|
||||
add_filter('update_footer', '__return_false', 11);
|
||||
}
|
||||
|
||||
if ($this->get_settings('hide_wordpress_logo_and_links')) {
|
||||
wlcms_set_hidden_css('#wp-admin-bar-wp-logo');
|
||||
wlcms_set_hidden_css('#wpadminbar .quicklinks li .blavatar');
|
||||
}
|
||||
|
||||
// Setup css for the admin bar logo
|
||||
if ($this->get_settings('admin_bar_logo')) {
|
||||
/**
|
||||
* Create css for admin bar custom logo
|
||||
*/
|
||||
$css_args = array();
|
||||
|
||||
$css_args['vertical-align'] = 'middle!important';
|
||||
|
||||
|
||||
//limit admin logo height
|
||||
$css_args['max-height'] = '20px!important';
|
||||
$css_args['margin'] = '0 auto';
|
||||
$css_args['vertical-align'] = 'middle';
|
||||
|
||||
wlcms_set_css('.wlcms-admin-logo img', $css_args);
|
||||
|
||||
wlcms_set_css(
|
||||
'.wlcms-admin-logo .ab-item, .wlcms-admin-logo a',
|
||||
array(
|
||||
'line-height' => '28px!important',
|
||||
'display' => 'flex',
|
||||
'align-items' => 'center'
|
||||
)
|
||||
);
|
||||
|
||||
wlcms_set_css('#footer-left img', array('vertical-align' => 'middle', 'max-height' => '50px', 'margin-right' => '5px'));
|
||||
wlcms_set_css('#footer-left a', array('text-decoration' => 'none'));
|
||||
}
|
||||
}
|
||||
|
||||
public function admin_title($admin_title)
|
||||
{
|
||||
if ($custom_admin_title = esc_attr($this->get_settings('custom_page_title'))) {
|
||||
$admin_title = str_replace(
|
||||
"— WordPress",
|
||||
"— " . $custom_admin_title,
|
||||
$admin_title
|
||||
);
|
||||
}
|
||||
|
||||
return $admin_title;
|
||||
}
|
||||
|
||||
public function admin_body_class($classes)
|
||||
{
|
||||
$classes = trim($classes) . ' ' . (!is_wlcms_admin() ? 'not-' : '') . 'wlcms-admin ';
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
public function admin_bar_logo($wp_admin_bar)
|
||||
{
|
||||
|
||||
$admin_menu_bar_url = esc_url($this->get_settings('admin_bar_url'));
|
||||
$admin_menu_bar_alt_text = esc_attr($this->get_settings('admin_bar_alt_text'));
|
||||
$admin_menu_bar_image = esc_url($this->get_settings('admin_bar_logo'));
|
||||
|
||||
if (!$admin_menu_bar_image) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add custom logo to the admin bar menu
|
||||
*/
|
||||
$args = array(
|
||||
'id' => 'wlcms-admin-logo',
|
||||
'href' => $admin_menu_bar_url,
|
||||
'title' => sprintf('<img src="%s" alt="%s" />', $admin_menu_bar_image, $admin_menu_bar_alt_text),
|
||||
'meta' => array('class' => 'wlcms-admin-logo', 'title' => $admin_menu_bar_alt_text, 'target' => '_blank')
|
||||
);
|
||||
$wp_admin_bar->add_node($args);
|
||||
}
|
||||
|
||||
public function sidebar_menu_url()
|
||||
{
|
||||
if ($this->get_settings('use_developer_side_menu_image')) {
|
||||
return esc_url($this->get_settings('developer_url'));
|
||||
}
|
||||
|
||||
return esc_url($this->get_settings('side_menu_link_url'));
|
||||
}
|
||||
|
||||
public function admin_menu()
|
||||
{
|
||||
global $menu;
|
||||
|
||||
$sidebar_url = esc_url($this->get_settings('side_menu_link_url'));
|
||||
$sidebar_text = esc_attr($this->get_settings('side_menu_alt_text'));
|
||||
$sidebar_image = esc_url($this->get_settings('side_menu_image'));
|
||||
$collapsed_sidebar_image = esc_url($this->get_settings('collapsed_side_menu_image'));
|
||||
|
||||
|
||||
if (!$sidebar_image) {
|
||||
return;
|
||||
}
|
||||
|
||||
$logo = sprintf('<img src=\"%s\" alt=\"%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);
|
||||
|
||||
$target = '_self';
|
||||
if ($sidebar_url) {
|
||||
$domain = wp_parse_url($sidebar_url);
|
||||
if (isset($domain['host'])) {
|
||||
if (strpos($_SERVER['HTTP_HOST'], $domain['host']) === false) {
|
||||
$target = '_blank';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($sidebar_url) {
|
||||
$logo = sprintf('<a href=\"%s\" title=\"%s\" target=\"%s\">%s</a>', $sidebar_url, $sidebar_text, $target, $logo);
|
||||
}
|
||||
wlcms_set_css('.collapsed-side-bar-logo', array('display' => 'none', 'padding' => '5px', 'max-width' => '36px'));
|
||||
wlcms_set_css('.folded .collapsed-side-bar-logo', array('display' => 'block', 'margin' => '0 auto', 'max-width' => '25px'));
|
||||
|
||||
wlcms_set_css('.large-side-bar-logo', array('display' => 'block', 'max-width' => '150px', 'margin' => '0 auto', 'padding' => '5px'));
|
||||
wlcms_set_css('.folded .large-side-bar-logo', array('display' => 'none'));
|
||||
|
||||
wlcms_add_js(sprintf('jQuery("#adminmenuwrap").prepend("<span class=\"wlcms-logo\">%s</span>");', $logo));
|
||||
|
||||
wlcms()->Admin_Script()->additional_css('
|
||||
@media only screen and (max-width: 960px) {
|
||||
.wlcms-logo .large-side-bar-logo{
|
||||
display:none;
|
||||
}
|
||||
.wlcms-logo .collapsed-side-bar-logo{
|
||||
display:block;
|
||||
}
|
||||
}');
|
||||
}
|
||||
|
||||
public function admin_bar_howdy_text($wp_admin_bar)
|
||||
{
|
||||
|
||||
$admin_bar_howdy_text = esc_attr($this->get_settings('admin_bar_howdy_text'));
|
||||
|
||||
if (!$admin_bar_howdy_text) {
|
||||
return;
|
||||
}
|
||||
|
||||
$account_node = $wp_admin_bar->get_node('my-account');
|
||||
if (!isset($account_node->title)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wp_admin_bar->add_node(array(
|
||||
'id' => 'my-account',
|
||||
'title' =>
|
||||
str_replace(
|
||||
str_replace(', %s', ',', __( 'Howdy, %s' )),
|
||||
$admin_bar_howdy_text, $account_node->title
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Use custom footer
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function admin_footer($original_text)
|
||||
{
|
||||
|
||||
$footer_html = wp_kses_post($this->get_settings('footer_html'));
|
||||
$footer_url = esc_url($this->get_settings('footer_url'));
|
||||
$footer_text = esc_attr($this->get_settings('footer_text'));
|
||||
$footer_image = esc_url($this->get_settings('footer_image'));
|
||||
$developer_name = esc_attr($this->get_settings('developer_name'));
|
||||
|
||||
if ($footer_html) {
|
||||
return $footer_html;
|
||||
}
|
||||
|
||||
$footer_main_text = "";
|
||||
|
||||
if ($footer_image) {
|
||||
$footer_main_text .= '<img src="' . $footer_image . '" alt="" /> ';
|
||||
}
|
||||
|
||||
if ($footer_text) {
|
||||
$footer_main_text .= $footer_text;
|
||||
}
|
||||
|
||||
if (empty($footer_main_text)) {
|
||||
|
||||
if (wlcms_field_setting('hide_wordpress_logo_and_links')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $original_text;
|
||||
}
|
||||
|
||||
if (!$footer_url) {
|
||||
return $footer_main_text;
|
||||
}
|
||||
|
||||
$footer_html = '<a href="' . $footer_url . '" title="' . $developer_name . '" target="_blank">' . $footer_main_text . '</a>';
|
||||
|
||||
return $footer_html;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Define the internationalization functionality
|
||||
*
|
||||
* Loads and defines the internationalization files for this plugin
|
||||
* so that it is ready for translation.
|
||||
*/
|
||||
|
||||
class WLCMS_I18n
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
add_action('init', array($this, 'load_textdomain'));
|
||||
}
|
||||
|
||||
public function load_textdomain()
|
||||
{
|
||||
|
||||
$domain = 'white-label-cms';
|
||||
$plugin_rel_path = $domain . '/languages/';
|
||||
load_plugin_textdomain(
|
||||
$domain,
|
||||
false,
|
||||
$plugin_rel_path
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
new WLCMS_I18n();
|
||||
@@ -0,0 +1,177 @@
|
||||
<?php
|
||||
|
||||
class WLCMS_Loader
|
||||
{
|
||||
const CLASS_DIR = 'includes/classes/';
|
||||
const VIEW_DIR = 'view/';
|
||||
|
||||
private $admin_core_class;
|
||||
private $wizard_class;
|
||||
private $admin_menus_class;
|
||||
private $settings_class;
|
||||
private $login_class;
|
||||
private $branding_class;
|
||||
private $admin_script_class;
|
||||
private $admin_dashboard_class;
|
||||
private $admin_settings_class;
|
||||
private $upgrade_class;
|
||||
|
||||
private $admin_url;
|
||||
|
||||
|
||||
private static $_instance; //The single instance
|
||||
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->loadClasses();
|
||||
}
|
||||
|
||||
public static function getInstance()
|
||||
{
|
||||
if (!self::$_instance) { // If no instance then make one
|
||||
self::$_instance = new self();
|
||||
}
|
||||
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
private function loadClasses()
|
||||
{
|
||||
$this->require_class('Messages');
|
||||
$this->require_class('Previewable');
|
||||
|
||||
$this->require_class('Admin_Core');
|
||||
$this->admin_core_class = new WLCMS_Admin_Core();
|
||||
|
||||
$this->require_class('Wizard');
|
||||
$this->wizard_class = new WLCMS_Wizard();
|
||||
|
||||
$this->require_class('Admin_Script');
|
||||
$this->admin_script_class = new WLCMS_Admin_Script();
|
||||
|
||||
$this->require_class('Settings');
|
||||
$this->settings_class = new WLCMS_Settings();
|
||||
|
||||
$this->require_class('Upgrade');
|
||||
$this->upgrade_class = new WLCMS_Upgrades();
|
||||
|
||||
$this->require_class('Admin_Menus');
|
||||
$this->admin_menus_class = new WLCMS_Admin_Menus();
|
||||
|
||||
$this->require_class('Login');
|
||||
$this->login_class = new WLCMS_Login();
|
||||
|
||||
$this->require_class('Branding');
|
||||
$this->branding_class = new WLCMS_Branding();
|
||||
|
||||
$this->require_class('Admin_Dashboard');
|
||||
$this->admin_dashboard_class = new WLCMS_Admin_Dashboard();
|
||||
|
||||
$this->require_class('Admin_Settings');
|
||||
$this->admin_settings_class = new WLCMS_Admin_Settings();
|
||||
|
||||
}
|
||||
|
||||
public function Admin_Core()
|
||||
{
|
||||
return $this->admin_core_class;
|
||||
}
|
||||
|
||||
public function Wizard()
|
||||
{
|
||||
return $this->wizard_class;
|
||||
}
|
||||
|
||||
public function Settings()
|
||||
{
|
||||
return $this->settings_class;
|
||||
}
|
||||
|
||||
public function Upgrade()
|
||||
{
|
||||
return $this->upgrade_class;
|
||||
}
|
||||
|
||||
public function Admin_Dashboard()
|
||||
{
|
||||
return $this->admin_dashboard_class;
|
||||
}
|
||||
|
||||
public function Admin_Menus()
|
||||
{
|
||||
return $this->admin_menus_class;
|
||||
}
|
||||
|
||||
public function Login()
|
||||
{
|
||||
return $this->login_class;
|
||||
}
|
||||
|
||||
public function Branding()
|
||||
{
|
||||
return $this->branding_class;
|
||||
}
|
||||
|
||||
public function Admin_Script()
|
||||
{
|
||||
return $this->admin_script_class;
|
||||
}
|
||||
|
||||
public function Admin_Settings()
|
||||
{
|
||||
return $this->admin_settings_class;
|
||||
}
|
||||
|
||||
public function require_class($file = "")
|
||||
{
|
||||
return $this->required(self::CLASS_DIR . $file);
|
||||
}
|
||||
|
||||
public function admin_url($view = 'settings')
|
||||
{
|
||||
return admin_url('options-general.php?page=wlcms-plugin.php&view=' . $view);
|
||||
}
|
||||
|
||||
public function required($file = "")
|
||||
{
|
||||
$dir = WLCMS_DIR;
|
||||
|
||||
if (empty($dir) || !is_dir($dir)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$file = path_join($dir, $file . '.php');
|
||||
|
||||
if (!file_exists($file)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
require_once $file;
|
||||
}
|
||||
|
||||
public function get_view($file = "")
|
||||
{
|
||||
$this->required(self::VIEW_DIR . $file);
|
||||
}
|
||||
|
||||
public function admin_view($file = "")
|
||||
{
|
||||
$this->get_view('admin/' . $file);
|
||||
}
|
||||
|
||||
public function get_active_view()
|
||||
{
|
||||
$default = 'settings';
|
||||
|
||||
if (!isset($_GET['view'])) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
$available = array('wizard', 'settings');
|
||||
$view = wp_filter_kses($_GET['view']);
|
||||
|
||||
return (in_array($view, $available)) ? $view : $default;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,359 @@
|
||||
<?php
|
||||
|
||||
class WLCMS_Login extends WLCMS_Previewable
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
//Check and set if it is a preview
|
||||
$this->check_preview();
|
||||
|
||||
add_action('login_footer', array($this, 'scripts'), 1000);
|
||||
add_action('init', array($this, 'preview_init'));
|
||||
|
||||
add_action('wlcms_before_save_preview', array($this, 'save_preview_login'), 10, 2);
|
||||
add_action('wlcms_save_addtional_settings', array($this, 'save_preview_login'), 10, 2);
|
||||
|
||||
// Save the preview settings
|
||||
add_action('wp_ajax_wlcms_save_login_preview_settings', array($this, 'store_preview'));
|
||||
|
||||
add_filter('wlcms_setting_fields', array($this, 'setting_fields'), 11, 1);
|
||||
}
|
||||
|
||||
|
||||
public function preview_init()
|
||||
{
|
||||
|
||||
if (!isset($_GET['wlcms-action'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($_GET['wlcms-action'] != 'preview') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (current_user_can('manage_options')) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_die(__('Sorry, you are not allowed to do this action.'));
|
||||
}
|
||||
|
||||
public function save_preview_login($setting, $placeholder)
|
||||
{
|
||||
// ignore if it has width or height request
|
||||
if (isset($_REQUEST['logo_width']) || isset($_REQUEST['logo_height']))
|
||||
return;
|
||||
|
||||
$logo = esc_url($setting->get($placeholder . 'login_logo'));
|
||||
|
||||
if ($logo) {
|
||||
$imagesize = @getimagesize($logo);
|
||||
if ($imagesize) {
|
||||
list($width, $height) = $imagesize;
|
||||
$setting->set($placeholder . 'logo_width', $width);
|
||||
$setting->set($placeholder . 'logo_height', $height);
|
||||
}
|
||||
}
|
||||
|
||||
return $setting;
|
||||
}
|
||||
|
||||
public function scripts()
|
||||
{
|
||||
|
||||
wp_print_scripts(array('jquery'));
|
||||
|
||||
echo '<script>';
|
||||
echo 'jQuery(document).ready(function(){';
|
||||
echo $this->set_custom_login_js();
|
||||
echo $this->get_js();
|
||||
echo '});';
|
||||
echo '</script>';
|
||||
echo '<style type="text/css">';
|
||||
echo $this->compiled_login_css();
|
||||
echo '</style>';
|
||||
}
|
||||
|
||||
private function compiled_login_css()
|
||||
{
|
||||
|
||||
$content = $this->set_custom_css();
|
||||
$content .= $this->set_background_css();
|
||||
$content .= $this->set_logo_css();
|
||||
$content .= $this->set_form_css();
|
||||
$content .= $this->set_links_css();
|
||||
|
||||
$content = wp_kses($content, array('\'', '\"'));
|
||||
$content = str_replace('>', '>', $content);
|
||||
return $content;
|
||||
}
|
||||
|
||||
private function get_js()
|
||||
{
|
||||
$js = 'jQuery("#login").wrap("<div id=\'wlcms-login-wrapper\'></div>");';
|
||||
if ($this->get_db_setting('login_logo')) {
|
||||
$js .= ';jQuery(\'#login h1 a\').attr(\'title\',\'' . get_bloginfo('name') . '\');jQuery(\'#login h1 a\').attr(\'href\',\'' . get_bloginfo('url') . '\');';
|
||||
}
|
||||
return $js;
|
||||
}
|
||||
|
||||
private function set_logo_css()
|
||||
{
|
||||
$logo_css = '#login h1 a, .login h1 a { ';
|
||||
if ($login_logo = $this->get_db_setting('login_logo')) {
|
||||
$logo_css .= 'background-image: url(' . esc_url($login_logo) . ')!important;';
|
||||
}
|
||||
|
||||
$has_width = false;
|
||||
if ($logo_width = $this->get_db_setting('logo_width')) {
|
||||
$logo_css .= 'width:' . wlcms_css_metrics(esc_attr($logo_width)) . '!important;';
|
||||
$has_width = true;
|
||||
} else {
|
||||
$logo_css .= 'width:auto!important;';
|
||||
}
|
||||
|
||||
// Add logo max-width same width with the form
|
||||
$logo_css .= 'max-width:100%;';
|
||||
|
||||
$has_height = false;
|
||||
if ($logo_height = $this->get_db_setting('logo_height')) {
|
||||
$has_height = true;
|
||||
$logo_css .= 'height:' . wlcms_css_metrics(esc_attr($logo_height)) . ';';
|
||||
}
|
||||
|
||||
//Add logo background size
|
||||
$logo_css_background_size = 'background-size:contain;background-position-y: center;';
|
||||
if ($has_height && $has_width) {
|
||||
$logo_css_background_size = sprintf('background-size:%s %s;', wlcms_css_metrics($logo_width), wlcms_css_metrics(esc_attr($logo_height)));
|
||||
}
|
||||
$logo_css .= $logo_css_background_size;
|
||||
|
||||
if ($logo_bottom_margin = $this->get_db_setting('logo_bottom_margin')) {
|
||||
$logo_css .= 'margin-bottom: ' . esc_attr($logo_bottom_margin) . 'px!important;';
|
||||
}
|
||||
|
||||
$logo_css .= '}'; // close #login h1 a, .login h1 a
|
||||
|
||||
if ($retina_login_logo = $this->get_db_setting('retina_login_logo')) {
|
||||
$logo_css .= '@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
||||
#login h1 a, .login h1 a { background-image: url(' . esc_url($retina_login_logo) . ')!important;}
|
||||
}';
|
||||
}
|
||||
|
||||
return $logo_css;
|
||||
}
|
||||
|
||||
private function set_background_css()
|
||||
{
|
||||
$body_login = 'body.login{';
|
||||
|
||||
if ($this->get_db_setting('full_screen_background_image')) {
|
||||
$body_login .= '-webkit-background-size: cover !important;';
|
||||
$body_login .= '-moz-background-size: cover !important;';
|
||||
$body_login .= '-o-background-size: cover !important;';
|
||||
$body_login .= 'background-size: cover !important;';
|
||||
}
|
||||
|
||||
if ($background_color = $this->get_db_setting('background_color')) {
|
||||
$body_login .= 'background-color:' . esc_attr($background_color) . '!important;';
|
||||
}
|
||||
|
||||
if ($background_image = $this->get_db_setting('background_image')) {
|
||||
$body_login .= 'background-image: url(' . esc_url($background_image) . ')!important;';
|
||||
}
|
||||
|
||||
if ($background_positions = $this->get_db_setting('background_positions')) {
|
||||
$body_login .= 'background-position:' . esc_attr($background_positions) . '!important;';
|
||||
}
|
||||
|
||||
if ($background_repeat = $this->get_db_setting('background_repeat')) {
|
||||
$body_login .= 'background-repeat:' . esc_attr($background_repeat) . '!important;';
|
||||
}
|
||||
|
||||
$body_login .= '}';
|
||||
|
||||
return $body_login;
|
||||
}
|
||||
|
||||
private function set_form_css()
|
||||
{
|
||||
$form_css = '';
|
||||
|
||||
if ($form_label_color = $this->get_db_setting('form_label_color')) {
|
||||
$form_css .= '#loginform label{ color:' . esc_attr($form_label_color) . '}';
|
||||
}
|
||||
|
||||
if ($form_background_color = $this->get_db_setting('form_background_color')) {
|
||||
$form_css .= '#loginform{ background-color:' . esc_attr($form_background_color) . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit Button css
|
||||
*/
|
||||
$form_button_text_color = esc_attr($this->get_db_setting('form_button_text_color'));
|
||||
$form_button_color = esc_attr($this->get_db_setting('form_button_color'));
|
||||
|
||||
if ($form_button_text_color || $form_button_color) {
|
||||
$form_css .= '#loginform input[type=submit],#loginform .submit input[type=button]{ ';
|
||||
if ($form_button_text_color) {
|
||||
$form_css .= 'color:' . $form_button_text_color . '!important;';
|
||||
$form_css .= 'text-shadow: none;';
|
||||
$form_css .= 'border-color: none;';
|
||||
$form_css .= 'box-shadow: none;';
|
||||
}
|
||||
|
||||
if ($form_button_color) {
|
||||
$form_css .= 'background-color:' . $form_button_color . '!important; border: 0;box-shadow:none';
|
||||
}
|
||||
|
||||
$form_css .= '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit Button Hover
|
||||
*/
|
||||
$form_button_text_hover_color = esc_attr($this->get_db_setting('form_button_text_hover_color'));
|
||||
$form_button_hover_color = esc_attr($this->get_db_setting('form_button_hover_color'));
|
||||
|
||||
if ($form_button_hover_color || $form_button_text_hover_color) {
|
||||
$form_css .= '#loginform input[type=submit]:hover,#loginform .submit input[type=button]:hover{ ';
|
||||
if ($form_button_text_hover_color) {
|
||||
$form_css .= 'color:' . $form_button_text_hover_color . '!important;';
|
||||
}
|
||||
|
||||
if ($form_button_hover_color) {
|
||||
$form_css .= 'background-color:' . $form_button_hover_color . '!important;';
|
||||
}
|
||||
|
||||
$form_css .= '}';
|
||||
}
|
||||
|
||||
return $form_css;
|
||||
}
|
||||
|
||||
private function set_links_css()
|
||||
{
|
||||
$form_css = '';
|
||||
if ($this->get_db_setting('hide_register_lost_password')) {
|
||||
$form_css .= 'p#nav{display:none;}';
|
||||
}
|
||||
|
||||
if ($this->get_db_setting('hide_back_to_link')) {
|
||||
$form_css .= 'p#backtoblog{display:none;}';
|
||||
}
|
||||
|
||||
if ($back_to_register_link_color = esc_attr($this->get_db_setting('back_to_register_link_color'))) {
|
||||
$form_css .= 'p#backtoblog a, p#nav a{color:' . $back_to_register_link_color . '!important;}';
|
||||
}
|
||||
|
||||
if ($back_to_register_link_hover_color = esc_attr($this->get_db_setting('back_to_register_link_hover_color'))) {
|
||||
$form_css .= 'p#backtoblog a:hover, p#nav a:hover{color:' . $back_to_register_link_hover_color . '!important;}';
|
||||
}
|
||||
|
||||
if ($privacy_policy_link_color = esc_attr($this->get_db_setting('privacy_policy_link_color'))) {
|
||||
$form_css .= 'a.privacy-policy-link{color:' . $privacy_policy_link_color . '!important;text-decoration:none}';
|
||||
}
|
||||
|
||||
if ($privacy_policy_link_hover_color = esc_attr($this->get_db_setting('privacy_policy_link_hover_color'))) {
|
||||
$form_css .= 'a.privacy-policy-link:hover{color:' . $privacy_policy_link_hover_color . '!important;}';
|
||||
}
|
||||
|
||||
return $form_css;
|
||||
}
|
||||
|
||||
private function set_custom_css()
|
||||
{
|
||||
$content = $this->get_db_setting('login_custom_css');
|
||||
|
||||
$content = wp_kses($content, array('\'', '\"'));
|
||||
$content = str_replace('>', '>', $content);
|
||||
return $content;
|
||||
}
|
||||
|
||||
private function set_custom_login_js()
|
||||
{
|
||||
return wlcms_esc_html_e($this->get_db_setting('login_custom_js'));
|
||||
}
|
||||
|
||||
public function settings()
|
||||
{
|
||||
if ($this->saving_preview_section() == 'wizard') {
|
||||
return $this->wizard_settings();
|
||||
}
|
||||
|
||||
return $this->complete_settings();
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings to be stored in preview mode
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function wizard_settings()
|
||||
{
|
||||
$settings = array(
|
||||
'login_logo' => '',
|
||||
'add_retina_logo' => false,
|
||||
'retina_login_logo' => '',
|
||||
);
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings to be included to the overall setting
|
||||
* it includes fields from preview mode
|
||||
* @return void
|
||||
*/
|
||||
public function complete_settings()
|
||||
{
|
||||
|
||||
$settings = array(
|
||||
'logo_bottom_margin' => 0,
|
||||
'logo_width' => false,
|
||||
'logo_height' => false,
|
||||
'background_color' => '#ffffff',
|
||||
'background_image' => '',
|
||||
'full_screen_background_image' => false,
|
||||
'background_positions' => 'center center',
|
||||
'background_repeat' => 'no-repeat',
|
||||
'hide_register_lost_password' => false,
|
||||
'hide_back_to_link' => false,
|
||||
'form_background_color' => '',
|
||||
'form_label_color' => '',
|
||||
'form_button_color' => '',
|
||||
'form_button_text_color' => '',
|
||||
'form_button_hover_color' => '',
|
||||
'form_button_text_hover_color' => '',
|
||||
'back_to_register_link_color' => '',
|
||||
'back_to_register_link_hover_color' => '',
|
||||
'privacy_policy_link_color' => '',
|
||||
'privacy_policy_link_hover_color' => '',
|
||||
'login_custom_css' => '',
|
||||
'login_custom_js' => ''
|
||||
);
|
||||
|
||||
return array_merge($settings, $this->wizard_settings());
|
||||
}
|
||||
|
||||
public function saving_preview_section()
|
||||
{
|
||||
$sections = array('wizard', 'settings');
|
||||
|
||||
if (!isset($_REQUEST['form_section'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!in_array($_REQUEST['form_section'], $sections)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return wp_filter_kses($_REQUEST['form_section']);
|
||||
}
|
||||
|
||||
public function setting_fields($settings)
|
||||
{
|
||||
return array_merge($settings, $this->complete_settings());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
class WLCMS_Messages
|
||||
{
|
||||
public static function queue($message, $class = '')
|
||||
{
|
||||
$default_allowed_classes = array('error', 'warning', 'success', 'info');
|
||||
$allowed_classes = apply_filters('wlcms_messages_allowed_classes', $default_allowed_classes);
|
||||
$default_class = apply_filters('wlcms_messages_default_class', 'success');
|
||||
|
||||
if (!in_array($class, $allowed_classes)) {
|
||||
$class = $default_class;
|
||||
}
|
||||
|
||||
$messages = maybe_unserialize(get_option('_wlcms_messages', array()));
|
||||
$messages[$class][] = $message;
|
||||
|
||||
update_option('_wlcms_messages', $messages);
|
||||
}
|
||||
|
||||
public static function show()
|
||||
{
|
||||
$group_messages = maybe_unserialize(get_option('_wlcms_messages'));
|
||||
|
||||
if (!$group_messages) {
|
||||
return;
|
||||
}
|
||||
|
||||
$errors = "";
|
||||
if (is_array($group_messages)) {
|
||||
foreach ($group_messages as $class => $messages) {
|
||||
$errors .= '<div class="notice notice-' . $class . ' is-dismissible"">';
|
||||
$prev_message = '';
|
||||
foreach ($messages as $message) {
|
||||
if ($prev_message != $message)
|
||||
$errors .= '<p>' . $message . '</p>';
|
||||
$prev_message = $message;
|
||||
}
|
||||
$errors .= '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
delete_option('_wlcms_messages');
|
||||
|
||||
echo $errors;
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('WLCMS_Messages') && !function_exists('WLCMS_Queue')) {
|
||||
function WLCMS_Queue($message, $class = null)
|
||||
{
|
||||
WLCMS_Messages::queue($message, $class);
|
||||
}
|
||||
}
|
||||
add_action('admin_notices', array('WLCMS_Messages', 'show'));
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
class WLCMS_Previewable
|
||||
{
|
||||
|
||||
public $is_preview = false;
|
||||
public $preview_setting_key_placeholder = '_';
|
||||
public $preview_section;
|
||||
|
||||
public function check_preview()
|
||||
{
|
||||
if (!isset($_GET['wlcms-action'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($_GET['wlcms-action'] != 'preview') {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->is_preview = true;
|
||||
$this->preview_section = isset($_GET['preview_section']) ? wp_filter_kses($_GET['preview_section']) : '';
|
||||
}
|
||||
|
||||
public function place_holder()
|
||||
{
|
||||
return ($this->is_preview) ? $this->preview_setting_key_placeholder : '';
|
||||
}
|
||||
|
||||
public function get_placeholder_key()
|
||||
{
|
||||
return $this->preview_setting_key_placeholder;
|
||||
}
|
||||
|
||||
public function store_preview()
|
||||
{
|
||||
|
||||
check_ajax_referer('wlcms_ajax_nonce');
|
||||
|
||||
$settings = wlcms()->Settings();
|
||||
|
||||
foreach ($this->settings() as $key => $default) {
|
||||
$setting_value = (isset($_POST[$key])) ? wlcms_kses($_POST[$key]) : $default;
|
||||
$settings->set($this->preview_setting_key_placeholder . $key, $setting_value);
|
||||
}
|
||||
|
||||
do_action('wlcms_before_save_preview', $settings, $this->preview_setting_key_placeholder);
|
||||
|
||||
$settings->save();
|
||||
exit;
|
||||
}
|
||||
|
||||
public function preview_section()
|
||||
{
|
||||
return $this->preview_section;
|
||||
}
|
||||
|
||||
public function settings()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function get_settings($key)
|
||||
{
|
||||
return $this->get_db_setting($key);
|
||||
}
|
||||
|
||||
public function setting_key($key)
|
||||
{
|
||||
if ($this->is_preview) {
|
||||
$key = $this->preview_setting_key_placeholder . $key;
|
||||
}
|
||||
|
||||
return $key;
|
||||
}
|
||||
|
||||
public function get_db_setting($key)
|
||||
{
|
||||
return wlcms_db_field_setting($this->setting_key($key));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,388 @@
|
||||
<?php
|
||||
|
||||
class WLCMS_Settings
|
||||
{
|
||||
private $settings;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->init_settings();
|
||||
add_filter('wp_kses_allowed_html', array($this, 'kses_allowed_html'), 10, 2);
|
||||
add_action('admin_init', array($this, 'init'));
|
||||
add_filter('plugin_action_links', array($this, 'plugin_settings'), 10, 2);
|
||||
add_action('wlcms_after_body', array($this, 'add_import_html'));
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
// check or initiate import
|
||||
$this->import();
|
||||
|
||||
if (!isset($_GET['wlcms-action'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
// check or initiate reset
|
||||
$this->reset_plugin();
|
||||
|
||||
// check or initiate export
|
||||
$this->export();
|
||||
}
|
||||
public function plugin_settings($links, $file)
|
||||
{
|
||||
if (WLCMS_BASENAME == $file) {
|
||||
// Add your custom link
|
||||
$custom_link = '<a href="' . admin_url('options-general.php?page=wlcms-plugin.php&wlcms-action=reset&_wlcms_anonce=' . wp_create_nonce('wlcms-action-nonce')) . '"onclick="return confirm(\'Are you sure you want to reset?\')">Reset</a>';
|
||||
// Insert the custom link at the beginning of the array
|
||||
array_unshift($links, $custom_link);
|
||||
}
|
||||
return $links;
|
||||
}
|
||||
|
||||
public function kses_allowed_html($tags, $context)
|
||||
{
|
||||
|
||||
if ('post' === $context) {
|
||||
|
||||
$tags['iframe'] = array(
|
||||
'align' => true,
|
||||
'width' => true,
|
||||
'height' => true,
|
||||
'frameborder' => true,
|
||||
'name' => true,
|
||||
'src' => true,
|
||||
'id' => true,
|
||||
'class' => true,
|
||||
'style' => true,
|
||||
'scrolling' => true,
|
||||
'marginwidth' => true,
|
||||
'marginheight' => true,
|
||||
'allowfullscreen' => true,
|
||||
'mozallowfullscreen' => true,
|
||||
'webkitallowfullscreen' => true,
|
||||
);
|
||||
|
||||
$tags['embed'] = array(
|
||||
'src' => true,
|
||||
'height' => true,
|
||||
'width' => true,
|
||||
'style' => true,
|
||||
'type' => true,
|
||||
);
|
||||
}
|
||||
|
||||
return $tags;
|
||||
}
|
||||
|
||||
public function get($key = "", $default = false)
|
||||
{
|
||||
if (!isset($this->settings[$key])) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
$value = wlcms_removeslashes($this->settings[$key]);
|
||||
if (empty($value) || is_null($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_array($value) && count($value) == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function reset()
|
||||
{
|
||||
$this->settings = array();
|
||||
}
|
||||
|
||||
public function setAll($value)
|
||||
{
|
||||
$this->settings = $value;
|
||||
}
|
||||
|
||||
public function getAll()
|
||||
{
|
||||
return $this->settings;
|
||||
}
|
||||
|
||||
public function set($key, $value)
|
||||
{
|
||||
$this->settings[$key] = $value;
|
||||
}
|
||||
|
||||
public function remove($key)
|
||||
{
|
||||
if (isset($this->settings[$key])) {
|
||||
unset($this->settings[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
public function save()
|
||||
{
|
||||
update_option("wlcms_options", $this->settings);
|
||||
}
|
||||
|
||||
public function store()
|
||||
{
|
||||
do_action('wlcms_before_saving', $this);
|
||||
$this->reset();
|
||||
$this->set('version', WLCMS_VERSION);
|
||||
|
||||
foreach ($this->keys() as $key) {
|
||||
$setting_value = '';
|
||||
if (isset($_POST[$key])) {
|
||||
$setting_value = wlcms_kses($_POST[$key]);
|
||||
}
|
||||
$this->set($key, $setting_value);
|
||||
}
|
||||
|
||||
$placeholder = ''; // use the same method used by preview wizard
|
||||
do_action('wlcms_save_addtional_settings', $this, $placeholder);
|
||||
|
||||
$this->save();
|
||||
|
||||
do_action('wlcms_after_saving', $this);
|
||||
|
||||
WLCMS_Queue('Settings saved.');
|
||||
wp_redirect(wlcms()->admin_url());
|
||||
exit;
|
||||
}
|
||||
|
||||
public function init_settings()
|
||||
{
|
||||
$settings = get_option("wlcms_options", false);
|
||||
|
||||
if (!$settings) {
|
||||
$settings = $this->default_options();
|
||||
}
|
||||
|
||||
$this->settings = $settings;
|
||||
}
|
||||
|
||||
public function add_import_html()
|
||||
{
|
||||
wlcms()->admin_view('parts/import-settings');
|
||||
}
|
||||
|
||||
public function import()
|
||||
{
|
||||
if (!is_wlcms_super_admin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isset($_POST['wlcms-settings_nonce'])) return;
|
||||
|
||||
if (!is_admin() && !current_user_can('manage_options')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isset($_POST['wlcms-settings']) && !isset($_FILES['import_file'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isset($_FILES['import_file'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($_FILES['import_file']['size'] == 0 && $_FILES['import_file']['name'] == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
// check nonce
|
||||
if (!wp_verify_nonce($_POST['wlcms-settings_nonce'], 'wlcms-settings-action')) {
|
||||
|
||||
WLCMS_Queue('Sorry, your nonce did not verify.', 'error');
|
||||
wp_redirect(wlcms()->admin_url());
|
||||
exit;
|
||||
}
|
||||
|
||||
$import_field = 'import_file';
|
||||
$temp_file_raw = $_FILES[$import_field]['tmp_name'];
|
||||
$temp_file = esc_attr($temp_file_raw);
|
||||
$arr_file_type = $_FILES[$import_field];
|
||||
$uploaded_file_type = $arr_file_type['type'];
|
||||
$allowed_file_types = array('application/json');
|
||||
|
||||
if (!in_array($uploaded_file_type, $allowed_file_types)) {
|
||||
WLCMS_Queue('Upload a valid .json file.', 'error');
|
||||
wp_redirect(wlcms()->admin_url());
|
||||
exit;
|
||||
}
|
||||
|
||||
$settings = (array)json_decode(
|
||||
file_get_contents($temp_file),
|
||||
true
|
||||
);
|
||||
|
||||
unlink($temp_file);
|
||||
|
||||
if (!$settings) {
|
||||
|
||||
WLCMS_Queue('Nothing to import, please check your json file format.', 'error');
|
||||
wp_redirect(wlcms()->admin_url());
|
||||
exit;
|
||||
}
|
||||
|
||||
// Validate the JSON schema: only accept keys the plugin actually
|
||||
// recognises so arbitrary options cannot be injected via import.
|
||||
$allowed_keys = array_merge($this->keys(), array('version'));
|
||||
$settings = array_intersect_key($settings, array_flip($allowed_keys));
|
||||
|
||||
// Sanitize imported values the same way the regular save path does
|
||||
// (see store()), so untrusted JSON cannot smuggle in unescaped markup.
|
||||
$settings = wlcms_kses($settings);
|
||||
|
||||
$this->setAll($settings);
|
||||
$this->save();
|
||||
|
||||
WLCMS_Queue('Your Import has been completed.');
|
||||
|
||||
wp_redirect(wlcms()->admin_url());
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
public function export()
|
||||
{
|
||||
if (!is_wlcms_super_admin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!isset($_GET['wlcms-action']) || (isset($_GET['wlcms-action']) && $_GET['wlcms-action'] != 'export')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!wp_verify_nonce($_REQUEST['_wlcms_anonce'], 'wlcms-action-nonce')) {
|
||||
|
||||
WLCMS_Queue('Sorry, your nonce did not verify.', 'error');
|
||||
wp_redirect(wlcms()->admin_url());
|
||||
exit;
|
||||
}
|
||||
|
||||
$settings = $this->getAll();
|
||||
|
||||
if (!is_array($settings)) {
|
||||
$settings = array();
|
||||
}
|
||||
|
||||
$settings = json_encode($settings);
|
||||
|
||||
header('Content-disposition: attachment; filename=wlcms-settings.json');
|
||||
header('Content-type: application/json');
|
||||
echo $settings;
|
||||
exit;
|
||||
}
|
||||
|
||||
public function reset_plugin()
|
||||
{
|
||||
global $wpdb;
|
||||
if (!current_user_can('install_plugins')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($_GET['wlcms-action'] != 'reset') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!wp_verify_nonce($_REQUEST['_wlcms_anonce'], 'wlcms-action-nonce')) {
|
||||
|
||||
WLCMS_Queue('Sorry, your nonce did not verify.', 'error');
|
||||
wp_redirect(admin_url());
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
delete_option("wlcms_options");
|
||||
$wpdb->get_results($wpdb->prepare("DELETE FROM $wpdb->options WHERE option_name LIKE %s", 'wlcms_o_%'));
|
||||
|
||||
WLCMS_Queue('Settings reset.');
|
||||
wp_redirect(wlcms()->admin_url());
|
||||
exit;
|
||||
}
|
||||
|
||||
public function keys()
|
||||
{
|
||||
return array_keys($this->default_options());
|
||||
}
|
||||
|
||||
public function get_default_option($key)
|
||||
{
|
||||
$settings = $this->default_options();
|
||||
return isset($settings[$key]) ? $settings[$key] : null;
|
||||
}
|
||||
|
||||
public function default_options()
|
||||
{
|
||||
|
||||
$settings = array(
|
||||
'developer_icon' => '',
|
||||
'use_developer_icon_footer' => 1,
|
||||
'developer_icon_footer_url' => '',
|
||||
'developer_side_menu_image' => '',
|
||||
'developer_icon_admin_bar' => false,
|
||||
'developer_branding_footer' => false,
|
||||
'use_developer_side_menu_image' => false,
|
||||
'hide_wordpress_logo_and_links' => false,
|
||||
'hide_wp_version' => false,
|
||||
'admin_bar_logo' => '',
|
||||
'admin_bar_logo_width' => 15,
|
||||
'admin_bar_alt_text' => '',
|
||||
'admin_bar_howdy_text' => '',
|
||||
'admin_bar_url' => '',
|
||||
'side_menu_image' => '',
|
||||
'collapsed_side_menu_image' => '',
|
||||
'side_menu_link_url' => '',
|
||||
'side_menu_alt_text' => '',
|
||||
'gutenberg_exit_icon' => '',
|
||||
'gutenberg_exit_custom_icon' => '',
|
||||
'footer_image' => '',
|
||||
'footer_url' => '',
|
||||
'footer_html' => '',
|
||||
'dashboard_icon' => '',
|
||||
'dashboard_title' => 'Dashboard',
|
||||
'dashboard_role_stat' => false,
|
||||
'dashboard_widgets_visibility_roles' => array('administrator', 'editor', 'author', 'contributor', 'subscriber'),
|
||||
'dashboard_widgets' => array(),
|
||||
'hide_all_dashboard_panels' => false,
|
||||
'hide_at_a_glance' => false,
|
||||
'hide_activities' => false,
|
||||
'hide_recent_comments' => false,
|
||||
'hide_quick_press' => false,
|
||||
'hide_news_and_events' => false,
|
||||
'remove_empty_dash_panel' => false,
|
||||
'welcome_panel' => array(
|
||||
array(
|
||||
'is_active' => false,
|
||||
'show_title' => false,
|
||||
'template_type' => 'html',
|
||||
'visible_to' => array('administrator', 'editor', 'author', 'contributor', 'subscriber'),
|
||||
), array(
|
||||
'is_active' => false,
|
||||
'show_title' => false,
|
||||
'template_type' => 'html',
|
||||
'visible_to' => array('administrator', 'editor', 'author', 'contributor', 'subscriber'),
|
||||
)
|
||||
),
|
||||
'add_own_rss_panel' => false,
|
||||
'rss_feed_number_of_item' => 3,
|
||||
'show_post_content' => false,
|
||||
'rss_introduction' => '',
|
||||
'rss_logo' => '',
|
||||
'rss_title' => '',
|
||||
'wlcms_admin' => false,
|
||||
'admin_menus' => false,
|
||||
'enable_wlcms_admin' => false,
|
||||
'admin_bar_menus' => false,
|
||||
'hide_admin_bar_all' => false,
|
||||
'hide_help_box' => false,
|
||||
'hide_screen_options' => false,
|
||||
'hide_nag_messages' => false,
|
||||
'settings_custom_css_admin' => '',
|
||||
'settings_custom_css_url' => ''
|
||||
);
|
||||
return apply_filters('wlcms_setting_fields', $settings);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,412 @@
|
||||
<?php
|
||||
|
||||
class WLCMS_Upgrades
|
||||
{
|
||||
|
||||
private $menu_class;
|
||||
private $legacy_menus = array();
|
||||
private $legacy_submenus = array();
|
||||
private $legacy_db_setting = array();
|
||||
private $settings;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
add_action('admin_init', array($this, 'upgrader_process_complete'), 999999);
|
||||
}
|
||||
|
||||
public function upgrader_process_complete()
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
$this->settings = wlcms()->Settings();
|
||||
|
||||
if (version_compare($this->settings->get('version'), '2.3', '<')) {
|
||||
$this->process_upgrade_settings_dashboard();
|
||||
}
|
||||
|
||||
|
||||
$this->process_legacy();
|
||||
}
|
||||
public function process_upgrade_settings_dashboard()
|
||||
{
|
||||
$widgets = [];
|
||||
|
||||
if ($this->settings->get('hide_at_a_glance') || $this->settings->get('hide_all_dashboard_panels')) {
|
||||
$widgets[] = 'dashboard_right_now';
|
||||
$this->settings->remove('hide_at_a_glance');
|
||||
}
|
||||
|
||||
if ($this->settings->get('hide_activities') || $this->settings->get('hide_all_dashboard_panels')) {
|
||||
$widgets[] = 'dashboard_activity';
|
||||
$this->settings->remove('hide_activities');
|
||||
}
|
||||
|
||||
if ($this->settings->get('hide_recent_comments') || $this->settings->get('hide_all_dashboard_panels')) {
|
||||
$widgets[] = 'dashboard_recent_comments';
|
||||
$this->settings->remove('hide_recent_comments');
|
||||
}
|
||||
|
||||
if ($this->settings->get('hide_news_and_events') || $this->settings->get('hide_all_dashboard_panels')) {
|
||||
$widgets[] = 'dashboard_primary';
|
||||
$this->settings->remove('hide_news_and_events');
|
||||
}
|
||||
|
||||
if ($this->settings->get('hide_quick_press')) {
|
||||
$widgets[] = 'dashboard_quick_press';
|
||||
$this->settings->remove('hide_quick_press');
|
||||
}
|
||||
$this->settings->set('dashboard_widgets', $widgets);
|
||||
$this->settings->set('version', WLCMS_VERSION);
|
||||
$this->settings->save();
|
||||
|
||||
}
|
||||
|
||||
public function process_legacy()
|
||||
{
|
||||
global $wpdb;
|
||||
$legacy_version = get_option('wlcms_o_ver', false);
|
||||
|
||||
if (!$legacy_version) {
|
||||
return;
|
||||
}
|
||||
|
||||
$new_wlcms_options = get_option('wlcms_options', false);
|
||||
|
||||
|
||||
if ($legacy_version && $new_wlcms_options) {
|
||||
return;
|
||||
}
|
||||
|
||||
$newdbsetting = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $wpdb->options WHERE option_name = %s", 'wlcms_options'));
|
||||
|
||||
if ($legacy_version && $newdbsetting) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->do_import();
|
||||
}
|
||||
|
||||
public function do_import()
|
||||
{
|
||||
$this->get_settings();
|
||||
$this->perform();
|
||||
}
|
||||
|
||||
private function get_settings()
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
// Get all WLCMS vals from options table
|
||||
$results = $wpdb->get_results($wpdb->prepare("SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE %s", 'wlcms_o_%'));
|
||||
|
||||
// Are there any options to grab?
|
||||
if (!$results) return;
|
||||
|
||||
// Loop through results and prep array.
|
||||
foreach ($results as $result) :
|
||||
if ($result->option_value == '') continue;
|
||||
|
||||
$this->legacy_db_setting[$result->option_name] = $result->option_value;
|
||||
endforeach;
|
||||
}
|
||||
|
||||
public function upgrade_reset()
|
||||
{
|
||||
$this->settings = wlcms()->Settings();
|
||||
}
|
||||
|
||||
private function perform()
|
||||
{
|
||||
$admin_bar_menu = array();
|
||||
|
||||
$this->upgrade_reset();
|
||||
|
||||
$this->settings->reset();
|
||||
$this->settings->set('version', WLCMS_VERSION);
|
||||
|
||||
foreach ($this->legacy_mapping() as $key => $setting_key) {
|
||||
|
||||
if ($new_setting = $this->get_legacy_setting($setting_key)) {
|
||||
if ($new_setting == 'true')
|
||||
$new_setting = 1;
|
||||
|
||||
$this->settings->set($key, $new_setting);
|
||||
}
|
||||
|
||||
}
|
||||
$this->settings->set('legacy_menu', '1');
|
||||
|
||||
$this->menu_class = wlcms()->Admin_Menus();
|
||||
|
||||
//Post
|
||||
$this->get_legacy_menu_settings('wlcms_o_hide_posts', 'edit.php');
|
||||
if (!$this->get_legacy_setting('wlcms_o_hide_posts')) {
|
||||
$admin_bar_menu[] = 'new-post';
|
||||
}
|
||||
|
||||
//Media
|
||||
$this->get_legacy_menu_settings('wlcms_o_hide_media', 'upload.php');
|
||||
if (!$this->get_legacy_setting('wlcms_o_hide_media')) {
|
||||
$admin_bar_menu[] = 'new-media';
|
||||
}
|
||||
|
||||
//Pages
|
||||
$this->get_legacy_menu_settings('wlcms_o_hide_pages', 'edit.php?post_type=page');
|
||||
if (!$this->get_legacy_setting('wlcms_o_hide_pages')) {
|
||||
$admin_bar_menu[] = 'new-page';
|
||||
}
|
||||
|
||||
//Comments
|
||||
$this->get_legacy_menu_settings('wlcms_o_hide_comments', 'edit-comments.php');
|
||||
if (!$this->get_legacy_setting('wlcms_o_hide_comments')) {
|
||||
$admin_bar_menu[] = 'comments';
|
||||
}
|
||||
|
||||
//User
|
||||
$this->get_legacy_menu_settings('wlcms_o_hide_profile', 'users.php');
|
||||
if (!$this->get_legacy_setting('wlcms_o_hide_profile')) {
|
||||
$admin_bar_menu[] = 'new-user';
|
||||
}
|
||||
|
||||
//Tools
|
||||
$this->get_legacy_menu_settings('wlcms_o_hide_tools', 'tools.php');
|
||||
|
||||
if (count($admin_bar_menu)) {
|
||||
$this->settings->set('admin_bar_menus', $admin_bar_menu);
|
||||
}
|
||||
|
||||
$this->hide_sidebar_menu('plugins.php');
|
||||
$this->hide_sidebar_menu('options-general.php');
|
||||
|
||||
//Appearance
|
||||
$this->get_legacy_appearance_menu_settings();
|
||||
$this->settings->set('admin_menus', array('main' => $this->legacy_menus, 'sub' => $this->legacy_submenus));
|
||||
|
||||
//Set Admin users to be wlcms admin
|
||||
$adminusers = get_users('role=administrator');
|
||||
|
||||
if (count($adminusers)) :
|
||||
|
||||
$wlcms_admin = array();
|
||||
foreach ($adminusers as $user) :
|
||||
$wlcms_admin[] = $user->user_email;
|
||||
endforeach;
|
||||
|
||||
$this->settings->set('wlcms_admin', $wlcms_admin);
|
||||
|
||||
endif;
|
||||
|
||||
//Welcome Dashboard
|
||||
$welcome = array();
|
||||
if ($this->get_legacy_setting('wlcms_o_show_welcome')) {
|
||||
$welcome[] = array(
|
||||
'is_active' => true,
|
||||
'template_type' => 'html',
|
||||
'show_title' => true,
|
||||
'is_fullwidth' => false,
|
||||
'visible_to' => $this->get_legacy_roles($this->get_legacy_setting('wlcms_o_welcome_visible_to')),
|
||||
'title' => $this->get_legacy_setting('wlcms_o_welcome_title'),
|
||||
'description' => $this->get_legacy_setting('wlcms_o_welcome_text'),
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
//Second Panel
|
||||
if ($this->get_legacy_setting('wlcms_o_welcome_text1')) {
|
||||
$welcome[] = array(
|
||||
'is_active' => true,
|
||||
'template_type' => 'html',
|
||||
'show_title' => true,
|
||||
'is_fullwidth' => false,
|
||||
'visible_to' => $this->get_legacy_roles($this->get_legacy_setting('wlcms_o_welcome_visible_to1')),
|
||||
'title' => $this->get_legacy_setting('wlcms_o_welcome_title1'),
|
||||
'description' => $this->get_legacy_setting('wlcms_o_welcome_text1'),
|
||||
);
|
||||
}
|
||||
|
||||
$this->settings->set('welcome_panel', $welcome);
|
||||
|
||||
if ($this->get_legacy_setting('wlcms_o_login_custom_logo')) {
|
||||
$this->settings->set('logo_width', false);
|
||||
$this->settings->set('logo_height', false);
|
||||
}
|
||||
|
||||
if ($this->get_legacy_setting('wlcms_o_loginbg_white')) {
|
||||
$this->settings->set('background_color', '#FFF');
|
||||
}
|
||||
|
||||
//Delete all legacy options
|
||||
$this->delete_legacy_settings();
|
||||
|
||||
//Save new settings
|
||||
$this->settings->save();
|
||||
|
||||
$redirect_url = admin_url();
|
||||
if (current_user_can('manage_options')) {
|
||||
$redirect_url = wlcms()->admin_url();
|
||||
}
|
||||
|
||||
wp_redirect($redirect_url);
|
||||
exit;
|
||||
}
|
||||
|
||||
private function get_legacy_setting($key)
|
||||
{
|
||||
return isset($this->legacy_db_setting[$key]) ? $this->legacy_db_setting[$key] : false;
|
||||
}
|
||||
|
||||
private function get_legacy_appearance_menu_settings()
|
||||
{
|
||||
$menus = array();
|
||||
$new_sub_menus = array();
|
||||
$get_submenu_placeholder = $this->menu_class->get_submenu_placeholder();
|
||||
$url = 'themes.php';
|
||||
$count_sub_menus = 0;
|
||||
|
||||
$theme_subs = array(
|
||||
'wlcms_o_subtemplate_hide_16' => 'custom-header',
|
||||
'wlcms_o_subtemplate_hide_15' => 'customize-php038autofocus%5bcontrol%5dheader_image',
|
||||
'wlcms_o_subtemplate_hide_10' => 'nav-menus-php',
|
||||
'wlcms_o_subtemplate_hide_7' => 'widgets-php',
|
||||
'wlcms_o_subtemplate_hide_6' => 'customize-php',
|
||||
'wlcms_o_subtemplate_hide_5' => 'themes-php'
|
||||
);
|
||||
|
||||
if ($this->get_legacy_setting('wlcms_o_editor_template_access') == 0) {
|
||||
$theme_subs['wlcms_o_subtemplate_hide_theme-php'] = 'themes-php';
|
||||
|
||||
foreach ($theme_subs as $theme_sub_key => $theme_sub) {
|
||||
$this->legacy_submenus[] = $url . $get_submenu_placeholder . $theme_sub;
|
||||
$count_sub_menus++;
|
||||
}
|
||||
|
||||
$this->legacy_menus[] = $url;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->get_legacy_setting('wlcms_o_editor_template_access') == 1) {
|
||||
|
||||
$submenus = $this->menu_class->get_new_submenus($url);
|
||||
|
||||
if ($submenus) {
|
||||
|
||||
$count_sub_menus = 0;
|
||||
|
||||
foreach ($theme_subs as $theme_sub_key => $theme_sub) {
|
||||
if ($this->get_legacy_setting($theme_sub_key)) {
|
||||
$this->legacy_submenus[] = $url . $get_submenu_placeholder . $theme_sub;
|
||||
$count_sub_menus++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($count_sub_menus == count($submenus['submenus'])) {
|
||||
$this->legacy_menus[] = $url;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function get_legacy_menu_settings($option = "", $url = "")
|
||||
{
|
||||
if (!$this->get_legacy_setting($option)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->hide_sidebar_menu($url);
|
||||
}
|
||||
|
||||
private function hide_sidebar_menu($url)
|
||||
{
|
||||
|
||||
$this->legacy_menus[] = $url;
|
||||
|
||||
$submenus = $this->menu_class->get_new_submenus($url);
|
||||
|
||||
if (!$submenus) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($submenus['submenus'] as $submenu) {
|
||||
$this->legacy_submenus[] = $submenu['slug'];
|
||||
}
|
||||
}
|
||||
|
||||
private function get_legacy_roles($key)
|
||||
{
|
||||
$roles = array('administrator', 'editor', 'author', 'contributor', 'subscriber');
|
||||
$allowed_roles = array();
|
||||
foreach ($roles as $role) {
|
||||
|
||||
$allowed_roles[] = $role;
|
||||
|
||||
if ($key == $role) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $allowed_roles;
|
||||
}
|
||||
|
||||
private function delete_legacy_settings()
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
delete_option('wlcms_o_ver');
|
||||
$wpdb->get_results($wpdb->prepare("DELETE FROM $wpdb->options WHERE option_name = %s", 'wlcms_o_ver'));
|
||||
}
|
||||
|
||||
private function legacy_settings()
|
||||
{
|
||||
return array_flip($this->legacy_mapping());
|
||||
}
|
||||
|
||||
public function legacy_mapping()
|
||||
{
|
||||
return array(
|
||||
'developer_name' => 'wlcms_o_developer_name',
|
||||
'developer_url' => 'wlcms_o_developer_url',
|
||||
'developer_icon' => 'wlcms_o_adminbar_custom_logo',
|
||||
'admin_bar_alt_text' => 'wlcms_o_developer_name',
|
||||
'admin_bar_url' => 'wlcms_o_developer_url',
|
||||
'hide_wordpress_logo_and_links' => 'wlcms_o_hide_wp_adminbar',
|
||||
'hide_wp_version' => 'wlcms_o_hide_wpversion',
|
||||
'custom_page_title' => 'wlcms_o_admin_page_title',
|
||||
'admin_bar_logo' => 'wlcms_o_adminbar_custom_logo',
|
||||
'footer_image' => 'wlcms_o_footer_custom_logo',
|
||||
'footer_text' => 'wlcms_o_developer_name',
|
||||
'footer_url' => 'wlcms_o_developer_url',
|
||||
'login_logo' => 'wlcms_o_login_custom_logo',
|
||||
'retina_login_logo' => 'wlcms_o_login_custom_logo',
|
||||
'background_color' => 'wlcms_o_loginbg_white',
|
||||
'login_custom_css' => 'wlcms_o_login_bg_css',
|
||||
'login_custom_js' => 'wlcms_o_login_bg_js',
|
||||
'dashboard_icon' => 'wlcms_o_header_custom_logo',
|
||||
'dashboard_title' => 'wlcms_o_dashboard_override',
|
||||
'hide_all_dashboard_panels' => 'wlcms_o_dashboard_others',
|
||||
'hide_at_a_glance' => 'wlcms_o_dashboard_remove_right_now',
|
||||
'hide_activities' => 'wlcms_o_dashboard_remove_activity_panel',
|
||||
'hide_recent_comments' => 'wlcms_o_dashboard_remove_recent_comments',
|
||||
'remove_empty_dash_panel' => 'wlcms_o_dashboard_border',
|
||||
'own_welcome_panel' => 'wlcms_o_show_welcome',
|
||||
'own_welcome_panel_visible_to' => 'wlcms_o_welcome_visible_to',
|
||||
'own_welcome_panel_title' => 'wlcms_o_welcome_title',
|
||||
'welcome_panel_description' => 'wlcms_o_welcome_text',
|
||||
'second_panel_title' => 'wlcms_o_welcome_title1',
|
||||
'second_panel_visible_to' => 'wlcms_o_welcome_visible_to1',
|
||||
'second_panel_description' => 'wlcms_o_welcome_text1',
|
||||
'add_own_rss_panel' => 'wlcms_o_show_rss_widget',
|
||||
'rss_feed_number_of_item' => 'wlcms_o_rss_num_items',
|
||||
'show_post_content' => 'wlcms_o_rss_show_intro',
|
||||
'rss_introduction' => 'wlcms_o_rss_intro_html',
|
||||
'rss_feed_address' => 'wlcms_o_rss_value',
|
||||
'rss_logo' => 'wlcms_o_rss_logo',
|
||||
'rss_title' => 'wlcms_o_rss_title',
|
||||
'hide_help_box' => 'wlcms_o_dashboard_remove_help_box',
|
||||
'hide_screen_options' => 'wlcms_o_dashboard_remove_screen_options',
|
||||
'hide_nag_messages' => 'wlcms_o_dashboard_remove_nag_update',
|
||||
'settings_custom_css_admin' => 'wlcms_o_custom_css',
|
||||
'settings_custom_css_url' => 'wlcms_o_welcome_stylesheet'
|
||||
);
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
class Welcome_Messages_Beaver_Builder
|
||||
{
|
||||
private $key;
|
||||
private $settings;
|
||||
private $template;
|
||||
public function process($settings, $key)
|
||||
{
|
||||
if (!isset($settings['page_id_beaver'])) return;
|
||||
|
||||
$this->key = $key;
|
||||
$this->settings = $settings;
|
||||
$this->template = $settings['page_id_beaver'];
|
||||
add_action('in_admin_header', array($this, 'welcome_panel'));
|
||||
add_action('admin_enqueue_scripts', 'FLBuilder::register_layout_styles_scripts');
|
||||
}
|
||||
|
||||
public function template()
|
||||
{
|
||||
echo do_shortcode('[fl_builder_insert_layout id="' . esc_attr($this->template) . '"]');
|
||||
}
|
||||
|
||||
public function welcome_panel()
|
||||
{
|
||||
?>
|
||||
<div id="welcome-panel<?php echo $this->key ?>" data-welcome_key="<?php echo $this->key ?>" class="wlcms-welcome-panel" style="display:none">
|
||||
<?php
|
||||
if (isset($this->settings['dismissible'])) :
|
||||
?><a class="welcome-panel-close" href="#" aria-label="Dismiss the welcome panel">Dismiss</a>
|
||||
<?php endif ?>
|
||||
<div class="welcome-panel-content welcome-panel-content<?php echo $this->key ?>">
|
||||
<?php if (isset($this->settings['page_id_beaver']) && isset($this->settings['show_title'])) : ?>
|
||||
<h2>
|
||||
<?php echo get_the_title($this->settings['page_id_beaver']) ?>
|
||||
</h2>
|
||||
<?php endif; ?>
|
||||
<?php $this->template(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$welcome = sprintf(";jQuery('#welcome-panel%1\$d').insertBefore('#dashboard-widgets-wrap');jQuery('#welcome-panel%1\$d').show();", $this->key);
|
||||
wlcms_add_js($welcome);
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
class Welcome_Messages_Elementor
|
||||
{
|
||||
private $key;
|
||||
private $settings;
|
||||
public function process($settings, $key)
|
||||
{
|
||||
if (!isset($settings['page_id_elementor'])) return;
|
||||
if ($settings['page_id_elementor'] == "") return;
|
||||
|
||||
$this->key = $key;
|
||||
$this->settings = $settings;
|
||||
add_action('in_admin_header', array($this, 'welcome_panel'));
|
||||
}
|
||||
|
||||
public function welcome_panel()
|
||||
{
|
||||
$has_dismissable = isset($this->settings['dismissible']);
|
||||
$is_show_title = isset($this->settings['page_id_elementor']) && isset($this->settings['show_title']);
|
||||
?>
|
||||
<div id="welcome-panel<?php echo $this->key ?>" data-welcome_key="<?php echo $this->key ?>" class="wlcms-welcome-panel" style="display:none">
|
||||
<?php
|
||||
if ($has_dismissable) :
|
||||
?><a class="welcome-panel-close" href="#" aria-label="Dismiss the welcome panel">Dismiss</a>
|
||||
<?php endif ?>
|
||||
<div class="welcome-panel-content welcome-panel-content<?php echo $this->key ?>">
|
||||
<?php if ($has_dismissable || $is_show_title) : ?>
|
||||
<?php if ($is_show_title) : ?>
|
||||
<h2>
|
||||
<?php echo get_the_title($this->settings['page_id_elementor']) ?>
|
||||
</h2>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php $this->template(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$welcome = sprintf(";jQuery('#welcome-panel%1\$d').insertBefore('#dashboard-widgets-wrap');jQuery('#welcome-panel%1\$d').show();", $this->key);
|
||||
wlcms_add_js($welcome);
|
||||
}
|
||||
|
||||
public function template()
|
||||
{
|
||||
if (!$this->settings['page_id_elementor']) {
|
||||
return;
|
||||
}
|
||||
|
||||
$elementor = @Elementor\Plugin::instance();
|
||||
|
||||
$elementor->frontend->register_styles();
|
||||
$elementor->frontend->enqueue_styles();
|
||||
|
||||
$elementor->frontend->register_scripts();
|
||||
$elementor->frontend->enqueue_scripts();
|
||||
|
||||
echo $elementor->frontend->get_builder_content((int) $this->settings['page_id_elementor'], true);
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
class Welcome_Messages_Html
|
||||
{
|
||||
private $key;
|
||||
private $settings;
|
||||
public function process($settings, $key)
|
||||
{
|
||||
$this->key = $key;
|
||||
$this->settings = $settings;
|
||||
|
||||
if (isset($this->settings['is_fullwidth']) && $this->settings['is_fullwidth'] == 1) {
|
||||
add_action('in_admin_header', array($this, 'welcome_panel'));
|
||||
return;
|
||||
}
|
||||
|
||||
wp_add_dashboard_widget(
|
||||
'custom_vum_widget' . $key,
|
||||
isset($this->settings['title']) ? $this->settings['title'] : ' ',
|
||||
array($this, 'welcome_description'),
|
||||
null,
|
||||
array('desc' => $this->template())
|
||||
);
|
||||
}
|
||||
|
||||
public function welcome_description($post, $callback_args)
|
||||
{
|
||||
echo $callback_args['args']['desc'];
|
||||
}
|
||||
|
||||
public function welcome_panel()
|
||||
{ ?>
|
||||
<div id="welcome-panel<?php echo $this->key ?>" data-welcome_key="<?php echo $this->key ?>" class="wlcms-welcome-panel">
|
||||
<?php
|
||||
if (isset($this->settings['dismissible'])) :
|
||||
?><a class="welcome-panel-close" href="#" aria-label="Dismiss the welcome panel">Dismiss</a>
|
||||
<?php endif ?>
|
||||
<div class="welcome-panel-content welcome-panel-content<?php echo $this->key ?>" style="padding-bottom:20px">
|
||||
<?php if (isset($this->settings['title'])) : ?>
|
||||
<h2><?php echo esc_html($this->settings['title']) ?></h2>
|
||||
<?php endif; ?>
|
||||
<div class="wlcms-welcome-content">
|
||||
<?php echo $this->template(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$welcome = sprintf(";jQuery('#welcome-panel%1\$d').insertBefore('#dashboard-widgets-wrap');jQuery('#welcome-panel%1\$d').show();", $this->key);
|
||||
wlcms_add_js($welcome);
|
||||
}
|
||||
|
||||
public function template()
|
||||
{
|
||||
return isset($this->settings['description']) ? wpautop(wp_kses_post($this->settings['description'])) : '';
|
||||
}
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
class Welcome_Messages_Page
|
||||
{
|
||||
private $key;
|
||||
private $settings;
|
||||
private $template;
|
||||
private $pages = [];
|
||||
public function init($pages = [])
|
||||
{
|
||||
if (!count($pages)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->pages = $pages;
|
||||
|
||||
add_action('wp', array($this, 'wp'));
|
||||
}
|
||||
public function wp()
|
||||
{
|
||||
$this->hide_admin_menu_bar();
|
||||
}
|
||||
|
||||
private function hide_admin_menu_bar()
|
||||
{
|
||||
if (!isset($_GET['wlcms-welcome-dashboard'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
add_filter('show_admin_bar', '__return_false');
|
||||
}
|
||||
|
||||
public function process($settings, $key)
|
||||
{
|
||||
if (!isset($settings['page_id_page'])) return;
|
||||
|
||||
$this->key = $key;
|
||||
$this->settings = $settings;
|
||||
$this->template = $settings['page_id_page'];
|
||||
|
||||
add_action('in_admin_header', array($this, 'welcome_panel'));
|
||||
}
|
||||
|
||||
|
||||
public function template()
|
||||
{
|
||||
if (!$this->template || ($this->template && $this->template == '')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$url = get_permalink($this->template);
|
||||
$url = add_query_arg('wlcms-welcome-dashboard', 'true', $url);
|
||||
$url = esc_url($url);
|
||||
|
||||
echo "<iframe class=\"responsive-iframe\" onLoad=\"wlcms_iframe_height(this)\" frameborder=\"0\" scrolling=\"no\" width=\"100%\" src=\"{$url}\"></iframe>";
|
||||
}
|
||||
|
||||
public function welcome_panel()
|
||||
{
|
||||
?>
|
||||
<div id="welcome-panel<?php echo $this->key ?>" data-welcome_key="<?php echo $this->key ?>" class="wlcms-welcome-panel" style="display:none">
|
||||
<?php
|
||||
if (isset($this->settings['dismissible'])) :
|
||||
?><a class="welcome-panel-close" href="#" aria-label="Dismiss the welcome panel">Dismiss</a>
|
||||
<?php endif ?>
|
||||
<div class="welcome-panel-content welcome-panel-content<?php echo $this->key ?>">
|
||||
<?php if (isset($this->settings['page_id_page']) && isset($this->settings['show_title'])) : ?>
|
||||
<h2>
|
||||
<?php echo get_the_title($this->settings['page_id_page']) ?>
|
||||
</h2>
|
||||
<?php endif; ?>
|
||||
<?php $this->template(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
$welcome = sprintf(";jQuery('#welcome-panel%1\$d').insertBefore('#dashboard-widgets-wrap');jQuery('#welcome-panel%1\$d').show();", $this->key);
|
||||
wlcms_add_js($welcome);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
class WLCMS_Wizard extends WLCMS_Previewable
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
//Check and set if it is a preview
|
||||
$this->check_preview();
|
||||
|
||||
add_filter('wlcms_setting_fields', array($this, 'setting_fields'), 10, 1);
|
||||
|
||||
// add_action('wlcms_before_saving', array($this, 'store'));
|
||||
add_action('wp_ajax_wlcms_save_dashboard_preview_settings', array($this, 'store_preview'));
|
||||
add_action('wlcms_save_addtional_settings', array($this, 'before_save'), 10, 2);
|
||||
add_action('wlcms_before_save_preview', array($this, 'before_save'), 10, 2);
|
||||
|
||||
}
|
||||
|
||||
public function before_save($settings, $placeholder)
|
||||
{
|
||||
if (!isset($_POST['wlcms_wizzard'])) {
|
||||
return $settings;
|
||||
}
|
||||
if (isset($_POST['wizard_developer_name'])) {
|
||||
$developer_name = wlcms_kses($_POST['wizard_developer_name']);
|
||||
$settings->set($placeholder . 'developer_name', $developer_name);
|
||||
$settings->set($placeholder . 'admin_bar_alt_text', $developer_name);
|
||||
$settings->set($placeholder . 'side_menu_alt_text', $developer_name);
|
||||
$settings->set($placeholder . 'rss_title', $developer_name);
|
||||
}
|
||||
|
||||
if (isset($_POST['wizard_developer_url'])) {
|
||||
$developer_url = wlcms_kses($_POST['wizard_developer_url']);
|
||||
$settings->set($placeholder . 'admin_bar_url', $developer_url);
|
||||
$settings->set($placeholder . 'side_menu_link_url', $developer_url);
|
||||
$settings->set($placeholder . 'footer_url', $developer_url);
|
||||
}
|
||||
|
||||
if (isset($_POST['client_business_name'])) {
|
||||
$custom_page_title = wlcms_kses($_POST['client_business_name']);
|
||||
$settings->set($placeholder . 'custom_page_title', $custom_page_title);
|
||||
$settings->set($placeholder . 'dashboard_title', $custom_page_title);
|
||||
}
|
||||
|
||||
if (isset($_POST['rss_feed_address']) && !empty($_POST['rss_feed_address'])) {
|
||||
$settings->set($placeholder . 'add_own_rss_panel', true);
|
||||
}
|
||||
|
||||
$settings->set($placeholder . 'welcome_panel', array(
|
||||
array(
|
||||
'is_active' => false,
|
||||
'show_title' => false,
|
||||
'template_type' => 'html',
|
||||
'visible_to' => array('administrator', 'editor', 'author', 'contributor', 'subscriber'),
|
||||
), array(
|
||||
'is_active' => false,
|
||||
'show_title' => false,
|
||||
'template_type' => 'html',
|
||||
'visible_to' => array('administrator', 'editor', 'author', 'contributor', 'subscriber'),
|
||||
)
|
||||
));
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
||||
public function settings()
|
||||
{
|
||||
$settings = $this->wizard_settings();
|
||||
$wizard_settings = array(
|
||||
'version' => WLCMS_VERSION,
|
||||
'use_developer_side_menu_image' => false,
|
||||
'developer_icon_admin_bar' => false,
|
||||
'developer_branding_footer' => false,
|
||||
'hide_wordpress_logo_and_links' => true,
|
||||
'hide_at_a_glance' => true,
|
||||
'hide_activities' => true,
|
||||
'hide_recent_comments' => true,
|
||||
'hide_quick_press' => true,
|
||||
'hide_news_and_events' => true,
|
||||
'remove_empty_dash_panel' => true,
|
||||
'hide_wp_version' => true,
|
||||
'rss_title' => ' '
|
||||
);
|
||||
|
||||
return array_merge($wizard_settings, $settings);
|
||||
}
|
||||
|
||||
public function wizard_settings()
|
||||
{
|
||||
return array(
|
||||
'developer_name' => '',
|
||||
'footer_text' => '',
|
||||
'rss_feed_address' => '',
|
||||
'custom_page_title' => '',
|
||||
);
|
||||
}
|
||||
|
||||
public function setting_fields($settings)
|
||||
{
|
||||
return array_merge($settings, $this->wizard_settings());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die('Access denied.');
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die('Access denied.');
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die('Access denied.');
|
||||
}
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,933 @@
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
||||
"Project-Id-Version: White Label CMS\n"
|
||||
"POT-Creation-Date: 2019-02-20 15:35+0800\n"
|
||||
"PO-Revision-Date: 2019-02-14 11:13+0800\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.8.12\n"
|
||||
"X-Poedit-Basepath: ..\n"
|
||||
"X-Poedit-WPHeader: wlcms-plugin.php\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
||||
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
||||
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
||||
|
||||
#. Plugin Name of the plugin/theme
|
||||
#: includes/classes/Admin_Core.php:19 includes/classes/Admin_Core.php:20
|
||||
#: view/admin/settings.php:18 view/admin/wizard.php:6
|
||||
msgid "White Label CMS"
|
||||
msgstr ""
|
||||
|
||||
#: includes/classes/Branding.php:165
|
||||
#, php-format
|
||||
msgid "%1s %2$s"
|
||||
msgstr ""
|
||||
|
||||
#: includes/classes/Settings.php:259
|
||||
msgid ""
|
||||
"<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."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-admin-bar.php:3
|
||||
msgid "Admin Bar Logo"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-admin-bar.php:3
|
||||
msgid "Replace the WordPress logo in the admin bar. Max height 20px"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-admin-bar.php:7
|
||||
msgid "Admin Bar Alt Text"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-admin-bar.php:12
|
||||
msgid "Replace the \"WordPress\" Alt text."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-admin-bar.php:17
|
||||
msgid "Replace Howdy Text"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-admin-bar.php:22
|
||||
msgid ""
|
||||
"Add a space to completely remove it from the admin bar. Or replace it with "
|
||||
"something like: \"Hi,\""
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-admin-bar.php:27
|
||||
msgid "Admin Bar URL"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-admin-bar.php:32
|
||||
msgid "Replace the link to WordPress.org."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-developer.php:3
|
||||
#: view/admin/parts/wizard-step-1.php:19
|
||||
msgid "Developer Name"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-developer.php:8
|
||||
#: view/admin/parts/wizard-step-1.php:24
|
||||
msgid "For use in footer and ALT text's."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-developer.php:13
|
||||
#: view/admin/parts/wizard-step-1.php:29
|
||||
msgid "Developer URL"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-developer.php:18
|
||||
#: view/admin/parts/wizard-step-1.php:34
|
||||
msgid "For use in footer and admin bar."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-developer.php:23
|
||||
msgid "Developer Icon"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-developer.php:23
|
||||
msgid "We recommend at 16 x 16 image"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-developer.php:29
|
||||
msgid "Use Developer Icon in Footer"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-developer.php:32
|
||||
msgid "If you wish to use a different image for the footer, you can."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-developer.php:37
|
||||
msgid "Developer Footer Icon"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-developer.php:44
|
||||
msgid "Developer Side Menu Image"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-footer.php:2
|
||||
msgid "Footer Image"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-footer.php:2
|
||||
msgid ""
|
||||
"Image which will appear in the footer replacing \"Thank you for creating "
|
||||
"with WordPress. Max height 50px"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-footer.php:6 view/admin/parts/wizard-step-1.php:39
|
||||
msgid "Footer Text"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-footer.php:11
|
||||
#: view/admin/parts/wizard-step-1.php:44
|
||||
msgid "Text which will appear to the right of the Footer Image."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-footer.php:16
|
||||
msgid "Footer URL"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-footer.php:21
|
||||
#: view/admin/parts/branding-wordpress.php:28
|
||||
msgid "Replace WordPress in the page titles."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-footer.php:26
|
||||
msgid "or use HTML"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-footer.php:31
|
||||
msgid ""
|
||||
"If you would like more control over what appears in the footer, add your own "
|
||||
"HTML.<br/>\n"
|
||||
"Note: this will overwrite anything set in the Footer Image, Footer Text and "
|
||||
"Footer URL."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-side-menu.php:2
|
||||
msgid "Side Menu Image"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-side-menu.php:2
|
||||
msgid "Image will appear at the top of the side menu. Max width 160px"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-side-menu.php:6
|
||||
msgid "Collapsed Side Menu Image"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-side-menu.php:6
|
||||
msgid ""
|
||||
"Image will appear at the top of the side menu when it is collapsed. Max "
|
||||
"width 36px"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-side-menu.php:9
|
||||
msgid "Side Menu Link URL"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-side-menu.php:14
|
||||
msgid "URL the Side Menu Image will link to."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-side-menu.php:18
|
||||
msgid "Side Menu Alt Text"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-side-menu.php:23
|
||||
msgid "Alt text for the Side Menu Image link."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-wordpress.php:5
|
||||
msgid "Hide WordPress Logo and Links"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-wordpress.php:8
|
||||
msgid "Hide mentions of WordPress and hide the links to WordPress.org."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-wordpress.php:15
|
||||
msgid "Hide WP Version"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-wordpress.php:18
|
||||
msgid "Hide version number of WordPress which appears in the footer."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding-wordpress.php:23
|
||||
msgid "Custom Page Titles"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding.php:3
|
||||
msgid "WordPress Branding"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding.php:11
|
||||
msgid "Admin Bar Branding"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding.php:19
|
||||
msgid "Side Menu Branding"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/branding.php:27
|
||||
msgid "Footer Branding"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:7
|
||||
msgid ""
|
||||
"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."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:11
|
||||
msgid "Add Your Own Welcome Panel"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:14
|
||||
msgid "You can add your own welcome panel."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:18
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:122
|
||||
msgid "Select the Roles the Welcome Panel Will Be Visible To"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:24
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:129
|
||||
msgid "Select the user roles this will be visible to."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:50
|
||||
msgid "Template Type"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:53
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:142
|
||||
msgid "Basic HTML"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:56
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:144
|
||||
msgid "Elementor"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:58
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:146
|
||||
msgid "Beaver Builder Pro"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:63
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:139
|
||||
msgid "Template"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:72
|
||||
msgid "Title of Welcome Panel"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:77
|
||||
msgid "Title of the Welcome Panel"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:82
|
||||
msgid "Welcome Panel Description HTML"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:86
|
||||
msgid "You can add any HTML to the welcome panel."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:92
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:180
|
||||
msgid "Make full-width"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:99
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:190
|
||||
msgid "Show Title"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:115
|
||||
msgid "Add Second Panel"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:118
|
||||
msgid "Add a second custom panel to the Dashboard."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:151
|
||||
msgid "Page Template"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:160
|
||||
msgid "Title of Second Panel"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:165
|
||||
msgid "Title of the Second Panel"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:170
|
||||
msgid "Second Panel Description (HTML)"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-custom-welcome-dashboard-panel.php:174
|
||||
msgid "You can add any HTML to the second panel."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:10
|
||||
msgid "Dashboard Icon"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:10
|
||||
msgid "Add a logo to the Dashboard. Suggested height 40px"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:14
|
||||
msgid "Dashboard Title"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:19
|
||||
msgid "Change the heading for the Dashboard"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:23
|
||||
msgid "Select the Roles the Dashboard Panels Will Be Hidden To"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:28
|
||||
msgid "Select the user roles this will be hidden to."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:36
|
||||
msgid "Hide All Dashboard Panels"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:38
|
||||
msgid ""
|
||||
"This will hide all the WordPress default dashboard panels. Or you can "
|
||||
"specify which panels should appear."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:43
|
||||
msgid "Hide 'At a Glance'"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:47
|
||||
msgid "Hide 'Activity'"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:51
|
||||
msgid "Hide 'Recent Comments'"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:55
|
||||
msgid "Remove 'Quick Draft'"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:59
|
||||
msgid "Remove WordPress Events and News Widget"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-default-panels.php:63
|
||||
msgid "Remove Empty Dashboard Panel"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-rss-dashboard-panel.php:4
|
||||
msgid "Add Your Own RSS Panel"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-rss-dashboard-panel.php:7
|
||||
msgid ""
|
||||
"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."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-rss-dashboard-panel.php:13
|
||||
msgid "RSS Title"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-rss-dashboard-panel.php:18
|
||||
msgid "The title of the RSS Panel"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-rss-dashboard-panel.php:23
|
||||
msgid "Add Your Logo"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-rss-dashboard-panel.php:23
|
||||
msgid "Add a logo to appear on the panel before the title."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-rss-dashboard-panel.php:27
|
||||
#: view/admin/parts/wizard-step-1.php:49
|
||||
msgid "RSS Feed"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-rss-dashboard-panel.php:32
|
||||
msgid "The RSS feed address. For example feed://"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-rss-dashboard-panel.php:37
|
||||
msgid "Number of Items to appear"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-rss-dashboard-panel.php:48
|
||||
msgid "Number of RSS items to show."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-rss-dashboard-panel.php:55
|
||||
msgid "Show Post Contents"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-rss-dashboard-panel.php:62
|
||||
msgid "Introduction HTML"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard-rss-dashboard-panel.php:67
|
||||
msgid "Add introduction text to appear above the RSS items. You can use HTML."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard.php:3
|
||||
msgid "Default Panels"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard.php:11
|
||||
msgid "Custom Welcome Dashboard Panel"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/dashboard.php:19
|
||||
msgid "RSS Dashboard Panel"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/import-settings.php:4 view/admin/settings.php:57
|
||||
msgid "Import Settings"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/import-settings.php:12
|
||||
msgid "To import the settings from another website"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/live-preview.php:5
|
||||
msgid "Close Preview"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:5
|
||||
msgid "Hide \"Register / Lost your password?\" link"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:8
|
||||
msgid ""
|
||||
"Hide the \"Register / Lost your password?\" link which appears below the "
|
||||
"login form."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:14
|
||||
msgid "Hide \"Back to\" link"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:17
|
||||
msgid "Hide the \"Back to\" link which appears below the login form."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:22
|
||||
msgid "Form Background Color"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:27
|
||||
msgid "Background color of the login form"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:32
|
||||
msgid "Form Label Color"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:37
|
||||
msgid "Color of the labels on the login form"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:42
|
||||
msgid "Form Button Color"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:47
|
||||
msgid "Color of the button on the login form"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:52
|
||||
msgid "Form Button Hover Color"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:57
|
||||
msgid "Hover color of the button on the login form"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:62
|
||||
msgid "Form Button Text Color"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:67
|
||||
msgid "Color of the text on the button on the login form"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:72
|
||||
msgid "Form Button Text Hover Color"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:77
|
||||
msgid "Hover color of the text on the button on the login form"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:82
|
||||
msgid "Back to / Register Link Color"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:87
|
||||
msgid "Color of the link text of Back to / Register"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:92
|
||||
msgid "Back to / Register Link Hover Color"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:97
|
||||
msgid "Hover color of the link text of Back to / Register"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:102
|
||||
msgid "Privacy Policy Link Color"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:107
|
||||
msgid "Color of the link text of Privacy Policy"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:112
|
||||
msgid "Privacy Policy Link Hover Color"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:117
|
||||
msgid "Hover color of the link text of Privacy Policy"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-advanced.php:121
|
||||
#: view/admin/parts/login-custom-css.php:18
|
||||
#: view/admin/parts/login-logo-and-background.php:96
|
||||
msgid "Live Preview"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-custom-css.php:6
|
||||
msgid "Completely customise the login page by entering your own CSS."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-custom-css.php:7
|
||||
msgid "For example"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-custom-css.php:12
|
||||
msgid "Or if you want to get fancy"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-live-preview.php:5
|
||||
msgid "Close Login"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:2
|
||||
msgid "Login Logo"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:2
|
||||
msgid "Replace the WordPress logo on the login page. Max width 320px"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:6
|
||||
#: view/admin/parts/wizard-step-2.php:24
|
||||
msgid "Retina Login Logo"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:6
|
||||
#: view/admin/parts/wizard-step-2.php:28
|
||||
msgid ""
|
||||
"Replace the Retina WordPress logo on the login page. Please make sure you "
|
||||
"use the standard retina format of x2"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:10
|
||||
msgid "Logo Width"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:15
|
||||
msgid "Add a width to your Login Logo. Max width 320px"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:19
|
||||
msgid "Logo Height"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:24
|
||||
msgid "Add a height to your Login Logo."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:29
|
||||
msgid "Logo Bottom Margin"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:34
|
||||
msgid "Add a bottom margin to your Login Logo."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:39
|
||||
msgid "Background Color"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:44
|
||||
msgid ""
|
||||
"Background color for the login page. Changing to White will help your logo "
|
||||
"standout."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:49
|
||||
msgid "Background Image"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:49
|
||||
msgid "Adds a background image to the login page."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:55
|
||||
msgid "Full Screen Background Image"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:58
|
||||
msgid "Stretch the background image to appear full screen."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:63
|
||||
msgid "Background Position"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:78
|
||||
msgid "Specify the CSS background position."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:83
|
||||
msgid "Background Repeat"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login-logo-and-background.php:92
|
||||
msgid "Specify the CSS background-repeat."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login.php:3
|
||||
msgid "Logo and Background"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login.php:13
|
||||
msgid "Advanced"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/login.php:22
|
||||
msgid "Custom CSS"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus-admin-bar-menus.php:3
|
||||
msgid ""
|
||||
"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"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus-legacy.php:7
|
||||
msgid "White Label CMS Legacy Menus"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus-legacy.php:12
|
||||
msgid ""
|
||||
"You are seeing this because you have installed version 1 of the plugin in "
|
||||
"the past."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus-legacy.php:13
|
||||
msgid "In version 1 you could only change the menus for Editors."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus-legacy.php:14
|
||||
msgid ""
|
||||
"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."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus-legacy.php:18
|
||||
msgid "Use the new version"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus-menus.php:3
|
||||
msgid ""
|
||||
"Menus will be hidden to all User Roles up to and including Admins (with the "
|
||||
"exception of White Label CMS Admins and Super Admins)."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus-menus.php:4
|
||||
msgid "Select which menus you want to appear."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus-white-label-cms-admin.php:6
|
||||
msgid "Want to hide menus for your client?"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus-white-label-cms-admin.php:11
|
||||
msgid ""
|
||||
"You are now a White Label CMS Admin. This allows you to modify the menus "
|
||||
"that other people will see."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus-white-label-cms-admin.php:12
|
||||
msgid "You"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus-white-label-cms-admin.php:24
|
||||
msgid "Other Admins:"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus-white-label-cms-admin.php:40
|
||||
msgid ""
|
||||
"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>."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus.php:4
|
||||
msgid "White Label CMS Admin"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus.php:12 view/admin/settings.php:6
|
||||
msgid "Menus"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/menus.php:20
|
||||
msgid "Admin Bar Menus"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings-admin-bar-setting.php:5
|
||||
msgid "Hide Front-end Admin Bar"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings-admin-bar-setting.php:8
|
||||
msgid ""
|
||||
"This will disable the admin bar on the front-end for all logged in users"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings-admin-settings.php:5
|
||||
msgid "Hide Help Box"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings-admin-settings.php:8
|
||||
msgid "Hide the help tab which appears in the top right"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings-admin-settings.php:15
|
||||
msgid "Hide Screen Options"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings-admin-settings.php:18
|
||||
msgid "Hide the screen options which appear in the top right"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings-custom-css-for-admin.php:5
|
||||
msgid ""
|
||||
"Override or add to any of the styles in the WordPress admin enter your own "
|
||||
"custom css here"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings-custom-editor-stylesheet.php:2
|
||||
msgid "Custom Stylesheet URL"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings-custom-editor-stylesheet.php:7
|
||||
msgid ""
|
||||
"Create and upload a custom stylesheet with all style rules prefixed with ."
|
||||
"mceContentBody to your themes directory and enter the filename"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings-nag-messages.php:3
|
||||
msgid ""
|
||||
"Nag Messages will be hidden to all User Roles up to and including Admins"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings-nag-messages.php:7
|
||||
msgid "Nag Update Messages"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings.php:3
|
||||
msgid "Admin Bar"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings.php:11
|
||||
msgid "Admin Settings"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings.php:19
|
||||
msgid "Nag Messages"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings.php:27
|
||||
msgid "Custom CSS for Admin"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/settings.php:35
|
||||
msgid "Custom Editor Stylesheet"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/wizard-step-1.php:14
|
||||
msgid "Developer Branding"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/wizard-step-1.php:17
|
||||
msgid ""
|
||||
"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."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/wizard-step-1.php:54
|
||||
msgid "The RSS feed address. For example http://"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/wizard-step-2.php:3
|
||||
msgid "Clients Branding"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/wizard-step-2.php:9
|
||||
msgid "Clients Business Name"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/wizard-step-2.php:14
|
||||
msgid "For use in Admin Page Title and Dashboard Title."
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/parts/wizard-step-2.php:28
|
||||
msgid "Upload Login Logo"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/settings.php:3
|
||||
msgid "Branding"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/settings.php:4
|
||||
msgid "Login"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/settings.php:5
|
||||
msgid "Dashboard"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/settings.php:7
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/settings.php:34 view/admin/wizard.php:20
|
||||
msgid "Save"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/settings.php:58
|
||||
msgid "Export Settings"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/settings.php:59
|
||||
msgid "Reset Plugin"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/wizard.php:11
|
||||
msgid "Quick Setup Wizard: Step 1 of 2 - Developers Branding"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/wizard.php:13
|
||||
msgid "Skip"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/wizard.php:14
|
||||
msgid "Next"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/wizard.php:17
|
||||
msgid "Quick Setup Wizard: Step 2 of 2 - Clients Branding"
|
||||
msgstr ""
|
||||
|
||||
#: view/admin/wizard.php:19
|
||||
msgid "Back to step 1"
|
||||
msgstr ""
|
||||
|
||||
#. Plugin URI of the plugin/theme
|
||||
msgid ""
|
||||
"http://www.videousermanuals.com/white-label-cms/?"
|
||||
"utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt"
|
||||
msgstr ""
|
||||
|
||||
#. Description of the plugin/theme
|
||||
msgid "A plugin that allows you to brand WordPress CMS as your own"
|
||||
msgstr ""
|
||||
|
||||
#. Author of the plugin/theme
|
||||
msgid "www.videousermanuals.com"
|
||||
msgstr ""
|
||||
|
||||
#. Author URI of the plugin/theme
|
||||
msgid ""
|
||||
"http://www.videousermanuals.com/?"
|
||||
"utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt"
|
||||
msgstr ""
|
||||
@@ -0,0 +1,89 @@
|
||||
=== White Label CMS ===
|
||||
|
||||
Contributors: VideoUserManuals
|
||||
Plugin Name: White Label CMS
|
||||
Plugin URI: https://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
|
||||
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
|
||||
Author URI: https://www.videousermanuals.com/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
|
||||
Author: Video User Manuals
|
||||
Requires at least: 3.3
|
||||
Requires PHP: 5.4
|
||||
Tested up to: 7.0
|
||||
Stable tag: 2.7.13
|
||||
|
||||
Customise dashboard panels and branding, hide menus plus lots more.
|
||||
|
||||
== Description ==
|
||||
The White Label CMS plugin is for developers who want to give their clients a more personalised and less confusing content management system.
|
||||
|
||||
For a overview of the changes in 2.0 version of the plugin please visit the Video User Manuals website.
|
||||
|
||||
= Features =
|
||||
- Customize the login page
|
||||
- Add your branding to the header and footer
|
||||
- Customize the dashboard
|
||||
- Control which menus appear for your client
|
||||
- Setting up a customized dashboard can be done in seconds using the White Label CMS Wizard
|
||||
|
||||
= Customize The Login Page =
|
||||
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.
|
||||
|
||||
[youtube https://www.youtube.com/watch?v=LESxAuRdjBw]
|
||||
|
||||
= Add Your Branding to the Header and Footer =
|
||||
Stay top of mind with your client by adding your branding to the admin bar, menu or footer.
|
||||
|
||||
= Customize the Dashboard =
|
||||
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?
|
||||
|
||||
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.
|
||||
|
||||
Add your own welcome dashboard, and now you can use an Elementor or Beaver Builder template to make it look beautiful.
|
||||
|
||||
= Control with Menus Appear for Your Client =
|
||||
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.
|
||||
|
||||
= Setup a Site in Seconds Using the Wizard =
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
== Installation ==
|
||||
1. Download the White Label CMS plugin
|
||||
2. Upload it to your plugins directory
|
||||
3. Go to the plugins directory and activate the plugin
|
||||
4. Go to Settings->White Label CMS and use the menu system to change the default values.
|
||||
|
||||
== Screenshots ==
|
||||
1. An example of how your clients dashboard could look
|
||||
2. White Label CMS Setting: Branding
|
||||
3. White Label CMS Setting: Login
|
||||
4. White Label CMS Setting: Dashboard
|
||||
5. White Label CMS Setting: Menus
|
||||
6. White Label CMS Setting: Settings
|
||||
7. An example of a custom login
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 2.7.13 =
|
||||
* Security Patch: Props to Tal Kantor (Wordfence) for the responsible disclosure.
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
= Who is this plugin for?=
|
||||
For developers who handover websites to their clients and use WordPress as a CMS.
|
||||
|
||||
=How do I add links to my own panel?=
|
||||
Your custom panel accepts html, so just write the markup as you normally would in html.
|
||||
|
||||
=How do you recommend using this plugin?=
|
||||
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:
|
||||
|
||||
* Use the clients logo for the login (it gives the CMS a bit of a wow factor!)
|
||||
* Use the clients logo in the header
|
||||
* Use your own logo in the footer, and place a link back to your website
|
||||
* Remove all panels from the dashboard (they have a lot of information that just confuses the client)
|
||||
* 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.
|
||||
|
||||
= Feature Requests =
|
||||
Got a feature request for WLCMS, let us know [here](https://www.videousermanuals.com/about/).
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
if ( !defined('ABSPATH') && !defined('WP_UNINSTALL_PLUGIN') ) {
|
||||
exit();
|
||||
}
|
||||
|
||||
delete_option('wlcms_options' );
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die('Access denied.');
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="wlcms-advert-wrapper">
|
||||
<a href="https://www.videousermanuals.com/a-better-wp-for-clients" target="_blank">
|
||||
<picture>
|
||||
<source srcset="<?php echo WLCMS_ASSETS_URL ?>images/better-wp-clients-m.jpg" media="(max-width: 480px)">
|
||||
<img srcset="<?php echo WLCMS_ASSETS_URL ?>images/better-wp-clients.jpg" alt="A Better WordPress for Clients">
|
||||
</picture>
|
||||
</a>
|
||||
</div>
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field(__('Admin Bar Logo', 'white-label-cms'), 'admin_bar_logo', __('Replace the WordPress logo in the admin bar. Max height 20px', 'white-label-cms')) ?>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Admin Bar Alt Text', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="admin_bar_alt_text" value="<?php echo esc_attr(wlcms_field_setting('admin_bar_alt_text')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Replace the "WordPress" Alt text.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Replace Howdy Text', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="admin_bar_howdy_text" value="<?php echo esc_attr(wlcms_field_setting('admin_bar_howdy_text')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Add a space to completely remove it from the admin bar. Or replace it with something like: "Hi,"', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Admin Bar URL', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="url" name="admin_bar_url" value="<?php echo esc_url(wlcms_field_setting('admin_bar_url')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Replace the link to WordPress.org.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Developer Name', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="developer_name" value="<?php echo esc_attr(wlcms_field_setting('developer_name')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('For use in footer and ALT text\'s.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Developer URL', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="url" name="developer_url" value="<?php echo esc_url(wlcms_field_setting('developer_url')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('For use in footer and admin bar.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field(__('Developer Icon', 'white-label-cms'), 'developer_icon', __('We recommend at 16 x 16 image', 'white-label-cms')) ?>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group toggle-group">
|
||||
<div class="wlcms-input">
|
||||
<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"/>
|
||||
<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>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('If you wish to use a different image for the footer, you can.', 'white-label-cms') ?>
|
||||
</div>
|
||||
|
||||
<div class="sub-fields">
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field(__('Developer Footer Icon', 'white-label-cms'), 'developer_icon_footer_url', __x('Image will appear in footer menu.', 'white-label-cms')) ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field(__('Developer Side Menu Image', 'white-label-cms'), 'developer_side_menu_image', __x('Image will appear in side menu.', 'white-label-cms')) ?>
|
||||
</div>
|
||||
@@ -0,0 +1,34 @@
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field(__('Footer Image', 'white-label-cms'), 'footer_image', __('Image which will appear in the footer replacing "Thank you for creating with WordPress. Max height 50px', 'white-label-cms')) ?>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Footer Text', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="footer_text" value="<?php echo esc_attr(wlcms_field_setting('footer_text')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Text which will appear to the right of the Footer Image.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Footer URL', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="url" name="footer_url" value="<?php echo esc_url(wlcms_field_setting('footer_url')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Replace WordPress in the page titles.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('or use HTML', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<textarea name="footer_html" class="textarea-full" id="footer_html"><?php echo esc_html(wlcms_field_setting('footer_html')) ?></textarea>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('If you would like more control over what appears in the footer, add your own HTML.<br/>
|
||||
Note: this will overwrite anything set in the Footer Image, Footer Text and Footer URL.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Gutenberg Exit Button', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<select class="wlcms-select gutenberg-exit-toggle" name="gutenberg_exit_icon">
|
||||
<option value="exit-icon" <?php selected(wlcms_field_setting('gutenberg_exit_icon'), 'exit-icon', true) ?><?php selected(wlcms_field_setting('gutenberg_exit_icon'), '', true) ?>>Exit Icon</option>
|
||||
<option value="admin-bar-logo" <?php selected(wlcms_field_setting('gutenberg_exit_icon'), 'admin-bar-logo', true) ?>>Admin Bar Logo</option>
|
||||
<option value="custom-icon" <?php selected(wlcms_field_setting('gutenberg_exit_icon'), 'custom-icon', true) ?>>Custom Icon</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-input-group custom_gutenberg_exit_wrapper">
|
||||
<?php echo wlcms_form_upload_field(__('Custom Image', 'white-label-cms'), 'gutenberg_exit_custom_icon', __('Max width and height 50px', 'white-label-cms')) ?>
|
||||
</div>
|
||||
<div class="wlcms-help branding-toggled-off" style="color: #f64031;">
|
||||
Note: You need to turn on the Hide WordPress Logo and Links, for this to work.
|
||||
</div>
|
||||
<div class="wlcms-help help_gutenberg_exit">
|
||||
<?php _e('Replace the WordPress logo on the Gutenberg Editor page with <span></span>', 'white-label-cms') ?>
|
||||
</div>
|
||||
@@ -0,0 +1,25 @@
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field(__('Side Menu Image', 'white-label-cms'), 'side_menu_image', __('Image will appear at the top of the side menu. Max width 160px', 'white-label-cms')) ?>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field(__('Collapsed Side Menu Image', 'white-label-cms'), 'collapsed_side_menu_image', __('Image will appear at the top of the side menu when it is collapsed. Max width 36px', 'white-label-cms')) ?>
|
||||
</div>
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Side Menu Link URL', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="url" name="side_menu_link_url" value="<?php echo esc_url(wlcms_field_setting('side_menu_link_url')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('External links will open in a new window.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Side Menu Alt Text', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="side_menu_alt_text" value="<?php echo esc_attr(wlcms_field_setting('side_menu_alt_text')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Alt text for the Side Menu Image link.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-input">
|
||||
<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) ?>/>
|
||||
<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', 'white-label-cms') ?></label>
|
||||
</div>
|
||||
<div class="wlcms-help branding-toggled-off" style="color: #f64031;">
|
||||
<?php _e('You have selected no, so all custom branding images will be ignored', 'white-label-cms') ?>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Hide mentions of WordPress and hide the links to WordPress.org.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-input">
|
||||
<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) ?>/>
|
||||
<label class="wlcms-toggle-btn" for="hide_wp_version"></label><label class="toggle-label" for="hide_wp_version"><?php _e('Hide WP Version', 'white-label-cms') ?></label>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Hide version number of WordPress which appears in the footer.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Custom Page Titles', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="custom_page_title" value="<?php echo esc_attr(wlcms_field_setting('custom_page_title')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Replace WordPress in the page titles.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,40 @@
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('WordPress Branding', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/branding-wordpress'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Admin Bar Branding', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/branding-admin-bar'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Side Menu Branding', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/branding-side-menu'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Gutenberg Branding', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/branding-gutenberg'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Footer Branding', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/branding-footer'); ?>
|
||||
</div>
|
||||
</div>
|
||||
+243
@@ -0,0 +1,243 @@
|
||||
<!-- Own Welcome Panel -->
|
||||
<?php
|
||||
$welcome_panel_is_active = wlcms_welcome_value(0, 'is_active');
|
||||
?>
|
||||
<div class="wlcms-input-group toggle-group wlcms-dashboard" data-wlcms_dashboard="1">
|
||||
<div class="wlcms-help">
|
||||
<?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.', 'white-label-cms') ?>
|
||||
</div>
|
||||
<div class="wlcms-input">
|
||||
<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) ?>/>
|
||||
<label class="wlcms-toggle-btn" for="welcome_panel"></label><label class="toggle-label" for="welcome_panel"><?php _e('Add Your Own Welcome Panel', 'white-label-cms') ?></label>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('You can add your own welcome panel.', 'white-label-cms') ?>
|
||||
</div>
|
||||
<div class="sub-fields">
|
||||
<div class="wlcms-help"></div>
|
||||
<label><?php _e('Select the Roles the Welcome Panel Will Be Visible To', 'white-label-cms') ?></label>
|
||||
|
||||
<?php
|
||||
echo wlcms_select_roles(array('name' => 'welcome_panel[0][visible_to]', 'class' => 'wlcms_visible_to wlcms-select2'), wlcms_welcome_value(0, 'visible_to'));
|
||||
?>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Select the user roles this will be visible to.', 'white-label-cms') ?>
|
||||
</div>
|
||||
<?php
|
||||
$checked_welcome_type = wlcms_welcome_value(0, 'template_type');
|
||||
|
||||
$beaver_args = array(
|
||||
'post_type' => 'fl-builder-template',
|
||||
'posts_per_page' => '-1',
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'fl-builder-template-type',
|
||||
'field' => 'slug',
|
||||
'terms' => array( 'layout', 'row' )
|
||||
)
|
||||
)
|
||||
);
|
||||
$elementor_args = array(
|
||||
'post_type' => 'elementor_library',
|
||||
'posts_per_page' => '-1',
|
||||
'post_status' => 'publish'
|
||||
);
|
||||
|
||||
$is_basic = ( ! $checked_welcome_type ) || ($checked_welcome_type == 'html') ? true : false;
|
||||
$is_page = ($checked_welcome_type == 'page') ? true : false;
|
||||
|
||||
?>
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Template Type', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<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"/>
|
||||
<label class="wlcms-toggle-btn" for="template_type_basic"></label><label class="toggle-label" for="template_type_basic"><?php _e('Basic HTML');?></label>
|
||||
|
||||
<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"/>
|
||||
<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>
|
||||
<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"/>
|
||||
<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>
|
||||
|
||||
<input class="wlcms-toggle wlcms-toggle-light template_type template_type1" data-template_type="1" data-page_type="page" id="template_type_page" value="page" name="welcome_panel[0][template_type]" <?php checked($is_page, true, true) ?> type="radio"/>
|
||||
<label class="wlcms-toggle-btn" for="template_type_page"></label><label class="toggle-label" for="template_type_page"><?php _e('Page');?></label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="welcome-page1">
|
||||
<label class="welcome-label-template"><?php _e('Template', 'white-label-cms') ?></label>
|
||||
<label class="welcome-label-page"><?php _e('Page', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<?php
|
||||
echo wlcms_select_pages(array('name' => 'welcome_panel[0][page_id_elementor]', 'class' => 'wlcms_visible_to wlcms-select2 pages_select1 elementor_page1'), wlcms_welcome_value(0, 'page_id_elementor'), $elementor_args);
|
||||
echo wlcms_select_pages(array('name' => 'welcome_panel[0][page_id_beaver]', 'class' => 'wlcms_visible_to wlcms-select2 pages_select1 beaver_page1'), wlcms_welcome_value(0, 'page_id_beaver'), $beaver_args);
|
||||
?>
|
||||
<select class="wlcms_visible_to wlcms-pageselect2 pages_select1 page_page1" data-model="<?php echo wlcms_welcome_value(0, 'page_id_page');?>" name="welcome_panel[0][page_id_page]"></select>
|
||||
</div>
|
||||
<div class="wlcms-help pages_select1 page_page1">
|
||||
<?php _e('This feature is primarily for people using other page builders. Please ensure your page does not use a header or footer, as it will be displayed in an iFrame on the dashboard. The links will be automatically modified to load correctly, so you don’t need to change the target.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="welcome-basicHtml1">
|
||||
<label><?php _e('Title of Welcome Panel', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="welcome_panel[0][title]" value="<?php echo esc_attr(wlcms_welcome_value(0, 'title')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Title of the Welcome Panel', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="welcome-basicHtml1">
|
||||
<label><?php _e('Welcome Panel Description HTML', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<textarea class="textarea-full" name="welcome_panel[0][description]"><?php echo esc_html(wlcms_welcome_value(0, 'description')) ?></textarea>
|
||||
</div>
|
||||
<div class="wlcms-help"><?php _e('You can add any HTML to the welcome panel.', 'white-label-cms') ?></div>
|
||||
</div>
|
||||
|
||||
<div class="welcome-basicHtml1">
|
||||
<div class="wlcms-input">
|
||||
<input class="wlcms-toggle wlcms-toggle-light welcome_panel_fullwidth" 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"/>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<?php if( wlcms_has_pagebuilder() ):?>
|
||||
<div class="welcome-page1">
|
||||
<div class="wlcms-input">
|
||||
<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"/>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<div class="wlcms-input-group wlcms_welcome_dismissible wlcms_welcome_panel_dismissible1">
|
||||
<div class="wlcms-input">
|
||||
<input class="wlcms-toggle wlcms-toggle-light" id="first_welcome_panel_dismissible" value="1" name="welcome_panel[0][dismissible]" <?php checked(wlcms_welcome_value(0, 'dismissible'), 1, true) ?> type="checkbox"/>
|
||||
<label class="wlcms-toggle-btn" for="first_welcome_panel_dismissible"></label><label class="toggle-label" for="first_welcome_panel_dismissible"><?php _e('Dismissible'); ?></label>
|
||||
</div>
|
||||
<?php
|
||||
if( is_wlcms_super_admin() ):?>
|
||||
<div class="wlcms_welcome_dismissible_reset"><a href="<?php echo wlcms()->admin_url() ?>&wlcms-action=reset-welcome-dashboard&dashboard=0"><?php _e('Reset Dismissed Welcome Dashboard')?></a></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Second Panel -->
|
||||
<?php
|
||||
$welcome_panel_is_active = wlcms_welcome_value(1, 'is_active');
|
||||
?>
|
||||
<div class="wlcms-input-group toggle-group wlcms-dashboard" data-wlcms_dashboard="2">
|
||||
<div class="wlcms-input">
|
||||
<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) ?>/>
|
||||
<label class="wlcms-toggle-btn" for="add_second_panel"></label><label class="toggle-label" for="add_second_panel"><?php _e('Add Second Panel', 'white-label-cms') ?></label>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Add a second custom panel to the Dashboard.', 'white-label-cms') ?>
|
||||
</div>
|
||||
<div class="sub-fields">
|
||||
<div class="wlcms-help"></div>
|
||||
<label><?php _e('Select the Roles the Welcome Panel Will Be Visible To', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<?php
|
||||
echo wlcms_select_roles(array('name' => 'welcome_panel[1][visible_to]', 'class' => 'wlcms_visible_to wlcms-select2'), wlcms_welcome_value(1, 'visible_to'));
|
||||
?>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Select the user roles this will be visible to.', 'white-label-cms') ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$checked_welcome_type = wlcms_welcome_value(1, 'template_type');
|
||||
|
||||
$is_basic = ( ! $checked_welcome_type ) || ($checked_welcome_type == 'html') ? true : false;
|
||||
$is_page = ($checked_welcome_type == 'page') ? true : false;
|
||||
|
||||
?>
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Template', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<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"/>
|
||||
<label class="wlcms-toggle-btn" for="template_type_basic2"></label><label class="toggle-label" for="template_type_basic2"><?php _e('Basic HTML');?></label>
|
||||
<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"/>
|
||||
<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>
|
||||
<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"/>
|
||||
<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>
|
||||
<input class="wlcms-toggle wlcms-toggle-light template_type template_type2" data-template_type="2" data-page_type="page" id="template_type_page2" value="page" name="welcome_panel[1][template_type]" <?php checked($is_page, true, true) ?> type="radio"/>
|
||||
<label class="wlcms-toggle-btn" for="template_type_page2"></label><label class="toggle-label" for="template_type_page2"><?php _e('Page');?></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="welcome-page2">
|
||||
<label class="welcome-label-template"><?php _e('Template', 'white-label-cms') ?></label>
|
||||
<label class="welcome-label-page"><?php _e('Page', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<?php
|
||||
echo wlcms_select_pages(array('name' => 'welcome_panel[1][page_id_elementor]', 'class' => 'wlcms_visible_to pages_select2 wlcms-select2 elementor_page2'), wlcms_welcome_value(1, 'page_id_elementor'), $elementor_args);
|
||||
echo wlcms_select_pages(array('name' => 'welcome_panel[1][page_id_beaver]', 'class' => 'wlcms_visible_to pages_select2 wlcms-select2 beaver_page2'), wlcms_welcome_value(1, 'page_id_beaver'), $beaver_args);
|
||||
?>
|
||||
<select class="wlcms_visible_to wlcms-pageselect2 pages_select2 page_page2" data-model="<?php echo wlcms_welcome_value(1, 'page_id_page');?>" name="welcome_panel[1][page_id_page]"></select>
|
||||
</div>
|
||||
<div class="wlcms-help pages_select2 page_page2">
|
||||
<?php _e('This feature is primarily for people using other page builders. Please ensure your page does not use a header or footer, as it will be displayed in an iFrame on the dashboard. The links will be automatically modified to load correctly, so you don’t need to change the target.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="welcome-basicHtml2">
|
||||
<label><?php _e('Title of Second Panel', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="welcome_panel[1][title]" value="<?php echo esc_attr(wlcms_welcome_value(1, 'title')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Title of the Second Panel', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="welcome-basicHtml2">
|
||||
<label><?php _e('Second Panel Description (HTML)', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<textarea class="textarea-full" name="welcome_panel[1][description]"><?php echo esc_html(wlcms_welcome_value(1, 'description')) ?></textarea>
|
||||
</div>
|
||||
<div class="wlcms-help"><?php _e('You can add any HTML to the second panel.', 'white-label-cms') ?></div>
|
||||
</div>
|
||||
|
||||
<div class="welcome-page">
|
||||
<label><?php _e('Second Panel Description (HTML)', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
|
||||
</div>
|
||||
<div class="wlcms-help"><?php _e('You can add any HTML to the second panel.', 'white-label-cms') ?></div>
|
||||
</div>
|
||||
|
||||
<div class="welcome-basicHtml2">
|
||||
<div class="wlcms-input">
|
||||
<input class="wlcms-toggle wlcms-toggle-light welcome_panel_fullwidth" 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"/>
|
||||
<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>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if( wlcms_has_pagebuilder() ):?>
|
||||
<div class="welcome-page2">
|
||||
<div class="wlcms-input">
|
||||
<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"/>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<div class="wlcms-input-group wlcms_welcome_dismissible wlcms_welcome_panel_dismissible2">
|
||||
<div class="wlcms-input">
|
||||
<input class="wlcms-toggle wlcms-toggle-light" id="second_welcome_panel_dismissible" value="1" name="welcome_panel[1][dismissible]" <?php checked(wlcms_welcome_value(1, 'dismissible'), 1, true) ?> type="checkbox"/>
|
||||
<label class="wlcms-toggle-btn" for="second_welcome_panel_dismissible"></label><label class="toggle-label" for="second_welcome_panel_dismissible"><?php _e('Dismissible'); ?></label>
|
||||
</div>
|
||||
<?php
|
||||
if( is_wlcms_super_admin() ):?>
|
||||
<div class="wlcms_welcome_dismissible_reset"><a href="<?php echo wlcms()->admin_url() ?>&wlcms-action=reset-welcome-dashboard&dashboard=1"><?php _e('Reset Dismissed Welcome Dashboard')?></a></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
$default_settings = wlcms()->Settings()->get_default_option('dashboard_widgets_visibility_roles');
|
||||
$dashboard_role_stat = wlcms_field_setting('dashboard_role_stat');
|
||||
$dashboard_widgets_visibility_roles = wlcms_field_setting('dashboard_widgets_visibility_roles');
|
||||
$dashboard_widget = wlcms_field_setting('dashboard_widgets');
|
||||
|
||||
$widgets = wlcms()->Admin_Dashboard()->widgets();
|
||||
|
||||
if( ! $dashboard_role_stat) {
|
||||
$dashboard_widgets_visibility_roles = $default_settings;
|
||||
}
|
||||
?>
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field(__('Dashboard Icon', 'white-label-cms'), 'dashboard_icon', __('Add a logo to the Dashboard. Suggested height 40px', 'white-label-cms')) ?>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Dashboard Title', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="dashboard_title" value="<?php echo esc_attr(wlcms_field_setting('dashboard_title')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Change the heading for the Dashboard', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Select the Roles the Dashboard Panels Will Be Hidden To', 'white-label-cms') ?></label>
|
||||
<?php
|
||||
echo wlcms_select_roles(array('name' => 'dashboard_widgets_visibility_roles', 'class' => 'dashboard_widgets_visibility_roles wlcms-select2'), $dashboard_widgets_visibility_roles);
|
||||
?>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Select the user roles this will be hidden to.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-input-group toggle-group">
|
||||
<ul>
|
||||
<li>
|
||||
<input type="hidden" value="1" name="dashboard_role_stat" />
|
||||
<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) ?>/>
|
||||
<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', 'white-label-cms')?></label>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('This will hide all the WordPress default dashboard panels. Or you can specify which panels should appear.', 'white-label-cms') ?>
|
||||
</div>
|
||||
<ul class="sub-fields">
|
||||
<?php
|
||||
if (is_array($widgets)) {
|
||||
foreach ( $widgets as $context => $section ) {
|
||||
if (is_array($section)) {
|
||||
foreach ( $section as $position ) {
|
||||
if (is_array($position)) {
|
||||
foreach ( $position as $widget_id => $widget ) {
|
||||
if (false !== $widget && strpos($widget_id, 'custom_vum_widget') === false) {
|
||||
$selected = false;
|
||||
if(wlcms_field_setting('hide_all_dashboard_panels')) {
|
||||
$selected = true;
|
||||
}elseif($dashboard_widget && is_array($dashboard_widget)) {
|
||||
$selected = in_array($widget_id,$dashboard_widget);
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<input class="wlcms-toggle wlcms-toggle-light" id="<?php echo $widget_id ?>" name="dashboard_widgets[]" value="<?php echo $widget_id ?>" type="checkbox" <?php checked($selected, true, true) ?>/>
|
||||
<label class="wlcms-toggle-btn" for="<?php echo $widget_id ?>"></label><label class="toggle-label" for="<?php echo $widget_id ?>"><?php echo wp_strip_all_tags( stripslashes($widget['title']) )?></label>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<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) ?>/>
|
||||
<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', 'white-label-cms')?></label>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,72 @@
|
||||
<div class="wlcms-input-group toggle-group">
|
||||
<div class="wlcms-input">
|
||||
<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) ?>/>
|
||||
<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', 'white-label-cms') ?></label>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?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.', 'white-label-cms') ?>
|
||||
</div>
|
||||
<div class="sub-fields">
|
||||
|
||||
<div class="wlcms-input">
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('RSS Title', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="rss_title" value="<?php echo esc_attr(wlcms_field_setting('rss_title')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('The title of the RSS Panel', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field(__('Add Your Logo', 'white-label-cms'), 'rss_logo', __('Add a logo to appear on the panel before the title.', 'white-label-cms')) ?>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('RSS Feed', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" id="rss_feed_address" name="rss_feed_address" value="<?php echo esc_url(wlcms_field_setting('rss_feed_address')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('The RSS feed address. For example '. get_bloginfo('rss_url'), 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Number of Items to appear', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<select name="rss_feed_number_of_item">
|
||||
<?php
|
||||
$item_setting = wlcms_field_setting('rss_feed_number_of_item');
|
||||
for($item = 1; $item <= 10; $item++) {?>
|
||||
<option value="<?php echo esc_attr($item)?>" <?php echo ($item == $item_setting) ? ' selected="selected"' : '' ?>><?php echo esc_attr($item)?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Number of RSS items to show.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-input">
|
||||
<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"/>
|
||||
<label class="wlcms-toggle-btn" for="show_post_content"></label><label class="toggle-label" for="show_post_content"><?php _e('Show Post Contents');?></label>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Introduction HTML', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<textarea class="textarea-full" name="rss_introduction"><?php echo wlcms_esc_html_e(wlcms_field_setting('rss_introduction')) ?></textarea>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Add introduction text to appear above the RSS items. You can use HTML.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Default Panels', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/dashboard-default-panels'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Custom Welcome Dashboard Panel', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/dashboard-custom-welcome-dashboard-panel'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('RSS Dashboard Panel', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/dashboard-rss-dashboard-panel'); ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
<section class="tab-import-settings" id="import-settings">
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Import Settings', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-input">
|
||||
<input type="file" name="import_file" id="import_file" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('To import the settings from another website', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die('Access denied.');
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<div class="lightbox short-animate" id="wlcms-preview-content">
|
||||
|
||||
</div>
|
||||
<div id="lightbox-controls" class="short-animate">
|
||||
<a id="close-lightbox" class="long-animate" href="#"><?php _e('Close Preview')?></a>
|
||||
</div>
|
||||
@@ -0,0 +1,122 @@
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-input">
|
||||
|
||||
<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) ?>/>
|
||||
<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', 'white-label-cms') ?></label>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Hide the "Register / Lost your password?" link which appears below the login form.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-input">
|
||||
<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) ?>/>
|
||||
<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', 'white-label-cms') ?></label>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Hide the "Back to" link which appears below the login form.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Form Background Color', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="form_background_color" class="wlcms-color-field" value="<?php echo esc_attr(wlcms_field_setting('form_background_color')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Background color of the login form', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Form Label Color', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="form_label_color" class="wlcms-color-field" value="<?php echo esc_attr(wlcms_field_setting('form_label_color')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Color of the labels on the login form', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Form Button Color', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="form_button_color" class="wlcms-color-field" value="<?php echo esc_attr(wlcms_field_setting('form_button_color')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Color of the button on the login form', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Form Button Hover Color', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="form_button_hover_color" class="wlcms-color-field" value="<?php echo esc_attr(wlcms_field_setting('form_button_hover_color')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Hover color of the button on the login form', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Form Button Text Color', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="form_button_text_color" class="wlcms-color-field" value="<?php echo esc_attr(wlcms_field_setting('form_button_text_color')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Color of the text on the button on the login form', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Form Button Text Hover Color', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="form_button_text_hover_color" class="wlcms-color-field" value="<?php echo esc_attr(wlcms_field_setting('form_button_text_hover_color')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Hover color of the text on the button on the login form', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Back to / Register Link Color', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="back_to_register_link_color" class="wlcms-color-field" value="<?php echo esc_attr(wlcms_field_setting('back_to_register_link_color')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Color of the link text of Back to / Register', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Back to / Register Link Hover Color', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="back_to_register_link_hover_color" class="wlcms-color-field" value="<?php echo esc_attr(wlcms_field_setting('back_to_register_link_hover_color')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Hover color of the link text of Back to / Register', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Privacy Policy Link Color', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="privacy_policy_link_color" class="wlcms-color-field" value="<?php echo esc_attr(wlcms_field_setting('privacy_policy_link_color')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Color of the link text of Privacy Policy', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Privacy Policy Link Hover Color', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="privacy_policy_link_hover_color" class="wlcms-color-field" value="<?php echo esc_attr(wlcms_field_setting('privacy_policy_link_hover_color')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Hover color of the link text of Privacy Policy', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if( !is_multisite() ):?>
|
||||
<p align="center"><a href="#wlcms-preview-content" class="wlcms-preview-link"><?php _e('Live Preview', 'white-label-cms') ?></a></p>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-input">
|
||||
<textarea class="textarea-full wlcms-css" name="login_custom_css"><?php echo esc_html(wlcms_field_setting('login_custom_css')) ?></textarea>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<p><?php _e('Completely customise the login page by entering your own CSS.', 'white-label-cms') ?></p>
|
||||
<p><?php _e('For example', 'white-label-cms') ?>:<br/>
|
||||
<code>
|
||||
.login form { background-color: #0013FF }<br/>
|
||||
.login #login p#nav a { color: #333 !important }</code>
|
||||
</p>
|
||||
<p>
|
||||
<?php _e('Or if you want to get fancy', 'white-label-cms') ?>:<br/>
|
||||
<code>
|
||||
#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%;}
|
||||
</code>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php if( !is_multisite() ):?>
|
||||
<p align="center"><a href="#wlcms-preview-content" class="wlcms-preview-link"><?php _e('Live Preview', 'white-label-cms') ?></a></p>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,14 @@
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-input">
|
||||
<textarea class="textarea-full wlcms-css" name="login_custom_js"><?php echo esc_html(wlcms_field_setting('login_custom_js')) ?></textarea>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<p><?php _e('Completely customise the login page by entering your own Javascript code.', 'white-label-cms') ?></p>
|
||||
<p><?php _e('For example', 'white-label-cms') ?>:<br/>
|
||||
</p>
|
||||
<code>document.getElementById('user_login').placeholder='Username';<br/> document.getElementById('user_pass').placeholder='Password';</code>
|
||||
</div>
|
||||
</div>
|
||||
<?php if( !is_multisite() ):?>
|
||||
<p align="center"><a href="#wlcms-preview-content" class="wlcms-preview-link"><?php _e('Live Preview', 'white-label-cms') ?></a></p>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,6 @@
|
||||
<div class="lightbox short-animate" id="wlcms-login">
|
||||
|
||||
</div>
|
||||
<div id="lightbox-controls" class="short-animate">
|
||||
<a id="close-lightbox" class="long-animate" href="#login"><?php _e('Close Login')?></a>
|
||||
</div>
|
||||
@@ -0,0 +1,97 @@
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field(__('Login Logo', 'white-label-cms'), 'login_logo', __('Replace the WordPress logo on the login page. Max width 320px', 'white-label-cms')) ?>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field(__('Retina Login Logo', 'white-label-cms'), 'retina_login_logo', __('Replace the Retina WordPress logo on the login page. Please make sure you use the standard retina format of x2', 'white-label-cms')) ?>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Logo Width', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="number" name="logo_width" class="wlcms-upload-input" value="<?php echo esc_attr(wlcms_field_setting('logo_width', '')) ?>" />px
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Add a width to your Login Logo. Max width 320px', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Logo Height', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="number" name="logo_height" class="wlcms-upload-input" value="<?php echo esc_attr(wlcms_field_setting('logo_height', '')) ?>" />px
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Add a height to your Login Logo.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Logo Bottom Margin', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="number" name="logo_bottom_margin" class="wlcms-upload-input" value="<?php echo esc_attr(wlcms_field_setting('logo_bottom_margin')) ?>" />px
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Add a bottom margin to your Login Logo.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Background Color', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="background_color" class="wlcms-color-field" value="<?php echo esc_attr(wlcms_field_setting('background_color')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Background color for the login page. Changing to White will help your logo standout.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field(__('Background Image', 'white-label-cms'), 'background_image', __('Adds a background image to the login page.', 'white-label-cms')) ?>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-input">
|
||||
<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) ?>/>
|
||||
<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', 'white-label-cms') ?></label>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Stretch the background image to appear full screen.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Background Position', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<select class="wlcms-select" name="background_positions">
|
||||
<option value="center center" <?php selected(wlcms_field_setting('background_positions'), 'center center', true) ?>>Center Center</option>
|
||||
<option value="center top" <?php selected(wlcms_field_setting('background_positions'), 'center top', true) ?>>Center Top</option>
|
||||
<option value="center bottom" <?php selected(wlcms_field_setting('background_positions'), 'center bottom', true) ?>>Center Bottom</option>
|
||||
<option value="left top" <?php selected(wlcms_field_setting('background_positions'), 'left top', true) ?>>Left Top</option>
|
||||
<option value="left center" <?php selected(wlcms_field_setting('background_positions'), 'left center', true) ?>>Left Center</option>
|
||||
<option value="left bottom" <?php selected(wlcms_field_setting('background_positions'), 'left bottom', true) ?>>Left Bottom</option>
|
||||
<option value="right top" <?php selected(wlcms_field_setting('background_positions'), 'right top', true) ?>>Right Top</option>
|
||||
<option value="right center" <?php selected(wlcms_field_setting('background_positions'), 'right center', true) ?>>Right Center</option>
|
||||
<option value="right bottom" <?php selected(wlcms_field_setting('background_positions'), 'right bottom', true) ?>>Right Bottom</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Specify the CSS background position.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Background Repeat', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<select class="wlcms-select" name="background_repeat">
|
||||
<option value="repeat" <?php selected(wlcms_field_setting('background_repeat'), 'repeat', true) ?>>repeat</option>
|
||||
<option value="repeat-y" <?php selected(wlcms_field_setting('background_repeat'), 'repeat-y', true) ?>>repeat-y</option>
|
||||
<option value="no-repeat" <?php selected(wlcms_field_setting('background_repeat'), 'no-repeat', true) ?>>no-repeat</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Specify the CSS background-repeat.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if( !is_multisite() ):?>
|
||||
<p align="center"><a href="#wlcms-preview-content" class="wlcms-preview-link"><?php _e('Live Preview', 'white-label-cms') ?></a></p>
|
||||
<?php endif;?>
|
||||
@@ -0,0 +1,40 @@
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Logo and Background', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<input type="hidden" name="form_section" value="setting" />
|
||||
<?php wlcms()->admin_view('parts/login-logo-and-background'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Advanced', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/login-advanced'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Custom JavaScript', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/login-custom-js'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Custom CSS', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/login-custom-css'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="login-live-preview">
|
||||
<?php wlcms()->admin_view('parts/live-preview'); ?>
|
||||
</div>
|
||||
@@ -0,0 +1,16 @@
|
||||
<div class="wlcms-input-group wlcms-toggle-wrapper wlcms-menus-settings">
|
||||
<div class="wlcms-help">
|
||||
<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', 'white-label-cms') ?></p>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
$menu_class = wlcms()->Admin_Menus();
|
||||
$admin_bar_menu_setting = wlcms_field_setting('admin_bar_menus');
|
||||
|
||||
if ($admin_bar_menus = $menu_class->get_admin_bar_menus()) {
|
||||
|
||||
echo $menu_class->get_admin_bar_menu_html($admin_bar_menus);
|
||||
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
$legacy = wlcms_field_setting('legacy_menu');
|
||||
if($legacy) {
|
||||
?>
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('White Label CMS Legacy Menus', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-help">
|
||||
<p><i><?php _e('You are seeing this because you have installed version 1 of the plugin in the past.', 'white-label-cms') ?></i></p>
|
||||
<p><i><?php _e('In version 1 you could only change the menus for Editors.', 'white-label-cms') ?></i></p>
|
||||
<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.', 'white-label-cms') ?></i></p>
|
||||
</div>
|
||||
<div class="wlcms-input">
|
||||
<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) ?>/>
|
||||
<label class="wlcms-toggle-btn" for="remove_legacy_menu"></label><label class="toggle-label" for="remove_legacy_menu"><?php _e('Use the new version', 'white-label-cms') ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php }
|
||||
@@ -0,0 +1,74 @@
|
||||
<div class="wlcms-input-group wlcms-toggle-wrapper wlcms-menus-settings">
|
||||
<div class="wlcms-help">
|
||||
<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).', 'white-label-cms') ?></p>
|
||||
<p><?php _e('Select which menus you want to appear.', 'white-label-cms') ?></p>
|
||||
</div>
|
||||
<input type="hidden" value="index.php" name="admin_menus[main][]">
|
||||
<input type="hidden" value="index.php_wlcms_index-php" name="admin_menus[sub][]">
|
||||
<?php
|
||||
|
||||
$menu_class = wlcms()->Admin_Menus();
|
||||
$admin_menu = wlcms_field_setting('admin_menus');
|
||||
$sidebar_url = wlcms()->Branding()->sidebar_menu_url();
|
||||
$setting_admin_menus = wlcms_field_setting('admin_menus');
|
||||
|
||||
if ($admin_menus = $menu_class->get_admin_menus()) :
|
||||
echo '<ul>';
|
||||
|
||||
foreach ($admin_menus as $main_key => $main_menu) :
|
||||
|
||||
if ($main_key == $sidebar_url) {
|
||||
continue;
|
||||
}
|
||||
$main_menu_checked = ' checked="checked"';
|
||||
$menu_name = $main_menu['name'];
|
||||
$menu_slug = $main_menu['slug'];
|
||||
if (is_array($setting_admin_menus) && isset($setting_admin_menus['main']) && in_array($menu_slug, $setting_admin_menus['main'])) {
|
||||
$main_menu_checked = '';
|
||||
}
|
||||
|
||||
$disabled = '';
|
||||
if ($main_key == 'index.php') {
|
||||
$disabled = ' disabled';
|
||||
}
|
||||
|
||||
?>
|
||||
<li>
|
||||
<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 ?> />
|
||||
<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, 'white-label-cms') ?></label>
|
||||
<?php
|
||||
if (isset($main_menu['submenus']) && count($main_menu['submenus'])) :
|
||||
echo '<a href="javascript:void(0)" class="wlcms-toggle-arrow"></a><ul class="sub_menu_wrapper">';
|
||||
$submenus = $main_menu['submenus'];
|
||||
|
||||
foreach ($submenus as $submenu_key => $sub_menu) :
|
||||
|
||||
$sub_menu_name = $sub_menu['name'];
|
||||
$checked_sub = ' checked="checked"';
|
||||
$submenu_value = $sub_menu['slug'];
|
||||
$disabled = '';
|
||||
if ($submenu_key == 'index-php') {
|
||||
$disabled = ' disabled';
|
||||
} elseif ($submenu_key == 'wlcms-plugin-php') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_array($setting_admin_menus) && (isset($setting_admin_menus['sub']) && in_array($submenu_value, $setting_admin_menus['sub']))) {
|
||||
$checked_sub = '';
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<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 ?> />
|
||||
<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, 'white-label-cms') ?></label>
|
||||
</li>
|
||||
<?php
|
||||
endforeach;
|
||||
echo '</ul>';
|
||||
endif;
|
||||
?>
|
||||
</li>
|
||||
<?php
|
||||
endforeach;
|
||||
echo '</ul>';
|
||||
endif; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
$current_user = wp_get_current_user();
|
||||
?>
|
||||
<div class="wlcms-input-group toggle-group wlcms_admin_wrapper">
|
||||
<div class="wlcms-input">
|
||||
<label class="toggle-label" for="enable_wlcms_admin"><?php _e('Want to hide menus for your client?', 'white-label-cms') ?></label>
|
||||
<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) ?>/>
|
||||
<label class="wlcms-toggle-btn" for="enable_wlcms_admin"></label>
|
||||
</div>
|
||||
<div class="sub-fields">
|
||||
<p><?php _e('You are now a White Label CMS Admin. This allows you to modify the menus that other people will see.', 'white-label-cms') ?></p>
|
||||
<p><?php echo sprintf('<strong>%s: %s</strong>', __('You', 'white-label-cms'), $current_user->user_email); ?></p>
|
||||
|
||||
<input name="wlcms_admin[]" value="<?php echo $current_user->ID ?>" type="hidden"/>
|
||||
<?php
|
||||
$admin_args = array(
|
||||
'role' => 'administrator',
|
||||
'exclude' => $current_user->ID,
|
||||
);
|
||||
$adminusers = get_users( $admin_args );
|
||||
$wlcms_admin_setting = wlcms_field_setting('wlcms_admin');
|
||||
|
||||
if( count( $adminusers ) ):
|
||||
echo sprintf('<label>%s</label>', __('Other Admins:', 'white-label-cms'));
|
||||
echo '<div class="wlcms-other-admins">';
|
||||
foreach ( $adminusers as $user ) { ?>
|
||||
<div class="wlcms-input">
|
||||
<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
|
||||
if( $wlcms_admin_setting && in_array( $user->ID, $wlcms_admin_setting ) ):
|
||||
?>checked="checked"<?php
|
||||
endif;?>/>
|
||||
<label class="wlcms-toggle-btn" for="wlcms_admin_<?php echo $user->ID?>"></label> <label class="toggle-label" for="wlcms_admin_<?php echo $user->ID?>"><?php echo $user->user_email ?></label>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
echo '</div>';
|
||||
endif;
|
||||
?>
|
||||
<div class="wlcms-help">
|
||||
<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>.', 'white-label-cms') ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php wlcms()->admin_view('parts/menus-legacy'); ?>
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('White Label CMS Admin', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/menus-white-label-cms-admin'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-body-wrapper menu-admin-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Menus', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/menus-menus'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-body-wrapper menu-admin-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Admin Bar Menus', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/menus-admin-bar-menus'); ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-input">
|
||||
<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"/>
|
||||
<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>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('This will disable the admin bar on the front-end for all logged in users', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-input">
|
||||
<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) ?>/>
|
||||
<label class="wlcms-toggle-btn" for="hide_help_box"></label><label class="toggle-label" for="hide_help_box"><?php _e('Hide Help Box', 'white-label-cms') ?></label>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Hide the help tab which appears in the top right', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-input">
|
||||
<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) ?>/>
|
||||
<label class="wlcms-toggle-btn" for="hide_screen_options"></label><label class="toggle-label" for="hide_screen_options"><?php _e('Hide Screen Options', 'white-label-cms') ?></label>
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Hide the screen options which appear in the top right', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-input">
|
||||
<textarea class="textarea-full" name="settings_custom_css_admin"><?php echo esc_html(wlcms_field_setting('settings_custom_css_admin')) ?></textarea>
|
||||
</div>
|
||||
<div class="wlcms-help"><?php _e('Override or add to any of the styles in the WordPress admin enter your own custom css here', 'white-label-cms') ?></div>
|
||||
</div>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Custom Stylesheet URL', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="settings_custom_css_url" value="<?php echo esc_url(wlcms_field_setting('settings_custom_css_url')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Create and upload a custom stylesheet with all style rules prefixed with .mceContentBody to your themes directory and enter the filename', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
$meta_boxes = array(
|
||||
'custom_fields' => 'Custom Fields',
|
||||
'author' => 'Author',
|
||||
'discussion' => 'Discussion',
|
||||
'revisions' => 'Revisions',
|
||||
'page_attributes' => 'Page Attributes',
|
||||
'slug' => 'Slug'
|
||||
);
|
||||
?>
|
||||
<div class="wlcms-input-group">
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($meta_boxes as $box_key => $box_value) {
|
||||
?>
|
||||
<li>
|
||||
<div class="wlcms-input">
|
||||
<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) ?>/>
|
||||
<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, 'white-label-cms') ?></label>
|
||||
</div>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
$meta_boxes = array(
|
||||
'excerpt' => 'Excerpt',
|
||||
'slug' => 'Slug',
|
||||
'tags' => 'Tags',
|
||||
'author' => 'Author',
|
||||
'comments' => 'Comments',
|
||||
'revisions' => 'Revisions',
|
||||
'discussion' => 'Discussion',
|
||||
'categories' => 'Categories',
|
||||
'custom_fields' => 'Custom Fields',
|
||||
'send_trackbacks' => 'Send Trackbacks'
|
||||
);
|
||||
?>
|
||||
<div class="wlcms-input-group">
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($meta_boxes as $box_key => $box_value) {
|
||||
?>
|
||||
<li>
|
||||
<div class="wlcms-input">
|
||||
<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) ?>/>
|
||||
<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, 'white-label-cms') ?></label>
|
||||
</div>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,9 @@
|
||||
<div class="wlcms-input-group">
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Nag Messages will be hidden to all User Roles up to and including Admins', 'white-label-cms') ?>
|
||||
</div>
|
||||
<div class="wlcms-input">
|
||||
<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"/>
|
||||
<label class="wlcms-toggle-btn" for="hide_nag_messages"></label><label class="toggle-label" for="hide_nag_messages"><?php _e('Nag Update Messages'); ?></label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,40 @@
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Admin Bar', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/settings-admin-bar-setting'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Admin Settings', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/settings-admin-settings'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Nag Messages', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/settings-nag-messages'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Custom CSS for Admin', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/settings-custom-css-for-admin'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Custom Editor Stylesheet', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<?php wlcms()->admin_view('parts/settings-custom-editor-stylesheet'); ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,58 @@
|
||||
<input type="hidden" name="hide_wordpress_logo_and_links" value="1" />
|
||||
<input type="hidden" name="hide_all_dashboard_panels" value="1" />
|
||||
<input type="hidden" name="hide_at_a_glance" value="1" />
|
||||
<input type="hidden" name="hide_activities" value="1" />
|
||||
<input type="hidden" name="hide_recent_comments" value="1" />
|
||||
<input type="hidden" name="hide_quick_press" value="1" />
|
||||
<input type="hidden" name="hide_news_and_events" value="1" />
|
||||
<input type="hidden" name="remove_empty_dash_panel" value="1" />
|
||||
<input type="hidden" name="hide_wp_version" value="1" />
|
||||
<input type="hidden" name="wlcms_wizzard" value="1" />
|
||||
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Developer Branding', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main wizard-step1">
|
||||
<p><?php _e('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.', 'white-label-cms') ?></p>
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Developer Name', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="wizard_developer_name" value="<?php echo esc_attr(wlcms_field_setting('developer_name')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('For use in footer and ALT text\'s.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Developer URL', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="url" name="wizard_developer_url" value="<?php echo esc_url(wlcms_field_setting('developer_url')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('For use in footer and admin bar.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Footer Text', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="footer_text" value="<?php echo esc_attr(wlcms_field_setting('footer_text')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('Text which will appear to the right of the Footer Image.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('RSS Feed', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="url" name="rss_feed_address" value="<?php echo esc_url(wlcms_field_setting('rss_feed_address')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('The RSS feed address. For example '. get_bloginfo('rss_url'), 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,34 @@
|
||||
<div class="wlcms-body-wrapper">
|
||||
<div class="wlcms-body-header">
|
||||
<h2><?php _e('Clients Branding', 'white-label-cms') ?></h2>
|
||||
</div>
|
||||
<div class="wlcms-body-main">
|
||||
<input type="hidden" name="form_section" value="wizard" />
|
||||
<!-- Start wlcms-body-main -->
|
||||
<div class="wlcms-input-group">
|
||||
<label><?php _e('Clients Business Name', 'white-label-cms') ?></label>
|
||||
<div class="wlcms-input">
|
||||
<input type="text" name="client_business_name" value="<?php echo esc_attr(wlcms_field_setting('client_business_name')) ?>" />
|
||||
</div>
|
||||
<div class="wlcms-help">
|
||||
<?php _e('For use in Admin Page Title and Dashboard Title.', 'white-label-cms') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field('Login Logo', 'login_logo', 'Replace the WordPress logo on the login page. Max width 320px') ?>
|
||||
</div>
|
||||
<div class="wlcms-input-group toggle-group">
|
||||
<div class="wlcms-input">
|
||||
<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"/>
|
||||
<label class="wlcms-toggle-btn" for="add_retina_logo"></label><label class="toggle-label" for="add_retina_logo"><?php _e('Retina Login Logo', 'white-label-cms') ?></label>
|
||||
</div>
|
||||
<div class="sub-fields">
|
||||
<div class="wlcms-input-group">
|
||||
<?php echo wlcms_form_upload_field(__('Upload Login Logo', 'white-label-cms'), 'retina_login_logo', __('Replace the Retina WordPress logo on the login page. Please make sure you use the standard retina format of x2', 'white-label-cms')) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End wlcms-body-main -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
$views = array(
|
||||
"branding" => __('Branding'),
|
||||
"login" => __('Login'),
|
||||
"dashboard" => __('Dashboard'),
|
||||
"menus" => __('Menus'),
|
||||
"settings" => __('Settings')
|
||||
);
|
||||
$wlcms_anonce = wp_create_nonce( 'wlcms-action-nonce' );
|
||||
?>
|
||||
<div class="wlcms_wrapper">
|
||||
<div class="wlcms_messages">
|
||||
<?php do_action("wlcms_messages");?>
|
||||
<span></span>
|
||||
</div>
|
||||
<form method="post" enctype="multipart/form-data" class="wlcms-form" action="<?php echo wlcms()->admin_url(); ?>" >
|
||||
<?php wp_nonce_field('wlcms-settings-action', 'wlcms-settings_nonce'); ?>
|
||||
<div class="wlcms_header">
|
||||
<h1 class="wlcms_page_title"><img src="<?php echo WLCMS_ASSETS_URL ?>images/wlcms-logo.png"><?php _e("White Label CMS", 'white-label-cms'); ?></h1>
|
||||
</div>
|
||||
<div class="wlcms-navigation navigation">
|
||||
<ul>
|
||||
<?php
|
||||
foreach($views as $slug => $view):
|
||||
?>
|
||||
<li>
|
||||
<a href="#tab-<?php echo $slug ?>" data-tab="tab-<?php echo $slug ?>" id="wlcms_tab-<?php echo $slug ?>"<?php $slug == 'branding' ? ' class="current"' : ''?>><?php _e($view, 'white-label-cms'); ?></a>
|
||||
</li>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
<?php do_action("wlcms_after_menu_tab"); ?>
|
||||
</ul>
|
||||
<span class="wlcms-pull-right">
|
||||
<input type="submit" value="<?php _e('Save', 'white-label-cms') ?>" class="button button-primary button-large" name="wlcms-settings" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="wlcms_content">
|
||||
<?php
|
||||
|
||||
do_action("wlcms_before_body");
|
||||
|
||||
foreach ($views as $slug => $view) :
|
||||
echo '<section class="tab-'. $slug .'" id="'. $slug .'">';
|
||||
wlcms()->admin_view( 'parts/' . $slug);
|
||||
echo '</section>';
|
||||
endforeach;
|
||||
|
||||
do_action("wlcms_after_body");
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
<?php wlcms()->admin_view( 'parts/advert');?>
|
||||
<div class="wlcms_footer">
|
||||
<?php do_action("wlcms_footer"); ?>
|
||||
<div class="wlcms-navigation">
|
||||
<ul>
|
||||
<li><a href="#tab-import-settings" data-tab="tab-import-settings" id="wlcms_tab_import-settings"><?php _e('Import Settings')?></a></li>
|
||||
<li><a href="<?php echo admin_url('options-general.php?page=wlcms-plugin.php&wlcms-action=export&_wlcms_anonce='. $wlcms_anonce) ?>" class="wlcms-ignore"><?php _e('Export Settings') ?></a></li>
|
||||
<li><a href="<?php echo admin_url('options-general.php?page=wlcms-plugin.php&wlcms-action=reset&_wlcms_anonce='. $wlcms_anonce) ?>" class="wlcms-ignore reset-confirm"><?php _e('Reset Plugin')?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
wp_enqueue_media();
|
||||
@@ -0,0 +1,44 @@
|
||||
<div class="wlcms_wrapper">
|
||||
<?php do_action("wlcms_messages"); ?>
|
||||
<form method="post" enctype="multipart/form-data" class="wlcms-form" action="<?php echo wlcms()->admin_url(); ?>" >
|
||||
<?php wp_nonce_field('wlcms-settings-action', 'wlcms-settings_nonce'); ?>
|
||||
<div class="wlcms_header">
|
||||
<h1 class="wlcms_page_title"><img src="<?php echo WLCMS_ASSETS_URL ?>images/wlcms-logo.png"><?php _e("White Label CMS", 'white-label-cms'); ?></h1>
|
||||
</div>
|
||||
<div class="navigation wizard-steps">
|
||||
<ul>
|
||||
<li id="wlcms_tab_step-1">
|
||||
<?php _e('Quick Setup Wizard: Step 1 of 2 - Developers Branding', 'white-label-cms')?>
|
||||
<span class="wlcms-pull-right">
|
||||
<a href="<?php echo wlcms()->admin_url() ?>" class="button button-large"><?php _e('Skip', 'white-label-cms')?></a>
|
||||
<input type="button" value="<?php _e('Next', 'white-label-cms') ?>" class="button button-primary button-large wlcms-next-step" name="wlcms-settings" />
|
||||
</span>
|
||||
</li>
|
||||
<li id="wlcms_tab_step-2" style="display:none"><?php _e('Quick Setup Wizard: Step 2 of 2 - Clients Branding', 'white-label-cms')?>
|
||||
<span class="wlcms-pull-right">
|
||||
<input type="button" value="<?php _e('Back to step 1', 'white-label-cms') ?>" class="button wlcms-prev-step button-large" name="wlcms-settings" />
|
||||
<input type="submit" value="<?php _e('Save', 'white-label-cms') ?>" class="button button-primary button-large" name="wlcms-settings" />
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="wlcms_content">
|
||||
<section id="tab-step-1" class="current">
|
||||
<?php
|
||||
wlcms()->admin_view('parts/wizard-step-1');
|
||||
?>
|
||||
</section>
|
||||
<section id="tab-step-2" style="display:none">
|
||||
<?php
|
||||
wlcms()->admin_view('parts/wizard-step-2');
|
||||
?>
|
||||
</section>
|
||||
|
||||
<div class="wizard-live-preview">
|
||||
<?php wlcms()->admin_view('parts/live-preview'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
wp_enqueue_media();
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die('Access denied.');
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: White Label CMS
|
||||
Plugin URI: https://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
|
||||
Description: A plugin that allows you to brand WordPress CMS as your own
|
||||
Version: 2.7.13
|
||||
Author: www.videousermanuals.com
|
||||
Author URI: https://www.videousermanuals.com/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
|
||||
Text Domain: white-label-cms
|
||||
Domain Path: /languages
|
||||
*/
|
||||
|
||||
|
||||
if (!defined('ABSPATH')) exit; // Exit if accessed directly
|
||||
|
||||
define('WLCMS_VERSION', '2.7.13');
|
||||
define("WLCMS_DIR", plugin_dir_path(__FILE__));
|
||||
define("WLCMS_ASSETS_URL", plugin_dir_url(__FILE__) . 'assets/');
|
||||
define("WLCMS_BASENAME", plugin_basename(__FILE__));
|
||||
define("WLCMS_ASSETS_DIR", WLCMS_DIR . 'assets/');
|
||||
define("WLCMS_SCREEN_ID", 'settings_page_wlcms-plugin');
|
||||
|
||||
|
||||
include_once(WLCMS_DIR . 'includes/classes/I18n.php');
|
||||
include_once(WLCMS_DIR . 'includes/classes/Loader.php');
|
||||
include_once(WLCMS_DIR . 'includes/Functions.php');
|
||||
|
||||
global $wlcms;
|
||||
|
||||
if (!function_exists('wlcms')) :
|
||||
function wlcms()
|
||||
{
|
||||
global $wlcms;
|
||||
|
||||
$wlcms = WLCMS_Loader::getInstance();
|
||||
|
||||
return $wlcms;
|
||||
}
|
||||
endif;
|
||||
|
||||
wlcms();
|
||||
Reference in New Issue
Block a user