This commit is contained in:
2026-04-26 23:47:49 +02:00
parent 1b95f03d1e
commit b073e009d8
5288 changed files with 1112699 additions and 55536 deletions

View File

@@ -0,0 +1,274 @@
<?php
/**
* @version 1.0
* @package oPlugins
* @category Installation
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-04-09, 2016-03-17
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Activation | Deactivation Class
*/
abstract class OPSD_Install {
private $init_option;
function __construct() {
$default_init_option_names = array(
'option-version_num' => 'securedownloads_version_num'
, 'option-is_delete_if_deactive' => 'securedownloads_is_delete_if_deactive'
, 'option-activation_process' => 'securedownloads_activation_process'
, 'transient-opsd_activation_redirect' => '_securedownloads_activation_redirect'
, 'message-delete_data' => '<strong>Warning!</strong> ' . 'All plugin data will be deleted when plugin had deactivated.' . '<br />'
. sprintf( 'If you want to save your plugin data, please uncheck the %s"Delete plugin data"%s at the', '<strong>', '</strong>')
, 'link_settings' => '<a href="">Settings</a>'
, 'link_whats_new' => '<a href="">Whats New</a>'
);
$init_option = $this->get_init_option_names();
$this->init_option = wp_parse_args( $init_option, $default_init_option_names );
register_activation_hook( OPSD_FILE, array( $this, 'opsd_activate_initial' ) ); // WordPress > Plugins > "Activate" link.
register_deactivation_hook( OPSD_FILE, array( $this, 'opsd_deactivate' ) ); // WordPress > Plugins > "Deactivate" link.
add_filter('upgrader_post_install', array( $this, 'opsd_install_in_bulk_upgrade' ), 10, 2 ); // Upgrade during bulk upgrade of plugins
// Settings link at the plugin page
add_filter('plugin_action_links', array( $this, 'plugin_links'), 10, 2 );
// Warning message in plugin info
add_filter('plugin_row_meta', array( $this, 'plugin_row_meta'), 10, 4 );
$this->check_if_need_to_update(); // Check upgrade, if was no activation process
}
/** Must be overloaded in child CLASS
* Exmaple:
* return array(
'option-version_num' => 'securedownloads_version_num'
, 'option-is_delete_if_deactive' => 'securedownloads_is_delete_if_deactive'
, 'option-activation_process' => 'securedownloads_activation_process'
, 'transient-opsd_activation_redirect' => '_securedownloads_activation_redirect'
, 'message-delete_data' => '<strong>Warning !!!</strong> ' . 'All plugin data will be deleted when plugin had deactivated.' . '<br />'
. sprintf( 'If you want to save your plugin data, please uncheck the %s"Delete plugin data"%s at the settings page.', '<strong>', '</strong>')
, 'link_settings' => '<a href="">Settings</a>'
, 'link_whats_new' => '<a href="">Whats New</a>'
);
*/
abstract function get_init_option_names();
/** Must be overloaded in child CLASS
* Exmaple:
*
return false
*/
abstract function is_update_from_lower_to_high_version();
////////////////////////////////////////////////////////////////////////////
// <editor-fold defaultstate="collapsed" desc=" Update info of plugin at the plugins section ">
/** Update info of plugin at the plugins section */
function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $context ) {
$this_plugin = plugin_basename( OPSD_FILE );
if ($plugin_file == $this_plugin ) {
$is_delete_if_deactive = get_opsd_option( $this->init_option['option-is_delete_if_deactive'] ); // check
if ($is_delete_if_deactive == 'On') { ?>
<div class="plugin-update-tr">
<div class="update-message notice inline notice-warning notice-altNO" style="font-size: 1em;line-height: 2em;margin:0 5px 10px;"><?php echo $this->init_option['message-delete_data']; ?></div>
</div>
<?php
}
/*
[$plugin_meta] => Array
(
[0] => Version 2.8.35
[1] => By wpdevelop
[2] => Visit plugin site
)
[$plugin_file] => securedownloads/OPSD.php
[$plugin_data] => Array
(
[Name] => pluginname
[PluginURI] => https://oplugins.com/plugins/secure-downloads/#demo
[Version] => 2.8.35
[Description] => Some description...
[Author] => wpdevelop
[AuthorURI] => https://oplugins.com/
[TextDomain] =>
[DomainPath] =>
[Network] =>
[Title] => Title
[AuthorName] => wpdevelop
)
[$context] => all
/**/
// Echo plugin description here
return $plugin_meta;
} else
return $plugin_meta;
}
// Adds Settings link to plugins settings
function plugin_links($links, $file) {
$this_plugin = plugin_basename( OPSD_FILE );
if ( $file == $this_plugin ) {
if ( ! empty( $this->init_option[ 'link_settings' ] ) )
array_unshift( $links, $this->init_option[ 'link_settings' ] );
if ( ! empty( $this->init_option[ 'link_whats_new' ] ) )
array_unshift( $links, $this->init_option[ 'link_whats_new' ] );
}
return $links;
}
// </editor-fold>
////////////////////////////////////////////////////////////////////////////
// Check about ability to upgrade, if was no activation process
private function check_if_need_to_update() {
if( is_admin() ) {
$opsd_version_num = get_option( $this->init_option['option-version_num'] );
if ($opsd_version_num === false )
$opsd_version_num = '0';
$is_make_activation = false;
if ( version_compare( OPSD_VERSION_NUM, $opsd_version_num) > 0 ) {
$is_make_activation = true;
} else {
// Check if we was update from free to paid or from lower to higher versions,
// and do not make normal activation. In this case we need to make update.
$is_make_activation = $this->is_update_from_lower_to_high_version();
}
// Add hook for initial activation.
if ( $is_make_activation ) {
add_action( 'plugins_loaded', array( $this, 'opsd_activate_initial' ) );
}
}
}
/** Upgrade during bulk upgrade of plugins
*
* @param type $return
* @param type $hook_extra
* @return type
*/
public function opsd_install_in_bulk_upgrade( $return, $hook_extra ){
if ( is_wp_error( $return ) )
return $return;
if ( isset( $hook_extra ) )
if ( isset( $hook_extra['plugin'] ) ) {
$file_name = basename( OPSD_FILE );
$pos = strpos( $hook_extra['plugin'], trim( $file_name ) );
if ( $pos !== false ) {
$this->opsd_activate();
}
}
return $return;
}
/** User clicked on "Activate" link at Plugins Menu.
*
* @return type
*/
public function opsd_activate_initial(){
// Activate the plugin
$this->opsd_activate();
// Bail if this demo or activating from network, or bulk
if ( is_network_admin() || isset( $_GET['activate-multi'] ) || opsd_is_this_demo() )
return;
// Add the transient to redirect - Showing Welcome screen
set_transient( $this->init_option['transient-opsd_activation_redirect'], true, 30 );
}
////////////////////////////////////////////////////////////////////////////
/** Run Activate */
public function opsd_activate() {
if ( ( function_exists( 'set_time_limit' ) ) && // Try to extend script running to 15 minutes
( ! in_array( ini_get( 'safe_mode' ), array( '1', 'On' ) ) ) // It's doesn't work, if PHP have SAFE MODE ON
) set_time_limit( 900 );
ini_set('memory_limit','256M'); //FixIn:6.1.1.15
update_opsd_option( $this->init_option['option-activation_process'], 'On' );
make_opsd_action( 'opsd_activation' ); // S T A R T
update_opsd_option( $this->init_option['option-version_num'], OPSD_VERSION_NUM );
update_opsd_option( $this->init_option['option-activation_process'], 'Off');
}
/** Run Deactivate */
public function opsd_deactivate() {
if ( ( function_exists( 'set_time_limit' ) ) && // Try to extend script running to 15 minutes
( ! in_array( ini_get( 'safe_mode' ), array( '1', 'On' ) ) ) // It's doesn't work, if PHP have SAFE MODE ON
) set_time_limit( 900 );
$is_delete_if_deactive = get_opsd_option( $this->init_option['option-is_delete_if_deactive'] ); // check
if ( $is_delete_if_deactive == 'On' ) {
make_opsd_action( 'opsd_deactivation' ); // F I N I S H
delete_opsd_option( $this->init_option['option-version_num'] );
delete_opsd_option( $this->init_option['option-activation_process'] );
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,534 @@
<?php
/**
* @version 1.1
* @package General Emails API
* @category General Emails API Fields for Settings page and Functions for Sending emails.
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
* @modified 2016-05-12, 2015-10-06
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
// Email Settings API - Saving different options
abstract class OPSD_Emails_API extends OPSD_Settings_API {
public $sending;
public $replace = array();
/** Email Settings API Constructor
* During creation, system try to load values from DB, if exist.
*
* @param type $id - "Pure Email Template name
*/
public function __construct( $id, $init_fields_values = array()) {
$options = array(
'db_prefix_option' => 'opsd_email_'
, 'db_saving_type' => 'togather' // { 'togather' (Default), 'separate', 'separate_prefix' }
);
// Email template saved as:
// ( "prefix_email_" . $id ) >>> "prefix_email_new_admin"
parent::__construct( $id, $options, $init_fields_values ); // Define ID of Setting page and options
add_filter( 'phpmailer_init', array( $this, 'process_multipart' ) ); // For multipart messages
add_action( 'wp_mail_failed', array($this, 'email_error_parse') ); // Parse any errors during sending emails.
}
/** This function must be overriden - Initialise Settings Form Fields
public function init_settings_fields() {
$this->fields = array();
$this->fields['enabled'] = array(
'type' => 'checkbox'
, 'default' => 'On'
, 'title' => __('Enable / Disable', 'secure-downloads')
, 'label' => __('Enable this email notification', 'secure-downloads')
, 'description' => ''
, 'group' => 'general'
);
// ...
}
/**/
// <editor-fold defaultstate="collapsed" desc=" Suport functions " >
/** List of preg* regular expression patterns to search for replace in plain emails.
* More: https://raw.github.com/ushahidi/wp-silcc/master/class.html2text.inc
*/
private function get_plain_search_array() {
return array(
"/\r/", // Non-legal carriage return
'/&(nbsp|#160);/i', // Non-breaking space
'/&(quot|rdquo|ldquo|#8220|#8221|#147|#148);/i', // Double quotes
'/&(apos|rsquo|lsquo|#8216|#8217);/i', // Single quotes
'/&gt;/i', // Greater-than
'/&lt;/i', // Less-than
'/&#38;/i', // Ampersand
'/&#038;/i', // Ampersand
'/&amp;/i', // Ampersand
'/&(copy|#169);/i', // Copyright
'/&(trade|#8482|#153);/i', // Trademark
'/&(reg|#174);/i', // Registered
'/&(mdash|#151|#8212);/i', // mdash
'/&(ndash|minus|#8211|#8722);/i', // ndash
'/&(bull|#149|#8226);/i', // Bullet
'/&(pound|#163);/i', // Pound sign
'/&(euro|#8364);/i', // Euro sign
'/&#36;/', // Dollar sign
'/&[^&;]+;/i', // Unknown/unhandled entities
'/[ ]{2,}/' // Runs of spaces, post-handling
);
}
/** List of symbols "for Replace To" */
private function get_plain_replace_array() {
return array(
'', // Non-legal carriage return
' ', // Non-breaking space
'"', // Double quotes
"'", // Single quotes
'>', // Greater-than
'<', // Less-than
'&', // Ampersand
'&', // Ampersand
'&', // Ampersand
'(c)', // Copyright
'(tm)', // Trademark
'(R)', // Registered
'--', // mdash
'-', // ndash
'*', // Bullet
'£', // Pound sign
'EUR', // Euro sign. € ?
'$', // Dollar sign
'', // Unknown/unhandled entities
' ' // Runs of spaces, post-handling
);
}
/** Esacpe and replace any HTML entities
*
* @param type $string
* @return string
*/
public function esc_to_plain_text( $string ) {
// //Replace <a href="http://server.com">Link</a> to Link( http://server.com )
// $pattern = "/<a(.*)+href=[\"|']+([^\"']+)(?=(\"|'))[^>]*>(.*)<\/a>/" ; //"/(?<=href=(\"|'))[^\"']+(?=(\"|'))/i";
// $newurl = "$4 ($2)";
// $string = preg_replace($pattern,$newurl,$string);
$newstring = preg_replace( $this->get_plain_search_array(), $this->get_plain_replace_array(), strip_tags( $string ) );
return $newstring;
}
/** Set array for replacing shortcodes in Email Content and Subject
*
* @param array $replace - if this parameter skipped, then array reseted to empty array
*/
function set_replace( $replace = array() ) {
$this->replace = $replace;
}
/** Replace shortcodes in givven string. Usually its Email Content and Subject
*
* @param string $subject
*/
public function replace_shortcodes( $subject ) {
$defaults = array(
'ip' => apply_opsd_filter( 'opsd_get_user_ip' )
, 'blogname' => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )
, 'siteurl' => get_site_url()
);
$replace = wp_parse_args( $this->replace, $defaults );
foreach ( $replace as $replace_shortcode => $replace_value ) {
if ( is_string( $replace_value ) ) { //FixIn: 1.1.3.1
$replace_shortcode = (string) $replace_shortcode;
$replace_value = (string) $replace_value;
$subject = str_replace( array( '[' . $replace_shortcode . ']'
, '{' . $replace_shortcode . '}' )
, $replace_value
, $subject );
}
}
return $subject;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc=" Pure Email functions " >
/** For MultiPart email define plain text - AltBody
*
* Also additionaly fix Sender - its have to be same as From
*
* @param PHPMailer $mailer
* @return PHPMailer
*/
public function process_multipart( $mailer ) {
//if ( $this->sending && $this->get_email_content_type() == 'multipart' ) {
if ( $this->sending ) {
if ( $this->get_email_content_type() == 'multipart' )
$mailer->AltBody = wordwrap( $this->esc_to_plain_text( $this->replace_shortcodes( $this->get_content_plain() ) ) );
$mailer->Sender = $mailer->From;
//$this->sending = false; // If we set it to false, then we can not trigger for any Mail errors in this CLASS
}
return $mailer;
}
/** Get type of Email: 'plain' | 'html' | 'multipart'
*
* @return string
*/
public function get_email_content_type() {
return $this->fields_values['email_content_type'] && class_exists( 'DOMDocument' ) ? $this->fields_values['email_content_type'] : 'plain';
}
/** Get Email Content Type: 'text/plain' | 'text/html' | 'multipart/alternative'
*
* @return string
*/
public function get_content_type() {
switch ( $this->get_email_content_type() ) {
case 'html' :
return 'text/html';
case 'multipart' :
return 'multipart/alternative';
default :
return 'text/plain';
}
}
/** Define Email Headers. For exmaple: "Conte type:" 'text/plain' | 'text/html' | 'multipart/alternative' or "From": Name <email@server.com>
*
* @return string
*/
public function get_headers( $additional_params = array() ) {
$mail_headers = '';
$from_address = $this->get_from__email_address();
if ( ! empty( $from_address ) ) {
$mail_headers .= 'From: ' . $this->get_from__name() . ' <' . $from_address . '> ' . "\r\n" ;
} else {
/* If we don't have an email from the input headers default to wordpress@$sitename
* Some hosts will block outgoing mail from this address if it doesn't exist but
* there's no easy alternative. Defaulting to admin_email might appear to be another
* option but some hosts may refuse to relay mail from an unknown domain. See
* https://core.trac.wordpress.org/ticket/5007.
*/
}
$mail_headers .= 'Content-Type: ' . $this->get_content_type() . "\r\n" ;
$mail_headers = apply_filters( 'opsd_email_api_get_headers_after', $mail_headers, $this->id, $this->fields_values , $this->replace, $additional_params );
return $mail_headers;
}
/** Get Content of Email
*
* @return string
*/
public function get_content() {
if ( $this->get_email_content_type() == 'plain' ) {
$email_content = $this->esc_to_plain_text( $this->replace_shortcodes( $this->get_content_plain() ) );
} else {
$email_content = $this->replace_shortcodes( $this->get_content_html() );
}
$email_content = apply_filters( 'opsd_email_api_get_content_after' , $email_content, $this->id, $this->get_email_content_type() );
// Remove all shortcodes, which is not replaced early.
$email_content = preg_replace ('/[\[\{][a-zA-Z0-9.,_-]{0,}[\]\}]/', '', $email_content);
return wordwrap( $email_content, 100 );
}
/** Get Email Content as Text (from Plain Text template)
*
* @return string
*/
function get_content_plain() {
//require_once( dirname(__FILE__) . '/emails_tpl/standard-text-tpl.php' );
//require_once( dirname(__FILE__) . '/emails_tpl/plain-text-tpl.php' );
if ( isset( $this->fields_values['template_file'] ) ) {
$email_tpl_name = $this->fields_values['template_file'];
} else {
$email_tpl_name = 'plain';
}
if ( file_exists( dirname(__FILE__) . '/emails_tpl/'. $email_tpl_name .'-text-tpl.php' ) )
require_once( dirname(__FILE__) . '/emails_tpl/'. $email_tpl_name .'-text-tpl.php' );
else
require_once( dirname(__FILE__) . '/emails_tpl/plain-text-tpl.php' );
$fields_values = $this->fields_values;
$fields_values = apply_filters( 'opsd_email_api_get_content_before' , $fields_values, $this->id , 'plain' ); //Ability to parse 'content', 'header_content', 'footer_content' for different languges, etc ....
if ( function_exists( 'opsd_email_template_' . $email_tpl_name . '_text' ) )
$plain_email = call_user_func_array( 'opsd_email_template_' . $email_tpl_name . '_text' , array( $fields_values ) );
else
$plain_email = opsd_email_template_text( $fields_values );
// Replace <p> | <br> to \n
$plain_email = preg_replace( '/<(br|p)[\t\s]*[\/]?>/i', "\n", $plain_email );
// $plain_email = str_replace( array('<br/>', '<br>'), "\n", $plain_email );
return $plain_email;
}
/** Get Email Content as HTML (from HTML template)
*
* @return type
*/
function get_content_html() {
// Load specific Email Template: ///////////////////////////////////
if ( isset( $this->fields_values['template_file'] ) ) {
$email_tpl_name = $this->fields_values['template_file'];
} else {
$email_tpl_name = 'plain';
}
//require_once( dirname(__FILE__) . '/emails_tpl/standard-html-tpl.php' );
//require_once( dirname(__FILE__) . '/emails_tpl/plain-html-tpl.php' );
if ( file_exists( dirname(__FILE__) . '/emails_tpl/'. $email_tpl_name .'-html-tpl.php' ) )
require_once( dirname(__FILE__) . '/emails_tpl/'. $email_tpl_name .'-html-tpl.php' );
else
require_once( dirname(__FILE__) . '/emails_tpl/plain-html-tpl.php' );
////////////////////////////////////////////////////////////////////
$fields_values = $this->fields_values;
$fields_values = apply_filters( 'opsd_email_api_get_content_before' , $fields_values, $this->id , 'html' ); //Ability to parse 'content', 'header_content', 'footer_content' for different languges, etc ....
if ( function_exists( 'opsd_email_template_' . $email_tpl_name . '_html' ) )
$html_email = call_user_func_array( 'opsd_email_template_' . $email_tpl_name . '_html' , array( $fields_values ) );
else
$html_email = opsd_email_template_html( $fields_values );
return $html_email;
}
/** Get escaped Email Subject
*
* @return string
*/
public function get_subject() {
$subject = $this->fields_values['subject'];
$subject = apply_filters( 'opsd_email_api_get_subject_before' , $subject, $this->id );
$subject = $this->esc_to_plain_text( $this->replace_shortcodes( $subject ) );
$subject = apply_filters( 'opsd_email_api_get_subject_after' , $subject, $this->id );
return $subject;
}
/** Get escapeed Name from any not supporting characters
*
* @return string
*/
public function get_from__name() {
return wp_specialchars_decode( esc_html( stripslashes( $this->fields_values['from_name'] ) ), ENT_QUOTES );
}
/** Get sanitized Email address
*
* @return type
*/
public function get_from__email_address() {
return sanitize_email( $this->fields_values['from'] );
}
/** For future support, right now does not support
*
* @return empty string
*/
public function get_attachments() {
return '';
}
/** Check email and format it
*
* @param string $emails
* @return string
*/
public function validate_emails( $emails ) {
$emails = str_replace(';', ',', $emails);
if ( !is_array( $emails ) )
$emails = explode( ',', $emails );
$emails_list = array();
foreach ( (array) $emails as $recipient ) {
// Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
$recipient_name = '';
if( preg_match( '/(.*)<(.+)>/', $recipient, $matches ) ) {
if ( count( $matches ) == 3 ) {
$recipient_name = $matches[1];
$recipient = $matches[2];
}
} else {
// Check about correct format of email
if( preg_match( '/([\w\.\-_]+)?\w+@[\w\-_]+(\.\w+){1,}/im', $recipient, $matches ) ) { //FixIn: 8.7.7.2
$recipient = $matches[0];
}
}
//$recipient_name = str_replace('"', '', $recipient_name);
$recipient_name = trim( wp_specialchars_decode( esc_html( stripslashes( $recipient_name ) ), ENT_QUOTES ) );
$emails_list[] = ( empty( $recipient_name ) ? '' : $recipient_name . ' ' )
. '<' . sanitize_email( $recipient ) . '>';
}
$emails_list = implode( ',', $emails_list );
return $emails_list;
}
/**
* Make Email Sending by using wp_mail standard function.
*
* @param string $to - Email
* @param array $replace - accociated array of values to replace in email Body and Subject. Exmaple: array( 'name' => 'Jo', 'secondname' => 'Smith' )
* @return boolean Sent or Failed to send.
*/
public function send( $to = '', $replace = array() ) {
$return = false;
// if ( empty( $to ) )
// return $return;
$this->sending = true;
$this->set_replace( $replace );
$to = $this->validate_emails( $to );
$subject = $this->get_subject();
$message = $this->get_content();
$headers = $this->get_headers();
$attachments = $this->get_attachments();
//debuge('In email', htmlentities($to), $subject, htmlentities($message), $headers, $attachments) ;
$is_send_email = true;
$is_send_email = apply_filters( 'opsd_email_api_is_allow_send', $is_send_email, $this->id, $this->fields_values );
if ( $is_send_email )
$return = wp_mail( $to, $subject, $message, $headers, $attachments );
$this->sending = false;
// Send Copy to admin email
if (
( isset( $this->fields_values['copy_to_admin'] ) )
&& ( $this->fields_values['copy_to_admin'] == 'On' )
){
$this->sending = true;
$subject = __('Email copy to', 'secure-downloads') . ' ' . str_replace( array( '<', '>' ), '', $to) . ' - ' . $subject;
$headers = $this->get_headers( array( 'reply' => $to ) );
$to = $this->validate_emails( $this->get_from__name() . ' <' . $this->get_from__email_address() . '> ' );
$is_send_email = apply_filters( 'opsd_email_api_is_allow_send_copy', $is_send_email, $this->id, $this->fields_values );
if ( $is_send_email )
$return_copy = wp_mail( $to, $subject, $message, $headers, $attachments );
$this->sending = false;
}
$this->set_replace(); // Reset replace parameter
return $return;
}
// </editor-fold>
/** Show possible erros during sending emails.
*
* @param type $wp_error_object - new WP_Error( $e->getCode(), $e->getMessage(), $mail_error_data )
*/
public function email_error_parse( $wp_error_object ) {
//debuge( $wp_error_object );
if ( $this->sending ) { // Check if this error generated for email relative to this class.
$error_description_array = array();
if ( isset( $wp_error_object->errors ) )
foreach ( $wp_error_object->errors as $key_error => $error_description ) {
$error_description_array[] = implode(' ', $error_description );
}
if ( ! empty( $error_description_array ) ) {
$error_description = implode(' ', $error_description_array ) ;
do_action('opsd_email_sending_error', $wp_error_object, $error_description );
} else {
do_action('opsd_email_sending_error', $wp_error_object, '' );
}
}
}
}

View File

@@ -0,0 +1,259 @@
<?php /**
* @version 1.1
* @package Any
* @category Menu in Admin Panel
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-11-02
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class OPSD_Admin_Menus {
/* Static Variables */
static $capability = array( 'administrator' => 'activate_plugins',
'editor' => 'publish_pages',
'author' => 'publish_posts',
'contributor' => 'edit_posts',
'subscriber' => 'read'
);
protected $menu_tag;
protected $menu_title;
protected $menu_title_second; // For root menu chnage second title in submenu - little hack
protected $page_header; // Header - H2, in page content
protected $browser_header; // Browser Header Title
protected $in_menu;
protected $user_role; // Acceess Role for current menu item
protected $mune_icon_url; // Icon - if used 'none', then you can define it in the CSS backgound: .toplevel_page_opsd .wp-menu-image { background-image: url("../img/icon-16x16.png"); background-position: 7px 7px; } But its mean that you are need to load this CSS in every admin page.
public $root_position; /* Positions for Core Menu Items
2 Dashboard
4 Separator
5 Posts
10 Media
15 Links
20 Pages
25 Comments
59 Separator
60 Appearance
65 Plugins
70 Users
75 Tools
80 Settings
99 Separator
*/
function __construct( $slug, $param = array() ) {
$this->in_menu = false;
$this->menu_tag = $slug; // For exmaple: 'opsd-settings' - its 'page' parameter in URL
if ( isset( $param['menu_title'] ) ) $this->menu_title = $param['menu_title'];
if ( isset( $param['menu_title_second'] ) ) $this->menu_title_second = $param['menu_title_second'];
if ( isset( $param['page_header'] ) ) $this->page_header = $param['page_header'];
if ( isset( $param['browser_header'] ) ) $this->browser_header = $param['browser_header'];
if ( isset( $param['in_menu'] ) ) $this->in_menu = $param['in_menu'];
if ( isset( $param['position'] ) ) $this->root_position = $param['position'];
else $this->root_position = null;
if ( isset( $param['mune_icon_url'] ) ) $this->mune_icon_url = $param['mune_icon_url'];
else $this->mune_icon_url = 'none';
if ( isset( $param['user_role'] ) ) $this->user_role = $param['user_role'];
else $this->user_role = 'subscriber';
add_action( 'admin_menu', array($this, 'new_admin_page'), 10 );
add_action( 'admin_menu', array($this, 'change_second_root_menu_title'), 11 ); // Change Title of Submenu title for root menu item
}
public function load_js() {
do_action( 'opsd_load_js_on_admin_page' );
}
public function load_css() {
do_action( 'opsd_load_css_on_admin_page' );
}
/** Define Plugin Menu Page
*
*/
public function new_admin_page(){
if ( $this->in_menu == 'root' ) { // Main Menu
$page = $this->create_plugin_menu(
$this->browser_header // Browser Page Header Title
, $this->menu_title // Menu Title
, ( ( isset( self::$capability[ $this->user_role ] ) ) ? self::$capability[ $this->user_role ] : self::$capability[ 'subscriber' ] ) // Capabilities
, $this->menu_tag // Slug // I was used early -> plugin_basename(OPSD_FILE).'opsd'
, $this->mune_icon_url // Icon // - if used 'none', then you can define it in the CSS backgound: .toplevel_page_opsd .wp-menu-image { background-image: url("../img/icon-16x16.png"); background-position: 7px 7px; } But its mean that you are need to load this CSS in every admin page.
, array( $this, 'content' ) // Function for output content of page
);
} else { // Sub Menu
$page = $this->create_plugin_submenu(
$this->in_menu // The slug name for parent menu (or file name of standard WordPress admin page)
, $this->browser_header // Page Title
, $this->menu_title // Menu Title
, ( ( isset( self::$capability[ $this->user_role ] ) ) ? self::$capability[ $this->user_role ] : self::$capability[ 'subscriber' ] ) // Capabilities
, $this->menu_tag // Slug
, array( $this, 'content' ) // Function for output content of page
);
}
//do_action('opsd_define_settings_pages', $this->menu_tag ); // Define sub classes, like: page-settings-general.php $this->menu_tag - 'opsd-settings' - its 'page' parameter in URL
do_action('opsd_menu_created', $this->menu_tag ); // Define sub classes, like: page-settings-general.php $this->menu_tag - 'opsd-settings' - its 'page' parameter in URL
do_action('opsd_define_nav_tabs', $this->menu_tag ); // Define Nav tabs.
}
/** Content of the Menu Page
*
Define page S t r u c t u r e, nav T A B s , set N O N C E: opsd_ajax_admin_nonce field
in ..\any\class\class-admin-page-structure.php
then show page C O N T E N T in files, like page-structure.php
$this->menu_tag - 'opsd-settings' - its 'page' parameter in URL
*/
public function content() {
do_action('opsd_page_structure_show', $this->menu_tag );
}
/** Hack for changing Root 2nd Submenu Title
*
* @global type $submenu
*/
public function change_second_root_menu_title() {
// Change Title of the Main menu inside of submenu
global $submenu;
if ( ( $this->in_menu == 'root' )
&& ( isset( $submenu[ $this->menu_tag ] ) )
&& ( isset( $this->menu_title_second ) )
) {
$submenu[ $this->menu_tag ][0][0] = $this->menu_title_second;
}
}
/** Add Menu
*
* @param type $menu_page_title
* @param type $menu_title
* @param type $capability
* @param type $menu_slug
* @param type $mune_icon_url
* @param type $page_content
* @param type $page_css
* @param type $page_js
* @return type
*/
protected function create_plugin_menu($menu_page_title, $menu_title, $capability, $menu_slug, $mune_icon_url, $page_content ) {
/**
* add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position );
* @return string The resulting page's hook_suffix
*/
//FixIn: 2.0.1.2
// The url to the icon to be used for this menu. Using 'none' would leave div.wp-menu-image empty so an icon can be added as background with CSS.
if ( '<svg' == substr( $mune_icon_url, 0, 4 ) ) {
/*
$mune_icon_url_svg = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="" viewBox="-2 -1 20 20">
<path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM2 2a1 1 0 0 0-1 1v1h14V3a1 1 0 0 0-1-1H2zm13 3H1v9a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V5z"/>
<path d="M9 7.5a.5.5 0 0 1 .5-.5H15v2H9.5a.5.5 0 0 1-.5-.5v-1zm-2 3v1a.5.5 0 0 1-.5.5H1v-2h5.5a.5.5 0 0 1 .5.5z"/>
</svg>';
*/
$mune_icon_url = sprintf( 'data:image/svg+xml;base64,%s', base64_encode( $mune_icon_url ) );
} elseif ( $mune_icon_url == 'none' ) {
$mune_icon_url = 'none';
} elseif ( empty( $mune_icon_url ) ) {
$mune_icon_url = '';
} else {
$mune_icon_url = plugins_url( $mune_icon_url, OPSD_FILE );
}
$page = add_menu_page( $menu_page_title, // The text to be displayed in the title tags of the page when the menu is selected
$menu_title, // The text to be used for the menu
$capability, // The capability required for this menu to be displayed to the user.
$menu_slug, // The slug name to refer to this menu by (should be unique for this menu)
$page_content, // The function to be called to output the content for this page.
$mune_icon_url//(($mune_icon_url=='none')?'none':((empty($mune_icon_url))?'':plugins_url($mune_icon_url, OPSD_FILE)) ) // The url to the icon to be used for this menu. Using 'none' would leave div.wp-menu-image empty so an icon can be added as background with CSS.
, $this->root_position /* @param int $position The position in the menu order this one should appear
* Positions for Core Menu Items
2 Dashboard
4 Separator
5 Posts
10 Media
15 Links
20 Pages
25 Comments
59 Separator
60 Appearance
65 Plugins
70 Users
75 Tools
80 Settings
99 Separator
*/
);
add_action( 'admin_print_styles-' . $page, array( $this, 'load_css' ) );
add_action( 'admin_print_scripts-' . $page, array( $this, 'load_js' ) );
return $page;
}
/** Add Sub Menu
*
* @param type $parent_menu_slug - The slug name for the parent menu (or the file name of a standard WordPress admin page)
* @param type $menu_page_title
* @param type $menu_title
* @param type $capability
* @param type $menu_slug
* @param type $page_content
* @param type $page_css
* @param type $page_js
* @return type
*/
protected function create_plugin_submenu( $parent_menu_slug, $menu_page_title, $menu_title, $capability, $menu_slug, $page_content ) {
/**
* function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function = '' );
* @return string|bool The resulting page's hook_suffix, or false if the user does not have the capability required.
*/
$page = add_submenu_page(
$parent_menu_slug, // The slug name for the parent menu (or the file name of a standard WordPress admin page)
$menu_page_title, // The text to be displayed in the title tags of the page when the menu is selected
$menu_title, // The text to be used for the menu
$capability, // The capability required for this menu to be displayed to the user.
$menu_slug, // The slug name to refer to this menu by (should be unique for this menu)
$page_content // The function to be called to output the content for this page.
);
add_action( 'admin_print_styles-' . $page, array( $this, 'load_css' ) );
add_action( 'admin_print_scripts-' . $page, array( $this, 'load_js' ) );
return $page;
}
}

