function enqueue_styles_and_scripts() { rh_enqueue_script('bootstrap', $this->url . 'bootstrap/js/bootstrap.js', array('jquery'), '3.0.0', $this->bootstrap_in_footer); rh_enqueue_script('bootstrap-renamed', $this->url . 'bootstrap/js/custom.js', array(), '3.0.0.1', $this->bootstrap_in_footer); wp_enqueue_style('bootstrap', $this->url . 'bootstrap/css/namespaced.bootstrap.css', array(), '2.3.2'); wp_enqueue_script('jquery'); wp_enqueue_script('tinycolor', $this->url . 'js/tinycolor.js', array(), '1.0.1', $this->in_footer); wp_enqueue_script('rh-css-scripts', $this->url . 'js/scripts.js', array(), '1.0.1', $this->in_footer); wp_register_script('rh-css-normalizers', $this->url . 'js/rhl_css_normalizers.js', array(), '1.0.1', $this->in_footer); wp_register_script('rh-css-actions', $this->url . 'js/editor_actions.js', array(), '1.0.1', $this->in_footer); wp_register_script('jquery-fontSelector', $this->url . 'js/jquery.fontSelector.js', array(), '1.0.0', $this->in_footer); wp_register_script('jquery-rule', $this->url . 'js/jquery.rule-1.0.2-dev.js', array(), '1.0.2', $this->in_footer); if (get_bloginfo('version') < '3.9') { wp_enqueue_style('rh-css-edit', $this->url . 'css/style.prewp39.css', array(), '1.0.0.2'); wp_enqueue_style('minicolors', $this->url . 'css/jquery.miniColors.css', array(), '1.0.1'); wp_enqueue_script('minicolors', $this->url . 'js/jquery.miniColors.js', array(), '1.0.0', $this->in_footer); wp_enqueue_script('rh-css-edit', $this->url . 'js/rhl_css_edit.pre39.js', array('tinycolor', 'minicolors', 'rh-css-normalizers', 'rh-css-actions', 'jquery-fontSelector', 'jquery-rule'), '1.0.1.1', $this->in_footer); } else { wp_enqueue_style('rh-css-edit', $this->url . 'css/style.css', array(), '1.0.0.3'); wp_enqueue_style('minicolors', $this->url . 'css/jquery.minicolors.2015.css', array(), '1.0.2'); wp_enqueue_script('minicolors', $this->url . 'js/jquery.minicolors.2015.min.js', array(), '1.0.2', $this->in_footer); wp_enqueue_script('rh-css-edit', $this->url . 'js/rhl_css_edit.js', array('tinycolor', 'minicolors', 'rh-css-normalizers', 'rh-css-actions', 'jquery-fontSelector', 'jquery-rule'), '1.0.1.5', $this->in_footer); } }
function head() { wp_register_style('rhpop-bootstrap', $this->module_url . 'bootstrap/css/bootstrap.namespaced.rhpop.css', array(), '2.3.1'); wp_print_styles('rhpop-bootstrap'); rh_enqueue_script('bootstrap', $this->module_url . 'bootstrap/js/bootstrap.js', array(), '2.3.1'); rh_enqueue_script('jquery-isotope', $this->module_url . 'js/jquery.isotope.min.js', array(), '1.5.14'); wp_print_scripts('bootstrap'); wp_print_scripts('jquery-isotope'); wp_print_styles('rh-dc'); wp_print_scripts('rh-dc'); $rh_bundles = $this->get_option('rh_bundles', (object) array()); $rh_downloaded_bundles = property_exists($rh_bundles, 'downloaded') ? $rh_bundles->downloaded : array(); $rh_downloaded_bundles = is_array($rh_downloaded_bundles) ? $rh_downloaded_bundles : array(); /* $current = $this->get_option($this->options_varname, array()); $current = is_array($current) ? $current : array(); $addons = isset($current['addons']) && is_array($current['addons']) ? $current['addons'] : array() ; if(count($addons)>0){ $tmp = array(); foreach($addons as $a){ $tmp[]=$a; } $addons=$tmp; } */ $addons = $this->get_active_addons(); $arr = $this->get_plugins(); $installed_addons = array_keys($arr); $installed_addons = is_array($installed_addons) ? $installed_addons : array(); $arr = is_array($arr) ? $arr : array(); if (count($arr) > 0) { foreach ($arr as $i => $a) { $brr = explode(' ', $a['Version']); $arr[$i]['Version'] = $brr[0]; } } /* echo "<pre>"; print_r($installed_addons); print_r($arr); echo "</pre>"; */ ?> <script src="https://checkout.stripe.com/v2/checkout.js"></script> <script> var rh_download_panel_id = '<?php echo $this->id; ?> '; var apiurl = '<?php echo $this->api_url; ?> '; var rh_license_keys = <?php echo json_encode($this->license_keys); ?> ; var rh_item_ids = <?php echo json_encode($this->get_license_item_ids()); ?> ; var rh_downloaded = <?php echo json_encode($rh_downloaded_bundles); ?> ; var rh_filter = ''; var rh_bundles = []; var rh_active_addons = <?php echo json_encode((array) $addons); ?> ; var rh_installed_addons = <?php echo json_encode((array) $installed_addons); ?> ; var stripe_public_key = ''; var stripe_item_id = ''; var stripe_coupon = ''; var rh_addon_details = <?php echo json_encode($arr); ?> ; var rh_theme = <?php echo $this->theme ? 'true' : 'false'; ?> ; var rh_custom_filter = <?php echo $this->custom_filter ? 'true' : 'false'; ?> ; var dc_updates_available = "<?php _e('You have %s update(s) available for download', 'pop'); ?> "; jQuery('document').ready(function($){ get_bundles(); $('#bundles').isotope({ itemSelector : '.pop-dlc-item', layoutMode : 'fitRows' /*,filter : '.letter-a'*/ }); $('.isotope-filter').on('click',function(e){ $('.isotope-filter').removeClass('current-cat'); $(this).addClass('current-cat'); var filter = $(this).attr('rel'); $('#bundles').isotope({filter:filter}); }); }); </script> <style> .dc-col-name { min-width:200px; } </style> <?php }
function head() { wp_register_style('rhaddons', $this->module_url . 'css/addons.css', array(), '1.0.0'); wp_register_style('rhpop-bootstrap', $this->module_url . 'bootstrap/css/bootstrap.namespaced.rhpop.css', array(), '2.3.1'); rh_enqueue_script('bootstrap', $this->module_url . 'bootstrap/js/bootstrap.js', array(), '2.3.1'); rh_enqueue_script('jquery-isotope', $this->module_url . 'js/jquery.isotope.min.js', array(), '1.5.14'); wp_print_styles('rhaddons'); wp_print_styles('rhpop-bootstrap'); wp_print_scripts('bootstrap'); wp_print_scripts('jquery-isotope'); ?> <script> jQuery(document).ready(function($){ $('#pop-addon-items').isotope({ itemSelector : '.pop-addon-item', layoutMode : 'fitRows' /*,filter : '.letter-a'*/ }); $('.enable-addon,.disable-addon').on('click',function(i,o){ var plugin = $(this).parent().data('addon_path'); var id = $(this).attr('id'); if( $(this).is('.enable-addon') ){ activate_addon( plugin, id, true ); }else{ activate_addon( plugin, id, false ); } }); }); function activate_addon( plugin, el_id, activate ){ jQuery(document).ready(function($){ var args = { action: 'rhpop_activate_addon_<?php echo $this->id; ?> ', plugin: plugin, activate: activate ? 1 : 0, el_id: el_id } $.post( ajaxurl, args, function(data){ if(data.R=='OK'){ if( activate ){ $('#'+el_id).parent().find('.btn.enable-addon') .addClass('btn-success') ; $('#'+el_id).parent().find('.btn.disable-addon') .removeClass('btn-danger') ; }else{ $('#'+el_id).parent().find('.btn.enable-addon') .removeClass('btn-success') ; $('#'+el_id).parent().find('.btn.disable-addon') .addClass('btn-danger') ; } if(data.URL && ''!=data.URL){ window.location.replace(data.URL); }else{ window.location.reload(); } return; }else if(data.R=='ERR'){ alert(data.MSG); }else{ alert('Error saving, reload page and try again.'); } $('#'+el_id).parent().find('.btn.active').removeClass('active'); }, 'json'); }); } </script> <?php }