first commit
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/**
|
||||
* The admin-specific functionality of the plugin.
|
||||
*
|
||||
* @link https://suprememodules.com/about-us/
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Dsm_Supreme_Modules_For_Divi
|
||||
* @subpackage Dsm_Supreme_Modules_For_Divi/admin
|
||||
*/
|
||||
|
||||
/**
|
||||
* The admin-specific functionality of the plugin.
|
||||
*
|
||||
* Defines the plugin name, version, and two examples hooks for how to
|
||||
* enqueue the admin-specific stylesheet and JavaScript.
|
||||
*
|
||||
* @package Dsm_Supreme_Modules_For_Divi
|
||||
* @subpackage Dsm_Supreme_Modules_For_Divi/admin
|
||||
* @author Supreme Modules <hello@divisupreme.com>
|
||||
*/
|
||||
class Dsm_Supreme_Modules_For_Divi_Admin {
|
||||
|
||||
/**
|
||||
* The ID of this plugin.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access private
|
||||
* @var string $plugin_name The ID of this plugin.
|
||||
*/
|
||||
private $plugin_name;
|
||||
|
||||
/**
|
||||
* The version of this plugin.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access private
|
||||
* @var string $version The current version of this plugin.
|
||||
*/
|
||||
private $version;
|
||||
|
||||
/**
|
||||
* Initialize the class and set its properties.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @param string $plugin_name The name of this plugin.
|
||||
* @param string $version The version of this plugin.
|
||||
*/
|
||||
public function __construct( $plugin_name, $version ) {
|
||||
|
||||
$this->plugin_name = $plugin_name;
|
||||
$this->version = $version;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the stylesheets for the admin area.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function enqueue_styles( $hook ) {
|
||||
|
||||
/**
|
||||
* This function is provided for demonstration purposes only.
|
||||
*
|
||||
* An instance of this class should be passed to the run() function
|
||||
* defined in Dsm_Supreme_Modules_Pro_For_Divi_Loader as all of the hooks are defined
|
||||
* in that particular class.
|
||||
*
|
||||
* The Dsm_Supreme_Modules_Pro_For_Divi_Loader will then create the relationship
|
||||
* between the defined hooks and the functions defined in this
|
||||
* class.
|
||||
*/
|
||||
if ( function_exists( 'et_builder_bfb_enabled' ) ) {
|
||||
if ( et_builder_bfb_enabled() ) {
|
||||
wp_enqueue_style( 'dsm-et-admin', plugin_dir_url( dirname( __FILE__ ) ) . 'public/css/dsm-et-admin.css', array(), $this->version, 'all' );
|
||||
}
|
||||
}
|
||||
if ( 'toplevel_page_divi_supreme_settings' === $hook ) {
|
||||
wp_enqueue_style( 'dsm-plugin', plugin_dir_url( __FILE__ ) . 'css/dsm-plugin.css', array(), $this->version, 'all' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the JavaScript for the admin area.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function enqueue_scripts() {
|
||||
|
||||
/**
|
||||
* This function is provided for demonstration purposes only.
|
||||
*
|
||||
* An instance of this class should be passed to the run() function
|
||||
* defined in Dsm_Supreme_Modules_For_Divi_Loader as all of the hooks are defined
|
||||
* in that particular class.
|
||||
*
|
||||
* The Dsm_Supreme_Modules_For_Divi_Loader will then create the relationship
|
||||
* between the defined hooks and the functions defined in this
|
||||
* class.
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
#toplevel_page_divi_supreme_settings .wp-menu-image img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
padding: 7px 0 0;
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
|
||||
.dsm-section-subtitle th {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.dsm-section-subtitle h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.dsm-settings-panel th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dsm-settings-panel .form-table {
|
||||
padding: 23px 15px;
|
||||
box-shadow: 0 5px 30px rgba(0,0,0,.1);
|
||||
border-radius: 3px;
|
||||
background: #fff;
|
||||
border-collapse: initial;
|
||||
}
|
||||
|
||||
.dsm-settings-panel h2 {
|
||||
padding: 9px 0 4px 0;
|
||||
font-size: 1.3em;
|
||||
display: none;
|
||||
}
|
||||
.dsm-settings-panel .postbox-container {
|
||||
margin-top: .5em;
|
||||
}
|
||||
|
||||
.dsm-settings-panel .postbox-container .postbox {
|
||||
box-shadow: 0 5px 30px rgba(0,0,0,.1);
|
||||
border-radius: 3px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dsm-settings-checkbox fieldset label {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 50px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.dsm-settings-checkbox input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.dsm-settings-checkbox .dsm-settings-slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #ccc;
|
||||
-webkit-transition: .4s;
|
||||
transition: .4s;
|
||||
}
|
||||
|
||||
.dsm-settings-checkbox .dsm-settings-slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
left: 4px;
|
||||
bottom: 4px;
|
||||
background-color: white;
|
||||
-webkit-transition: .4s;
|
||||
transition: .4s;
|
||||
}
|
||||
|
||||
.dsm-settings-checkbox input:checked+.dsm-settings-slider {
|
||||
background-color: #6b09eb;
|
||||
}
|
||||
|
||||
.dsm-settings-checkbox input:focus+.dsm-settings-slider {
|
||||
box-shadow: 0 0 1px #6b09eb;
|
||||
}
|
||||
|
||||
.dsm-settings-checkbox input:checked+.dsm-settings-slider:before {
|
||||
-webkit-transform: translateX(26px);
|
||||
-ms-transform: translateX(26px);
|
||||
transform: translateX(26px);
|
||||
}
|
||||
|
||||
|
||||
.dsm-settings-checkbox .dsm-settings-round {
|
||||
border-radius: 24px;
|
||||
}
|
||||
|
||||
.dsm-settings-checkbox .dsm-settings-round:before {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.dsm-settings-panel .setting_subheading {
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 0 0 1em 0;
|
||||
}
|
||||
.dsm-settings-panel .setting_subheading_title {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
.dsm-settings-panel p.submit .button-primary {
|
||||
color: #fff;
|
||||
border-color: #25db92;
|
||||
border-radius: 50px;
|
||||
font-size: 14px;
|
||||
background: #25db92;
|
||||
text-shadow: none;
|
||||
padding: 15px 30px;
|
||||
line-height: 1;
|
||||
box-shadow: none;
|
||||
box-shadow: 0px 12px 18px -6px rgba(0, 0, 0, 0.19);
|
||||
font-weight: 700;
|
||||
height: initial;
|
||||
transition: color 300ms ease 0ms, color 300ms ease 0ms, background-color 300ms ease 0ms, background-color 300ms ease 0ms, border 300ms ease 0ms, border 300ms ease 0ms, border-radius 300ms ease 0ms, border-radius 300ms ease 0ms;
|
||||
}
|
||||
|
||||
.dsm-settings-panel p.submit .button-primary:hover,
|
||||
.dsm-settings-panel p.submit .button-primary:focus {
|
||||
background: #fff;
|
||||
color: #30323d;
|
||||
border-color: #fff;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
#dsm_header_footer_meta_box .dsm-header-footer-meta-box.dsm_top_header .dsm-remove-default-footer-meta-box-options,
|
||||
#dsm_header_footer_meta_box .dsm-header-footer-meta-box.dsm_404 .dsm-remove-default-footer-meta-box-options,
|
||||
#dsm_header_footer_meta_box .dsm-header-footer-meta-box.dsm_404 .dsm-conditional-meta-box-options,
|
||||
#dsm_header_footer_meta_box .dsm-header-footer-meta-box.dsm_404 .dsm-css-classes-meta-box-options,
|
||||
#dsm_header_footer_meta_box .dsm-header-footer-meta-box.dsm_404 .dsm-footer-show-on-blank-template-meta-box-options,
|
||||
#dsm_header_footer_meta_box .dsm-header-footer-meta-box.dsm_404 .dsm-footer-show-on-404-template-meta-box-options,
|
||||
#dsm_header_footer_meta_box .dsm-header-footer-meta-box.dsm_search_no_result .dsm-remove-default-footer-meta-box-options,
|
||||
#dsm_header_footer_meta_box .dsm-header-footer-meta-box.dsm_search_no_result .dsm-conditional-meta-box-options,
|
||||
#dsm_header_footer_meta_box .dsm-header-footer-meta-box.dsm_search_no_result .dsm-css-classes-meta-box-options,
|
||||
#dsm_header_footer_meta_box .dsm-header-footer-meta-box.dsm_search_no_result .dsm-footer-show-on-blank-template-meta-box-options,
|
||||
#dsm_header_footer_meta_box .dsm-header-footer-meta-box.dsm_search_no_result .dsm-footer-show-on-404-template-meta-box-options
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
#dsm_header_footer_meta_box p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<?php // Silence is golden
|
||||
@@ -0,0 +1,19 @@
|
||||
(function($) {
|
||||
$(
|
||||
function() {
|
||||
$('select[name="dsm-header-footer-meta-box-options"]').change(function() {
|
||||
if ($('select[name="dsm-header-footer-meta-box-options"]').val() == '404' || $('select[name="dsm-header-footer-meta-box-options"]').val() == 'search_no_result') {
|
||||
$('.dsm-conditional-meta-box-options, .dsm-css-classes-meta-box-options, .dsm-footer-show-on-blank-template-meta-box-options, .dsm-footer-show-on-404-template-meta-box-options').css("display", "none");
|
||||
} else {
|
||||
$('.dsm-conditional-meta-box-options, .dsm-css-classes-meta-box-options, .dsm-footer-show-on-blank-template-meta-box-options, .dsm-footer-show-on-404-template-meta-box-options').css("display", "block");
|
||||
}
|
||||
if ($('select[name="dsm-header-footer-meta-box-options"]').val() == 'top_header' || $('select[name="dsm-header-footer-meta-box-options"]').val() == '404' || $('select[name="dsm-header-footer-meta-box-options"]').val() == 'search_no_result') {
|
||||
$('.dsm-remove-default-footer-meta-box-options, .dsm-footer-show-on-blank-template-meta-box-options, .dsm-footer-show-on-404-template-meta-box-options').css("display", "none");
|
||||
} else {
|
||||
$('.dsm-remove-default-footer-meta-box-options, .dsm-footer-show-on-blank-template-meta-box-options, .dsm-footer-show-on-404-template-meta-box-options').css("display", "block");
|
||||
}
|
||||
});
|
||||
}
|
||||
)
|
||||
|
||||
}(jQuery));
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Provide a admin area view for the plugin
|
||||
*
|
||||
* This file is used to markup the admin-facing aspects of the plugin.
|
||||
*
|
||||
* @link https://suprememodules.com/about-us/
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Dsm_Supreme_Modules_For_Divi
|
||||
* @subpackage Dsm_Supreme_Modules_For_Divi/admin/partials
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
|
||||
Reference in New Issue
Block a user