View File

@@ -0,0 +1,665 @@
<?php /**
* @version 1.1
* @package Any
* @category Page Structure in Admin Panel
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-11-02
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit, if accessed directly
/** Define Settings Page Structure */
abstract class OPSD_Page_Structure {
protected static $nav_tabs; // Tabs array, same for all objects
private $current_page_params; // Parameters for current page, if this page selected, otherwise its = empty array()
private $is_only_icons = false;
protected $tags; // Defining Name of parameter in GET request for Navigation TOP and BOTTOM tabs
// - $_GET[ 'tab' ] == 'payment'
// - $_GET[ 'subtab' ] == 'paypal'
public function __construct() {
$this->tags = array();
$this->tags['tab'] = 'tab'; // Defining Name of parameter in GET request - $_GET[ 'tab' ] == 'payment'
$this->tags['subtab'] = 'subtab'; // Defining Name of parameter in GET request - $_GET[ 'subtab' ] == 'paypal'
$this->current_page_params = array();
self::$nav_tabs = array();
add_action('opsd_define_nav_tabs', array( $this, 'opsd_define_nav_tabs' ) ); // This Hook fire after creation menu in class OPSD_Admin_Menus
add_action('opsd_page_structure_show', array( $this, 'content_structure' ) ); // This Hook fire in the class OPSD_Admin_Menus for showing page content of specific menu
}
////////////////////////////////////////////////////////////////////////////
// Abstract Methods
////////////////////////////////////////////////////////////////////////////
/** Define slug in what menu to show this page. // Parameter relative: $_GET['page'].
*
* @return string
*
* Example:
return 'opsd-settings';
*/
abstract public function in_page();
/** Define Tabs and Subtabs of this Admin Page
*
* @return array();
* Example:
$tabs = array();
$tabs[ 'form' ] = array(
'title' => __('Form', 'secure-downloads') // Title of TAB
, 'hint' => __('Customizaton of Form Fields', 'secure-downloads') // Hint
, 'page_title' =>ucwords( __('Form fields', 'secure-downloads') ) // Title of Page
//, 'link' => '' // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link
//, 'position' => '' // 'left' || 'right' || ''
//, 'css_classes' => '' // CSS class(es)
//, 'icon' => '' // Icon - link to the real PNG img
, 'font_icon' => 'glyphicon glyphicon-edit' // CSS definition of forn Icon
, 'default' => false // Is this tab activated by default or not: true || false.
, 'disabled' => false // Is this tab disbaled: true || false.
, 'hided' => false // Is this tab hided: true || false.
, 'subtabs' => array()
);
$tabs[ 'upgrade' ] = array(
'title' => __('Upgrade', 'secure-downloads') // Title of TAB
, 'hint' => __('Upgrade to higher version', 'secure-downloads') // Hint
//, 'page_title' => __('Upgrade', 'secure-downloads') // Title of Page
, 'link' => 'http://server.com/' // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link
, 'position' => 'right' // 'left' || 'right' || ''
//, 'css_classes' => '' // CSS class(es)
//, 'icon' => '' // Icon - link to the real PNG img
, 'font_icon' => 'glyphicon glyphicon-shopping-cart'// CSS definition of forn Icon
//, 'default' => false // Is this tab activated by default or not: true || false.
//, 'subtabs' => array()
);
$subtabs = array();
$subtabs['fields'] = array(
'type' => 'subtab' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'
, 'title' => __('Form', 'secure-downloads') // Title of TAB
, 'page_title' => __('Form Settings', 'secure-downloads') // Title of Page
, 'hint' => __('Customization of Form Settings', 'secure-downloads') // Hint
, 'link' => '' // link
, 'position' => '' // 'left' || 'right' || ''
, 'css_classes' => '' // CSS class(es)
//, 'icon' => 'https://www.paypalobjects.com/webstatic/icon/pp258.png' // Icon - link to the real PNG img
//, 'font_icon' => 'glyphicon glyphicon-credit-card' // CSS definition of Font Icon
, 'default' => true // Is this sub tab activated by default or not: true || false.
, 'disabled' => false // Is this sub tab deactivated: true || false.
, 'checkbox' => false // or definition array for specific checkbox: array( 'checked' => true, 'name' => 'feature1_active_status' )
, 'content' => 'content' // Function to load as conten of this TAB
);
$subtabs['form-separator'] = array(
'type' => 'separator' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'
);
$subtabs['form-goto'] = array(
'type' => 'goto-link' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'
, 'title' =>ucwords( __('Form fields', 'secure-downloads') ) // Title of TAB
, 'hint' => '' // Hint
, 'show_section' => 'id_of_show_section' // ID of HTML element, for scroll to.
);
ob_start();
...
$html_element_data = ob_get_clean();
$subtabs['form-selection'] = array(
'type' => 'html' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'
, 'html' => $html_element_data
);
$subtabs['form-save'] = array(
'type' => 'button' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'
, 'title' => __('Save Changes', 'secure-downloads') // Title of TAB
, 'form' => 'opsd_form' // Required for 'button'! Name of Form to submit
);
$tabs[ 'form' ][ 'subtabs' ] = $subtabs;
return $tabs;
*/
abstract public function tabs();
/** Show Content of this page - Main function.
*
* In top of this function have to be checking ubout Update (saving POST request).
*
* Exmaple:
// S u b m i t ///////////////////////////////////////////////////////
$this_submit_form = 'opsd_emails_toolbar'; // Define form name
if ( isset( $_POST['is_form_sbmitted_'. $this_submit_form ] ) ) {
// Check N o n c e
check_admin_referer( 'opsd_settings_page_' . $this_submit_form ); // Its stop show anything on submiting, if its not refear to the original page
// Make Update of settings
$edit_field_data = $this->update_opsd_emails_toolbar( $menu_slug );
}
////////////////////////////////////////////////////////////////////////
*/
abstract public function content();
////////////////////////////////////////////////////////////////////////////
// C O N T E N T
////////////////////////////////////////////////////////////////////////////
/** General Page Structure
*
* @param string $page_tag - its the same that return $this->in_page()
*/
public function content_structure( $page_tag ) {
if ( ! $this->is_page_activated() )
return false;
$active_page_tab = $active_page_subtab = '';
if ( ( isset( $this->current_page_params['tab'] ) ) && ( ! empty( $this->current_page_params['tab']['tag'] ) ) )
$active_page_tab = $this->current_page_params['tab']['tag'];
if ( ( isset( $this->current_page_params['subtab'] ) ) && ( ! empty( $this->current_page_params['subtab']['tag'] ) ) )
$active_page_subtab = $this->current_page_params['subtab']['tag'];
$is_show_this_page = apply_filters( 'opsd_before_showing_settings_page_is_show_page', true, $page_tag, $active_page_tab, $active_page_subtab ); // Fires Before showing settings Content page
if ( $is_show_this_page === false ) return false;
do_action( 'opsd_before_settings_content', $page_tag, $active_page_tab, $active_page_subtab ); // Fires Before showing settings Content page
?><div id="<?php echo $page_tag; ?>-admin-page" class="wrap opsd_page"><?php
do_action( 'opsd_settings_before_header', $page_tag, $active_page_tab, $active_page_subtab ); // FixIn: N
?>
<h1 class="opsd_header"><div class="opsd_header_icon"></div><?php echo $this->get_page_header_h1(); ?></h1><?php
do_action( 'opsd_settings_after_header', $page_tag, $active_page_tab, $active_page_subtab ); // FixIn: N
?>
<div class="opsd_admin_message"></div>
<div class="opsd_admin_page">
<div id="ajax_working"></div>
<div class="clear opsd_header_margin"></div>
<div id="ajax_respond" class="ajax_respond" style="display:none;"></div>
<?php
// T A B S
$this->show_tabs_structure( $page_tag );
wp_nonce_field('opsd_ajax_admin_nonce', "opsd_admin_panel_nonce" , true , true );
// C o n t e n t
if ( ( isset( $this->current_page_params['subtab'] ) ) && ( isset( $this->current_page_params['subtab']['content'] ) ) ) {
call_user_func( array( $this, $this->current_page_params['subtab']['content'] ) );
} else if ( ( isset( $this->current_page_params['tab'] ) ) && ( isset( $this->current_page_params['tab']['content'] ) ) ) {
call_user_func( array( $this, $this->current_page_params['tab']['content'] ) );
} else
$this->content();
do_action('opsd_show_settings_content' , $page_tag, $active_page_tab, $active_page_subtab );
?></div>
</div><?php
do_action( 'opsd_after_settings_content', $page_tag, $active_page_tab, $active_page_subtab ); // Fires After showing settings Content page
}
////////////////////////////////////////////////////////////////////////////
// Active Page Parameters
////////////////////////////////////////////////////////////////////////////
/** Check if this page selected (active), depend from the GET parameter
* If selected, then define Current Page Parameters.
*
* @return boolean
*/
private function is_page_activated() {
$is_page_selected = false;
$this_page = $this->in_page();
foreach ( $this->tabs() as $this_tab_tag => $this_tab ) { // Get First Tab Element, which MUST be subtab element, all other tabs, can be links, not really showing content!!!
break;
}
if ( empty( $this_tab ) )
return $this_page; // this page empty - tabs is empty array, probabaly its was redefined in child CLASS to $tabs = array(); for not ability to open this page.
$this_subtab_tag = 0;
$this_subtab = array( 'default' => false );
if ( isset( $this_tab['subtabs'] ) )
foreach ( $this_tab['subtabs'] as $temp_this_subtab_tag => $temp_this_subtab ) {
if ( $temp_this_subtab['type'] == 'subtab' ) { // Get First Subtab element from subtabs array
$this_subtab_tag = $temp_this_subtab_tag;
$this_subtab = $temp_this_subtab;
break;
}
}
//debuge($this_page, $_REQUEST);
if ( ( isset( $_REQUEST[ 'page' ] ) )
&& ( $this_page == $_REQUEST[ 'page' ] ) ){ // We are inside of this page. Menu item selected.
if ( ( ! isset( $_REQUEST[ $this->tags['tab'] ] ) ) // TAB NOT selected && Default
//&& ( ! isset( $_REQUEST[ $this->tags['subtab'] ] ) ) // SubTab NOT selected
&& ( isset( $this_tab['default'] ) ) && ( $this_tab['default'] )
)
$is_page_selected = true;
if ( ( isset( $_REQUEST[ $this->tags['tab'] ] ) ) // TAB Selected
&& ( ! isset( $_REQUEST[ $this->tags['subtab'] ] ) ) // SubTab NOT selected && ! exist || Default
&& ( $_REQUEST[ $this->tags['tab'] ] == $this_tab_tag )
&& ( ( $this_subtab_tag === 0 )
|| ( $this_subtab['default'] )
)
)
$is_page_selected = true;
if ( ( isset( $_REQUEST[ $this->tags['tab'] ] ) ) // TAB Selected
&& ( isset( $_REQUEST[ $this->tags['subtab'] ] ) ) // SubTab Selected
&& ( $_REQUEST[ $this->tags['tab'] ] == $this_tab_tag )
&& ( $_REQUEST[ $this->tags['subtab'] ] == $this_subtab_tag )
)
$is_page_selected = true;
}
if ( $is_page_selected ) // If this page activated, then define Current Page parameters
$this->define_current_page_parameters( $this_tab_tag, $this_tab, $this_subtab_tag, $this_subtab );
return $is_page_selected;
}
/** Define parameters for current selected page
*
* @param type $paramas
*/
private function define_current_page_parameters( $this_tab_tag, $this_tab, $this_subtab_tag, $this_subtab ) {
$this->current_page_params = array(
'tab' => array_merge ( $this_tab, array( 'tag' => $this_tab_tag ) )
, 'subtab' => array_merge ( $this_subtab, array( 'tag' => $this_subtab_tag ) )
);
}
/** Get Header Title (H1) of this selected page
* Firstly check in subtabs, otherwise get from tabs and if not exist then
*
* @return string
*/
private function get_page_header_h1() {
if ( ! empty( $this->current_page_params ) ) {
if ( isset( $this->current_page_params['subtab']['page_title'] ) )
return $this->current_page_params['subtab']['page_title'];
if ( isset( $this->current_page_params['tab']['page_title'] ) )
return $this->current_page_params['tab']['page_title'];
}
return '';
}
/** Get all SubTabs of current opened page Tab
*
* @param string $menu_in_page_tag - Optional. Menu Tag, the same as $this->in_page();
* @return array
*/
private function get_all_sub_tabs_of_selected_tab( $menu_in_page_tag = false ) {
if ($menu_in_page_tag === false )
$menu_in_page_tag = $this->in_page();
$all_sub_tabs_of_selected_tab = self::$nav_tabs[ $menu_in_page_tag ][ $this->current_page_params['tab']['tag'] ]['subtabs'];
return $all_sub_tabs_of_selected_tab;
}
////////////////////////////////////////////////////////////////////////////
// T A B s
////////////////////////////////////////////////////////////////////////////
// Define ------------------------------------------------------------------
/** Define TABS structure.
* General structure of tabs for every plugin menu page.
*/
public function opsd_define_nav_tabs() { // Function executed after creation menu in class OPSD_Admin_Menus
/*
Array (
[opsd-resources] => Array ()
[opsd-settings] => Array
(
[general] => Array
(
[title] => General
[page_title] => General Settings
...
[subtabs] => Array ()
)
[help] => Array
(
[title] => Help
[page_title] =>
...
[subtabs] => Array ()
)
[form] => Array
(
[title] => Form
[hint] => Customizaton of Form Fields
[page_title] => Form Fields
...
[subtabs] => Array
(
[goto-form] => Array
(
[type] => goto-link
[title] => Form Fields
...
[content] => content
[update] => update
)
[goto-content-data] => Array
(
[type] => button
[title] => Save Changes
[form] => opsd_form
...
)
)
)
[payment] => Array
(
[title] => Payments
[hint] => Customizaton of Payment
[page_title] => Payment Gateways
...
[subtabs] => Array
(
[paypal] => Array
(
[type] => subtab
[title] => PayPal
...
)
[sage] => Array
(
[type] => subtab
[title] => Sage
...
)
)
)
)
)
*/
if ( ! isset( self::$nav_tabs[ $this->in_page() ] ) )
self::$nav_tabs[ $this->in_page() ] = array(); // If this page does not exist, then define it.
$current_tab = $this->tabs();
$current_subtabs = array(); // Get Subtabs in separate array.
foreach ( $current_tab as $tab_tag => $tab_array ) {
if ( isset( $tab_array[ 'subtabs' ] ) ) {
$current_subtabs[ $tab_tag ] = $tab_array[ 'subtabs' ]; // Create new Subtabs array
unset( $current_tab[ $tab_tag ][ 'subtabs' ] ); // Detach Subtabs array from Tab array. Its required for do not overwrite subtabs with already exist subtabs in previlosly defined tab.
} else
$current_subtabs[ $tab_tag ] = array();
}
foreach ( $current_tab as $tab_tag => $tab_array ) {
if ( ! isset( self::$nav_tabs[ $this->in_page() ][ $tab_tag ] ) ) { // If this tab ( for exmaple "payment") declared previously, then does not do anything
self::$nav_tabs[ $this->in_page() ][ $tab_tag ] = $current_tab[ $tab_tag ];
self::$nav_tabs[ $this->in_page() ][ $tab_tag ][ 'subtabs' ] = array();
}
if ( isset(self::$nav_tabs[ $this->in_page() ] ) ) {
// Merge subtabs (Ex: PayPal and Sage) and attach to current tab: (Ex: payment)
self::$nav_tabs[ $this->in_page() ][ $tab_tag ][ 'subtabs' ] = array_merge(
self::$nav_tabs[ $this->in_page() ][ $tab_tag ][ 'subtabs' ]
, $current_subtabs[ $tab_tag ]
);
}
}
}
/** Get array of visible TABs
* Tabs that do not hided or disbaled
*
* @param string $menu_in_page_tag - Menu Tag, the same as $this->in_page();
* @return type
*/
private function get_visible_tabs( $menu_in_page_tag ) {
$visible_tabs = array();
foreach ( self::$nav_tabs[ $menu_in_page_tag ] as $tab_tag => $tab ) {
if ( empty( $tab['disabled'] )
&& empty( $tab['hided'] )
) {
$visible_tabs[$tab_tag] = $tab;
}
}
return $visible_tabs;
}
// Showing -----------------------------------------------------------------
/**
*
* @param string $menu_in_page_tag - Menu Tag, the same as $this->in_page();
* @return boolean - true if nav tabs exist and false if does not exist
*/
public function show_tabs_structure( $menu_in_page_tag ) {
// Exit if no Tabs in this page.
if ( empty( self::$nav_tabs[ $menu_in_page_tag ] ) )
return false;
// Exit if tabs hidded or disbaled
$visible_tabs = $this->get_visible_tabs( $menu_in_page_tag );
if ( empty( $visible_tabs ) )
return false;
?><span class="wpdevelop wpdvlp-nav-tabs-container">
<div class="clear"></div><?php
opsd_bs_toolbar_tabs_html_container_start();
do_action( 'opsd_toolbar_top_tabs_before' , $menu_in_page_tag );
$this->show_tabs_line( $menu_in_page_tag ); // T O P T A B S
do_action( 'opsd_toolbar_top_tabs_after' , $menu_in_page_tag );
opsd_bs_toolbar_tabs_html_container_end();
$bottom_tabs = $this->get_all_sub_tabs_of_selected_tab( $menu_in_page_tag );
if ( ! empty( $bottom_tabs ) ) { // S U B T A B S
opsd_bs_toolbar_sub_html_container_start();
$this->show_subtabs_line( $bottom_tabs, $menu_in_page_tag );
opsd_bs_toolbar_sub_html_container_end();
} // Bottom Tabs
?></span><?php
return true;
}
/** Show Top nav TABs line
*
* @param string $menu_in_page_tag - Menu Tag, the same as $this->in_page();
*/
public function show_tabs_line( $menu_in_page_tag ) {
foreach ( self::$nav_tabs[ $menu_in_page_tag ] as $tab_tag => $tab ) {
$css_classes = ( ( isset($tab['css_classes']) ) ? $tab['css_classes'] : '' );
if ( ( isset( $this->current_page_params['tab'] ) ) && ( $this->current_page_params['tab']['tag'] == $tab_tag ) )
$css_classes .= ' nav-tab-active';
if ( ! empty( $tab['position'] ) )
$css_classes .= ' nav-tab-position-' . $tab['position'];
if ( ! empty( $tab['hided'] ) )
$css_classes .= ' hide';
if ( ( isset( $tab['disabled'] ) ) && ( $tab['disabled'] ) )
$css_classes .= ' wpdevelop-tab-disabled';
$tab['css_classes'] = $css_classes;
$tab['link'] = ( ! empty($tab['link']) ? $tab['link'] : $this->get_tab_url( $menu_in_page_tag, $tab_tag ) );
if ( // Recheck active status of default TAB
( isset( $_REQUEST[ $this->tags['tab'] ] ) ) // Some Tab selected
&& ( $_REQUEST[ $this->tags['tab'] ] !== $tab_tag ) // This tag not in URL
&& ( isset($tab['default']) && ( $tab['default'] ) ) // This tab default, need to set it as not defaultm for not showing it selected
)
$tab['default'] = false;
opsd_bs_display_tab( $tab );
}
}
/** Show Sub Menu Lines at the Settings page for Active Tab
*
* @param array $bottom_tabs
* @param string $menu_in_page_tag - Menu Tag, the same as $this->in_page();
*/
public function show_subtabs_line( $bottom_tabs, $menu_in_page_tag ) {
if ( ! empty( $bottom_tabs ) )
foreach ( $bottom_tabs as $tab_tag => $tab ) {
switch ( $tab['type'] ) {
case 'separator': // Separator
?><span class="wpdevelop-submenu-tab-separator-vertical"></span><?php
break;
case 'button': // Button
?><div class="clear-for-mobile"></div><input
type="button"
class="button button-primary opsd_submit_button"
value="<?php echo $tab['title']; ?>"
onclick="if (typeof document.forms['<?php echo $tab['form']; ?>'] !== 'undefined'){ document.forms['<?php echo $tab['form']; ?>'].submit(); } else { opsd_admin_show_message( '<?php echo ' <strong>', __('Error', 'secure-downloads') ,'!</strong> ', __('Form', 'secure-downloads') , ' <strong>' , $tab['form'] , '</strong> ', __('does not exist', 'secure-downloads'); ?>.', 'error', 10000 ); }"
/><?php
break;
case 'html': // HTML
echo $tab['html'];
break;
case 'goto-link':
?><a class="nav-tab wpdevelop-submenu-tab go-to-link"
original-title="<?php echo (empty($tab['hint'])?'':$tab['hint']); ?>"
onclick="javascript:opsd_scroll_to('#<?php echo esc_js( $tab['show_section'] ); ?>' );"
href="javascript:void(0);"><span><?php echo $tab['title']; ?></span></a><?php
break;
default: // Link
$css_classes = ( ( isset($tab['css_classes']) ) ? $tab['css_classes'] : '' );
if ( ! empty($tab['position'] ) )
$css_classes .= ' nav-tab-position-'.$tab['position'];
if ( $tab_tag == $this->current_page_params['subtab']['tag'] )
$css_classes .= ' wpdevelop-submenu-tab-selected';
if ( $tab['disabled'] )
$css_classes .= ' wpdevelop-submenu-tab-disabled';
$tab['css_classes'] = $css_classes;
$tab['link'] = ( ! empty($tab['link']) ? $tab['link'] : $this->get_tab_url( $menu_in_page_tag, $this->current_page_params['tab']['tag'], $tab_tag ) );
$tab['top'] = false;
opsd_bs_display_tab( $tab );
break;
} // End Switch
} // End Bottom Tabs Loop
}
////////////////////////////////////////////////////////////////////////////
// Support
////////////////////////////////////////////////////////////////////////////
/** Get URL of settings page, based on Page Slug and Tab Slug
*
* @param string $page_tag
* @param string $tab_name
* @param string $subtab_name ( Optional )
* @return string - Escaped URL to plugin page.
*/
private function get_tab_url( $page_tag, $tab_name, $subtab_name = false ){
if ( $subtab_name === false )
return esc_url( admin_url( add_query_arg( array( 'page' => $page_tag, $this->tags['tab'] => $tab_name ), 'admin.php' ) ) );
else
return esc_url( admin_url( add_query_arg( array( 'page' => $page_tag, $this->tags['tab'] => $tab_name, $this->tags['subtab'] => $subtab_name ), 'admin.php' ) ) );
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,157 @@
<?php /**
* @version 1.1
* @package Any
* @category Load JS and CSS files
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-10-28
*/
abstract class OPSD_JS_CSS {
public $objects = array();
public $type; // css || js
function __construct() {
$this->define();
add_action( 'admin_enqueue_scripts', array( $this, 'registerScripts' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'registerScripts' ) );
add_action( 'opsd_load_js_on_admin_page', array( $this, 'load_js_on_admin_page' ) ); // Load JS. Hook fire only in admin pages of plugin. CLASS: OPSD_Admin_Menus (..\any\class\class-admin-menu.php)
add_action( 'opsd_load_css_on_admin_page', array( $this, 'load_css_on_admin_page' ) ); // Load CSS. Hook fire only in admin pages of plugin. CLASS: OPSD_Admin_Menus (..\any\class\class-admin-menu.php)
}
public function load_css_on_admin_page() {
if ( $this->getType() == 'css' )
$this->load();
}
public function load_js_on_admin_page() {
if ( $this->getType() == 'js' )
$this->load();
}
/** Define all Scripts or Styles here */
abstract public function define();
/** Enqueue Scripts or Styles.
*
* @param type $where_to_load - can be "admin" or "client"
*/
abstract public function enqueue( $where_to_load );
/** Deregister some Conflict scripts from other plugins.
*
* @param type $where_to_load - can be "admin" or "client"
*/
abstract public function remove_conflicts( $where_to_load );
// Define CSS or JavaScript
public function setType($param) {
$this->type = $param;
}
// Get type of this script
public function getType() {
return $this->type;
}
// Add new Style or Script
public function add($param) {
$this->objects[] = $param;
}
private function isLoad( $whereToLoadArray ) {
$is_load = false;
if ( ( is_admin() ) && ( in_array('admin', $whereToLoadArray ) ) )
$is_load = true;
if ( ( ! is_admin() ) && ( in_array('client', $whereToLoadArray ) ) )
$is_load = true;
return $is_load;
}
// Register
public function registerScripts() {
//if ( function_exists( 'wp_dequeue_script' ) )
$this->remove_conflicts( ( is_admin() ? 'admin': 'client' ) );
foreach( $this->objects as $script ) {
if ( $this->isLoad( $script['where_to_load'] ) ) {
if ( $this->getType() == 'css' )
wp_register_style( $script['handle'], $script['src'], $script['deps'], $script['version'] );
else
wp_register_script( $script['handle'], $script['src'], $script['deps'], $script['version'] );
}
}
}
// Load scripts or styles here
public function load(){
$is_load_scripts = true;
$is_load_scripts = apply_filters( 'opsd_is_load_script_on_this_page', $is_load_scripts );
if ( ! $is_load_scripts ) return; // Exist, if on some page we do not need to load scripts
foreach( $this->objects as $num => $script ) {
if ( $this->isLoad( $script['where_to_load'] ) ) {
if ( $this->getType() == 'css' ) {
if ( $script['condition'] === false )
wp_enqueue_style( $script['handle'] );
else {
if (! function_exists('wp_style_add_data') ) { // This function is available only since WordPress 3.6.0 Update
wp_enqueue_style( $script['handle'] );
wp_style_add_data( $script['handle'], 'conditional', $script['condition'] );
} else { // Add additional "dynamic CSS" if the WP version older than 3.6.0 (its function suport since WP 3.3)
if ( ($num-1) > -1 ) { // Its because "wp_add_inline_style" add the CSS to the already added style. So its require that some other simple style was added before
wp_enqueue_style( $this->objects[($num-1)]['handle'] );
wp_add_inline_style( $this->objects[($num-1)]['handle'],
sprintf("<!--[if ".$script['condition']."]>\n" .
"<link rel='stylesheet' id='".$script['handle']."-css' href='". $script['src'] ."?ver=" . $script['version'] . "' type='text/css' media='all' />\n" .
"<![endif]-->\n")
);
}
}
}
} else {
wp_enqueue_script( $script['handle'] );
}
}
}
$this->enqueue( ( is_admin() ? 'admin': 'client' ) );
if ( $this->getType() == 'css' )
do_action( 'opsd_enqueue_style', ( is_admin() ? 'admin': 'client' ) );
if ( $this->getType() == 'js' )
do_action( 'opsd_enqueue_script', ( is_admin() ? 'admin': 'client' ) );
}
}

View File

@@ -0,0 +1,146 @@
/*
Document : admin resources-table
Created on : 2016-08-09, 11:38:06
Author : wpdevelop
Description: Resource Table CSS
*/
/* General Class */
.opsd_resources_table {
}
/* Resources Table */
.opsd_resources_table .table,
.opsd_resources_table .table.widefat {
border: 0px solid #bbb;
box-shadow: 0 0 2px #aaa;
}
.opsd_resources_table table > thead > tr > th {
background-color: #ffffff;
border-bottom: 2px solid #e5e5e5;
}
.wpdevelop.opsd_resources_table table > tfoot > tr > th {
background-color: #ffffff;
border-top: 2px solid #e5e5e5;
}
.opsd_resources_table thead th,
.opsd_resources_table tfoot th {
font-weight:600;
text-align: left;
}
.opsd_resources_table th a,
.opsd_resources_table th a:hover,
.opsd_resources_table th a:focus {
text-decoration: none;
}
.wpdevelop.opsd_resources_table table > tbody > tr.row_selected_color > th,
.wpdevelop.opsd_resources_table table > tbody > tr.row_selected_color > td {
background: #b5d4ef;
border-color: #ccc !important;
}
.opsd_resources_table th a span.glyphicon {
font-size: 0.8em;
font-weight: 400;
padding-left: 2px;
}
.wpdevelop.opsd_resources_table .table > thead > tr > th,
.wpdevelop.opsd_resources_table .table > tbody > tr > th,
.wpdevelop.opsd_resources_table .table > tfoot > tr > th,
.wpdevelop.opsd_resources_table .table > thead > tr > td,
.wpdevelop.opsd_resources_table .table > tbody > tr > td,
.wpdevelop.opsd_resources_table .table > tfoot > tr > td {
vertical-align: middle;
}
/* Labels Colors */
.opsd_resources_table .label {
border: 1px solid #EEEEEE;
box-shadow: 0 0 1px #ddd;
padding: 2px 5px;
white-space: nowrap;
line-height: 2.4em;
}
.opsd_resources_table .label span,
.opsd_resources_table .label a,
.opsd_resources_table .label a:hover{
color:#fff;
text-decoration: none;
}
.opsd_resources_table .label-pending {
background: #FFBB45;
}
.opsd_resources_table .label-approved {
background: #9BE;
}
.opsd_resources_table .label-trash {
background: #D94A48;
color: #fff;
text-shadow: 0 0 1px #E00;
}
.opsd_resources_table .label-success {
}
.opsd_resources_table .label-unknown {
background-color: #999 !important;
}
.opsd_resources_table .label-error {
background-color: #FA773D !important;
}
.opsd_resources_table .payment-label-success {
background-color: #468847 !important;
}
.opsd_resources_table .payment-label-pending {
background-color: #992 !important;
}
.opsd_resources_table .payment-label-unknown {
background-color: #999 !important;
}
.opsd_resources_table .payment-label-error {
background-color: #FA773D !important;
}
.opsd_resources_table .field-currency {
color: #444;
display: inline;
font-size: 15px;
font-weight: 600;
line-height: 1.7em;
height: 26px;
padding:0;
vertical-align: top;
}
.wpdevelop.opsd_resources_table .table > tbody > tr > td select.form-control,
.opsd_resources_table select {
width:auto;
height:2em;
padding: 2px;
border-radius: 0;
}
@media (max-width: 782px) {
.opsd_resources_table th.opsd_hide_mobile,
.opsd_resources_table td.opsd_hide_mobile {
display: none;
}
.opsd_resources_table th.opsd_col_id,
.opsd_resources_table td.opsd_col_id {
width: 4em;
}
.opsd_resources_table th.opsd_col_title,
.opsd_resources_table td.opsd_col_title {
width: 9em;
}
.opsd_resources_table .field-currency {
line-height: 2.1em;
}
#wpbody .opsd_resources_table select {
height:32px;
}
}
@media (max-width: 600px) {
.opsd_resources_table th.opsd_hide_mobile_xs,
.opsd_resources_table td.opsd_hide_mobile_xs {
display: none;
}
}

View File

@@ -0,0 +1,358 @@
/*
Document : admin-opsd-listing
Created on : 09.02.2014, 11:38:06
Author : wpdevelop
Description: Listing Table CSS
*/
/* Header */
.opsd-listing-header {
background: #e4e4e4; /* for non-css3 browsers */
border: 1px solid #C6C6C6;
border-bottom-color: #CCC;
border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
-webkit-border-radius: 4px 4px 0 0;
-ms-border-radius: 4px 4px 0 0;
color: #333;
font-size: 12px;
font-weight: 600;
margin: 0;
padding: 2px 0px;
text-shadow: 0 1px 1px #F5F5F5;
}
/* Row */
.opsd-listing-row {
border: 1px solid #C6C6C6;
border-top: none;
margin: 0px;
padding: 0px;
}
.opsd-listing-row.row_alternative_color.row,
.opsd-listing-row.row_alternative_color {
background: #F7F7F7;
}
.opsd-listing-row.row.row_selected_color {
background: #9cf;
border-color: #aaa !important;
}
.opsd-listing-row.opsd-listing-last_row {
border-radius: 0 0 4px 4px;
-moz-border-radius: 0 0 4px 4px;
-webkit-border-radius: 0 0 4px 4px;
-ms-border-radius: 0 0 4px 4px;
}
/* Columns */
.opsd-listing-collumn {
margin: 5px 0px 2px;
}
.opsd-listing-collumn .field-id {
color: #999;
font-size: 10px;
font-weight: 600;
text-align: right;
/* background-color: #777;
border: 1px solid #FFF;
border-radius: 10px 10px 10px 10px;
box-shadow: 0 0 2px #888;
color: #EEE;
font-size: 9px;
font-weight: 600;
padding: 2px 4px;
text-shadow: 0 0 3px #333;*/
}
.opsd-listing-collumn .field-id span.label {
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
background: #bbb;
color: #fff;
margin: 0;
padding: 2px 5px;
background: #888;
border:none;
line-height:2.8em;
}
.opsd-listing-collumn.field-system-info {
font-size: 9px;
font-style: italic;
line-height: 1.2em;
text-align: left;
text-shadow: 0 -1px 0 #eee;
white-space: nowrap;
padding: 2em 5px 0;
text-align: right;
color: #777;
}
.opsd-listing-collumn.field-system-info .field-creation-date {
font-weight: 600;
}
/* Checkbox */
.opsd-listing-collumn .field-checkbox {
vertical-align: middle;
}
/* Main Content */
.opsd-listing-collumn.field-content,
.opsd-listing-collumn .standard-content-form {
text-align: left;
word-wrap: break-word;
line-height: 1.7em;
}
/* Data Titles style - Yellow Values*/
.opsd-listing-collumn .fieldvalue {
background: #FE9;
color: #333;
font-size: 0.9em;
font-weight: 400;
margin: 0 3px 0 0;
padding: 2px 3px;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
/* text-shadow: 0 1px 1px #EEE;*/
}
/* Labels Colors */
.opsd-listing-collumn .label {
border: 1px solid #EEEEEE;
box-shadow: 0 0 1px #ddd;
padding: 2px 5px;
white-space: nowrap;
line-height: 2.4em;
}
.opsd-listing-collumn .label span,
.opsd-listing-collumn .label a,
.opsd-listing-collumn .label a:hover{
color:#fff;
text-decoration: none;
}
.opsd-listing-collumn .label-pending {
background: #FFBB45;
}
.opsd-listing-collumn .label-approved {
background: #9BE;
}
.opsd-listing-collumn .label-trash {
background: #D94A48;
color: #fff;
text-shadow: 0 0 1px #E00;
}
.opsd-listing-collumn .label-success {
}
.opsd-listing-collumn .label-unknown {
background-color: #999 !important;
}
.opsd-listing-collumn .label-error {
background-color: #FA773D !important;
}
.opsd-listing-collumn .payment-label-success {
background-color: #468847 !important;
}
.opsd-listing-collumn .payment-label-pending {
background-color: #992 !important;
}
.opsd-listing-collumn .payment-label-unknown {
background-color: #999 !important;
}
.opsd-listing-collumn .payment-label-error {
background-color: #FA773D !important;
}
/* Pagination */
.opsd-pagination .button{
box-shadow: none;
height: 32px;
line-height: 30px;
margin: 0 0 5px;
padding: 0 15px;
}
.wpdevelop.opsd-pagination .container-fluid .row .btn-toolbar .btn-group > .button.disabled {
box-shadow: none !important;
}
.wpdevelop.opsd-pagination .btn-toolbar .btn-group > .button.active {
box-shadow: 0 1px 5px -4px rgba(0, 0, 0, 0.5) inset;
font-weight: 600;
}
@media (max-width: 782px) {
.opsd-listing-header .opsd-listing-collumn {
font-size: 1.2em;
line-height: 2.2em;
margin:0;
}
.opsd-listing-header .opsd-listing-collumn input[type=checkbox] {
margin:-4px 0 0;
}
.opsd-listing-collumn.field-system-info {
padding:0 5px;
}
/* Pagination */
.opsd-pagination .button {
font-size: 14px;
height: 36px;
line-height: 34px;
margin: 0 0 5px;
padding: 0 16px;
}
}
/* C U S T O M ****************************************************************/
/* New Label */
.opsd-listing-collumn.new-label {
margin: 5px 0 0 -32px;
position: absolute !important;
}
.opsd-listing-collumn.new-label a{
font-size:13px;
}
.opsd-listing-collumn.new-label a i.glyphicon{
color:#8ac;
}
/* Dates */
.opsd-listing-collumn.field-dates .field-securedownloads-date,
.opsd-listing-collumn.field-dates .field-securedownloads-date:hover {
background: none repeat scroll 0 0 #FFBB45;
border: 1px solid #EEE;
border-radius: 5px 5px 5px 5px;
box-shadow: 0 0 1px #CCC;
color: #FFF;
font-weight: 600;
padding: 4px 10px 4px;
text-decoration: none;
text-shadow: 0 0px 0 #CCC;
white-space: nowrap;
font-size: 0.85em;
line-height: 2.5em;
}
.opsd-listing-collumn.field-dates .field-securedownloads-date.approved,
.opsd-listing-collumn.field-dates .field-securedownloads-date.approved:hover {
background: none repeat scroll 0 0 #9BE;
}
.opsd-listing-collumn.field-dates .field-securedownloads-time {
color: #555;
text-decoration: none;
text-shadow: 0 0 1px #AAA;
}
.opsd-listing-collumn.field-dates .date_tire {
font-size: 17px;
font-weight: 600;
}
.opsd-listing-collumn.field-dates .securedownloads_dates_small,
.opsd-listing-collumn.field-dates .securedownloads_dates_full {
line-height: 24px;
}
.opsd-listing-collumn.field-dates .date_from_dif_type {
color: #FFF;
text-shadow: 0 -1px 0 #BBB;
}
/* Actions buttons */
.opsd-listing-collumn.field-action-buttons {
padding-right: 2px;
}
.opsd-listing-collumn.field-action-buttons a.button {
margin:0 5px 5px 0;
}
.opsd-listing-collumn .glyphicon.red_icon_color {
color:#d54e21;
}
.opsd-listing-collumn .opsd-buttons-separator {
margin-right: 15px;
}
.opsd_free .opsd-listing-collumn .opsd-buttons-separator {
margin-right: 0px;
}
/* Cost Group */
.opsd-listing-collumn.field-action-buttons .cost-fields-group {
float:left;
}
.opsd-listing-collumn.field-action-buttons .cost-fields-group .field-currency {
color: #444;
display: inline;
font-size: 15px;
font-weight: 600;
line-height: 26px;
height: 26px;
padding:0;
vertical-align: top;
}
.opsd-listing-collumn.field-action-buttons .cost-fields-group.control-group .btn-toolbar .input-group > input[type="text"].field-securedownloads-cost {
display: inline-block;
margin: 0 5px 5px 0;
width: 75px;
font-weight: 600;
border-radius: 2px;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
}
.opsd-listing-collumn.field-action-buttons select.opsd-select-locale {
display: none;
margin: 0 5px 5px 0;
}
.opsd_free .opsd-listing-collumn.field-system-info {
padding:0 5px;
margin-top:-0.5em;
}
/* Columns customizations - labels header */
#listing_visible_opsd .opsd-listing-header .opsd_column_3 {
white-space: nowrap;
}
.label_resource_not_exist {
color: #000;
font-weight: 600;
text-shadow: 0 1px 0 #59D;
text-transform: none;
}
.opsd-listing-row .securedownloads_row_modification_element {
display: none;
clear: both;
width: 100%;
}
.opsd-listing-row .securedownloads_row_modification_element_changing_resource {
height: auto;
}
.opsd-listing-row .securedownloads_row_modification_element .btn-save-cost,
.opsd-listing-row .securedownloads_row_modification_element.securedownloads_edit_note a,
.opsd-listing-row .securedownloads_row_modification_element select{
float: left;
margin: 0 0 5px 5px;
}
#hided_boking_modifications_elements,
.hided_boking_modifications_elements { /* FixIn:5.4.5.1 */
display: none;
}
@media (max-width: 782px) {
/* New Label */
.opsd-listing-collumn.new-label {
margin: 7px 0 0 -26px;
position: absolute !important;
}
/* Dates */
.opsd-listing-collumn .field-id.text-center,
.opsd-listing-collumn .securedownloads-labels.text-center,
.opsd-listing-collumn.securedownloads-dates.text-center{
text-align: left;
}
.opsd-listing-collumn.field-action-buttons .control-group a.button {
height: 34px;
}
/* Cost Group */
.opsd-listing-collumn.field-action-buttons .cost-fields-group .field-currency {
line-height: 34px;
height: 34px;
font-size: 18px;
}
.opsd-listing-collumn.field-action-buttons .cost-fields-group.control-group .btn-toolbar .input-group > input[type="text"].field-securedownloads-cost {
padding: 2px 5px;
}
}

