function axiom_template_portfolio_add_scripts($style) { if (axiom_substr($style, 0, 10) == 'portfolio_' || axiom_substr($style, 0, 5) == 'grid_' || axiom_substr($style, 0, 7) == 'square_') { axiom_enqueue_script('isotope', axiom_get_file_url('js/jquery.isotope.min.js'), array(), null, true); axiom_enqueue_script('hoverdir', axiom_get_file_url('js/hover/jquery.hoverdir.js'), array(), null, true); axiom_enqueue_style('axiom-portfolio-style', axiom_get_file_url('css/core.portfolio.css'), array(), null); } }
function axiom_shortcodes_vc_scripts_front() { if (axiom_vc_is_frontend()) { // Include CSS axiom_enqueue_style('shortcodes_vc-style', axiom_get_file_url('shortcodes/shortcodes_vc_front.css'), array(), null); // Include JS axiom_enqueue_script('shortcodes_vc-script', axiom_get_file_url('shortcodes/shortcodes_vc_front.js'), array(), null, true); } }
function load_scripts() { if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'trx_emailer') { axiom_enqueue_style('trx-emailer-style', axiom_get_file_url('tools/emailer/emailer.css'), array(), null); } if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'trx_emailer') { axiom_enqueue_script('jquery-ui-core', false, array('jquery'), null, true); axiom_enqueue_script('jquery-ui-tabs', false, array('jquery', 'jquery-ui-core'), null, true); axiom_enqueue_script('trx-emailer-script', axiom_get_file_url('tools/emailer/emailer.js'), array('jquery'), null, true); } }
function axiom_admin_load_scripts() { axiom_enqueue_script('axiom-debug-script', axiom_get_file_url('js/core.debug.js'), array('jquery'), null, true); //if (axiom_options_is_used()) { axiom_enqueue_style('axiom-admin-style', axiom_get_file_url('css/core.admin.css'), array(), null); //} if (axiom_strpos($_SERVER['REQUEST_URI'], 'widgets.php') !== false) { axiom_enqueue_style('axiom-fontello-style', axiom_get_file_url('css/fontello-admin/css/fontello-admin.css'), array(), null); axiom_enqueue_style('axiom-animations-style', axiom_get_file_url('css/fontello-admin/css/animation.css'), array(), null); axiom_enqueue_script('axiom-admin-script', axiom_get_file_url('js/core.admin.js'), array('jquery'), null, true); } }
function axiom_enqueue_popup($engine = '') { if ($engine == 'pretty' || empty($engine) && axiom_get_theme_option('popup_engine') == 'pretty') { axiom_enqueue_style('axiom-prettyphoto-style', axiom_get_file_url('js/prettyphoto/css/prettyPhoto.css'), array(), null); axiom_enqueue_script('axiom-prettyphoto-script', axiom_get_file_url('js/prettyphoto/jquery.prettyPhoto.min.js'), array('jquery'), 'no-compose', true); } else { if ($engine == 'magnific' || empty($engine) && axiom_get_theme_option('popup_engine') == 'magnific') { axiom_enqueue_style('axiom-magnific-style', axiom_get_file_url('js/magnific/magnific-popup.css'), array(), null); axiom_enqueue_script('axiom-magnific-script', axiom_get_file_url('js/magnific/jquery.magnific-popup.min.js'), array('jquery'), '', true); } else { if ($engine == 'internal' || empty($engine) && axiom_get_theme_option('popup_engine') == 'internal') { axiom_enqueue_messages(); } } } }
function axiom_post_admin_scripts() { global $AXIOM_GLOBALS; if (isset($AXIOM_GLOBALS['post_meta_box']) && $AXIOM_GLOBALS['post_meta_box']['page'] == 'post') { axiom_enqueue_script('axiom-core-reviews-script', axiom_get_file_url('js/core.reviews.js'), array('jquery'), null, true); } }
function axiom_options_load_scripts() { // WP Color Picker axiom_enqueue_style('wp-color-picker', false, array(), null); // AxiomThemes fontello styles axiom_enqueue_style('axiom-fontello-admin-style', axiom_get_file_url('css/fontello-admin/css/fontello-admin.css'), array(), null); axiom_enqueue_style('axiom-fontello-style', axiom_get_file_url('css/fontello/css/fontello.css'), array(), null); // AxiomThemes options styles axiom_enqueue_style('axiom-options-style', axiom_get_file_url('core/core.options/css/core.options.css'), array(), null); axiom_enqueue_style('axiom-options-datepicker-style', axiom_get_file_url('core/core.options/css/core.options-datepicker.css'), array(), null); // WP core scripts wp_enqueue_media(); axiom_enqueue_script('wp-color-picker', false, array('jquery'), null, true); // Input masks for text fields axiom_enqueue_script('jquery-input-mask', axiom_get_file_url('core/core.options/js/jquery.maskedinput.1.3.1.min.js'), array('jquery'), null, true); // AxiomThemes core scripts axiom_enqueue_script('axiom-core-utils-script', axiom_get_file_url('js/core.utils.js'), array(), null, true); // AxiomThemes options scripts axiom_enqueue_script('axiom-options-script', axiom_get_file_url('core/core.options/js/core.options.js'), array('jquery', 'jquery-ui-core', 'jquery-ui-tabs', 'jquery-ui-accordion', 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-datepicker'), null, true); axiom_enqueue_script('axiom-options-custom-script', axiom_get_file_url('core/core.options/js/core.options-custom.js'), array('axiom-options-script'), null, true); axiom_enqueue_messages(); axiom_enqueue_popup(); }
function axiom_template_masonry_add_scripts($style) { if (in_array(axiom_substr($style, 0, 8), array('classic_', 'masonry_'))) { axiom_enqueue_script('isotope', axiom_get_file_url('js/jquery.isotope.min.js'), array(), null, true); } }
/** * How to display the widget on the screen. */ function widget($args, $instance) { extract($args); global $wp_query, $post; /* Our variables from the widget settings. */ $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : ''); $title_tabs = array(apply_filters('widget_title', isset($instance['title_author']) ? $instance['title_author'] : ''), apply_filters('widget_title', isset($instance['title_users']) ? $instance['title_users'] : '')); $number = isset($instance['number']) ? (int) $instance['number'] : ''; $show_date = isset($instance['show_date']) ? (int) $instance['show_date'] : 0; $show_image = isset($instance['show_image']) ? (int) $instance['show_image'] : 0; $show_author = isset($instance['show_author']) ? (int) $instance['show_author'] : 0; $show_counters = isset($instance['show_counters']) ? (int) $instance['show_counters'] : 0; $show_counters = $show_counters == 2 ? 'stars' : ($show_counters == 1 ? 'rating' : ''); $post_type = isset($instance['post_type']) ? $instance['post_type'] : 'post'; $category = isset($instance['category']) ? (int) $instance['category'] : 0; $taxonomy = axiom_get_taxonomy_categories_by_post_type($post_type); $tabs = array(); $reviews_first_author = axiom_get_theme_option('reviews_first') == 'author'; $reviews_second_hide = axiom_get_theme_option('reviews_second') == 'hide'; $rnd = str_replace('.', '', mt_rand()); for ($i = 0; $i < 2; $i++) { if ($i == 0 && !$reviews_first_author && $reviews_second_hide) { continue; } if ($i == 1 && $reviews_first_author && $reviews_second_hide) { continue; } $post_rating = 'reviews_avg' . ($i == 0 ? '' : '2'); $args = array('post_type' => $post_type, 'post_status' => current_user_can('read_private_pages') && current_user_can('read_private_posts') ? array('publish', 'private') : 'publish', 'post_password' => '', 'posts_per_page' => $number, 'ignore_sticky_posts' => 1, 'order' => 'DESC', 'orderby' => 'meta_value_num', 'meta_key' => $post_rating); if ($category > 0) { if ($taxonomy == 'category') { $args['cat'] = $category; } else { $args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => $category)); } } $ex = axiom_get_theme_option('exclude_cats'); if (!empty($ex)) { $args['category__not_in'] = explode(',', $ex); } query_posts($args); /* Loop posts */ if (have_posts()) { $post_number = 0; $output = ''; while (have_posts()) { the_post(); $post_number++; require axiom_get_file_dir('templates/parts/widgets-posts.php'); if ($post_number >= $number) { break; } } $tabs[] = array('title' => $title_tabs[$i], 'content' => $output); } } /* Restore main wp_query and current post data in the global var $post */ wp_reset_query(); wp_reset_postdata(); if (count($tabs) > 0) { if (count($tabs) > 1) { axiom_enqueue_script('jquery-ui-tabs', false, array('jquery', 'jquery-ui-core'), null, true); } /* Before widget (defined by themes). */ echo $before_widget; /* Display the widget title if one was input (before and after defined by themes). */ if ($title) { echo $before_title . $title . $after_title; } echo count($tabs) == 1 ? $tabs[0]['content'] : do_shortcode('[trx_tabs style="2"][trx_tab title="' . esc_attr($tabs[0]['title']) . '"]' . $tabs[0]['content'] . '[/trx_tab][trx_tab title="' . esc_attr($tabs[1]['title']) . '"]' . $tabs[1]['content'] . '[/trx_tab][/trx_tabs]'); /* After widget (defined by themes). */ echo $after_widget; } }
$field["accept"] = false; $marks = axiom_reviews_marks_to_display(axiom_reviews_marks_prepare(axiom_get_custom_option('reviews_marks'), count($field['options']))); $output .= '<div id="author_marks" class="sc_tabs_content">' . trim(axiom_reviews_get_markup($field, $marks, false, false, $reviews_first_author)) . '</div>'; } // Users marks if (!$reviews_first_author || !$reviews_second_hide) { $marks = axiom_reviews_marks_to_display(axiom_reviews_marks_prepare(get_post_meta($post_data['post_id'], 'reviews_marks2', true), count($field['options']))); $users = max(0, get_post_meta($post_data['post_id'], 'reviews_users', true)); $field["id"] = "reviews_marks_users"; $field["descr"] = sprintf(__("Summary rating from <b>%s</b> user's marks.", 'axiom'), $users) . ' ' . (!isset($_COOKIE['axiom_votes']) || axiom_strpos($_COOKIE['axiom_votes'], ',' . $post_data['post_id'] . ',') === false ? __('You can set own marks for this article - just click on stars above and press "Accept".', 'axiom') : __('Thanks for your vote!', 'axiom')); $field["accept"] = $allow_user_marks; $output .= '<div id="users_marks" class="sc_tabs_content"' . (!$output ? ' style="display: block;"' : '') . '>' . trim(axiom_reviews_get_markup($field, $marks, $allow_user_marks, false, !$reviews_first_author)) . '</div>'; } $reviews_markup .= $output . '</div>'; if ($allow_user_marks) { axiom_enqueue_script('jquery-ui-draggable', false, array('jquery', 'jquery-ui-core'), null, true); $reviews_markup .= ' <script type="text/javascript"> jQuery(document).ready(function() { AXIOM_GLOBALS["reviews_allow_user_marks"] = ' . ($allow_user_marks ? 'true' : 'false') . '; AXIOM_GLOBALS["reviews_max_level"] = ' . $max_level . '; AXIOM_GLOBALS["reviews_levels"] = "' . trim(axiom_get_theme_option('reviews_criterias_levels')) . '"; AXIOM_GLOBALS["reviews_vote"] = "' . (isset($_COOKIE['axiom_votes']) ? $_COOKIE['axiom_votes'] : '') . '"; AXIOM_GLOBALS["reviews_marks"] = "' . $marks . '".split(","); AXIOM_GLOBALS["reviews_users"] = ' . max(0, $users) . '; AXIOM_GLOBALS["post_id"] = ' . $post_data['post_id'] . '; }); </script> '; } global $AXIOM_GLOBALS;
if (axiom_get_custom_option('show_slider') == 'yes') { $slider = axiom_get_custom_option('slider_engine'); $slider_alias = $slider_ids = $slider_html = ''; if ($slider == 'revo' && axiom_exists_revslider()) { $slider_alias = axiom_get_custom_option('slider_alias'); if (!empty($slider_alias)) { $slider_html = do_shortcode('[rev_slider ' . esc_attr($slider_alias) . ']'); } } else { if ($slider == 'royal' && axiom_exists_royalslider()) { $slider_alias = get_new_royalslider($slider_alias); if (!empty($slider_alias)) { $slider_html = do_shortcode('[rev_slider ' . esc_attr($slider_alias) . ']'); } axiom_enqueue_style('new-royalslider-core-css', NEW_ROYALSLIDER_PLUGIN_URL . 'lib/royalslider/royalslider.css', array(), null); axiom_enqueue_script('new-royalslider-main-js', NEW_ROYALSLIDER_PLUGIN_URL . 'lib/royalslider/jquery.royalslider.min.js', array('jquery'), NEW_ROYALSLIDER_WP_VERSION, true); } else { if ($slider == 'swiper') { $slider_pagination = axiom_get_custom_option("slider_pagination"); $slider_alias = axiom_get_custom_option("slider_category"); $slider_orderby = axiom_get_custom_option("slider_orderby"); $slider_order = axiom_get_custom_option("slider_order"); $slider_count = $slider_ids = axiom_get_custom_option("slider_posts"); if (axiom_strpos($slider_ids, ',') !== false) { $slider_alias = ''; $slider_count = 0; } else { $slider_ids = ''; if (empty($slider_count)) { $slider_count = 3; }
function axiom_template_accordion_add_scripts($style) { if (axiom_substr($style, 0, 10) == 'accordion_') { axiom_enqueue_script('jquery-ui-accordion', false, array('jquery', 'jquery-ui-core'), null, true); } }
<?php //====================================== Editor area ======================================== if ($post_data['post_edit_enable']) { wp_register_script('wp-color-picker', get_site_url() . '/wp-admin/js/color-picker.min.js', array('jquery'), '1.0', true); axiom_enqueue_style('fontello-admin', axiom_get_file_url('css/fontello-admin/css/fontello-admin.css'), array(), null); axiom_enqueue_style('frontend-editor-style', axiom_get_file_url('js/core.editor/core.editor.css'), array(), null); axiom_enqueue_script('frontend-editor', axiom_get_file_url('js/core.editor/core.editor.js'), array(), null, true); axiom_enqueue_messages(); axiom_options_load_scripts(); axiom_options_prepare_scripts($post_data['post_type']); axiom_sc_load_scripts(); axiom_sc_prepare_scripts(); ?> <div id="frontend_editor"> <div id="frontend_editor_inner"> <form method="post"> <label id="frontend_editor_post_title_label" for="frontend_editor_post_title"><?php _e('Title', 'axiom'); ?> </label> <input type="text" name="frontend_editor_post_title" id="frontend_editor_post_title" value="<?php echo esc_attr($post_data['post_title']); ?> " /> <?php wp_editor($post_data['post_content_original'], 'frontend_editor_post_content', array('wpautop' => true, 'textarea_rows' => 16)); ?> <label id="frontend_editor_post_excerpt_label" for="frontend_editor_post_excerpt"><?php _e('Excerpt', 'axiom'); ?>
function axiom_sc_zoom($atts, $content = null) { if (axiom_sc_in_shortcode_blogger()) { return ''; } extract(axiom_sc_html_decode(shortcode_atts(array("effect" => "zoom", "src" => "", "url" => "", "over" => "", "align" => "", "bg_image" => "", "bg_top" => '', "bg_bottom" => '', "bg_left" => '', "bg_right" => '', "id" => "", "class" => "", "animation" => "", "css" => "", "width" => "", "height" => "", "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts))); axiom_enqueue_script('axiom-elevate-zoom-script', axiom_get_file_url('js/jquery.elevateZoom-3.0.4.js'), array(), null, true); $css .= axiom_get_css_position_from_values('!' . $top, '!' . $right, '!' . $bottom, '!' . $left); $css_dim = axiom_get_css_position_from_values('', '', '', '', $width, $height); $css_bg = axiom_get_css_paddings_from_values($bg_top, $bg_right, $bg_bottom, $bg_left); $width = axiom_prepare_css_value($width); $height = axiom_prepare_css_value($height); if (empty($id)) { $id = 'sc_zoom_' . str_replace('.', '', mt_rand()); } $src = $src != '' ? $src : $url; if ($src > 0) { $attach = wp_get_attachment_image_src($src, 'full'); if (isset($attach[0]) && $attach[0] != '') { $src = $attach[0]; } } if ($over > 0) { $attach = wp_get_attachment_image_src($over, 'full'); if (isset($attach[0]) && $attach[0] != '') { $over = $attach[0]; } } if ($effect == 'lens' && ((int) $width > 0 && axiom_substr($width, -2, 2) == 'px') || (int) $height > 0 && axiom_substr($height, -2, 2) == 'px') { if ($src) { $src = axiom_get_resized_image_url($src, (int) $width > 0 && axiom_substr($width, -2, 2) == 'px' ? (int) $width : null, (int) $height > 0 && axiom_substr($height, -2, 2) == 'px' ? (int) $height : null); } if ($over) { $over = axiom_get_resized_image_url($over, (int) $width > 0 && axiom_substr($width, -2, 2) == 'px' ? (int) $width : null, (int) $height > 0 && axiom_substr($height, -2, 2) == 'px' ? (int) $height : null); } } if ($bg_image > 0) { $attach = wp_get_attachment_image_src($bg_image, 'full'); if (isset($attach[0]) && $attach[0] != '') { $bg_image = $attach[0]; } } if ($bg_image) { $css_bg .= $css . 'background-image: url(' . esc_url($bg_image) . ');'; $css = $css_dim; } else { $css .= $css_dim; } $output = empty($src) ? '' : (!empty($bg_image) ? '<div class="sc_zoom_wrap' . (!empty($class) ? ' ' . esc_attr($class) : '') . ($align && $align != 'none' ? ' align' . esc_attr($align) : '') . '"' . (!axiom_sc_param_is_off($animation) ? ' data-animation="' . esc_attr(axiom_sc_get_animation_classes($animation)) . '"' : '') . ($css_bg != '' ? ' style="' . esc_attr($css_bg) . '"' : '') . '>' : '') . '<div' . ($id ? ' id="' . esc_attr($id) . '"' : '') . ' class="sc_zoom' . (empty($bg_image) && !empty($class) ? ' ' . esc_attr($class) : '') . (empty($bg_image) && $align && $align != 'none' ? ' align' . esc_attr($align) : '') . '"' . (empty($bg_image) && !axiom_sc_param_is_off($animation) ? ' data-animation="' . esc_attr(axiom_sc_get_animation_classes($animation)) . '"' : '') . ($css != '' ? ' style="' . esc_attr($css) . '"' : '') . '>' . '<img src="' . esc_url($src) . '"' . ($css_dim != '' ? ' style="' . esc_attr($css_dim) . '"' : '') . ' data-zoom-image="' . esc_url($over) . '" alt="" />' . '</div>' . (!empty($bg_image) ? '</div>' : ''); return apply_filters('axiom_shortcode_output', $output, 'trx_zoom', $atts, $content); }
function axiom_action_add_scripts_education() { if (file_exists(axiom_get_file_dir('skins/default/skin.js'))) { axiom_enqueue_script('theme-skin-script', axiom_get_file_url('skins/default/skin.js'), array(), null); } if (axiom_get_theme_option('show_theme_customizer') == 'yes' && file_exists(axiom_get_file_dir('skins/default/skin.customizer.js'))) { axiom_enqueue_script('theme-skin-customizer-script', axiom_get_file_url('skins/default/skin.customizer.js'), array(), null); } }
function axiom_template_event_add_scripts($style) { axiom_enqueue_script('isotope', axiom_get_file_url('js/jquery.isotope.min.js'), array(), null, true); }
function axiom_sc_load_scripts() { axiom_enqueue_script('axiom-shortcodes-script', axiom_get_file_url('shortcodes/shortcodes_admin.js'), array('jquery'), null, true); axiom_enqueue_script('axiom-selection-script', axiom_get_file_url('js/jquery.selection.js'), array('jquery'), null, true); }
function load_scripts() { if (axiom_get_theme_option('debug_mode') == 'yes' || axiom_get_theme_option('packed_scripts') == 'no' || !file_exists(axiom_get_file_dir('js/__packed.js'))) { axiom_enqueue_script('axiom-core-utils-script', axiom_get_file_url('js/core.utils.js'), array('jquery'), null, true); } axiom_enqueue_script('widget-qrcode-script', axiom_get_file_url('widgets/qrcode/jquery.qrcode-0.6.0.min.js'), array('jquery'), null, true); }
function axiom_options_custom_load_scripts() { axiom_enqueue_script('axiom-options-custom-script', axiom_get_file_url('core/core.options/js/core.options-custom.js'), array(), null, true); }