Plugin Directory

Changeset 1889355


Ignore:
Timestamp:
06/08/2018 04:09:30 AM (8 years ago)
Author:
velathemes
Message:

version 1.0.4

Location:
astore-companion
Files:
58 added
6 edited

Legend:

Unmodified
Added
Removed
  • astore-companion/trunk/assets/css/admin.css

    r1861560 r1889355  
    264264    outline:none !important;
    265265}
     266
     267.elementor-message{
     268    display:none;
     269}
     270form.astore-license-box {
     271    max-width: 700px;
     272    background: #fff;
     273    margin: 20px 0;
     274    padding: 20px 30px;
     275}
  • astore-companion/trunk/astore-companion.php

    r1871323 r1889355  
    55    Author: VelaThemes
    66    Author URI: https://velathemes.com/
    7     Version: 1.0.3
     7    Version: 1.0.4
    88    Text Domain: astore-companion
    99    Domain Path: /languages
     
    1414
    1515require_once 'inc/widget-recent-posts.php';
     16require_once 'inc/pageMetabox/options.php';
    1617require_once 'inc/AStore_Taxonomy_Images.php';
    1718require_once 'inc/templates-importer/templates-importer.php';
     
    3334            add_action( 'admin_enqueue_scripts',  array(&$this , 'enqueue_admin_scripts' ));
    3435            add_action( 'wp_footer', array( $this, 'gridlist_set_default_view' ) );
     36           
     37            add_filter( 'astore_page_sidebar_layout', array(&$this ,'page_sidebar_layout'), 20,1 );
     38            add_action( 'astore_before_sidebar', array( $this, 'before_sidebar' ) );
     39            add_action( 'astore_after_sidebar', array( $this, 'after_sidebar' ) );
    3540
    3641           
     
    8893    function enqueue_scripts()
    8994    {
     95   
     96        global $post;
     97        $custom_css = '';
     98        $postid = isset($post->ID)?$post->ID:0;
     99        if(is_home()){
     100            $postid = get_option( 'page_for_posts' );
     101            }
     102           
     103        if($postid>0){
     104            $this->slider = get_post_meta($postid, '_acmb_slideshow', true);
     105            $bg_color = get_post_meta($postid, '_acmb_bg_color', true);
     106            $bg_image = get_post_meta($postid, '_acmb_bg_image', true);
     107           
     108            if($bg_color!=''){
     109                $custom_css .= '.page-id-'.$postid.' .page-wrap,.postid-'.$postid.' .page-wrap{background-color:'.$bg_color.';}';
     110                if( !is_page_template('template-sections.php') )
     111                    $custom_css .= '.page-id-'.$postid.' .page-inner, .postid-'.$postid.' .page-inner{padding-top: 30px;}';
     112                }
     113            if($bg_image!=''){
     114                $custom_css .= '.page-id-'.$postid.' .page-wrap, .postid-'.$postid.' .page-wrap{background-image:url('.$bg_image.');}';
     115                if( !is_page_template('template-sections.php') )
     116                    $custom_css .= '.page-id-'.$postid.' .page-inner, .postid-'.$postid.' .page-inner{padding-top: 30px;}';
     117               
     118                }
     119               
     120        }
     121        if(!empty($this->slider) && is_array($this->slider)){
     122            $custom_css .= '.page-id-'.$postid.' .page-wrap, .blog .page-wrap{padding-top: 0;}.page-id-'.$postid.' .page-inner, .blog .page-inner{padding-top:30px;}';
     123        }
     124       
     125        if (is_category()) {
     126              $category = get_category(get_query_var('cat'));
     127              $cat_id = $category->cat_ID;
     128              if($cat_id>0){
     129                    $category_meta = get_term_meta($cat_id);
     130                    $category_meta = isset($category_meta['cactus_category_meta'])?unserialize($category_meta['cactus_category_meta'][0]):null;
     131                   
     132                    if(isset($category_meta[$cat_id]['_acmb_bg_color'])){
     133                        $custom_css .= ".category-".$cat_id." .page-wrap{background-color:".$category_meta[$cat_id]['_acmb_bg_color'].";}";
     134                        $custom_css .= ".category-".$cat_id." .page-inner, .category-".$cat_id." .page-inner{padding-top: 30px;}";
     135                        }
     136                    if(isset($category_meta[$cat_id]['bg_img'])){
     137                        $image = wp_get_attachment_image_url( $category_meta[ $cat_id ]['bg_img'], 'full');
     138                       
     139                        $custom_css .= ".category-".$cat_id." .page-wrap{background-image:url(".$image.");}";
     140                        $custom_css .= ".category-".$cat_id." .page-inner, .category-".$cat_id." .page-inner{padding-top: 30px;}";
     141                        }
     142                       
     143                  }
     144          }
    90145
    91146        $i18n = array();
     
    93148        wp_enqueue_style( 'astore-companion-front', plugins_url('assets/css/front.css', __FILE__));
    94149        wp_enqueue_script( 'astore-companion-front', plugins_url('assets/js/front.js', __FILE__),array('jquery'),'',true);
     150       
     151        if($custom_css!='')
     152            wp_add_inline_style( 'astore-companion-front', wp_filter_nohtml_kses($custom_css) );
    95153
    96154    }
     
    106164        );
    107165       
    108     }
     166        add_submenu_page(
     167            'astore-companion', __( 'AStore Theme License', 'astore-companion' ), __( 'AStore Theme License', 'astore-companion' ), 'manage_options', 'astore-license',
     168            array( 'AStoreCompanion', 'license' )
     169        );
     170        add_action( 'admin_init', array(&$this,'register_mysettings') );
     171    }
     172   
     173    /**
     174     * Register settings
     175    */
     176    function register_mysettings() {
     177        register_setting( 'astore-settings-group', 'astore_companion_options', array(&$this,'text_validate') );
     178    }
     179   
     180    static function license(){
     181       
     182        if ( !current_user_can( 'manage_options' ) )  {
     183            wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
     184        }
     185        ?>
     186       
     187        <form method="post" class="astore-license-box" action="<?php echo admin_url('options.php');?>">
     188
     189        <?php
     190            settings_fields( 'astore-settings-group' );
     191            $options     = get_option('astore_companion_options',AStoreCompanion::default_options());
     192            $astore_companion_options = wp_parse_args($options,AStoreCompanion::default_options());
     193           
     194        ?>
     195        <div class="wrap">
     196
     197          <div class="license">
     198        <p><?php _e( 'AStore License Key', 'astore-companion' );?>: <input size="50" name="astore_companion_options[license_key]" value="<?php echo $astore_companion_options['license_key'];?>" type="text" /></p>
     199        <p></p>
     200         
     201           </div>
     202            <p class="submit">
     203            <input type="submit" class="button-primary" value="<?php _e('Save Changes','astore-companion');?>" />
     204            </p>
     205        </div>
     206        </form>
     207       
     208    <?php   }
    109209   
    110210    /**
     
    116216        }
    117217       
    118         echo '<h2>'.__( 'About AStore', 'astore-companion' ).'</h2><div class="astore-info-wrap">
     218        echo '<div class="updated"><h2>'.__( 'About AStore', 'astore-companion' ).'</h2><div class="astore-info-wrap">
    119219    <p>'. __( 'AStore is the best choice for building online store since it\'s fully compatible with WooCommerce, the most popular ecommerce plugin. Using Elementor page builder plugin, you could simply edit your site using just drag &amp; drop.', 'astore-companion' ).'</p>
    120     </div>';
     220    </div></div>';
     221   
     222   
    121223       
    122224    }
     
    137239                <?php
    138240            }
     241           
     242   
     243    function before_sidebar(){
     244        global $post;
     245       
     246        $postid = isset($post->ID)?$post->ID:0;
     247        if( is_singular() ){
     248               
     249                $before_sidebar = get_post_meta($postid , '_acmb_before_sidebar', true);
     250                if( $before_sidebar != '' ){
     251                    echo '<div class="astore-before-sidebar">';
     252                    echo wp_kses_post($before_sidebar);
     253                    echo '</div>';
     254                }
     255               
     256        }
     257       
     258    }
     259   
     260   
     261    function after_sidebar(){
     262        global $post;
     263       
     264        $postid = isset($post->ID)?$post->ID:0;
     265        if( is_singular() ){
     266               
     267                $after_sidebar = get_post_meta($postid , '_acmb_after_sidebar', true);
     268                if( $after_sidebar != '' ){
     269                    echo '<div class="astore-after-sidebar">';
     270                    echo wp_kses_post($after_sidebar);
     271                    echo '</div>';
     272                }
     273               
     274        }
     275       
     276    }
     277   
     278    /**
     279     * Get sidebar layout
     280    */
     281
     282    function page_sidebar_layout( $content ){
     283       
     284            global $post;
     285           
     286            $postid = isset($post->ID)?$post->ID:0;
     287            if(is_home()){
     288                $postid = get_option( 'page_for_posts' );
     289            }
     290           
     291            if((is_singular()||is_home()) && $postid>0){
     292               
     293                $sidebar_layout = get_post_meta($postid , '_acmb_sidebar', true);
     294               
     295                if( $sidebar_layout != '' )
     296                    return $sidebar_layout;
     297                }
     298           
     299            if (is_category()) {
     300              $category = get_category(get_query_var('cat'));
     301              $cat_id = $category->cat_ID;
     302              if($cat_id>0){
     303                    $category_meta = get_term_meta($cat_id);
     304                    $category_meta = isset($category_meta['astore_category_meta'])?unserialize($category_meta['astore_category_meta'][0]):null;
     305                   
     306                    if(isset($category_meta[$cat_id]['_acmb_sidebar'])){
     307                        $sidebar_layout = $category_meta[$cat_id]['_acmb_sidebar'];
     308                        if( $sidebar_layout != '' )
     309                            return $sidebar_layout;
     310                        }
     311                }
     312            }
     313               
     314                return $content;
     315           
     316            }
    139317   
    140318    /**
  • astore-companion/trunk/inc/elementor-widgets/widgets/latest-news.php

    r1861560 r1889355  
    9898
    9999
    100 <div class="cactus-section">
    101       <div class="cactus-section-content">
    102           <div class="cactus-section-container">
     100<div class="astore-section">
     101      <div class="astore-section-content">
     102          <div class="astore-section-container">
    103103              <div class="row">
    104104             
  • astore-companion/trunk/inc/pageMetabox/options.php

    r1861560 r1889355  
    1010function acmb_page_metaboxes( array $meta_boxes ) {
    1111
    12     $prefix = '_ccmb_';
     12    $prefix = '_acmb_';
    1313
    1414    /**
     
    4949                ),
    5050            ),
     51            array(
     52                'name'    => __( 'Content Before Sidebar', 'astore-companion' ),
     53                'desc'    => '',
     54                'id'      => $prefix . 'before_sidebar',
     55                'type'    => 'textarea',
     56                'default' => ''
     57            ),
     58           
     59           
     60            array(
     61                'name'    => __( 'Content After Sidebar', 'astore-companion' ),
     62                'desc'    => '',
     63                'id'      => $prefix . 'after_sidebar',
     64                'type'    => 'textarea',
     65                'default' => ''
     66            ),
     67           
     68
    5169           
    5270        )
  • astore-companion/trunk/inc/templates-importer/template-directory-tpl.php

    r1861560 r1889355  
    11<?php
    2 
    32
    43$preview_url = add_query_arg( 'astore_templates', '', home_url() );
  • astore-companion/trunk/readme.txt

    r1871323 r1889355  
    3232
    3333== Changelog ==
     34
     35= 1.0.4 =
     36* Added License Key option
     37
    3438= 1.0.3 =
    3539* Added template > AStore Frontpage 2
Note: See TracChangeset for help on using the changeset viewer.