View File

@@ -0,0 +1,242 @@
/**
* @version 1.0
* @package: Tabs
* @category: Admin UI
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015.04.10
*/
/* Top Tab Menu ***************************************************************/
.wpdvlp-top-tabs {
margin:0;
position: relative;
width: auto;
}
.wpdvlp-top-tabs .wpdvlp-tabs-wrapper {
height: 28px;
margin-bottom: -1px;
width: 100%;
}
.wpdvlp-top-tabs .nav-tabs {
float: left;
margin-left: 0;
padding-left: 0px;
/* border-bottom: none !important;*/
border-bottom: 1px solid #CCC;
width: 100%;
}
.wpdvlp-top-tabs .nav-tab {
border-radius: 3px 3px 0 0;
-moz-border-radius: 3px 3px 0 0;
-webkit-border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-color: #D5D5D5 #D5D5D5 #BBC #D5D5D5;
border-style: solid;
border-width: 1px 1px 0;
border-bottom: none;
display: inline-block;
background: none repeat scroll 0 0 #F4F4F4;
background: #DFDFDF;
color: #464646;
font-weight: 600;
font-size: 13px;
text-decoration: none;
text-shadow: 0 1px 0 #F1F1F1;
line-height: 18px;
padding: 4px 14px 6px;
padding: 5px 15px 5px;
margin: 0 5px 0 0;
}
.wpdvlp-top-tabs .pull-right .nav-tab {
margin: 0 0 0 5px;
}
.wpdvlp-top-tabs a.nav-tab:hover,
.wpdvlp-top-tabs a.nav-tab:visited,
.wpdvlp-top-tabs a.nav-tab:link ,
.wpdvlp-sub-tabs a.nav-tab:hover,
.wpdvlp-sub-tabs a.nav-tab:visited,
.wpdvlp-sub-tabs a.nav-tab:link {
text-decoration: none;
outline: none;
}
/* IE6 */
* html .wpdvlp-top-tabs .nav-tab {
padding: 4px 14px 5px 32px;
}
.wpdvlp-top-tabs a.nav-tab:hover {
color: #D54E21 !important;
background-color: #E7E7E7 !important;
}
.wpdvlp-top-tabs .nav-tab-active,
.wpdvlp-top-tabs a.nav-tab-active:hover,
.wpdvlp-top-tabs a.nav-tab-active:focus {
border-color: #777;
border-bottom-color: #AAB;
background: none repeat scroll 0 0 #7A7A88;
text-shadow: 0 0px 0 #111;
border-width: 1px;
color: #FFF;
}
.wpdvlp-top-tabs a.nav-tab-active:hover,
.wpdvlp-top-tabs a.nav-tab-active:focus {
color: #FFF !important;
background: none repeat scroll 0 0 #7A7A88 !important;
}
.wpdvlp-top-tabs .nav-tab-position-right {
float:right;
margin: 0 0 0 5px;
}
/* Sub Menu *******************************************************************/
.wpdvlp-sub-tabs {
height: auto;
clear: both;
border: 1px solid #BBC;
border-top: none;
-moz-border-radius: 0px 0px 3px 3px;
-moz-box-shadow: 0 1px 1px #DDD;
-webkit-border-radius: 0px 0px 3px 3px;
-webkit-box-shadow: 0 1px 1px #DDD;
border-radius: 0px 0px 3px 3px;
box-shadow: 0 1px 1px #DDD;
background: #EEE;
margin: 0;
padding: 5px;
}
.wpdvlp-sub-tabs .wpdvlp-tabs-wrapper {
height: auto;
margin-bottom: -1px;
width: 100%;
}
.wpdvlp-sub-tabs .nav-tabs {
border: none;
width: auto;
height: auto;
padding: 0;
margin: 0;
}
.wpdvlp-sub-tabs .nav-tabs .nav-tab {
border: 1px solid #bbb;
background: #F5F5F5;
color: #777;
font-weight: 600;
font-size:13px;
height: 18px;
line-height: 16px;
padding: 6px 10px 4px;
margin: 5px 2px -4px;
border-bottom: none;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
box-sizing: content-box;
}
.wpdvlp-top-tabs .nav-tabs .nav-tab input[type="checkbox"],
.wpdvlp-sub-tabs .nav-tabs .nav-tab input[type="checkbox"] {
margin: 0 0 0 8px !important;
vertical-align: middle;
}
.wpdvlp-sub-tabs .nav-tabs .nav-tab.wpdevelop-submenu-tab-selected,
.wpdvlp-sub-tabs .nav-tabs .nav-tab.wpdevelop-submenu-tab-selected:hover {
border-color: #777;
border-bottom-color: #AAB;
text-shadow: 0 0px 0 #111;
border-width: 1px;
color: #FFF !important;
background: none repeat scroll 0 0 #7A7A88 !important;
}
.wpdvlp-top-tabs .nav-tabs .nav-tab.wpdevelop-tab-disabled,
.wpdvlp-sub-tabs .nav-tabs .nav-tab.wpdevelop-submenu-tab-disabled {
color: #bbb;
text-shadow: 0 -1px 1px #fff;
}
.wpdvlp-top-tabs .nav-tabs .nav-tab.nav-tab-active.wpdevelop-tab-disabled,
.wpdvlp-sub-tabs .nav-tabs .nav-tab.wpdevelop-submenu-tab-selected.wpdevelop-submenu-tab-disabled {
color: #555 !important;
text-shadow: 0 0 1px #aaa;
}
.wpdvlp-sub-tabs .nav-tabs .nav-tab.go-to-link,
.wpdvlp-sub-tabs .nav-tabs .nav-tab.go-to-link:hover,
.wpdvlp-sub-tabs .nav-tabs .nav-tab.go-to-link:active {
box-shadow: 0 0 0;
font-weight: 400;
border:none;
background: transparent !important;
margin:0 0 -4px;
box-shadow: none;
}
.wpdvlp-sub-tabs .nav-tabs .nav-tab.go-to-link span {
border-bottom: 1px dashed;
padding:0 2px;
}
.wpdvlp-sub-tabs .opsd_submit_button {
float:right;
margin:0px 5px 0px 0px;
}
.wpdvlp-sub-tabs .wpdevelop-submenu-tab-separator-vertical {
-moz-box-shadow: 1px 0px 0px #FEFEFE;
-webkit-box-shadow: 1px 0px 0px #FEFEFE;
box-shadow: 1px 0px 0px #FEFEFE;
border-right: #BBB solid 1px;
border-left: #CCC solid 1px;
background: none;
color: #777;
padding: 5px 0px 5px;
margin: 10px 15px 0px 10px;
}
.clear-for-mobile {
display:none;
}
/* iPad mini and all iPhones and other Mobile Devices */
@media (max-width: 782px) {
/* Settings Top TABS */
.wpdvlp-top-tabs .nav-tab {
padding: 10px 15px 5px;
padding: 8px 15px 8px;
font-size: 1.2em;
}
.wpdvlp-top-tabs .nav-tab .nav-tab-text {
display:none;
}
.wpdevelop-submenu-tab.nav-tab {
border-radius: 0 !important;
-moz-border-radius:0 !important;
-webkit-border-radius:0 !important;
display: block;
float: none;
width: auto;
clear:both;
vertical-align: middle !important;
border-bottom: 1px solid #bbb !important;
margin:-1px 0 0 !important;
padding:0px 10px !important;
height:3em !important;
line-height:3em !important;
}
.wpdevelop-submenu-tab-separator-vertical {
display:none;
}
.wpdevelop-submenu-tab.go-to-link {
border-bottom: none !important;
width:auto;
}
.clear-for-mobile {
clear:both;
width:100%;
height:10px;
display:block;
}
.wpdevelop-submenu-tab input[type="checkbox"] {
margin: -4px 0 0 8px !important
vertical-align: middle !important;
padding:0px !important;
}
}

