Plugin Directory

Changeset 1902269


Ignore:
Timestamp:
07/02/2018 03:25:14 AM (8 years ago)
Author:
velathemes
Message:

version 1.0.1

Location:
vela-companion/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • vela-companion/trunk/assets/js/site-importer.js

    r1902195 r1902269  
    3333                dataType: 'json',
    3434                data : {
    35                     action          : 'astra-sites-import-customizer-settings',
     35                    action          : 'vela-sites-import-customizer-settings',
    3636                    customizer_data : VelaImporter.customizer_data,
    3737                },
  • vela-companion/trunk/inc/pageMetabox/options.php

    r1902195 r1902269  
    1010function vela_page_metaboxes( array $meta_boxes ) {
    1111   
    12     $theme = get_option('stylesheet');
     12    $theme = VELA_THEME_OPTION_NAME;
    1313    $prefix = '_vela_';
    1414    if( $theme == 'cactus' || strstr($theme,'cactus') )
  • vela-companion/trunk/inc/templates-importer/templates-importer.php

    r1902195 r1902269  
    2626        );
    2727       
    28         $theme = get_option('stylesheet');
     28        $theme = VELA_THEME_OPTION_NAME;
    2929       
    3030        // Get a SimplePie feed object from the specified feed source.
     
    116116       
    117117        }
    118        
    119     /**
    120      * sites list
    121      */
    122     public static function sites(){
    123        
    124         $defaults_if_empty  = array(
    125            
    126         );
    127 
    128         $sites_list = array(
    129            
    130            
    131         );
    132        
    133         $theme = get_option('stylesheet');
    134        
    135         // Get a SimplePie feed object from the specified feed source.
    136         $options     = get_option('vela_companion_options',VelaCompanion::default_options());
    137         $license_key = isset($options['license_key'])?$options['license_key']:'';
    138        
    139         $feed_url = 'https://velathemes.com/api/sites-importer-api/?license_key='.$license_key.'&theme='.$theme;
    140        
    141        
    142         delete_transient('feed_' . md5($feed_url));
    143         delete_transient('feed_mod_' . md5($feed_url));
    144 
    145         $rss = fetch_feed( $feed_url );
    146 
    147         $maxitems = 0;
    148        
    149         if ( ! is_wp_error( $rss ) ) :
    150        
    151             $maxitems = $rss->get_item_quantity( 50 );
    152        
    153             $rss_items = $rss->get_items( 0, $maxitems );
    154        
    155         endif;
    156    
    157         if ( $maxitems == 0 ) :
    158          
    159         else :
    160            
    161             foreach ( $rss_items as $item ) :
    162 
    163             $template = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'template');
    164             $title = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title');
    165             $description = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description');
    166             $image = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'image');
    167             $siteid = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'siteid');
    168             $demo = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'demo');
    169             $plugins = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'plugins');
    170             $pro = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pro');
    171             $options = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'options');
    172             $wxr = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'wxr');
    173             $widgets = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'widgets');
    174             $customizer = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'customizer');
    175            
    176             $required_plugins = array('name' => __( 'Elementor Page Builder', 'vela-companion' ),'slug' => 'elementor', "init" => "elementor/elementor.php");
    177 
    178 
    179             if(isset($plugins[0]['data']) && $plugins[0]['data']!=''){
    180                 $my_plugins = @json_decode($plugins[0]['data'], true);
    181                 if( is_array($my_plugins) ){
    182                     $required_plugins = $my_plugins;
    183                 }
    184                
    185             }
    186            
    187             if(!($siteid)){
    188                 $siteid = sanitize_title($title[0]['data']);
    189             }else{
    190                 $siteid = sanitize_title($siteid[0]['data']);
    191                 }
    192             if(isset($title[0]['data'])){
    193                 $sites_list[$siteid] = array(
    194                     'title'       => $title[0]['data'],
    195                     'description' => $description[0]['data'],
    196                     'demo'    => urldecode($demo[0]['data']),
    197                     'screenshot'  => urldecode($image[0]['data']),
    198                     'wxr' => urldecode($wxr[0]['data']),
    199                     'required_plugins' => $required_plugins,
    200                     'pro' => $pro[0]['data'],
    201                     'options' => $options[0]['data'],
    202                     'widgets' => $widgets[0]['data'],
    203                     'customizer' => $customizer[0]['data'],
    204                 );
    205                 }
    206        
    207                  endforeach;
    208          endif;
    209 
    210 
    211         return apply_filters( 'vela_elementor_sites_list', $sites_list );
    212        
    213         }
    214    
    215     /**
    216      * Import wxr
    217      */
    218     private static function import_wxr($xml_file){
    219        
    220         include(dirname(__FILE__).'/wordpress-importer.php');
    221         if ( file_exists($xml_file) && class_exists( 'Vela_Import' ) ) {
    222                 $importer = new Vela_Import();
    223                 $importer->fetch_attachments = false;
    224                 ob_start();
    225                 $importer->import($xml_file);
    226                 ob_end_clean();
    227 
    228                 flush_rewrite_rules();
    229            
    230         }
    231 
    232         }
    233118
    234119    /**
     
    240125        include 'template-directory-tpl.php';
    241126    }
    242    
    243     public static function render_sites_page() {
    244        
    245         $sites_array = VelaTemplater::sites();
    246         include 'sites-directory-tpl.php';
    247     }
    248    
    249    
    250127   
    251128    /**
  • vela-companion/trunk/readme.txt

    r1902195 r1902269  
    1212== Description ==
    1313
    14 Theme options for Vela themes.
     14Theme options for Vela theme.
    1515
    1616== Installation ==
     
    3333== Changelog ==
    3434
    35 = 1.0.1 =
     35= 1.0.5 =
     36* Fixed plugin Active button issue
     37
     38= 1.0.4 =
     39* Added License Key option
     40
     41= 1.0.3 =
     42* Added template > Vela Frontpage 2
    3643
    3744== Upgrade Notice ==
  • vela-companion/trunk/vela-companion.php

    r1902195 r1902269  
    2828        {
    2929           
    30             $theme = get_option('stylesheet');
     30            $theme = wp_get_theme();
    3131            $prefix = 'vela_';
    32             if( $theme == 'cactus' || strstr($theme,'cactus') )
     32           
     33            $option_name = $theme->get( 'Template' );
     34            if( $option_name == '' )
     35                $option_name = $theme->get( 'TextDomain' );
     36           
     37            define( 'VELA_THEME_OPTION_NAME', sanitize_title($option_name) );
     38                       
     39            if( VELA_THEME_OPTION_NAME == 'cactus' || strstr(VELA_THEME_OPTION_NAME,'cactus') ){
    3340                $prefix = 'cactus_';
    34             if( $theme == 'astore' || strstr($theme,'astore') )
     41            }
     42            if( VELA_THEME_OPTION_NAME == 'astore' || strstr(VELA_THEME_OPTION_NAME,'astore') ){
    3543                $prefix = 'astore_';
     44           
     45            }
     46           
     47           
    3648
    3749            register_activation_hook( __FILE__, array(&$this ,'plugin_activate') );
     
    317329        wp_enqueue_style( 'wp-color-picker' );
    318330       
    319         $theme = get_option('stylesheet');
     331        $theme = VELA_THEME_OPTION_NAME;
    320332       
    321333        if(isset($_GET['page']) && $_GET['page']=='vela-template'){
     
    407419           
    408420            global $post;
    409             $theme = get_option('stylesheet');
     421            $theme = VELA_THEME_OPTION_NAME;
    410422            $prefix = '_vela_';
    411423            $prefix2 = 'vela_';
     
    461473            }
    462474       
    463         $theme = get_option('stylesheet');
     475        $theme = VELA_THEME_OPTION_NAME;
    464476        $prefix = '_vela_';
    465477        $prefix2 = 'vela_';
     
    678690        global $post;
    679691       
    680         $theme = get_option('stylesheet');
     692        $theme = VELA_THEME_OPTION_NAME;
    681693        $prefix = '_vela_';
    682694        if( $theme == 'cactus' || strstr($theme,'cactus') )
     
    703715        global $post;
    704716       
    705         $theme = get_option('stylesheet');
     717        $theme = VELA_THEME_OPTION_NAME;
    706718        $prefix = '_vela_';
    707719        if( $theme == 'cactus' || strstr($theme,'cactus') )
     
    732744            global $post;
    733745           
    734         $theme = get_option('stylesheet');
     746        $theme = VELA_THEME_OPTION_NAME;
    735747        $prefix = '_vela_';
    736748        if( $theme == 'cactus' || strstr($theme,'cactus') )
Note: See TracChangeset for help on using the changeset viewer.