Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Obox/layerswp
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Perel committed Sep 25, 2018
2 parents 20c2404 + d39c808 commit f00907b
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 126 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Layers Changelog

##2.0.10
### 25 September 2018

* **Fix** - Fixed image ratio button in Posts Widget *MP*
* **Enhancement** - Removed soon to be redundant Marketplace *MP*

##2.0.9
### 26 March 2018

Expand Down
101 changes: 30 additions & 71 deletions core/options-panel/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public function __construct() {
// Exit on missing ABSPATH
if ( ! defined( 'ABSPATH' ) ) exit;

if( isset( $_GET[ 'page' ] ) && 'layers-marketplace' == $_GET[ 'page' ] )
wp_redirect( 'https://www.layerswp.com/layers-pro/?ref=obox&utm_source=layers%20theme&utm_medium=link&utm_campaign=Layers%20Pro%20Upsell&utm_content=Dashboard%20Menu' );

global $pagenow, $wp_customize;

// Setup some folder variables
Expand All @@ -43,12 +46,6 @@ public function __construct() {
$this->set_valid_page_slugs();

add_action( 'wp_dashboard_setup', array( &$this, 'layers_add_dashboard_widgets' ) );

if( !defined( 'LAYERS_DISABLE_MARKETPLACE' ) ){
add_filter( 'media_upload_tabs', array( &$this, 'upload_upsell_media_tab' ) );
add_action( 'media_upload_upsell_media', array( &$this, 'upload_upsell_media_form' ) );
add_action( 'print_media_templates', array( &$this, 'upload_upsell_media_template' ) );
}
}

public function init() {
Expand Down Expand Up @@ -205,19 +202,6 @@ private function load_partial( $partial = NULL ) {
// Include Partials, we're using require so that inside the partial we can use $this to access the header and footer
require $this->options_panel_dir . 'partials/' . $partial . '.php';
}
public function upload_upsell_media_template(){
$this->body( 'discover-more-photos' );
}

function upload_upsell_media_tab($tabs) {
$tabs['upsell_media'] = __( 'Discover More' , 'layerswp' );
return $tabs;
}

// call the new tab with wp_iframe
function upload_upsell_media_form() {
wp_iframe( array( &$this, 'upload_upsell_media_template' ) );
}

/**
* Footer
Expand Down Expand Up @@ -277,8 +261,8 @@ public function get_menu_pages(){
'link' => admin_url( 'edit.php?post_type=page&filter=layers' ),
),
'layers-marketplace' => array(
'label' => 'Layers Add Ons',
'link' => admin_url( 'admin.php?page=layers-marketplace' ),
'label' => 'Layers Pro',
'link' => 'http://www.layerswp.com/layers-pro/?utm_source=layers%20theme&utm_medium=link&utm_campaign=Layers%20Pro%20Upsell&utm_content=WP%20Dashboard',
),
)
);
Expand Down Expand Up @@ -348,30 +332,18 @@ public function site_setup_actions(){
}

public function layers_add_dashboard_widgets(){
if( !defined( 'LAYERS_DISABLE_MARKETPLACE' ) ){
if( !class_exists( 'WooCommerce' ) ){
wp_add_dashboard_widget(
'layers-addons',
__( 'Layers Themes & Extensions', 'layerswp' ),
'layers-woocommerce',
__( 'Start an Online Store', 'layerswp' ),
array( &$this, 'layers_dashboard_widget' ),
NULL,
array(
'type' => 'addons'
'type' => 'woocommerce'
)
);
}

if( !class_exists( 'Layers_WooCommerce' ) && class_exists( 'WooCommerce' ) ) {
wp_add_dashboard_widget(
'layers-storekit',
__( 'Upgrade WooCommerce with StoreKit', 'layerswp' ),
array( &$this, 'layers_dashboard_widget' ),
NULL,
array(
'type' => 'upsell-storekit'
)
);

}

if( !class_exists( 'Layers_Pro' ) ) {
wp_add_dashboard_widget(
Expand All @@ -389,16 +361,15 @@ public function layers_add_dashboard_widgets(){

function layers_dashboard_widget( $var, $args ){ ?>
<div class="l_admin-wp-dashboard-panel">
<?php if( 'addons' == $args[ 'args' ][ 'type' ] ) { ?>
<?php if( 'woocommerce' == $args[ 'args' ][ 'type' ] ) { ?>
<div class="l_admin-section-title l_admin-tiny">
<p class="l_admin-excerpt">
<?php _e( 'Looking for a theme or plugin to achieve something unique with your website?
Browse the Layers Add Ons and take your site to the next level.' , 'layerswp' ); ?>
<?php _e( 'Looking to start an online store? We recommend WooCommerce, the best eCommerce solution for WordPress.' , 'layerswp' ); ?>
</p>
</div>
<div class="l_admin-button-well">
<a href="<?php echo admin_url( 'admin.php?page=layers-marketplace' ); ?>" class="button button-primary">
<?php _e( 'Themes &amp; Extensions' , 'layerswp' ); ?>
<a href="https://woocommerce.com/?aff=3074&cid=1061174" target="_blank" class="button button-primary">
<?php _e( 'Get WooCommerce Now' , 'layerswp' ); ?>
</a>
</div>
<?php } ?>
Expand Down Expand Up @@ -527,6 +498,7 @@ function layers_options_panel_menu(){

add_action('admin_print_scripts-' . $dashboard, array( $layers_options_panel, 'enqueue_dashboard_scripts') );


// Add Preset Pages
$add_new_page = add_submenu_page(
LAYERS_THEME_SLUG . '-dashboard',
Expand Down Expand Up @@ -567,19 +539,13 @@ function layers_options_panel_menu(){
LAYERS_THEME_SLUG . '-get-started',
'layers_options_panel_ui'
);

// This modifies the Layers submenu item - must be done here as $submenu
// is only created if $submenu items are added using add_submenu_page
if( isset( $submenu[ 'layers-dashboard' ] ) ) {
$submenu[LAYERS_THEME_SLUG . '-dashboard'][0][0] = __( 'Dashboard' , 'layerswp' );
}

// Marketplace
if( !defined( 'LAYERS_DISABLE_MARKETPLACE' ) ){
if( !defined( 'LAYERS_DISABLE_MARKETPLACE' ) && !class_exists( 'Layers_Pro' ) ){
// dashboard Page
$marketplace = add_menu_page(
__( 'Add Ons' , 'layerswp' ),
__( 'Add Ons' , 'layerswp' ),
$marketplace = add_submenu_page(
LAYERS_THEME_SLUG . '-dashboard',
__( 'Layers Pro' , 'layerswp' ),
__( 'Layers Pro' , 'layerswp' ),
'edit_theme_options',
LAYERS_THEME_SLUG . '-marketplace',
'layers_options_panel_ui',
Expand All @@ -589,24 +555,12 @@ function layers_options_panel_menu(){

add_action('admin_print_scripts-' . $marketplace, array( $layers_options_panel, 'enqueue_marketplace_scripts') );

$marketplace_envato = add_submenu_page(
LAYERS_THEME_SLUG . '-marketplace',
__( 'Envato Marketplace' , 'layerswp' ),
__( 'Envato Marketplace' , 'layerswp' ),
'edit_theme_options',
LAYERS_THEME_SLUG . '-envato-marketplace',
'layers_options_panel_ui'
);

add_action('admin_print_scripts-' . $marketplace_envato, array( $layers_options_panel, 'enqueue_marketplace_scripts') );

// This modifies the Layers submenu item - must be done here as $submenu
// is only created if $submenu items are added using add_submenu_page

if( isset( $submenu[ 'layers-marketplace' ] ) ) {
$submenu[LAYERS_THEME_SLUG . '-marketplace'][0][0] = __( 'Official' , 'layerswp' );
}
}

// This modifies the Layers submenu item - must be done here as $submenu
// is only created if $submenu items are added using add_submenu_page
if( isset( $submenu[ 'layers-dashboard' ] ) ) {
$submenu[LAYERS_THEME_SLUG . '-dashboard'][0][0] = __( 'Dashboard' , 'layerswp' );
}
}

Expand All @@ -616,7 +570,12 @@ function layers_options_panel_menu(){
* Kicking this off with the 'ad' hook
*/

function layers_options_panel_ui(){
function layers_options_panel_ui( $args ){

if( 'layers-marketplace' == $_GET[ 'page' ] ){
wp_redirect( 'https://www.layerswp.com/layers-pro/?ref=obox&utm_source=layers%20theme&utm_medium=link&utm_campaign=Layers%20Pro%20Upsell&utm_content=Dashboard%20Menu' );
}

$layers_options_panel = new Layers_Options_Panel();
$layers_options_panel->init();
}
Expand Down
80 changes: 28 additions & 52 deletions core/options-panel/partials/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,36 @@
</div>

<div class="l_admin-column l_admin-span-5">
<?php if( !defined( 'LAYERS_DISABLE_MARKETPLACE' ) ){ ?>
<?php if( !defined( 'LAYERS_DISABLE_MARKETPLACE' ) && !class_exists( 'Layers_Pro' ) ){ ?>
<div class="l_admin-panel l_admin-push-bottom">
<div class="l_admin-section-title l_admin-content l_admin-tiny">
<h3 class="l_admin-heading"><?php _e( 'Themes &amp; Extensions' , 'layerswp' ); ?></h3>
<p class="l_admin-excerpt">
<?php _e( 'Looking for a theme or plugin to achieve something unique with your website?
Browse the Layers Add Ons and take your site to the next level.' , 'layerswp' ); ?>
</p>
<div class="l_admin-panel-title">
<h4 class="l_admin-heading"><?php _e( 'Get Even More with Layers Pro' , 'layerswp' ); ?></h4>
</div>
<div class="l_admin-button-well">
<a href="<?php echo admin_url( 'admin.php?page=layers-marketplace' ); ?>" class="button button-primary">
<?php _e( 'Themes &amp; Extensions' , 'layerswp' ); ?>
<div class="l_admin-media l_admin-image-left l_admin-content l_admin-no-push-bottom">
<div class="l_admin-media l_admin-image-left">
<div class="l_admin-media-image l_admin-small">
<img src="<?php echo get_template_directory_uri(); ?>/core/assets/images/thumb-layers-pro.png" alt="LayersPro" />
</div>
<div class="l_admin-media-body">
<div class="l_admin-excerpt">
<p><?php _e( 'Layers Pro unlocks customizability in the Layers framework.' , 'layerswp' ); ?></p>
<ul class="l_admin-ticks-wp">
<li><?php _e( 'Make the logo bigger' , 'layerswp' ); ?></li>
<li><?php _e( 'Add video backgrounds' , 'layerswp' ); ?></li>
<li><?php _e( 'Add parallax backgrounds' , 'layerswp' ); ?></li>
<li><?php _e( 'Add a header background image' , 'layerswp' ); ?></li>
<li><?php _e( 'Full button styling control' , 'layerswp' ); ?></li>
<li><?php _e( 'New customization controls' , 'layerswp' ); ?></li>
<li><?php _e( 'Get more control over your blog' , 'layerswp' ); ?></li>
<li><?php _e( '4 new widgets' , 'layerswp' ); ?></li>
</ul>
</div>
</div>
</div>
</div>
<div class="l_admin-button-well l_admin-text-right">
<a href="https://www.layerswp.com/layers-pro/?ref=obox&utm_source=layers%20theme&utm_medium=link&utm_campaign=Layers%20Pro%20Upsell&utm_content=WP%20Dashboard" target="_blank" class="button button-primary">
<?php _e( 'Get Layers Pro' , 'layerswp' ); ?>
</a>
</div>
</div>
Expand Down Expand Up @@ -249,47 +267,5 @@
</div>
</div>
</section>
<section class="l_admin-area-wrapper">
<div class="l_admin-well-alt l_admin-content">

<div class="l_admin-section-title l_admin-small">
<h3 class="l_admin-heading"><?php _e( 'Layers News' , 'layerswp' ); ?></h3>
</div>

<div id="layers-dashboard-news-feed" class="l_admin-row" data-layers-feed="news" data-layers-feed-count="3">
<div class="l_admin-column l_admin-span-3 l_admin-panel" data-loading="1">
<div class="l_admin-content">
<div class="l_admin-section-title l_admin-tiny">
<h4 class="l_admin-heading"><?php _e( 'Loading Layers News' , 'layerswp' ); ?></h4>
</div>
</div>
</div>
<div class="l_admin-column l_admin-span-3">
<div class="l_admin-panel l_admin-content clearfix">
<div class="l_admin-section-title l_admin-tiny">
<h3 class="l_admin-heading"><?php _e( 'Stay in the Loop' , 'layerswp' ); ?></h3>
<p class="l_admin-excerpt">
<?php _e( 'Sign up to our monthly newsletter to find out when we launch new features, products.' , 'layerswp' ); ?>
</p>
</div>
<form id="layers-dashboard-newsletter" action="//oboxthemes.us10.list-manage.com/subscribe/post?u=5b9a020fcf797987098cc7bca&amp;id=069cfedbbc" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" target="_blank" validate>
<div id="mc_embed_signup_scroll" class="l_admin-form-item l_admin-form-inline">
<div class="mc-field-group">
<label for="mce-EMAIL"><?php _e( 'Email Address' , 'layerswp' ); ?></label>
<input type="email" value="" name="EMAIL" class="required email l_admin-form-inline input" id="mce-EMAIL">
<button type="submit" name="subscribe" id="mc-embedded-subscribe" class="button button-primary"><?php _e( 'Subscribe' , 'layerswp' ); ?></button><input type="hidden" name="SIGNUP" id="SIGNUP" value="layerswp" />
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;"><input type="text" name="b_5b9a020fcf797987098cc7bca_069cfedbbc" tabindex="-1" value=""></div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>

<?php $this->footer(); ?>
2 changes: 1 addition & 1 deletion core/widgets/modules/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ function form( $instance ){
'label' => __( 'Image Ratios', 'layerswp' ),
'name' => $this->get_layers_field_name( 'design', 'imageratios' ),
'id' => $this->get_layers_field_id( 'design', 'imageratios' ),
'value' => ( isset( $this->values['imageratios'] ) ) ? $this->values['imageratios'] : NULL,
'value' => ( isset( $instance['imageratios'] ) ) ? $instance['imageratios'] : NULL,
'options' => array(
'image-portrait' => __( 'Portrait', 'layerswp' ),
'image-landscape' => __( 'Landscape', 'layerswp' ),
Expand Down
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* The current version of the theme. Use a random number for SCRIPT_DEBUG mode
*/

define( 'LAYERS_VERSION', '2.0.9' );
define( 'LAYERS_VERSION', '2.0.10' );
define( 'LAYERS_TEMPLATE_URI' , get_template_directory_uri() );
define( 'LAYERS_TEMPLATE_DIR' , get_template_directory() );
define( 'LAYERS_THEME_TITLE' , 'Layers' );
Expand Down
2 changes: 1 addition & 1 deletion style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f00907b

Please sign in to comment.