View File

@@ -0,0 +1,589 @@
/**
* @version 1.0
* @package: Admin Panel
* @category: Admin UI
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-04-11
*/
/* Admin Content Pages */
/* Top Header at the page */
.opsd_page h2.opsd_header {
color: #595959;
font-size: 2em;
line-height: 2em;
padding:0;
text-shadow: 0 0 1px #aaaaaa;
margin-bottom:10px;
}
.opsd_page .wpdevelop label{
font-weight: 400;
}
.opsd_page .wpdevelop label.opsd-required{
font-weight: 600;
}
.opsd_page .wpdevelop optgroup {
font-weight: 600;
}
.opsd_page .wpdevelop .visibility_container {
display:none;
}
.opsd_page .wpdevelop .opsd-no-margin {
margin:0;
}
.opsd_page .wpdevelop .opsd-no-padding {
padding:0;
}
.wpdevelop a.button:focus,
.wpdevelop a.button:hover {
text-decoration: none;
}
/* Support CSS Classes **/
.wpdevelop .visible_items,
.visible_items {
display: block;
}
.wpdevelop .hidden_items,
.hidden_items {
display: none;
}
/* M E S S A G E S - Backward compatibility - For showing correctly messages in WP 4.0 */
.opsd_page .notice {
background: #fff;
border-left: 4px solid #fff;
-webkit-box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
margin: 5px 15px 2px;
padding: 1px 12px;
}
.opsd_page .notice-success,
.opsd_page div.updated {
border-left-color: #46b450;
}
.opsd_page div.notice-warning {
border-left-color: #ffb900;
}
.opsd_page .notice-error,
.opsd_page div.error {
border-left-color: #dc3232;
}
.opsd_page .notice-info {
border-left-color: #00a0d2;
}
/* Messages that show at top of admin panel pages */
.opsd_page div.opsd_inner_message {
padding:10px;
/* Overide position and style of Updated Message. If in new WP updates this meesage showing incorrectly, remove this code */
position: absolute;
display: inline;
z-index: 10000;
width: 98%;
margin: 3px 0 0;
top: 5px;
left: 0;
padding: 12px;
box-sizing: border-box;
min-height:1em;
height:auto;
/* From WordPress 4.4.1 */
/*
border-left: 4px solid #fff;
background: #fff none repeat scroll 0 0;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
*/
}
/* From WordPress 4.4.1 */
.opsd_page div.opsd_inner_message a.close,
.opsd_page div.opsd_inner_message a.close:hover,
.opsd_page div.opsd_inner_message a.close:focus{
font-size: 18px;
float: right;
text-decoration: none;
}
/* Form Messages */
.wpdevelop .alert.opsd-near-field-message {
height: auto;
font-size: 0.9em;
background-image: none;
}
/* Alerts & Help messages */
.opsd-info-message,
.opsd-error-message,
.opsd-success-message,
.opsd-help-message{
display: block;
margin: 10px 0;
padding: 5px 10px;
font-weight: 400;
text-align: center;
color:#777;
background-color: #faf8f8;
/* border: 1px solid #E6DB55;*/
border: 2px dashed #bbb;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
line-height: 1.9em;
font-size: 1em;
padding: 5px 10px !important;
width: auto !important;
box-sizing: padding-box;
-moz-box-sizing: padding-box;
-webkit-box-sizing: padding-box;
}
.opsd-help-message {
background-color: #FFFDFD;
text-align: left;
}
.opsd-error-message {
background-color: #FFEEEE;
border-color: #FFBBBB;
}
.opsd-success-message {
background-color: #F5FFF0;
border-color: #AAEEAA;
}
.opsd-demo-alert-not-allow {
color: #AA4400;
font-size: 1.1em;
font-weight: 400;
text-shadow: 0 -1px 0 #FFEEEE;
}
.opsd_inner_message {
margin-bottom: 25px !important;
}
.opsd_inner_message .close{
float: right;
font-size: 18px;
}
.opsd_page div.opsd_outer_message {
position: relative;
display: block;
margin: 5px 0 15px !important;
}
.alert.alert-block {
border:2px dashed;
}
.message {
border-left-width: 3px solid #f90;
clear: both;
display: block;
position: relative;
text-align: left;
}
/* Internal Settings Message */
.opsd-settings-notice {
background: #ffffff;
border-left: 4px solid #fff;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
margin: 5px 0 2px 0;
padding: 1px 12px;
line-height: 2.5em;
text-align:left;
}
.opsd-settings-notice.notice-success {
border-left-color: #46b450;
}
.opsd-settings-notice.notice-success.notice-alt {
background-color: #ecf7ed;
}
.opsd-settings-notice.notice-warning {
border-left-color: #ffb900;
}
.opsd-settings-notice.notice-warning.notice-alt {
background-color: #fff8e5;
}
.opsd-settings-notice.notice-error {
border-left-color: #dc3232;
}
.opsd-settings-notice.notice-error.notice-alt {
background-color: #fbeaea;
}
.opsd-settings-notice.notice-info {
border-left-color: #00a0d2;
}
.opsd-settings-notice.notice-info.notice-alt {
background-color: #e5f5fa;
}
/* Modal Content for popup windows ********************************************/
.opsd_popup_modal {
display: none;
}
/* Sort Table */
table.opsd_sort_table {
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
.opsd_sort_table thead th {
padding:8px 0;
text-align: center;
font-weight: 600;
font-size:1em;
color:#555 !important;
}
.opsd_sort_table tfoot th {
padding:10px;
}
.opsd_sort_table .widefat th.sort,
.opsd_sort_table .widefat td.sort {
width: 30px;
padding-top:4px;
padding-left:4px;
}
.opsd_sort_table .widefat td.sort::before{
color: #aaa;
content: "\f333";
display: inline-block;
font-family: dashicons;
font-size: 20px;
font-style: normal;
font-weight: 400;
height: 20px;
line-height: 1;
text-align: center;
text-decoration-color: inherit;
text-decoration-line: inherit;
text-decoration-style: inherit;
vertical-align: top;
width: 20px;
padding:4px 0 0 2px;
}
.opsd_sort_table .widefat td.sort span.glyphicon {
vertical-align: middle;
}
.opsd_sort_table .widefat td {
padding:0;
}
.opsd_sort_table .widefat th input[type=text],
.opsd_sort_table .widefat td input[type=text]{
width:100%;
margin:0;
padding-left:5px;
height: 36px;
}
.opsd_sortable_table.widefat {
background:#FAFAFA;
}
.opsd_sortable_table.widefat td.border_bottom {
border-bottom: 1px solid #ddd;
}
.opsd_sortable_table td input[type=text]{
border-radius: 0;
}
/* Color Picker */
.opsd_page .wpdevelop .wp-picker-container .wp-color-result,
.opsd_sortable_table td .wp-picker-container .wp-color-result {
height: 24px;
clear:both;
}
.opsd_sortable_table td .opsd-field-colors {
padding:2px 10px 2px;
border:1px solid #ccc;
font-weight: 600;
font-size:16px;
border-radius:3px;
-moz-border-radius:3px;
-webkit-border-radius:3px;
vertical-align: middle;
}
/* Settings table customization */
.opsd_page .form-table th,
.opsd_page .form-table td {
padding:10px 0;
}
.form-table th label {
line-height: 2em;
vertical-align: middle;
}
/* Dismiss button for Welcome Page Panel *************************************/
.opsd-panel-dismiss {
position: absolute;
top: 5px;
right: 10px;
padding: 8px 3px;
font-size: 13px;
text-decoration: none;
line-height: 1;
outline: 0 none;
cursor: pointer;
}
.opsd-panel-dismiss:before {
content: ' ';
position: absolute;
left: -12px;
width: 10px;
height: 100%;
background: url('../../../../../wp-admin/images/xit.gif') 0 7% no-repeat;
}
.opsd-panel-dismiss:hover:before {
background-position: 100% 7%;
}
/* SORTED Support Styles and Tricks *******************************************/
.opsd_mobile_legend {
display:none;
}
/* Align blocks */
.opsd-align-right {
float: right !important;
}
.opsd-align-left {
float: left !important;
}
/* Align text */
.opsd-text-right {
text-align: right !important;
}
.opsd-text-left {
text-align: left !important;
}
.opsd-text-center {
text-align: center !important;
}
.opsd-text-justify {
text-align: justify !important;
}
.clear-line {
clear:both;
width:100%;
}
/* Trick - Fix HEIGHT for the container with FLOAT elements inside */
.clearfix-height:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.clearfix-height {
display: inline-block;
}
html[xmlns] .clearfix-height {
display: block;
}
html[xmlns] .clearfix-height.hidden_items {
display: none;
}
* html .clearfix-height {
height: 1%;
}
/* Sortable table */
.opsd_sortable_table thead th {
padding:10px 0;
font-weight: 600;
}
.opsd_sortable_table tfoot th {
padding:10px;
}
.opsd_sortable_table .widefat th.sort,
.opsd_sortable_table .widefat td.sort {
width:30px;
}
.opsd_sortable_table .widefat td.sort::before{
color: #aaa;
content: "\f333";
display: inline-block;
font-family: dashicons;
font-size: 20px;
font-style: normal;
font-weight: 400;
height: 20px;
line-height: 1;
text-align: center;
text-decoration-color: inherit;
text-decoration-line: inherit;
text-decoration-style: inherit;
vertical-align: top;
width: 20px;
padding:4px 0 0 2px;
}
.branch-3-5 .opsd_sortable_table .widefat td.sort::before,
.branch-3-6 .opsd_sortable_table .widefat td.sort::before,
.branch-3-7 .opsd_sortable_table .widefat td.sort::before {
content: "=";
}
.opsd_sortable_table .widefat td {
padding:0;
}
.opsd_sortable_table .widefat th input[type=text],
.opsd_sortable_table .widefat td input[type=text]{
width:100%;
margin:0;
padding-left:5px;
}
/* Hack to fix checkbox height in Firefox, otherwise sometimes, there exist weird artefact */
@-moz-document url-prefix() {
.opsd_page input[type='checkbox'] {
/*height: auto;*/ /* FixIn: 1.1.1.1 */
}
.opsd_page input[type='radio'] {
/*height: auto;*/ /* FixIn: 1.1.1.1 */
/*height: 32px;*/
}
}
/* Ajax loading icon */
.opsd_ajax_icon {
font-size: 9px;
margin: 0px 5px 5px 5px;
line-height: 1em;
vertical-align: middle;
}
/* Rotate Icons for Loading ***********************************************/
.opsd_spin {
-webkit-animation: spin 2s infinite linear;
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
}
@-moz-keyframes spin {
0% {
-moz-transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
}
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
}
}
@-o-keyframes spin {
0% {
-o-transform: rotate(0deg);
}
100% {
-o-transform: rotate(359deg);
}
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
.opsd_rotate-90 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}
.opsd_rotate-180 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
}
.opsd_rotate-270 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
-webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg);
-ms-transform: rotate(270deg);
-o-transform: rotate(270deg);
transform: rotate(270deg);
}
.opsd_flip-horizontal {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);
-webkit-transform: scale(-1, 1);
-moz-transform: scale(-1, 1);
-ms-transform: scale(-1, 1);
-o-transform: scale(-1, 1);
transform: scale(-1, 1);
}
.opsd_flip-vertical {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);
-webkit-transform: scale(1, -1);
-moz-transform: scale(1, -1);
-ms-transform: scale(1, -1);
-o-transform: scale(1, -1);
transform: scale(1, -1);
}
/******************************************************************************/
/* iPad mini and all iPhones and other Mobile Devices */
@media (max-width: 782px) {
.opsd_mobile_legend {
display:inline;
font-size: 14px;
font-weight: 400;
float: left;
line-height: 1.3em;
}
.opsd_mobile_legend.clear{
float:none;
display:block;
}
.wpdevelop .hide-sm {
display:none;
}
/* Messages that show at top of admin panel pages */
.opsd_page div.opsd_inner_message {
/* Overide position and style of Updated Message. If in new WP updates this meesage showing incorrectly, remove this code */
margin: 20px 0 25px 10px;
position: fixed;
top: 32px;
width: 96%;
padding: 10px 12px;
min-height: 1em;
height: auto;
}
}
@media (max-width: 480px) {
.wpdevelop .hide-xs {
display:none;
}
}
/* Support new fonts in WP 4.6 */ /* FixIn: 6.2.2.4 */
.wpdevelop .label,
.wpdevelop strong {
font-weight: 600;
}
.wpdevelop [class^="icon-"] {
margin-top: 2px;
}
.wpdevelop .button [class^="icon-"] {
margin-top: 3px;
}

View File

@@ -0,0 +1,441 @@
/**
* @version 1.1
* @package: Tabs
* @category: Admin UI
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-10-29
*/
/* DropDown Selectbox */
.wpdevelop .btn-group.open .dropdown-toggle {
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.125) inset;
background: #ccc;
}
/* Drop Down Menu */
.wpdevelop ul.dropdown-menu {
display: none;
}
.wpdevelop .dropdown-menu li {
padding:0;
margin:0;
}
.wpdevelop .dropdown-menu li.dropdown-header {
padding:0 15px;
color: #999;
font-size: 0.8em;
font-style: italic;
font-weight: 600;
}
.wpdevelop .dropdown-menu > .disabled > a,
.wpdevelop .dropdown-menu > .disabled > a:focus,
.wpdevelop .dropdown-menu > .disabled > a:hover {
color:#ccc;
}
.wpdevelop .dropdown-menu > li > a,
.wpdevelop .dropdown-menu a {
clear: both;
display: block;
font-weight: 400;
padding:5px 15px;
white-space: nowrap;
font-size:13px;
line-height: 18px;
}
.wpdevelop .dropdown-menu li > a:hover,
.wpdevelop .dropdown-menu li.active > a,
.wpdevelop .dropdown-menu li.active > a:hover {
background: #08c;
color: #fff;
text-decoration-color: -moz-use-text-color;
text-decoration-line: none;
text-decoration-style: solid;
}
/* radio button or checbox togther with selctbox as option in dropdown list */
.wpdevelop .dropdown-menu li .btn-toolbar .input-group {
margin:2px 5px 4px 5px;
}
.wpdevelop .dropdown-menu li .btn-toolbar .input-group .input-group-addon {
background: none;
border: none;
box-shadow: none;
}
.wpdevelop .dropdown-menu li .btn-toolbar .input-group .input-group-addon input {
margin:0 5px 0 0;
vertical-align: middle;
}
.wpdevelop .dropdown-menu li .btn-toolbar .input-group .input-group-addon label {
color: #444;
margin: 0;
vertical-align: middle;
line-height: 16px;
}
.wpdevelop .dropdown-menu li .btn-toolbar .input-group select {
border-radius:0px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
}
/* button group in drop down list*/
.wpdevelop .dropdown-menu li .btn-toolbar .btn-group {
float: right;
margin: 0 5px;
}
.wpdevelop .dropdown-menu li .btn-toolbar .btn-group a.button {
clear:none;
}
.wpdevelop .dropdown-menu li .btn-toolbar .input-group.text-group {
display:block;
}
.wpdevelop .dropdown-menu li .btn-toolbar .input-group.text-group .input-group-addon {
text-align: left;
}
.wpdevelop .dropdown-menu li .btn-toolbar .input-group.text-group .dropdown-menu-text-element{
box-sizing: padding-box;
float: left;
font-size: 11px;
padding: 0 0 0 15px;
width: 50%;
}
.wpdevelop .dropdown-menu li .btn-toolbar .input-group.text-group .dropdown-menu-text-element.dropdown-menu-text-element-count-1 {
width: 100%;
}
.wpdevelop .dropdown-menu li .btn-toolbar .input-group.text-group .dropdown-menu-text-element input[type=text] {
font-size: 12px;
width: 100%;
}
/* Containers in Toolbars */
.wpdevelop .visibility_container .tab-bottom {
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background: none repeat scroll 0 0 #EEE;
border-color: #BBC;
border-width: 1px;
border-style: dashed solid solid;
border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-radius: 0 0 5px 5px;
-ms-border-radius: 0 0 5px 5px;
box-shadow: 0 0 1px #DDD;
padding: 0px 7px;
position: absolute;
margin-top: 4px;
}
.wpdevelop .visibility_container .tab-bottom a {
color:#777;
}
.wpdevelop .visibility_container .control-group {
float:left;
margin-right:15px;
margin-top:8px;
min-height: 29px;
}
.wpdevelop .control-group .dropdown-toggle label.label_in_filters {
font-weight: 600;
}
/* Buttons Group */
.wpdevelop .btn-group a.button:focus,
.wpdevelop .btn-group a.button:hover,
.wpdevelop .form-group .input-group a.button:focus,
.wpdevelop .form-group .input-group a.button:hover{
text-decoration: none;
}
.wpdevelop .control-group .btn-group > .button{
float: left;
margin:0 0 0 -1px;
position: relative;
}
.wpdevelop .control-group .btn-group > .button.active {
background-color: #E6E6E6;
background-image: none;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) inset, 0 1px 2px rgba(0, 0, 0, 0.05);
color: rgba(0, 0, 0, 0.5);
outline: 0 none;
border-color: #CCCCCC;
}
/* control-group | btn-group */
.wpdevelop .control-group .btn-toolbar .input-group > input[type='text'],
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-btn .button {
height: 34px;
line-height: 1.42857143;
height: 28px;
}
.wpdevelop .control-group .btn-toolbar .input-group > select,
.wpdevelop .control-group .btn-toolbar .input-group > input[type='text'],
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-addon {
padding: 4px 12px;
font-size: 13px;
box-shadow: inset 0 0px 0 #fff,0 1px 0 rgba(0,0,0,.08);
}
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-addon {
text-shadow: 0 1px 1px #fff;
background-color: #eee;
color: #444;
}
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-addon > input {
vertical-align: bottom;
}
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-btn .button {
line-height: 26px;
font-size: 13px;
vertical-align: middle;
padding: 0 10px -1px;
}
.wpdevelop .control-group .btn-toolbar .input-group > input[type='text'] {
padding: 4px 4px 4px 8px;
height: 28px;
}
.wpdevelop .control-group .btn-toolbar .input-group > select {
height: 28px;
line-height: 22px;
padding: 0 12px;
font-size: 13px;
}
.wpdevelop .control-group .btn-toolbar .input-group > select option:disabled {
color: #bbb;
}
.wpdevelop .control-group .btn-toolbar .input-group .input-group-btn .button {
box-shadow: 0 0 0 #ffffff inset, 0 1px 0 rgba(0, 0, 0, 0.08);
}
.wpdevelop .control-group-text {
float:left;
margin-right:10px;
height:28px;
line-height:28px;
}
.wpdevelop .btn-toolbar .input-group > .input-group-btn .button.disabled,
.wpdevelop .btn-toolbar .btn-group > .button.disabled,
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-btn .button.disabled,
.wpdevelop .control-group .btn-toolbar .btn-group > .button.disabled {
box-shadow: 0 1px 0 #cfcfcf !important;
}
.wpdevelop .btn-toolbar .input-group > .input-group-btn .button.active,
.wpdevelop .btn-toolbar .btn-group > .button.active,
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-btn .button.active,
.wpdevelop .control-group .btn-toolbar .btn-group > .button.active {
transform: none;
border-color: #ccc;
}
.wpdevelop .control-group .btn-toolbar .input-group > input[type='text'],
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-btn .button,
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-addon,
.wpdevelop .control-group .btn-toolbar .btn-group > .button,
.wpdevelop .control-group .btn-toolbar .btn-group > input[type=text],
.wpdevelop .control-group .btn-toolbar .btn-group > select {
border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
}
.wpdevelop .control-group .btn-toolbar .input-group > input[type='text']:first-child,
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-btn:first-child .button,
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-addon:first-child,
.wpdevelop .control-group .btn-toolbar .btn-group > .button:first-child,
.wpdevelop .control-group .btn-toolbar .btn-group > input[type=text]:first-child,
.wpdevelop .control-group .btn-toolbar .btn-group > select:first-child {
border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
-webkit-border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
-webkit-border-top-left-radius: 4px;
}
.wpdevelop .control-group .btn-toolbar .input-group > input[type='text']:last-child,
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-btn:last-child .button,
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-addon:last-child,
.wpdevelop .control-group .btn-toolbar .btn-group > .button:last-child,
.wpdevelop .control-group .btn-toolbar .btn-group > input[type=text]:last-child,
.wpdevelop .control-group .btn-toolbar .btn-group > select:last-child {
border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
-webkit-border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
-moz-border-radius-topright: 4px;
-webkit-border-top-right-radius: 4px;
margin-left: -1px;
}
.wpdevelop .control-group .btn-group .dropdown-toggle label{
margin-bottom: 3px;
}
.wpdevelop .control-group .btn-group .dropdown-toggle span.opsd_selected_in_dropdown{
display: inline-block;
vertical-align: middle;
margin-bottom: 3px;
}
/* .form-group */
.wpdevelop .form-group .input-group > .button,
.wpdevelop .form-group .input-group .input-group-btn .button {
display: inline-block;
font-size: 14px;
font-weight: 400;
height:34px;
line-height: 1.42857;
margin-bottom: 0;
padding: 6px 12px;
text-align: center;
vertical-align: middle;
white-space: nowrap;
border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
}
.wpdevelop .form-group .input-group .input-group-btn .btn-toolbar .btn-group .button {
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
margin:0;
}
.wpdevelop .form-group .input-group > .button:first-child,
.wpdevelop .form-group .input-group > input[type=text]:first-child,
.wpdevelop .form-group .input-group > select:first-child,
.wpdevelop .form-group .input-group .input-group-btn:first-child .button,
.wpdevelop .form-group .input-group .input-group-btn .btn-toolbar .btn-group .button:first-child{
border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
-webkit-border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
-webkit-border-top-left-radius: 4px;
margin-left: 0;
}
.wpdevelop .form-group .input-group > .button:last-child,
.wpdevelop .form-group .input-group > input[type=text]:last-child,
.wpdevelop .form-group .input-group > select:last-child,
.wpdevelop .form-group .input-group > .dropdown-toggle,
.wpdevelop .form-group .input-group > .input-group-btn:last-child .button,
.wpdevelop .form-group .input-group .input-group-btn .btn-toolbar > .btn-group > .button:last-child {
border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
-webkit-border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
-moz-border-radius-topright: 4px;
-webkit-border-top-right-radius: 4px;
margin-left: -1px;
}
.wpdevelop .form-group .input-group ul.dropdown-menu {
margin-top:0;
border-top-right-radius: 0;
-moz-border-radius-topright: 0;
-webkit-border-top-right-radius: 0;
border-top-left-radius: 0;
-moz-border-radius-topleft: 0;
-webkit-border-top-left-radius: 0;
}
/* Fix: for showing correct width in Chrome. Its trick, so need to test more... 2016-08-31 */
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-addon,
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-btn {
width:auto;
}
/* .btn-group-vertical */
.wpdevelop .btn-group-vertical > .button,
.wpdevelop .btn-group-vertical > .btn-group,
.wpdevelop .btn-group-vertical > .btn-group > .button {
display: block;
float: none;
width: 100%;
max-width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom: 0;
}
.wpdevelop .btn-group-vertical > .btn-group > .button {
float: none;
}
.wpdevelop .btn-group-vertical > .button + .button,
.wpdevelop .btn-group-vertical > .button + .btn-group,
.wpdevelop .btn-group-vertical > .btn-group + .button,
.wpdevelop .btn-group-vertical > .btn-group + .btn-group {
margin-top: -1px;
margin-left: 0;
}
.wpdevelop .btn-group-vertical > .button:not(:first-child):not(:last-child) {
border-radius: 0;
}
.wpdevelop .btn-group-vertical > .button:first-child:not(:last-child) {
border-top-right-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.wpdevelop .btn-group-vertical > .button:last-child:not(:first-child) {
border-bottom-left-radius: 4px;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.wpdevelop .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .button {
border-radius: 0;
}
.wpdevelop .btn-group-vertical > .btn-group:first-child:not(:last-child) > .button:last-child,
.wpdevelop .btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.wpdevelop .btn-group-vertical > .btn-group:last-child:not(:first-child) > .button:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
/*******************************************************************************/
@media (max-width: 782px) {
.wpdevelop .opsd-sm-100 {
width:100% !important;
}
/* .wpdevelop .control-group .btn-toolbar .input-group {
margin-bottom: 10px;
}*/
.wpdevelop .in-button-text {
display:none;
}
.wpdevelop .control-group .btn-group > .button,
.wpdevelop .control-group .btn-toolbar .btn-group > .button,
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-btn .button {
height: 34px;
line-height: 1.5em;
}
.wpdevelop .control-group .btn-toolbar .input-group > input[type='text']{
height: 40px;
padding: 0 12px;
line-height: 29px;
font-size: 1.2em;
}
#wpbody .wpdevelop .control-group .btn-toolbar .input-group > select {
height: 34px;
line-height: 28px;
font-size: 1.2em;
}
.wpdevelop .control-group-text {
height: 34px;
line-height: 34px;
}
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-addon,
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-btn {
height: 40px;
}
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-btn .button {
margin:0 0 0 -1px;
height: 40px;
line-height: 39px;
padding: 0 15px;
}
.wpdevelop .control-group .btn-toolbar .input-group > .input-group-addon {
padding-top:0;
padding-bottom:0;
}
}
@media (max-width: 400px) {
.wpdevelop .opsd-sm-100 {
width:100% !important;
}
}

View File

@@ -0,0 +1,61 @@
/**
* @version 1.0
* @desciption Dismiss Button and System Notices
* @usage Admin panel
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2017-04-23
*/
/* System Notice */
.opsd_page .opsd_system_notice {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
min-height:1em;
height:auto;
padding: 1em;
margin: 5px 0 15px !important;
position: relative;
display: block;
width:100%
}
.opsd_page .opsd_internal_notice {
box-sizing: border-box;
min-height: 1em;
height: auto;
position: relative;
display: block;
width: 100%;
background: #fff;
border-left-style: solid;
border-left-width: 4px;
-moz-box-shadow: 0 0 2px 0 rgba(0,0,0,.2);
-webkit-box-shadow: 0 0 2px 0 rgba(0,0,0,.2);
box-shadow: 0 0 2px 0 rgba(0,0,0,.2);
margin: 5px 15px 2px;
}
.opsd_page .opsd_system_notice a,
.opsd_page .opsd_system_notice a:hover,
.opsd_page .opsd_system_notice a:focus,
.opsd_page .opsd_internal_notice a,
.opsd_page .opsd_internal_notice a:hover,
.opsd_page .opsd_internal_notice a:focus {
text-decoration: none;
}
/* Dismiss X button */
.opsd_page .opsd_dismiss,
.opsd_page a.opsd_dismiss:hover,
.opsd_page a.opsd_dismiss:focus{
font-size: 18px;
float: right;
text-decoration: none;
padding: 5px 10px 10px;
margin: -7px;
outline: none;
}

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,74 @@
/**
* @version 1.0
* @package: Admin Panel
* @category: Admin UI
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-04-11
*/
/* Admin Content Pages */
.opsd_page .opsd_admin_page .opsd_header_margin {
height:10px;
}
/* Collapse & expand elements in settings meta boxes */
.opsd_page .meta-box .postbox .handlediv {
background: url("../../../../../../wp-admin/images/arrows.png") no-repeat scroll 5px -27px transparent;
}
.opsd_page .meta-box .postbox.closed .handlediv {
background-position:5px 10px;
}
.opsd_page .meta-box .postbox .handlediv:hover {
cursor: pointer !important;
}
.opsd_page .meta-box .postbox .hndle:hover {
cursor: default !important;
}
/* Settings Menuboxes */
.opsd_settings_row.opsd_settings_row_left {
width:64%;
float:left;
margin-right:1%;
}
.opsd_settings_row.opsd_settings_row_right {
width:35%;
float:left;
}
/* Set switched Meta Boxes size*/
.opsd_settings_row.opsd_settings_row_left_small {
width:35%;
}
.opsd_settings_row.opsd_settings_row_right_big {
width:64%;
}
/* FixIn: 7.0.1.54 */
.opsd_page input::-moz-placeholder,
.opsd_page textarea::-moz-placeholder{
color: #ccc;
opacity: 1;
}
.opsd_page input:-ms-input-placeholder,
.opsd_page textarea:-ms-input-placeholder{
color: #ccc;
}
.opsd_page input::-webkit-input-placeholder,
.opsd_page textarea::-webkit-input-placeholder{
color: #ccc;
}
/* iPad mini and all iPhones and other Mobile Devices */
@media (max-width: 782px) {
/* Settings Top TABS */
.opsd_page .opsd_admin_page .metabox-holder .opsd_settings_row {
width:100%;
float:none;
}
.opsd_text_hide_mobile {
display:none;
}
}

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,81 @@
<?php /**
* @version 1.0
* @package: Emails
* @category: Templates
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-06-16
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* get email template
*
* @param array $fields_values
*/
function opsd_email_template_plain_html( $fields_values ) {
ob_start();
// $base_color = 'background-color:' . ( empty( $fields_values['base_color'] ) ? '#557da1' : $fields_values['base_color'] ) . ';';
// $background_color = 'background-color:' . ( empty( $fields_values['background_color'] ) ? '#FDFDFD' : $fields_values['background_color'] ) . ';';
// $body_color = 'background-color:' . ( empty( $fields_values['body_color'] ) ? '#F5F5F5' : $fields_values['body_color'] ) . ';';
// $text_color = 'color:' . ( empty( $fields_values['text_color'] ) ? '#333333' : $fields_values['text_color'] ) . ';';
$base_color = '';
$background_color = '';
$body_color = '';
$text_color = '';
////////////////////////////////////////////////////////////////////////////////
// HTML Email Template
////////////////////////////////////////////////////////////////////////////////
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <!-- dir="<?php echo is_rtl() ? 'rtl' : 'ltr'?>" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
</head>
<body style="Margin:0;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;min-width:100%;<?php echo $body_color; ?>" <?php echo is_rtl() ? 'rightmargin="0"' : 'leftmargin="0"'; ?> >
<div class="wrapper" style="table-layout:fixed;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;Margin:0;padding-top:10px;padding-bottom:10px;padding-right:10px;padding-left:10px;<?php echo $body_color; ?>" <?php echo is_rtl() ? 'dir="rtl"' : 'dir="ltr"'?> >
<?php
if ( ! empty( $fields_values['header_content'] ) ) {
?><p style="Margin:0;Margin-bottom:10px;font-family:Helvetica, Roboto, Arial, sans-serif;line-height:150%;font-size:14px;" ><?php
echo ( wp_kses_post( wptexturize( $fields_values['header_content'] ) ) );
?></p><?php
}
?><p style="Margin:0;font-size:14px;Margin-bottom:10px;font-family:Helvetica, Roboto, Arial, sans-serif;line-height:150%;<?php echo $text_color; ?>" ><?php
$h2_headers = array('<p class="h2" style="Margin-bottom:10px;font-family:Helvetica, Roboto, Arial, sans-serif;display:block;font-size:18px;font-weight:bold;line-height:130%;Margin:16px 0 8px;text-align:left;color:#557da1;" >', '</p>');
$fields_values['content'] = str_replace( array( '<h2>', '</h2>' ), $h2_headers, $fields_values['content'] );
echo ( wp_kses_post( wptexturize( $fields_values['content'] ) ) );
?></p><?php
if ( ! empty( $fields_values['footer_content'] ) ) {
?><p style="Margin:0;Margin-bottom:10px;font-family:Helvetica, Roboto, Arial, sans-serif;line-height:150%;font-size:11px;" ><?php
echo ( wp_kses_post( wptexturize( $fields_values['footer_content'] ) ) );
?></p><?php
}
?>
</div>
</body>
<?php
return ob_get_clean(); // Return this email content
}

View File

@@ -0,0 +1,37 @@
<?php /**
* @version 1.0
* @package: Emails
* @category: Templates
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-06-16
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* get email template
*
* @param array $fields_values
*/
function opsd_email_template_plain_text( $fields_values ) {
ob_start();
if ( ! empty($fields_values['header_content'] ) ) {
echo wp_kses_post( wptexturize( $fields_values['header_content'] ) ) . "\n\n"; //Header
}
echo ( wp_kses_post( wptexturize( $fields_values['content'] ) ) ); //Content
if ( ! empty( $fields_values['footer_content'] ) ) {
echo "\n\n" . wp_kses_post( wptexturize( $fields_values['footer_content'] ) ); //Footer
}
return ob_get_clean(); // Return this email content
}

View File

@@ -0,0 +1,654 @@
<?php /**
* @version 1.0
* @package: Emails
* @category: Templates
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-06-16
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* get email template
*
* @param array $fields_values
*/
function opsd_email_template_standard_html( $fields_values ) {
ob_start();
$base_color = 'background-color:' . ( empty( $fields_values['base_color'] ) ? '#557da1' : $fields_values['base_color'] ) . ';';
$background_color = 'background-color:' . ( empty( $fields_values['background_color'] ) ? '#FDFDFD' : $fields_values['background_color'] ) . ';';
$body_color = 'background-color:' . ( empty( $fields_values['body_color'] ) ? '#F5F5F5' : $fields_values['body_color'] ) . ';';
$text_color = 'color:' . ( empty( $fields_values['text_color'] ) ? '#333333' : $fields_values['text_color'] ) . ';';
////////////////////////////////////////////////////////////////////////////////
// HTML Email Template
////////////////////////////////////////////////////////////////////////////////
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <!-- dir="<?php echo is_rtl() ? 'rtl' : 'ltr'?>" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<style type="text/css">
body {
Margin: 0;
padding: 0;
min-width: 100%;
<?php echo $background_color; ?>
}
table {
border-spacing: 0;
font-family: sans-serif;
<?php echo $text_color; ?>
}
td {
padding: 0;
}
img {
border: 0;
}
.wrapper {
width: 100%;
table-layout: fixed;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
Margin: 0;
padding: 70px 0 70px 0;
<?php echo $background_color; ?>
}
.webkit {
max-width: 600px;
}
@-ms-viewport {
width: device-width;
}
.outer {
Margin: 0 auto;
width: 96%;
max-width: 600px;
box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;
border: 1px solid #dcdcdc;
border-radius: 3px !important;
<?php echo $body_color; ?>
}
.full-width-image img {
width: 100%;
height: auto;
}
.header {
border-radius: 3px 3px 0 0 !important;
color: #ffffff; border-bottom: 0;
font-weight: bold;
line-height: 100%;
vertical-align: middle;
font-family: Helvetica, Roboto, Arial, sans-serif;
<?php echo $base_color; ?>
}
.footer .inner {
text-align: center;
}
.footer .inner p {
font-size: 11px;
}
.inner {
padding: 48px;
}
.header .inner {
padding: 10px;
}
p {
Margin: 0;
}
p.footer {
font-size: 11px;
}
a {
color: #ee6a56;
text-decoration: underline;
}
.h1 {
font-size: 21px;
font-weight: bold;
Margin-bottom: 18px;
}
.header .inner .h1 {
color: #ffffff;
display: block;
font-family: Helvetica, Roboto, Arial, sans-serif;
font-size: 30px;
font-weight: 300;
line-height: 150%;
Margin: 0;
padding: 26px 48px;
text-align: left;
text-shadow: 0 1px 0 #7797b4;
-webkit-font-smoothing: antialiased;
}
.h2 {
font-size: 18px;
font-weight: bold;
Margin-bottom: 12px;
}
.one-column .contents {
text-align: left;
}
.one-column p {
font-size: 14px;
Margin-bottom: 10px;
font-family: Helvetica, Roboto, Arial, sans-serif;
font-size: 14px;
line-height: 150%;
color: #737373;
}
.one-column p.h2,
.two-column .column .contents p.h2 {
display: block;
font-size: 18px;
font-weight: bold;
line-height: 130%;
Margin: 16px 0 8px;
text-align: left;
color: #557da1;
}
.two-column {
text-align: center;
font-size: 0;
}
.two-column .column {
width: 100%;
max-width: 280px;
display: inline-block;
vertical-align: top;
}
.two-column .column .contents p{
font-size: 14px;
Margin-bottom: 10px;
font-family: Helvetica, Roboto, Arial, sans-serif;
font-size: 14px;
line-height: 150%;
color: #737373;
}
.two-column .inner,
.footer .inner {
padding: 10px 48px;
}
.contents {
width: 100%;
}
.header .inner {
width: 100%;
}
.footer .inner {
width: 100%;
border-top:1px solid #dddddd;
}
.two-column .contents {
font-size: 14px;
text-align: left;
}
.two-column img {
width: 100%;
height: auto;
}
.two-column .text {
padding-top: 10px;
}
.two-column p {
font-size: 14px;
Margin-bottom: 10px;
font-family: Helvetica, Roboto, Arial, sans-serif;
font-size: 14px;
line-height: 150%;
color: #737373;
}
@media screen and (max-width: 400px) {
.two-column .column {
max-width: 100% !important;
}
}
@media screen and (min-width: 401px) and (max-width: 620px) {
.two-column .column {
max-width: 50% !important;
}
}
</style>
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
table {border-collapse: collapse !important;}
</style>
<![endif]-->
</head>
<body style="Margin:0;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;min-width:100%;<?php echo $background_color; ?>" <?php echo is_rtl() ? 'rightmargin="0"' : 'leftmargin="0"'; ?> >
<center class="wrapper" style="width:100%;table-layout:fixed;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;Margin:0;padding-top:70px;padding-bottom:70px;padding-right:0;padding-left:0;<?php echo $background_color; ?>" <?php echo is_rtl() ? 'dir="rtl"' : 'dir="ltr"'?> >
<div class="webkit" style="max-width:600px;" >
<!--[if (gte mso 9)|(IE)]>
<table width="600" align="center" style="border-spacing:0;font-family:sans-serif;<?php echo $text_color; ?>" >
<tr>
<td style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;" >
<![endif]-->
<table class="outer" align="center" style="border-spacing:0;font-family:sans-serif;<?php echo $text_color; ?><?php echo $body_color; ?>Margin:0 auto;width:96%;max-width:600px;box-shadow:0 1px 4px rgba(0,0,0,0.1) !important;border-width:1px;border-style:solid;border-color:#dcdcdc;border-radius:3px !important;" >
<?php if ( ! empty( $fields_values['header_img600_src'] ) ) { ?>
<!-- Header IMG: 1 column template row -->
<tr> <!-- This image must be 600px width (NOT wider). If less, then we need to set in CSS width in px of this image -->
<td class="full-width-image" style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;" >
<img src="images/header.jpg" alt="" style="border-width:0;width:100%;height:auto;" /> <!-- src="<?php $fields_values['header_img600_src']; ?>" -->
</td>
</tr>
<?php } ?>
<!-- Header: 1 column template row -->
<tr>
<td class="one-column" style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;" >
<table width="100%" class="header" style="<?php echo $base_color; ?>border-spacing:0;border-radius:3px 3px 0 0 !important;color:#ffffff;border-bottom-width:0;font-weight:bold;line-height:100%;vertical-align:middle;font-family:Helvetica, Roboto, Arial, sans-serif;" >
<tr>
<td class="inner" style="padding-top:10px;padding-bottom:10px;padding-right:10px;padding-left:10px;width:100%;" >
<p class="h1" style="Margin-bottom:10px;color:#ffffff;display:block;font-family:Helvetica, Roboto, Arial, sans-serif;font-size:30px;font-weight:300;line-height:150%;Margin:0;padding-top:26px;padding-bottom:26px;padding-right:48px;padding-left:48px;text-align:left;text-shadow:0 1px 0 #7797b4;-webkit-font-smoothing:antialiased;" ><?php echo ( wp_kses_post( wptexturize( $fields_values['header_content'] ) ) ); ?></p>
</td>
</tr>
</table>
</td>
</tr>
<!-- Content: 1 column template row -->
<tr>
<td class="one-column" style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;" >
<table width="100%" style="border-spacing:0;font-family:sans-serif;<?php echo $text_color; ?>" >
<tr>
<td class="inner contents" style="padding-top:48px;padding-bottom:48px;padding-right:48px;padding-left:48px;width:100%;text-align:left;" >
<p style="Margin:0;font-size:14px;Margin-bottom:10px;font-family:Helvetica, Roboto, Arial, sans-serif;line-height:150%;color:#737373;" ><?php
$h2_headers = array('<p class="h2" style="Margin-bottom:10px;font-family:Helvetica, Roboto, Arial, sans-serif;display:block;font-size:18px;font-weight:bold;line-height:130%;Margin:16px 0 8px;text-align:left;color:#557da1;" >', '</p>');
$fields_values['content'] = str_replace( array( '<h2>', '</h2>' ), $h2_headers, $fields_values['content'] );
echo ( wp_kses_post( wptexturize( $fields_values['content'] ) ) );
?></p>
</td>
</tr>
</table>
</td>
</tr>
<!-- Footer: 1 column template row -->
<tr>
<td class="one-column" style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;" >
<table width="100%" class="footer" style="border-spacing:0;font-family:sans-serif;<?php echo $text_color; ?>" >
<tr>
<td class="inner" style="text-align:center;padding-top:10px;padding-bottom:10px;padding-right:48px;padding-left:48px;width:100%;border-top-width:1px;border-top-style:solid;border-top-color:#dddddd;" >
<p style="Margin:0;Margin-bottom:10px;font-family:Helvetica, Roboto, Arial, sans-serif;line-height:150%;color:#737373;font-size:11px;" >
<?php /* <a style="color:#ee6a56;text-decoration:underline;" >Forward to a Friend</a> &nbsp; &nbsp; <a style="color:#ee6a56;text-decoration:underline;" >Unsubscribe</a> &nbsp; &nbsp; <a style="color:#ee6a56;text-decoration:underline;" >Preferences</a><br /> */
echo ( wp_kses_post( wptexturize( $fields_values['footer_content'] ) ) ); ?>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</div>
</center>
</body>
<?php
return ob_get_clean(); // Return this email content
}
return;
// Exist from this file, at the bottom - original static HTML template for email
// <editor-fold defaultstate="collapsed" desc=" Source Code of template for parsing at http://inliner.cm/ " >
////////////////////////////////////////////////////////////////////////////////
// Source Code of template for parsing at http://inliner.cm/
////////////////////////////////////////////////////////////////////////////////
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <!-- dir="<?php echo is_rtl() ? 'rtl' : 'ltr'?>" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<style type="text/css">
body {
Margin: 0;
padding: 0;
min-width: 100%;
background-color: #ffffff;
}
table {
border-spacing: 0;
font-family: sans-serif;
color: #333333;
}
td {
padding: 0;
}
img {
border: 0;
}
.wrapper {
width: 100%;
table-layout: fixed;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
Margin: 0;
padding: 70px 0 70px 0;
background-color: #f5f5f5;
}
.webkit {
max-width: 600px;
}
@-ms-viewport {
width: device-width;
}
/* width 100% */
.outer {
Margin: 0 auto;
width: 96%;
max-width: 600px;
box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;
border: 1px solid #dcdcdc;
border-radius: 3px !important;
background-color: #fdfdfd;
}
.full-width-image img {
width: 100%;
height: auto;
}
.header {
border-radius: 3px 3px 0 0 !important;
color: #ffffff; border-bottom: 0;
font-weight: bold;
line-height: 100%;
vertical-align: middle;
font-family: Helvetica, Roboto, Arial, sans-serif;
background-color: #557da1;
}
.footer .inner {
text-align: center;
}
.footer .inner p {
font-size: 11px;
}
.inner {
padding: 48px;
}
.header .inner {
padding: 10px;
}
p {
Margin: 0;
}
p.footer {
font-size: 11px;
}
a {
color: #ee6a56;
text-decoration: underline;
}
.h1 {
font-size: 21px;
font-weight: bold;
Margin-bottom: 18px;
}
.header .inner .h1 {
color: #ffffff;
display: block;
font-family: Helvetica, Roboto, Arial, sans-serif;
font-size: 30px;
font-weight: 300;
line-height: 150%;
Margin: 0;
padding: 26px 48px;
text-align: left;
text-shadow: 0 1px 0 #7797b4;
-webkit-font-smoothing: antialiased;
}
.h2 {
font-size: 18px;
font-weight: bold;
Margin-bottom: 12px;
}
.one-column .contents {
text-align: left;
}
.one-column p {
font-size: 14px;
Margin-bottom: 10px;
font-family: Helvetica, Roboto, Arial, sans-serif;
font-size: 14px;
line-height: 150%;
color: #737373;
}
.one-column p.h2,
.two-column .column .contents p.h2 {
display: block;
font-size: 18px;
font-weight: bold;
line-height: 130%;
Margin: 16px 0 8px;
text-align: left;
color: #557da1;
}
.two-column {
text-align: center;
font-size: 0;
}
/* Previously 300px. - TODO: need to test if we really need to have here 280 or 300px in the different email applications. Also its possible that we need to have header images, not 280px but only 260px.... */
.two-column .column {
width: 100%;
max-width: 280px;
display: inline-block;
vertical-align: top;
}
.two-column .column .contents p{
font-size: 14px;
Margin-bottom: 10px;
font-family: Helvetica, Roboto, Arial, sans-serif;
font-size: 14px;
line-height: 150%;
color: #737373;
}
.two-column .inner,
.footer .inner {
padding: 10px 48px;
}
.contents {
width: 100%;
}
.header .inner {
width: 100%;
}
.footer .inner {
width: 100%;
border-top:1px solid #dddddd;
}
.two-column .contents {
font-size: 14px;
text-align: left;
}
.two-column img {
width: 100%;
height: auto;
}
.two-column .text {
padding-top: 10px;
}
.two-column p {
font-size: 14px;
Margin-bottom: 10px;
font-family: Helvetica, Roboto, Arial, sans-serif;
font-size: 14px;
line-height: 150%;
color: #737373;
}
/*Media Queries*/
@media screen and (max-width: 400px) {
.two-column .column {
max-width: 100% !important;
}
}
@media screen and (min-width: 401px) and (max-width: 620px) {
.two-column .column {
max-width: 50% !important;
}
}
</style>
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
table {border-collapse: collapse;}
</style>
<![endif]-->
</head>
<body> <!-- <?php echo is_rtl() ? 'rightmargin="0"' : 'leftmargin="0"'; ?> -->
<center class="wrapper" > <!-- <?php echo is_rtl() ? 'dir="rtl"' : 'dir="ltr"'?> -->
<div class="webkit">
<!--[if (gte mso 9)|(IE)]>
<table width="600" align="center">
<tr>
<td>
<![endif]-->
<table class="outer" align="center">
<!-- <?php if ( ! empty( $fields_values['header_img600_src'] ) ) { ?> -->
<!-- Header IMG: 1 column template row -->
<tr> <!-- This image must be 600px width (NOT wider). If less, then we need to set in CSS width in px of this image -->
<td class="full-width-image">
<img src="images/header.jpg" alt="" /> <!-- src="<?php $fields_values['header_img600_src']; ?>" -->
</td>
</tr>
<!-- <?php } ?> -->
<!-- Header: 1 column template row -->
<tr>
<td class="one-column">
<table width="100%" class="header">
<tr>
<td class="inner">
<p class="h1">HTML Email Header</p> <!-- <?php echo ( wp_kses_post( wptexturize( $fields_values['header_content'] ) ) ); ?> -->
</td>
</tr>
</table>
</td>
</tr>
<!-- Content: 1 column template row -->
<tr>
<td class="one-column">
<table width="100%">
<tr>
<td class="inner contents"> <!-- <?php echo ( wp_kses_post( wptexturize( $fields_values['content'] ) ) ); ?> -->
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed aliquet diam a facilisis eleifend. Cras ac justo felis. Mauris faucibus, orci eu blandit fermentum, lorem nibh sollicitudin mi, sit amet interdum metus urna ut lacus.</p>
<p class="h2">Lorem ipsum dolor</p>
<p>Fusce eu euismod leo, a accumsan tellus. Quisque vitae dolor eu justo cursus egestas. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sit amet sapien odio. Sed pellentesque arcu mi, quis malesuada lectus lacinia et. Cras a tempor leo.</p>
</td>
</tr>
</table>
</td>
</tr>
<!-- <?php if ( ( ! empty( $fields_values['content_column_1'] ) ) && ( ! empty( $fields_values['content_column_2'] ) ) ) { ?> -->
<!-- Content: 2 columns template row -->
<tr>
<td class="two-column">
<!--[if (gte mso 9)|(IE)]>
<table width="100%">
<tr>
<td width="50%" valign="top">
<![endif]-->
<div class="column">
<!-- Column 1 -->
<table width="100%">
<tr>
<td class="inner">
<table class="contents">
<!-- <?php if ( ! empty( $fields_values['header_column_1_img260_src'] ) ) { ?> -->
<tr>
<td>
<!-- width of image must be 260px -->
<img src="images/two-column-01.jpg" alt="" /> <!-- src="<?php $fields_values['header_column_1_img260_src']; ?>" -->
</td>
</tr>
<!-- <?php } ?> -->
<tr>
<td class="text"> <!-- <?php echo ( wp_kses_post( wptexturize( $fields_values['content_column_1'] ) ) ); ?> -->
<p>Column 1 Content .... Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed aliquet diam a facilisis eleifend. Cras ac justo felis. Mauris faucibus, orci eu blandit fermentum, lorem nibh sollicitudin mi, sit amet interdum metus urna ut lacus. </p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td><td width="50%" valign="top">
<![endif]-->
<div class="column">
<!-- Column 2 -->
<table width="100%">
<tr>
<td class="inner">
<table class="contents">
<!-- <?php if ( ! empty( $fields_values['header_column_2_img260_src'] ) ) { ?> -->
<tr>
<td>
<!-- width of image must be 260px -->
<img src="images/two-column-02.jpg" alt="" /> <!-- src="<?php $fields_values['header_column_2_img260_src']; ?>" -->
</td>
</tr>
<!-- <?php } ?> -->
<tr>
<td class="text"> <!-- <?php echo ( wp_kses_post( wptexturize( $fields_values['content_column_2'] ) ) ); ?> -->
<p>Column 2 Content .... Fusce eu euismod leo, a accumsan tellus. Quisque vitae dolor eu justo cursus egestas. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sit amet sapien odio. Sed pellentesque arcu mi, quis malesuada lectus lacinia et. Cras a tempor leo. </p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
<!-- <?php } ?> -->
<!-- Footer: 1 column template row -->
<tr>
<td class="one-column">
<table width="100%" class="footer">
<tr>
<td class="inner"> <!-- <?php echo ( wp_kses_post( wptexturize( $fields_values['footer_content'] ) ) ); ?> -->
<p>
<a>Forward to a Friend</a> &nbsp; &nbsp; <a>Unsubscribe</a> &nbsp; &nbsp; <a>Preferences</a><br />
You are receiving this email because you are either purchased product at OPSD or you entered your email at OPSD
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</div>
</center>
</body>
<?php
// </editor-fold>

View File

@@ -0,0 +1,41 @@
<?php /**
* @version 1.0
* @package: Emails
* @category: Templates
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-06-16
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* get email template
*
* @param array $fields_values
*/
function opsd_email_template_standard_text( $fields_values ) {
ob_start();
if ( ! empty($fields_values['header_content'] ) ) {
echo "= " . wp_kses_post( wptexturize( $fields_values['header_content'] ) ) . " =\n\n";
echo "----------------------------------------------------------------------\n\n";
}
echo ( wp_kses_post( wptexturize( $fields_values['content'] ) ) );
if ( ! empty( $fields_values['footer_content'] ) ) {
echo "\n---------------------------------------------------------------------\n\n";
echo ( wp_kses_post( wptexturize( $fields_values['footer_content'] ) ) );
}
return ob_get_clean(); // Return this email content
}

View File

@@ -0,0 +1,7 @@
<?php
// Silence is golden.
// Replace OPSD to ...
// _opsd_ to _bk_ (...) in get_opsd_option ....
// - opsd to ...
// , 'secure-downloads') ==> ...

View File

@@ -0,0 +1,622 @@
/**
* @version 1.0
* @package Support Functions
* @subpackage BackEnd Main Script Lib
* @category Scripts
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-04-09
*/
/** Scroll to specific HTML element
*
* @param {type} object_name
* @returns {undefined}
*/
function opsd_scroll_to( object_name ) {
if ( jQuery( object_name ).length > 0 ) {
var targetOffset = jQuery( object_name ).offset().top;
// targetOffset = targetOffset - 50;
if (targetOffset<0) targetOffset = 0;
if ( jQuery('#wpadminbar').length > 0 ) targetOffset = targetOffset - 50;
else targetOffset = targetOffset - 20;
jQuery('html,body').animate({scrollTop: targetOffset}, 500);
}
}
function opsd_animate_border( element, time, colors, x ) {
if (x >= colors.length) {
x = 0;
} else {
x++;
var color;
if ( colors[x] === '' ) {
color = ''
} else {
color = '#'+colors[x]
}
element.css('border-color', color)
setTimeout(function() {
opsd_animate_border( element, time, colors, x );
}, time)
}
}
function opsd_field_highlight( object_name ) {
if ( jQuery( object_name ).length > 0 ) {
opsd_scroll_to( object_name );
opsd_animate_border(
jQuery( object_name ) // Element
, 200 // Time in ms
, ['f87000', '', 'f87000', '', 'f87000', '', 'f87000', '', 'f87000', '', 'f87000', ''] // Colors Array
, 0
);
}
}
/** Show Yes/No dialog
*
* @param {type} message_question
* @returns {Boolean}
*/
function opsd_are_you_sure( message_question ){
var answer = confirm( message_question );
if ( answer) { return true; }
else { return false;}
}
function opsd_admin_show_message_processing( message_type ){
var message = '' ;
if ( message_type == 'saving' )
message += opsd_message_saving;
else if ( message_type == 'updating' )
message += opsd_message_updating;
else if ( message_type == 'deleting' )
message += opsd_message_deleting;
else
message += opsd_message_processing;
if ( message == 'undefined' )
message = 'Processing'
message = ' <span class="wpdevelop"><span class="glyphicon glyphicon-refresh opsd_spin opsd_ajax_icon" aria-hidden="true"></span></span> ' + message + '...';
opsd_admin_show_message( message, 'info', 10000 );
}
/** Show Alert Messages
*
* @param {type} message
* @param {type} m_type
* @param {type} m_delay
* @returns {undefined}
*/
function opsd_admin_show_message( message, m_type, m_delay ){
var alert_class = 'notice '; //'alert ';
if (m_type == 'error') alert_class += 'notice-error '; //'alert-danger ';
if (m_type == 'warning') alert_class += 'notice-warning ';
if (m_type == 'info') alert_class += 'notice-info '; //'alert-info ';
if (m_type == 'success') alert_class += 'alert-success updated ';
jQuery('#ajax_working').html( '<div id="opsd_alert_message" class="opsd_alert_message">' +
'<div class="opsd_inner_message '+alert_class+'"> ' +
'<a class="close" href="javascript:void(0)" onclick="javascript:jQuery(this).parent().hide();">&times;</a> ' +
message +
'</div>' +
'</div>'
);
jQuery('#opsd_alert_message').animate( {opacity: 1}, m_delay ).fadeOut(500);
}
function opsd_close_dropdown_selectbox( selector_id ) {
jQuery('#' + selector_id + '_container li input[type=checkbox],#' + selector_id + '_container li input[type=radio]').prop('checked', false);
jQuery('#' + selector_id + '_container').hide();
}
// Show Container depend from the selected option in dropdown list
function opsd_show_selected_in_dropdown( selector_id, title, value ){
jQuery('#' + selector_id + '_selector .opsd_selected_in_dropdown').html( title );
jQuery('#' + selector_id ).val( value );
}
// Show Container depend from the selected Radio Option and Selectbox value in dropdown list
// Exmaple: opsd_show_selected_in_dropdown__radio_select_option( 'wh_ ... _date', 'wh_ ... _date2', 'wh_ ... _datedays_interval_Radios' );
function opsd_show_selected_in_dropdown__radio_select_option( selector_id, selector_id2, radio_name ){
// Get selected value in radio buttons
var rad_val = jQuery('input:radio[name="' + radio_name + '"]:checked').val();
if ( rad_val != 'undefined' ) {
var select_box = jQuery('input:radio[name="' + radio_name + '"]:checked').parents('.input-group').find('select');
// Selectbox exist
if ( select_box.length > 0 ) {
// Get label near selected radiobutton and selected Tilte in selectbox
var title = jQuery('input:radio[name="' + radio_name + '"]:checked').parent().find('label').html() + ' ' +
jQuery('input:radio[name="' + radio_name + '"]:checked').parents('.input-group').find('select option:selected').text();
// Get Value of selected option in selectbox
var value = jQuery('input:radio[name="' + radio_name + '"]:checked').parents('.input-group').find('select option:selected').val();
// Set Title in dropdown list
jQuery('#' + selector_id + '_selector .opsd_selected_in_dropdown').html( title );
// Set value of radio button
jQuery('#' + selector_id ).val( rad_val );
// Set value of selectbox
jQuery('#' + selector_id2 ).val( value );
} else {
// 2 Text Fields
var text_box = jQuery('input:radio[name="' + radio_name + '"]:checked').parents('.text-group').find('input[type="text"]');
if ( text_box.length > 0 ) {
var text_divs = jQuery('input:radio[name="' + radio_name + '"]:checked').parents('.text-group').find('.dropdown-menu-text-element');
// Check if we have 2 DIV elements with text fields
if ( text_box.length > 0 ) {
var id_list = [ selector_id, selector_id2 ];
var title = '';
//Loop our text DIV elements
jQuery('input:radio[name="' + radio_name + '"]:checked').parents('.text-group').find('.dropdown-menu-text-element').each(function( i ) {
if ( title != '' )
title += ' - ';
title += jQuery(this).find('input[type="text"]').val();
jQuery('#' + id_list[ i ] ).val( jQuery(this).find('input[type="text"]').val() );
});
// Set Title in dropdown list
jQuery('#' + selector_id + '_selector .opsd_selected_in_dropdown').html( title );
}
}
}
}
// Hide dropdown list
jQuery('#' + selector_id + '_container').hide();
}
//Set status of all checkbos in one time
function opsd_set_checkbox_in_table( el_stutus, el_class ){
jQuery('.'+el_class).attr('checked', el_stutus);
if ( el_stutus ) {
jQuery('.'+el_class).parent().parent().parent().parent().addClass('row_selected_color');
// jQuery('.'+el_class).parent().parent().addClass('warning');
} else {
jQuery('.'+el_class).parent().parent().parent().parent().removeClass('row_selected_color');
// jQuery('.'+el_class).parent().parent().removeClass('warning');
}
}
/** Ajax Request
*
* @param {type} us_id
* @param {type} window_id
* @returns {undefined}
*/
//<![CDATA[
function opsd_verify_window_opening( us_id, window_id ){
var is_closed = 0;
if (jQuery('#' + window_id ).hasClass('closed') == true){
jQuery('#' + window_id ).removeClass('closed');
} else {
jQuery('#' + window_id ).addClass('closed');
is_closed = 1;
}
jQuery.ajax({ // Start Ajax Sending
url: opsd_ajaxurl,
type:'POST',
success: function (data, textStatus){if( textStatus == 'success') jQuery('#ajax_respond').html( data );},
error:function (XMLHttpRequest, textStatus, errorThrown){ window.status = 'Ajax sending Error status:'+ textStatus; alert(XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText); if ( XMLHttpRequest.status == 500 ) { alert('Error: 500'); } } ,
// beforeSend: someFunction,
data:{
action: 'USER_SAVE_WINDOW_STATE',
user_id: us_id ,
window: window_id,
is_closed: is_closed,
opsd_nonce: jQuery('#opsd_admin_panel_nonce').val()
}
});
}
//]]>
/** Ajax Request - Saving Custom Data for User
*
* @param {int} us_id
* @param {string} data_name
* @param {string} data_value - serialized data
* @param {int} is_reload - { 0 | 1 } reload or not page
*/
//<![CDATA[
function opsd_save_custom_user_data( us_id, data_name, data_value , is_reload ){
opsd_admin_show_message_processing( 'saving' );
jQuery.ajax({ // Start Ajax Sending
url: opsd_ajaxurl,
type:'POST',
success: function (data, textStatus){if( textStatus == 'success') jQuery('#ajax_respond').html( data );},
error:function (XMLHttpRequest, textStatus, errorThrown){ window.status = 'Ajax sending Error status:'+ textStatus; alert(XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText); if ( XMLHttpRequest.status == 500 ) { alert('Error: 500'); } } ,
// beforeSend: someFunction,
data:{
action: 'USER_SAVE_CUSTOM_DATA',
user_id: us_id,
data_name: data_name,
data_value: decodeURIComponent( data_value ),
is_reload: is_reload,
opsd_nonce: jQuery('#opsd_admin_panel_nonce').val()
}
});
}
//]]>
////////////////////////////////////////////////////////////////////////////////
// Contact Form
////////////////////////////////////////////////////////////////////////////////
function opsd_submit_client_form( submit_form, wpdev_active_locale ){
var count = submit_form.elements.length;
var formdata = '';
var inp_value;
var element;
var el_type;
for (i=0; i<count; i++) {
element = submit_form.elements[i];
if ( (element.type !=='button') && (element.type !=='hidden') ) {
// Get Value of Element
if ( element.type == 'checkbox' ){
if ( element.value == '' ) {
inp_value = element.checked;
} else {
if ( element.checked )
inp_value = element.value;
else
inp_value = '';
}
} else if ( element.type == 'radio' ) {
if ( element.value == '' ) {
inp_value = element.checked;
} else {
if ( element.checked )
inp_value = element.value;
else
inp_value = '';
}
/*
if ( element.checked )
inp_value = element.value;
else
continue;
*/
} else {
inp_value = element.value;
}
// Get value in selectbox of multiple selection
if (element.type =='select-multiple') {
inp_value = jQuery('[name="'+element.name+'"]').val() ;
if ( ( inp_value == null ) || ( inp_value.toString() == '' ) )
inp_value='';
}
/*if ( element.name == ('phone') ) {
// we validate a phone number of 10 digits with no comma, no spaces, no punctuation and there will be no + sign in front the number - See more at: http://www.w3resource.com/javascript/form/phone-no-validation.php#sthash.U9FHwcdW.dpuf
var reg = /^\d{10}$/;
var message_verif_phone = "Please enter correctly phone number";
if ( inp_value != '' )
if(reg.test(inp_value) == false) {opsd_show_error_message( element , message_verif_phone);return;}
}*/
// Validation Check -- Requred fields
if ( element.className.indexOf( 'opsd-validate-required' ) !== -1 ){
if ( ( element.type =='checkbox' ) && ( element.checked === false ) ) {
if ( ! jQuery(':checkbox[name="'+element.name+'"]', submit_form).is(":checked") ) {
opsd_show_error_message( element , opsd_global1.message_verif_requred_for_check_box);
return;
}
}
if ( element.type =='radio' ) {
if ( ! jQuery(':radio[name="'+element.name+'"]', submit_form).is(":checked") ) {
opsd_show_error_message( element , opsd_global1.message_verif_requred_for_radio_box);
return;
}
}
if ( ( element.type !='checkbox' ) && ( element.type !='radio' ) && ( inp_value === '' ) ) {
opsd_show_error_message( element , opsd_global1.message_verif_requred);
return;
}
}
// Validation Check --- Email correct filling field
if ( element.className.indexOf( 'opsd-validate-email' ) !== -1 ){
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,})$/;
if ( ( inp_value != '' ) && ( reg.test(inp_value) == false ) ) {
opsd_show_error_message( element , opsd_global1.message_verif_email );
return;
}
}
/*
// Validation Check --- Same Email Field
if ( ( element.className.indexOf('wpdev-validates-as-email') !== -1 ) && ( element.className.indexOf('same_as_') !== -1 ) ) {
// Get the name of Primary Email field from the "same_as_NAME" class
var primary_email_name = element.className.match(/same_as_([^\s])+/gi);
if (primary_email_name != null) { // We found
primary_email_name = primary_email_name[0].substr(8);
// Recehck if such primary email field exist in the form
if (jQuery('[name="' + primary_email_name + '"]').length > 0) {
// Recheck the values of the both emails, if they do not equla show warning
if ( jQuery('[name="' + primary_email_name + '"]').val() !== inp_value ) {
opsd_show_error_message( element , message_verif_same_emeil );return;
}
}
}
// Skip one loop for the email veryfication field
continue;
} */
/*
// Get Form Data
if ( element.name !== ('captcha_input' ) ) {
if (formdata !=='') formdata += '~'; // next field element
el_type = element.type;
if ( element.className.indexOf('wpdev-validates-as-email') !== -1 ) el_type='email';
if ( element.className.indexOf('wpdev-validates-as-coupon') !== -1 ) el_type='coupon';
inp_value = inp_value + '';
inp_value = inp_value.replace(new RegExp("\\^",'g'), '&#94;'); // replace registered characters
inp_value = inp_value.replace(new RegExp("~",'g'), '&#126;'); // replace registered characters
inp_value = inp_value.replace(/"/g, '&#34;'); // replace double quot
inp_value = inp_value.replace(/'/g, '&#39;'); // replace single quot
formdata += el_type + '^' + element.name + '^' + inp_value ; // element attr
} */
}
} // End Fields Loop
submit_form.submit(); // Submit Form, if previously was no interuptions
}
/**
* Show message under specific element
*
* @param {type} element - jQuery definition of the element
* @param {type} errorMessage - String message
* @param {type} message_type "" | "alert-warning" | "alert-success" | "alert-info" | "alert-danger"
*/
function opsd_show_message_under_element( element , errorMessage , message_type) {
opsd_scroll_to( element );
if ( jQuery( element ).attr('type') == "radio" ) {
jQuery( element ).parent().parent().parent()
.after('<span class="opsd-near-field-message alert '+ message_type +'">'+ errorMessage +'</span>'); // Show message
} else if (jQuery( element ).attr('type') == "checkbox") {
jQuery( element ).parent()
.after('<span class="opsd-near-field-message alert '+ message_type +'">'+ errorMessage +'</span>'); // Show message
} else {
jQuery( element )
.after('<span class="opsd-near-field-message alert '+ message_type +'">'+ errorMessage +'</span>'); // Show message
}
jQuery(".widget_opsd .opsd-near-field-message")
.css( {'vertical-align': 'sub' } ) ;
jQuery(".opsd-near-field-message")
.animate( {opacity: 1}, 10000 )
.fadeOut( 2000 );
}
// Show Error Message in Form at Front End
function opsd_show_error_message( element , errorMessage) {
// Scroll to the element
opsd_scroll_to( element );
jQuery("[name='"+ element.name +"']")
.fadeOut( 350 ).fadeIn( 300 )
.fadeOut( 350 ).fadeIn( 400 )
.fadeOut( 350 ).fadeIn( 300 )
.fadeOut( 350 ).fadeIn( 400 )
.animate( {opacity: 1}, 4000 )
; // mark red border
if (jQuery("[name='"+ element.name +"']").attr('type') == "radio") {
jQuery("[name='"+ element.name +"']").parent().parent()//.parent()
.after('<span class="opsd-near-field-message alert alert-warning">'+ errorMessage +'</span>'); // Show message
} else if (jQuery("[name='"+ element.name +"']").attr('type') == "checkbox") {
jQuery("[name='"+ element.name +"']").parent().parent()
.after('<span class="opsd-near-field-message alert alert-warning">'+ errorMessage +'</span>'); // Show message
} else {
jQuery("[name='"+ element.name +"']")
.after('<span class="opsd-near-field-message alert alert-warning">'+ errorMessage +'</span>'); // Show message
}
jQuery(".opsd-near-field-message")
.css( {'padding' : '5px 5px 4px', 'margin' : '2px', 'vertical-align': 'top', 'line-height': '32px' } );
if ( element.type == 'checkbox' )
jQuery(".opsd-near-field-message").css( { 'vertical-align': 'middle'} );
jQuery(".widget_opsd .opsd-near-field-message")
.css( {'vertical-align': 'sub' } ) ;
jQuery(".opsd-near-field-message")
.animate( {opacity: 1}, 10000 )
.fadeOut( 2000 );
element.focus(); // make focus to elemnt
return;
}
/**
* Reload the page with new parameter value.
*
* @param {type} url - full URL of the page, can include or exclude that parameter
* @param {type} param - URL parameter name
* @param {type} value - URL parameter value
* @returns {undefined}
*/
function opsd_reload_page_with_paramater( url, param, value ) {
var hash = {};
var parser = document.createElement('a');
parser.href = url;
var parameters = parser.search.split(/\?|&/);
for(var i=0; i < parameters.length; i++) {
if(!parameters[i])
continue;
var ary = parameters[i].split('=');
hash[ary[0]] = ary[1];
}
hash[param] = value;
var list = [];
Object.keys(hash).forEach(function (key) {
list.push(key + '=' + hash[key]);
});
parser.search = '?' + list.join('&');
//return parser.href;
window.location.href = parser.href;
}
jQuery( window ).on( "load", function (){ //FixIn: 8.7.9.7
// Color Text picker ///////////////////////////////////////////////////////
if ( jQuery('.field-text-color').length > 0 ) {
jQuery('.field-text-color').iris( {
change: function(event, ui){
jQuery(this).css( { backgroundColor: ui.color.toString() } );
jQuery(this).closest('.fields-color-group').find('.fieldvalue').css( { color: ui.color.toString() } );
}
, hide: true
, border: true
, palettes: ['#333', '#555', '#777', '#aaa', '#fff']
} ).each( function() {
jQuery(this).css( { backgroundColor: jQuery(this).val() } );
})
.on( 'click', function(){
jQuery('.iris-picker').hide();
jQuery(this).closest('div').find('.iris-picker').show();
});
}
// Color Background picker /////////////////////////////////////////////////
if ( jQuery('.field-background-color').length > 0 ) {
jQuery('.field-background-color').iris( {
change: function(event, ui){
jQuery(this).css( { backgroundColor: ui.color.toString() } );
jQuery(this).closest('.fields-color-group').find('.fieldvalue').css( { backgroundColor: ui.color.toString() } );
}
, hide: true
, border: true
, palettes: [ '#FFEE99', '#459', '#78b', '#ab0', '#df5d5d', '#f0f']
} ).each( function() {
jQuery(this).css( { backgroundColor: jQuery(this).val() } );
})
.on( 'click', function(){
jQuery('.iris-picker').hide();
jQuery(this).closest('div').find('.iris-picker').show();
});
jQuery('.field-text-color, .field-background-color').on( 'click', function(event){
event.stopPropagation();
});
}
////////////////////////////////////////////////////////////////////////////
// General Color picker in settings table //////////////////////////////////
////////////////////////////////////////////////////////////////////////////
if ( jQuery('.opsd_colorpick').length > 0 ) {
jQuery('.opsd_colorpick').iris( {
change: function(event, ui){
jQuery(this).css( { backgroundColor: ui.color.toString() } );
}
, hide: true
, border: true
, palettes: ['#125', '#459', '#78b', '#ab0', '#de3', '#f0f']
} ).each( function() {
jQuery(this).css( { backgroundColor: jQuery(this).val() } );
})
.on( 'click', function(){
jQuery('.iris-picker').hide();
jQuery(this).closest('td').find('.iris-picker').show();
});
jQuery('body').on( 'click', function() {
jQuery('.iris-picker').hide();
});
jQuery('.opsd_colorpick').on( 'click', function(event){
event.stopPropagation();
});
}
});
////////////////////////////////////////////////////////////////////////////
// Support Functions
////////////////////////////////////////////////////////////////////////////
/**
* Reset of WP Editor or TextArea Content
* @param {string} editor_textarea_id - ID of element
* @param {string} editor_textarea_content - Content
*/
function opsd_reset_wp_editor_content( editor_textarea_id, editor_textarea_content ) {
if( typeof tinymce != "undefined" ) {
var editor = tinymce.get( editor_textarea_id );
if( editor && editor instanceof tinymce.Editor ) {
editor.setContent( editor_textarea_content );
editor.save( { no_events: true } );
} else {
jQuery( '#' + editor_textarea_id ).val( editor_textarea_content );
}
} else {
jQuery( '#' + editor_textarea_id ).val( editor_textarea_content );
}
}

View File

@@ -0,0 +1,57 @@
/**
* @version 1.0
* @desciption Dismiss Notices - Ajax handler
* @usage Admin panel
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2017-04-23
*/
/** Ajax Request - Dismiss */
jQuery( function ( $ ) { // Shortcut to jQuery(document).ready(function(){ ... });
jQuery( '.opsd_is_dismissible' ).on( 'click', '.opsd_dismiss', function ( event ) { // This delegated event, can be run, when DOM element added after page loaded
var jq_el = jQuery( this ).closest( '.opsd_is_dismissible' ); // Get dismissible HTML element
var params_obj = {};
params_obj.id = jq_el.attr( 'id' );
params_obj.nonce = jq_el.attr( 'data-nonce' );
params_obj.user_id = jq_el.attr( 'data-user-id' );
jQuery.post( opsd_ajaxurl, {
action: 'OPSD_DISMISS',
user_id: params_obj.user_id ,
nonce: params_obj.nonce,
element_id: params_obj.id,
is_closed: 1
},
function ( response_data, textStatus, jqXHR ) { // success
// console.log( response_data ); console.log( textStatus); console.log( jqXHR ); // Debug
// jQuery( '#ajax_respond' ).html( response_data ); // For ability to show response, add such DIV element to page
}
).fail( function ( jqXHR, textStatus, errorThrown ) { if ( window.console && window.console.log ){ console.log( 'Ajax_Error', jqXHR, textStatus, errorThrown ); } })
// .done( function ( data, textStatus, jqXHR ) { if ( window.console && window.console.log ){ console.log( 'second success', data, textStatus, jqXHR ); } })
// .always( function ( data_jqXHR, textStatus, jqXHR_errorThrown ) { if ( window.console && window.console.log ){ console.log( 'always finished', data_jqXHR, textStatus, jqXHR_errorThrown ); } })
;
});
});
/* Hide */
jQuery( function ( $ ) { // Shortcut to jQuery(document).ready(function(){ ... });
jQuery( '.opsd_is_hideable' ).on( 'click', '.opsd_dismiss', function ( event ) { // This delegated event, can be run, when DOM element added after page loaded
var jq_el = jQuery( this ).closest( '.opsd_is_hideable' ); // Get hideable HTML element
jq_el.hide();
});
});

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,187 @@
<?php /**
* @version 1.0
* @description Dismiss Class
* @category Dismiss panels Class
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-11-13
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/** Dismiss Class
* @usage:
*
* Inline Setting Notice Dismiss'
*
$notice_id = 'opsd_upload_help_section';
if ( ! opsd_section_is_dismissed( $notice_id ) ) {
?><div id="<?php echo $notice_id; ?>"
class="opsd_system_notice opsd_is_dismissible opsd_is_hideable notice-warning opsd_internal_notice"
data-nonce="<?php echo wp_create_nonce( $nonce_name = $notice_id . '_opsdnonce' ); ?>"
data-user-id="<?php echo get_current_user_id(); ?>"
><?php
opsd_x_dismiss_button();
....
?></div><?php
*
* System Notice
*
$notice_id = 'opsd_system_notice_free_instead_paid';
if ( ! opsd_section_is_dismissed( $notice_id ) ) {
?><div id="<?php echo $notice_id; ?>"
class="opsd_system_notice opsd_is_dismissible opsd_is_hideable updated notice-warning"
data-nonce="<?php echo wp_create_nonce( $nonce_name = $notice_id . '_opsdnonce' ); ?>"
data-user-id="<?php echo get_current_user_id(); ?>"
><?php
opsd_x_dismiss_button();
...
?></div><?php
*
*/
final class OPSD_Dismiss {
static private $instance = NULL; // Define only one instance of this class
/** Get only one instance of this class
*
* @return class OPSD_Dismiss
*/
public static function init() {
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof OPSD_Dismiss ) ) {
self::$instance = new OPSD_Dismiss;
// JS & CSS
add_action( 'opsd_enqueue_js_files', array( self::$instance, 'opsd_js_load_files' ), 50 );
add_action( 'opsd_enqueue_css_files', array( self::$instance, 'opsd_enqueue_css_files' ), 50 );
// Ajax Handlers. Note. "locale_for_ajax" recehcked in opsd-ajax.php
add_action( 'wp_ajax_' . 'OPSD_DISMISS', array( self::$instance, 'opsd_ajax_' . 'OPSD_DISMISS' ) ); // Admin & Client (logged in usres)
//add_action( 'wp_ajax_nopriv_' . 'OPSD_DISMISS', array( self::$instance, 'opsd_ajax_' . 'OPSD_DISMISS' ) ); // Client (not logged in)
}
return self::$instance;
}
/** Ajax Handler
* for request like:
* action: 'OPSD_DISMISS',
user_id: panel_obj.user_id ,
nonce: panel_obj.nonce,
element_id: panel_obj.id,
is_closed: 1
*
*/
public function opsd_ajax_OPSD_DISMISS() {
if ( ! isset( $_POST['element_id'] ) || empty( $_POST['element_id'] ) ) {
exit;
}
$action_name = $_POST['element_id'] . '_opsdnonce';
$nonce_post_key = 'nonce';
// Check Security
$result = check_ajax_referer( $action_name, $nonce_post_key );
// Save status
update_user_option( (int) $_POST[ 'user_id' ], 'opsd_win_' . esc_attr( $_POST[ 'element_id' ] ), (int) $_POST[ 'is_closed' ] );
// send JSON
wp_send_json( array( 'response' => 'success' ) ); // Return JS OBJ: response_data = { response: "success" } in "dismiss.js"
// This function call wp_die( '', '', array( 'response' => null, ) )
}
/** JSS */
public function opsd_js_load_files( $where_to_load ) {
$in_footer = true;
if ( ( is_admin() ) && ( in_array( $where_to_load, array( 'admin', 'both' ) ) ) ) {
wp_enqueue_script( 'opsd-dismiss', opsd_plugin_url( '/core/any/js/dismiss.js' ), array( 'opsd-global-vars' ), '1.1', $in_footer );
}
}
/** CSS */
public function opsd_enqueue_css_files( $where_to_load ) {
if ( ( is_admin() ) && ( in_array( $where_to_load, array( 'admin', 'both' ) ) ) ) {
wp_enqueue_style( 'opsd-dismiss', opsd_plugin_url( '/core/any/css/dismiss.css' ), array(), OPSD_VERSION_NUM );
}
}
/** Check if this section dismissed or not.
*
* @param string $section_html_id
* @return boolean
*/
public function is_dismissed( $section_html_id ) {
if ( '1' == get_user_option( 'opsd_win_' . $section_html_id ) )
return true;
else
return false;
}
}
function opsd_dismiss() {
return OPSD_Dismiss::init();
}
opsd_dismiss(); // Run
/** Check if specific section dismissed or not
*
* @param type $section_html_id
* @return boolean
*/
function opsd_section_is_dismissed( $section_html_id ) {
$opsd_dismiss = opsd_dismiss();
return $opsd_dismiss->is_dismissed( $section_html_id );
}
/** Show dismiss X button
*
* @param string $title
* @param array $attributes_arr - array of attributes, like: array( 'class' => 'opsd_dismiss' )
* @param bool $echo
* @return string of dismiss button
*/
function opsd_x_dismiss_button( $title = '&times;', $attributes_arr = array(), $echo = true ) {
$defaults = array(
'style' => ''
, 'class' => 'opsd_dismiss'
, 'title' => esc_js( __( 'Close', 'secure-downloads' ) )
);
$attributes_arr = wp_parse_args( $attributes_arr, $defaults );
$attr_echo = array();
foreach ( $attributes_arr as $attr_name => $attr_value ) {
$attr_echo[] = esc_attr( $attr_name ) . '="' . esc_attr( $attr_value ) . '"';
}
$attr_echo = implode( ' ', $attr_echo );
if ( ! $echo ) { ob_start(); }
?><a href="javascript:void(0)" <?php echo $attr_echo; ?> ><?php echo $title; ?></a><?php
if ( ! $echo ) { return ob_get_clean(); }
}

View File

@@ -0,0 +1,385 @@
<?php /**
* @version 1.0
* @description Notices Class
* @category Show system Notices
* @author wpdevelop
*
* @web-site https://oplugins.com/
* @email info@oplugins.com
*
* @modified 2015-11-13
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/** Showing our system notices in admin panel */
class OPSD_Notices {
function __construct() {
// Hooks for showing notices only at specific admin pages
add_action( 'opsd_hook_opsd_page_header', array( $this, 'show_system_notices' ) );
add_action( 'opsd_settings_after_header', array( $this, 'show_system_notices' ) );
}
/** Check and show some system messages
*
* @param array $page_arr array( 'page' => $this->in_page() ) || array( 'page' => $this->in_page(), 'subpage' => 'emails_settings' )
*/
public function show_system_notices( $page_arr ) {
if ( ! in_array( $page_arr, array( 'opsd-files', 'opsd', 'opsd-settings' ) ) )
return false;
///////////////////////////////////////////////////////////
$notice_id = 'opsd_system_notice_nginix';
///////////////////////////////////////////////////////////
if ( ( isset( $_SERVER[ 'SERVER_SOFTWARE' ] ) )
&& ( stristr( $_SERVER[ 'SERVER_SOFTWARE' ], 'nginx' ) !== false )
&& ( ! opsd_section_is_dismissed( $notice_id ) )
//|| true
) {
// Rules for NGINX
$opsd_upload = opsd_upload();
$upload_path = $opsd_upload->get_protected_dir();
if ( isset( $_SERVER[ 'DOCUMENT_ROOT' ] ) )
$upload_path = str_replace( $_SERVER[ 'DOCUMENT_ROOT' ], '', $upload_path ); // replace document root because nginx uses path from document root
$nx_rules = "location " . $upload_path . " {\n deny all; \n return 403;\n}";
// echo '<div class="error notice is-dismissible dlm-notice" id="nginx_rules" data-nonce="' . wp_create_nonce( 'opsd_dismiss_notice-nginx_rules' ) . '">';
?><div id="<?php echo $notice_id; ?>"
class="opsd_system_notice opsd_is_dismissible opsd_is_hideable updated error"
data-nonce="<?php echo wp_create_nonce( $nonce_name = $notice_id . '_opsdnonce' ); ?>"
data-user-id="<?php echo get_current_user_id(); ?>"
><?php
opsd_x_dismiss_button();
echo '<strong>' . __( 'Warning!', 'secure-downloads' ) . '</strong> ';
printf( __( 'Your download files are not protected with .htaccess file, because your server is running on NGINX. To protect these files, you must add the following rules to your nginx config to disable direct file access: %s', 'secure-downloads' )
, '<br/><pre style="line-height: 1.55em;pre-wrap;"><code>' . $nx_rules . '</code></pre>' );
//FixIn:1.1.1
printf( __( 'By default the file is named %s and placed in the %s directory. (For the open source NGINX product, the location depends on the package system used to install NGINX and the operating system. It is typically one of %s)', 'secure-downloads' )
, '<code>nginx.conf</code>'
, '<code>/etc/nginx</code>'
, '<code>/usr/local/nginx/conf</code>, <code>/etc/nginx</code>, <code>/usr/local/etc/nginx</code>.'
);
echo ' ';
printf( __( 'Please contact your server administrator or support of hosting company about more details of your server configuration.', 'secure-downloads' ) );
?></div><?php
} else {
//FixIn:1.1.1
$notice_id = 'opsd_system_notice_nginix_recheck';
if ( ! opsd_section_is_dismissed( $notice_id ) ) {
// // Rules for NGINX
// $opsd_upload = opsd_upload();
// $upload_path = $opsd_upload->get_protected_dir();
// if ( isset( $_SERVER[ 'DOCUMENT_ROOT' ] ) )
// $upload_path = str_replace( $_SERVER[ 'DOCUMENT_ROOT' ], '', $upload_path ); // replace document root because nginx uses path from document root
// $nx_rules = "location " . $upload_path . " {\n deny all; \n return 403;\n}";
// echo '<div class="error notice is-dismissible dlm-notice" id="nginx_rules" data-nonce="' . wp_create_nonce( 'opsd_dismiss_notice-nginx_rules' ) . '">';
?><div id="<?php echo $notice_id; ?>"
class="opsd_system_notice opsd_is_dismissible opsd_is_hideable updated notice-warning"
data-nonce="<?php echo wp_create_nonce( $nonce_name = $notice_id . '_opsdnonce' ); ?>"
data-user-id="<?php echo get_current_user_id(); ?>"
><?php
opsd_x_dismiss_button();
//FixIn: 1.1.2.6
// Rules for NGINX
$opsd_upload = opsd_upload();
$upload_path2 = $opsd_upload->get_protected_dir();
if ( isset( $_SERVER[ 'DOCUMENT_ROOT' ] ) )
$upload_path2 = str_replace( $_SERVER[ 'DOCUMENT_ROOT' ], '', $upload_path2 ); // replace document root because nginx uses path from document root
$nx_rules = "location " . $upload_path2 . " {\n deny all; \n return 403;\n}";
echo '<strong>' . __( 'Note!', 'secure-downloads' ) . '</strong> ';
printf( __( 'If your server is running on NGINX or your server use NGINX as proxy server for managing static content like images or zip files, then some or all your download files are not protected with .htaccess file.', 'secure-downloads' )
, '<br/><pre style="line-height: 1.55em;pre-wrap;"><code>' . $nx_rules . '</code></pre>' );
echo ' <br/>';
printf( __( 'Please contact your server administrator or support of hosting company about more details of your server configuration.', 'secure-downloads' ) );
?></div><?php
}
}
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
$notice_id = 'opsd_system_notice_free_instead_paid';
///////////////////////////////////////////////////////////
if ( opsd_is_updated_paid_to_free()
&& ( ! opsd_section_is_dismissed( $notice_id ) )
// || true
) {
?><div id="<?php echo $notice_id; ?>"
class="opsd_system_notice opsd_is_dismissible opsd_is_hideable updated notice-warning"
data-nonce="<?php echo wp_create_nonce( $nonce_name = $notice_id . '_opsdnonce' ); ?>"
data-user-id="<?php echo get_current_user_id(); ?>"
><?php
opsd_x_dismiss_button();
echo '<strong>' . __( 'Warning!', 'secure-downloads' ) . '</strong> ';
printf( __( 'Probabaly you updated your paid version of Secure Downloads by free version or update process failed. You can request the new update of your paid version at %1sthis page%2s.', 'secure-downloads' )
, '<a href="https://oplugins.com/plugins/secure-downloads/request-update/" target="_blank">', '</a>' );
?></div><?php
}
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
$notice_id = 'opsd-panel-get-started';
///////////////////////////////////////////////////////////
if ( ! opsd_section_is_dismissed( $notice_id ) ) {
?>
<style type="text/css" media="screen">
/* OPSD Welcome Panel */
.opsd-panel .welcome-panel {
background: linear-gradient(to top, #F5F5F5, #FAFAFA) repeat scroll 0 0 #F5F5F5;
border-color: #DFDFDF;
position: relative;
overflow: auto;
margin: 5px 0 20px;
padding: 23px 10px 12px;
border-width: 1px;
border-style: solid;
border-radius: 3px;
font-size: 13px;
line-height: 2.1em;
}
.opsd-panel .welcome-panel h3 {
margin: 0;
font-size: 21px;
font-weight: 400;
line-height: 1.2;
}
.opsd-panel .welcome-panel h4 {
margin: 1.33em 0 0;
font-size: 13px;
font-weight: 600;
}
.opsd-panel .welcome-panel a{
color:#21759B;
}
.opsd-panel .welcome-panel .about-description {
font-size: 16px;
margin: 0;
}
.opsd-panel .welcome-panel .welcome-panel-close {
position: absolute;
top: 5px;
right: 10px;
padding: 8px 3px;
font-size: 13px;
text-decoration: none;
line-height: 1;
}
.opsd-panel .welcome-panel .welcome-panel-close:before {
content: ' ';
position: absolute;
left: -12px;
width: 10px;
height: 100%;
background: url('../wp-admin/images/xit.gif') 0 7% no-repeat;
}
.opsd-panel .welcome-panel .welcome-panel-close:hover:before {
background-position: 100% 7%;
}
.opsd-panel .welcome-panel .button.button-hero {
margin: 15px 0 3px;
}
.opsd-panel .welcome-panel-content {
margin-left: 13px;
max-width: 1500px;
}
.opsd-panel .welcome-panel .welcome-panel-column-container {
clear: both;
overflow: hidden;
position: relative;
}
.opsd-panel .welcome-panel .welcome-panel-column {
width: 32%;
min-width: 200px;
float: left;
}
.ie8 .opsd-panel .welcome-panel .welcome-panel-column {
min-width: 230px;
}
.opsd-panel .welcome-panel .welcome-panel-column:first-child {
width: 36%;
}
.opsd-panel .welcome-panel-column p {
margin-top: 7px;
}
.opsd-panel .welcome-panel .welcome-icon {
background: none;
display: block;
padding: 2px 0 8px 2px;
}
.opsd-panel .welcome-panel .welcome-add-page {
background-position: 0 2px;
}
.opsd-panel .welcome-panel .welcome-edit-page {
background-position: 0 -90px;
}
.opsd-panel .welcome-panel .welcome-learn-more {
background-position: 0 -136px;
}
.opsd-panel .welcome-panel .welcome-comments {
background-position: 0 -182px;
}
.opsd-panel .welcome-panel .welcome-view-site {
background-position: 0 -274px;
}
.opsd-panel .welcome-panel .welcome-widgets-menus {
background-position: 1px -229px;
line-height: 14px;
}
.opsd-panel .welcome-panel .welcome-write-blog {
background-position: 0 -44px;
}
.opsd-panel .welcome-panel .welcome-panel-column ul {
margin: 0.8em 1em 1em 0;
}
.opsd-panel .welcome-panel .welcome-panel-column li {
line-height: 1.7em;
list-style-type: none;
margin:0;
padding:0;
}
@media screen and (max-width: 870px) {
.opsd-panel .welcome-panel .welcome-panel-column,
.opsd-panel .welcome-panel .welcome-panel-column:first-child {
display: block;
float: none;
width: 100%;
}
.opsd-panel .welcome-panel .welcome-panel-column li {
display: inline-block;
margin-right: 13px;
}
.opsd-panel .welcome-panel .welcome-panel-column ul {
margin: 0.4em 0 0;
}
.opsd-panel .welcome-panel .welcome-icon {
padding-left: 25px;
}
}
</style>
<div id="<?php echo $notice_id ?>"
class="opsd-panel opsd_is_dismissible opsd_is_hideable "
data-nonce="<?php echo wp_create_nonce( $nonce_name = $notice_id . '_opsdnonce' ); ?>"
data-user-id="<?php echo get_current_user_id(); ?>"
><div class="welcome-panel"><?php
opsd_x_dismiss_button( '&times;', array( 'style' => 'font-size:1.5em;margin-top:-0.8em;' ) );
?>
<div class="welcome-panel-content">
<p class="about-description"><?php _e( 'We&#8217;ve assembled some links to get you started:', 'secure-downloads'); ?></p>
<div class="welcome-panel-column-container">
<div class="welcome-panel-column">
<h4><?php _e( 'Upload your files to secure direcory', 'secure-downloads'); ?>:</h4>
<ul>
<li><div class="welcome-icon"><?php
printf( __( 'Open %s menu page', 'secure-downloads')
, '<a href="' . admin_url( 'admin.php?page=opsd-files' ) . '">'
. '<strong>' . 'Secure Downloads > ' . __( 'Files', 'secure-downloads' ) . '</strong>'
. '</a>'
);
?></div></li>
<li><div class="welcome-icon"><?php
echo '1. ' . sprintf( __( 'Click on %s"Add New"%s button and upload your files.', 'secure-downloads' ), '<strong>', '</strong>' );
?></div></li>
<li><div class="welcome-icon"><?php
echo '2. ' . sprintf( __( 'Enter Title, Version Number and Description at %s"Attachment details"%s section.', 'secure-downloads' ), '<strong>', '</strong>' );
?></div></li>
<li><div class="welcome-icon"><?php
echo '3. ' . sprintf( __( 'Select one or multiple files, click insert button and Save changes.', 'secure-downloads' ) );
?></div></li>
</ul>
</div>
<div class="welcome-panel-column">
<h4><?php _e( 'Next Steps', 'secure-downloads'); ?>.</h4>
<ul>
<li><div class="welcome-icon"><?php
printf( __( 'Open %s menu page and %s send predefined email with secure link %s to your customer or simply %s generate secure link %s', 'secure-downloads')
, '<a href="' . admin_url( 'admin.php?page=opsd' ) . '">'
. '<strong>' . __( 'Secure Links', 'secure-downloads' ) . '</strong>'
. '</a>'
, '<strong>', '</strong>'
, '<strong>', '</strong>.'
);
?></div></li>
<li><div class="welcome-icon"><?php
printf( __( 'Configure different options in %sSettings%s.' , 'secure-downloads'),
'<a href="' . esc_url( opsd_get_settings_url() ) . '">', '</a>' );
?></div></li>
<li><div class="welcome-icon"><?php
printf( __( 'Configure your predefined %sEmail Templates%s.', 'secure-downloads'),
'<a href="' . esc_url( opsd_get_settings_url() . '&tab=email' ) . '">', '</a>' );
?></div></li>
</ul>
</div>
<div class="welcome-panel-column welcome-panel-last">
<h4><?php _e( 'Tips', 'secure-downloads'); ?></h4>
<ul>
<li><div class="welcome-icon"><?php
printf( __( 'You can easy reorder files list at %s page.', 'secure-downloads')
, '<a href="' . admin_url( 'admin.php?page=opsd-files&tab=files-sortable' ) . '">'
. '<strong>' . __( 'Sortable List', 'secure-downloads' ) . '</strong>'
. '</a>'
);
?></div></li>
<li><div class="welcome-icon"><?php
echo '<strong>' . __( 'Note', 'secure-downloads' ) . '</strong>. '
. __( 'You can use line with simple text without CSV separators for definition of sections in file list.', 'secure-downloads')
;
?></div></li>
<li><div class="welcome-icon"><?php
printf( __( 'Still having questions? Contact %sSupport%s.', 'secure-downloads'),
'<a href="https://oplugins.com/support/" target="_blank">',
'</a>' );
?></div></li>
<li><div class="welcome-icon"><?php
printf( __( 'Do you require new feature? Send your %ssuggestion%s to us.', 'secure-downloads'),
'<a href="mailto:newfeature@oplugins.com?Subject=Secure%20Downloads" target="_blank">',
'</a>' );
?></div></li>
</ul>
</div>
</div>
<div class="welcome-icon welcome-widgets-menus" style="text-align:right;font-style:italic;"><?php
printf( __( 'Need even more functionality? Check %s higher versions %s', 'secure-downloads'),
'<a href="https://oplugins.com/plugins/secure-downloads/#premium" target="_blank">',
'</a>'
); ?>
</div>
</div>
<?php
?></div></div><?php
}
}
}
new OPSD_Notices(); // Run