Example #1
1
 /**
  * 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'] : '');
     $post_type = isset($instance['post_type']) ? $instance['post_type'] : 'post';
     $taxonomy = axiom_get_taxonomy_categories_by_post_type($post_type);
     $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']) && $instance['show_counters'] > 0 ? axiom_get_theme_option('blog_counters') : '';
     $category = isset($instance['category']) ? (int) $instance['category'] : 0;
     $output = '';
     $args = array('numberposts' => $number, 'offset' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => $post_type, 'post_status' => current_user_can('read_private_pages') && current_user_can('read_private_posts') ? array('publish', 'private') : 'publish', 'ignore_sticky_posts' => 1, 'suppress_filters' => true);
     if ($category > 0) {
         if ($taxonomy == 'category') {
             $args['category'] = $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);
     }
     $recent_posts = wp_get_recent_posts($args, OBJECT);
     $post_number = 0;
     foreach ($recent_posts as $post) {
         $post_number++;
         require axiom_get_file_dir('templates/parts/widgets-posts.php');
         if ($post_number >= $number) {
             break;
         }
     }
     if (!empty($output)) {
         /* Before widget (defined by themes). */
         echo $before_widget;
         /* Display the widget title if one was input (before and after defined by themes). */
         echo $before_title . $title . $after_title;
         echo $output;
         /* After widget (defined by themes). */
         echo $after_widget;
     }
 }
Example #2
0
 function axiom_tribe_events_theme_setup()
 {
     if (axiom_exists_tribe_events()) {
         //if (axiom_is_tribe_events_page()) {
         // Detect current page type, taxonomy and title (for custom post_types use priority < 10 to fire it handles early, than for standard post types)
         add_filter('axiom_filter_get_blog_type', 'axiom_tribe_events_get_blog_type', 9, 2);
         add_filter('axiom_filter_get_blog_title', 'axiom_tribe_events_get_blog_title', 9, 2);
         add_filter('axiom_filter_get_current_taxonomy', 'axiom_tribe_events_get_current_taxonomy', 9, 2);
         add_filter('axiom_filter_is_taxonomy', 'axiom_tribe_events_is_taxonomy', 9, 2);
         add_filter('axiom_filter_get_stream_page_title', 'axiom_tribe_events_get_stream_page_title', 9, 2);
         add_filter('axiom_filter_get_stream_page_link', 'axiom_tribe_events_get_stream_page_link', 9, 2);
         add_filter('axiom_filter_get_stream_page_id', 'axiom_tribe_events_get_stream_page_id', 9, 2);
         add_filter('axiom_filter_get_period_links', 'axiom_tribe_events_get_period_links', 9, 3);
         add_filter('axiom_filter_detect_inheritance_key', 'axiom_tribe_events_detect_inheritance_key', 9, 1);
         //}
         add_action('axiom_action_add_styles', 'axiom_tribe_events_frontend_scripts');
         add_filter('axiom_filter_list_post_types', 'axiom_tribe_events_list_post_types', 10, 1);
         // Advanced Calendar filters
         add_filter('axiom_filter_calendar_get_month_link', 'axiom_tribe_events_calendar_get_month_link', 9, 2);
         add_filter('axiom_filter_calendar_get_prev_month', 'axiom_tribe_events_calendar_get_prev_month', 9, 2);
         add_filter('axiom_filter_calendar_get_next_month', 'axiom_tribe_events_calendar_get_next_month', 9, 2);
         add_filter('axiom_filter_calendar_get_curr_month_posts', 'axiom_tribe_events_calendar_get_curr_month_posts', 9, 2);
         // Extra column for events lists
         if (axiom_get_theme_option('show_overriden_posts') == 'yes') {
             add_filter('manage_edit-' . TribeEvents::POSTTYPE . '_columns', 'axiom_post_add_options_column', 9);
             add_filter('manage_' . TribeEvents::POSTTYPE . '_posts_custom_column', 'axiom_post_fill_options_column', 9, 2);
         }
     }
 }
Example #3
0
 function axiom_taxonomy_theme_setup()
 {
     $inheritance = axiom_get_theme_inheritance();
     if (!empty($inheritance)) {
         $show_overriden = axiom_get_theme_option('show_overriden_taxonomies') == 'yes';
         foreach ($inheritance as $k => $v) {
             // Set taxonomy actions
             if (!empty($v['taxonomy'])) {
                 foreach ($v['taxonomy'] as $tax) {
                     // Add the fields to the taxonomy, using our callback function
                     add_action($tax . '_edit_form_fields', 'axiom_taxonomy_show_custom_fields', 10, 1);
                     add_action($tax . '_add_form_fields', 'axiom_taxonomy_show_custom_fields', 10, 1);
                     // Save the changes made on the taxonomy, using our callback function
                     add_action('edited_' . $tax, 'axiom_taxonomy_save_custom_fields', 10, 1);
                     add_action('created_' . $tax, 'axiom_taxonomy_save_custom_fields', 10, 1);
                     // Extra column for taxonomies lists
                     if ($show_overriden) {
                         add_filter('manage_edit-' . $tax . '_columns', 'axiom_taxonomy_add_options_column', 9);
                         add_filter('manage_' . $tax . '_custom_column', 'axiom_taxonomy_fill_options_column', 9, 3);
                     }
                 }
             }
         }
     }
 }
Example #4
0
 function axiom_updater_after_theme_setup()
 {
     if (axiom_get_theme_option('admin_update_notifier') == 'no') {
         return;
     }
     // Notifier settings
     global $AXIOM_GLOBALS;
     $AXIOM_GLOBALS['update_notifier_options'] = apply_filters('axiom_filter_update_notifier', array('theme_name' => '-not-set-', 'theme_folder' => '-not-set-', 'xml_url' => 'http://axiomthemes.com/!updates/', 'cache_interval' => 21600));
 }
Example #5
0
 function axiom_sc_add_scripts($output, $tag = '', $atts = array(), $content = '')
 {
     global $AXIOM_GLOBALS;
     if (empty($AXIOM_GLOBALS['shortcodes_scripts_added'])) {
         $AXIOM_GLOBALS['shortcodes_scripts_added'] = true;
         if (axiom_get_theme_option('debug_mode') == 'yes' || axiom_get_theme_option('packed_scripts') == 'no' || !file_exists(axiom_get_file_dir('css/__packed.js'))) {
             axiom_enqueue_script('axiom-shortcodes-script', axiom_get_file_url('shortcodes/shortcodes.js'), array('jquery'), null, true);
         }
     }
     return $output;
 }
Example #6
0
 function axiom_core_customizer_add_custom_styles($custom_style)
 {
     // Custom fonts
     if (axiom_get_custom_option('typography_custom') == 'yes') {
         $fonts = axiom_get_list_fonts(false);
         $fname = axiom_get_custom_option('typography_p_font');
         if (isset($fonts[$fname])) {
             $fstyle = explode(',', axiom_get_custom_option('typography_p_style'));
             $fname2 = ($pos = axiom_strpos($fname, ' (')) !== false ? axiom_substr($fname, 0, $pos) : $fname;
             $i = in_array('i', $fstyle);
             $u = in_array('u', $fstyle);
             $c = axiom_get_custom_option('typography_p_color');
             $custom_style .= "\n\t\t\t\t\tbody, button, input, select, textarea {\n\t\t\t\t\t\tfont-family: '" . esc_attr($fname2) . "'" . (isset($fonts[$fname]['family']) ? ", " . esc_attr($fonts[$fname]['family']) : '') . ";\n\t\t\t\t\t}\n\t\t\t\t\tbody {\n\t\t\t\t\t\tfont-size: " . esc_attr(axiom_get_custom_option('typography_p_size')) . "px;\n\t\t\t\t\t\tfont-weight: " . esc_attr(axiom_get_custom_option('typography_p_weight')) . ";\n\t\t\t\t\t\tline-height: " . esc_attr(axiom_get_custom_option('typography_p_lineheight')) . "px;\n\t\t\t\t\t\t" . ($c ? "color: " . esc_attr($c) . ";" : '') . "\n\t\t\t\t\t\t" . ($i ? "font-style: italic;" : '') . "\n\t\t\t\t\t\t" . ($u ? "text-decoration: underline;" : '') . "\n\t\t\t\t\t}\n\t\t\t\t";
         }
         for ($h = 1; $h <= 6; $h++) {
             $fname = axiom_get_custom_option('typography_h' . $h . '_font');
             if (isset($fonts[$fname])) {
                 $fstyle = explode(',', axiom_get_custom_option('typography_h' . $h . '_style'));
                 $fname2 = ($pos = axiom_strpos($fname, ' (')) !== false ? axiom_substr($fname, 0, $pos) : $fname;
                 $i = in_array('i', $fstyle);
                 $u = in_array('u', $fstyle);
                 $c = axiom_get_custom_option('typography_h' . $h . '_color');
                 $custom_style .= "\n\t\t\t\t\t\th" . intval($h) . ", .h" . intval($h) . " {\n\t\t\t\t\t\t\tfont-family: '" . esc_attr($fname2) . "'" . (isset($fonts[$fname]['family']) ? ", " . esc_attr($fonts[$fname]['family']) : '') . ";\n\t\t\t\t\t\t\tfont-size: " . esc_attr(axiom_get_custom_option('typography_h' . intval($h) . '_size')) . "px;\n\t\t\t\t\t\t\tfont-weight: " . esc_attr(axiom_get_custom_option('typography_h' . intval($h) . '_weight')) . ";\n\t\t\t\t\t\t\tline-height: " . esc_attr(axiom_get_custom_option('typography_h' . intval($h) . '_lineheight')) . "px;\n\t\t\t\t\t\t\t" . ($c ? "color: " . esc_attr($c) . ";" : '') . "\n\t\t\t\t\t\t\t" . ($i ? "font-style: italic;" : '') . "\n\t\t\t\t\t\t\t" . ($u ? "text-decoration: underline;" : '') . "\n\t\t\t\t\t\t}\n\t\t\t\t\t\th" . $h . " a, .h" . $h . " a {\n\t\t\t\t\t\t\t" . ($c ? "color: " . esc_attr($c) . ";" : '') . "\n\t\t\t\t\t\t}\n\t\t\t\t\t";
             }
         }
     }
     // Submenu width
     $menu_width = axiom_get_theme_option('menu_width');
     if (!empty($menu_width)) {
         $custom_style .= "\n\t\t\t\t/* Submenu width */\n\t\t\t\t.menu_main_wrap .menu_main_nav > li ul {\n\t\t\t\t\twidth: " . intval($menu_width) . "px;\n\t\t\t\t}\n\t\t\t\t.menu_main_wrap .menu_main_nav > li > ul ul {\n\t\t\t\t\tleft:" . intval($menu_width + 4) . "px;\n\t\t\t\t}\n\t\t\t\t.menu_main_wrap .menu_main_nav > li > ul ul.submenu_left {\n\t\t\t\t\tleft:-" . intval($menu_width + 1) . "px;\n\t\t\t\t}\n\t\t\t";
     }
     // Logo height
     $logo_height = axiom_get_custom_option('logo_height');
     if (!empty($logo_height)) {
         $custom_style .= "\n\t\t\t\t/* Logo header height */\n\t\t\t\t.menu_main_wrap .logo_main {\n\t\t\t\t\theight:" . intval($logo_height) . "px;\n\t\t\t\t}\n\t\t\t";
     }
     // Logo top offset
     $logo_offset = axiom_get_custom_option('logo_offset');
     if (!empty($logo_offset)) {
         $custom_style .= "\n\t\t\t\t/* Logo header top offset */\n\t\t\t\t.menu_main_wrap .logo {\n\t\t\t\t\tmargin-top:" . intval($logo_offset) . "px;\n\t\t\t\t}\n\t\t\t";
     }
     // Logo footer height
     $logo_height = axiom_get_theme_option('logo_footer_height');
     if (!empty($logo_height)) {
         $custom_style .= "\n\t\t\t\t/* Logo footer height */\n\t\t\t\t.contacts_wrap .logo img {\n\t\t\t\t\theight:" . intval($logo_height) . "px;\n\t\t\t\t}\n\t\t\t";
     }
     // Custom css from theme options
     $custom_style .= axiom_get_custom_option('custom_css');
     return $custom_style;
 }
Example #7
0
 function axiom_get_date_or_difference($dt1, $dt2 = null, $max_days = -1)
 {
     static $gmt_offset = 999;
     if ($gmt_offset == 999) {
         $gmt_offset = (int) get_option('gmt_offset');
     }
     if ($max_days < 0) {
         $max_days = axiom_get_theme_option('show_date_after', 30);
     }
     if ($dt2 == null) {
         $dt2 = date('Y-m-d H:i:s');
     }
     $dt2n = strtotime($dt2) + $gmt_offset * 3600;
     $dt1n = strtotime($dt1);
     $diff = $dt2n - $dt1n;
     $days = floor($diff / (24 * 3600));
     if (abs($days) < $max_days) {
         return sprintf($days >= 0 ? __('%s ago', 'axiom') : __('after %s', 'axiom'), axiom_get_date_difference($days >= 0 ? $dt1 : $dt2, $days >= 0 ? $dt2 : $dt1));
     } else {
         return axiom_get_date_translations(date(get_option('date_format'), $dt1n));
     }
 }
Example #8
0
<?php

//===================================== Post author info =====================================
if (axiom_get_custom_option("show_post_author") == 'yes') {
    $post_author_name = $post_author_socials = '';
    $show_post_author_socials = true;
    if ($post_data['post_type'] == 'post') {
        $post_author_title = __('About', 'axiom');
        $post_author_name = $post_data['post_author'];
        $post_author_url = $post_data['post_author_url'];
        $post_author_email = get_the_author_meta('user_email', $post_data['post_author_id']);
        $post_author_avatar = get_avatar($post_author_email, 75 * min(2, max(1, axiom_get_theme_option("retina_ready"))));
        $post_author_descr = do_shortcode(nl2br(get_the_author_meta('description', $post_data['post_author_id'])));
        if ($show_post_author_socials) {
            $post_author_socials = axiom_show_user_socials(array('author_id' => $post_data['post_author_id'], 'style' => 'bg', 'size' => 'small', 'style' => 'icons', 'echo' => false));
        }
    }
    if (!empty($post_author_name)) {
        ?>
		<section class="post_author author vcard" itemprop="author" itemscope itemtype="http://schema.org/Person">
			<div class="post_author_avatar"><a href="<?php 
        echo esc_url($post_data['post_author_url']);
        ?>
" itemprop="image"><?php 
        echo $post_author_avatar;
        ?>
</a></div>
			<h6 class="post_author_title"><?php 
        echo esc_html($post_author_title);
        ?>
 <span itemprop="name"><a href="<?php 
Example #9
0
    if (axiom_get_custom_option('show_left_panel') == 'yes') {
        ?>
								<div class="sidemenu_button"><i class="icon-menu-1"></i></div>
							<?php 
    }
    ?>

							<div class="menu_user_area menu_user_right menu_user_nav_area">
								<?php 
    require_once axiom_get_file_dir('templates/parts/user-panel.php');
    ?>
							</div>

							<?php 
    if (axiom_get_theme_option('show_emergency_phone') == 'yes' && axiom_get_theme_option('emergency_phone') != '') {
        echo '<div class="emergency_phone">' . __('Emergency call:', 'axiom') . ' ' . axiom_get_theme_option('emergency_phone') . '</div>';
    }
    ?>

							<?php 
    if (axiom_get_custom_option('show_contact_info') == 'yes') {
        ?>
							<div class="menu_user_area menu_user_left menu_user_contact_area"><?php 
        echo axiom_get_custom_option('work_hours') ? '<span class="work_hours"> ' . axiom_get_custom_option('work_hours') . '</span>' : '';
        ?>
</div>
							<?php 
    }
    ?>
						</div>
					</div>
Example #10
0
    function axiom_post_before_show_meta_box($post_type, $post_id)
    {
        $max_level = max(5, (int) axiom_get_theme_option('reviews_max_level'));
        ?>
		<script type="text/javascript">
			jQuery(document).ready(function() {
				// Prepare global values for the review procedure
				AXIOM_GLOBALS['reviews_levels']			= "<?php 
        echo trim(axiom_get_theme_option('reviews_criterias_levels'));
        ?>
";
				AXIOM_GLOBALS['reviews_max_level'] 		= <?php 
        echo (int) $max_level;
        ?>
;
				AXIOM_GLOBALS['reviews_allow_user_marks']= true;
			});
		</script>
		<div class="reviews_area reviews_<?php 
        echo esc_attr($max_level);
        ?>
">
		<?php 
    }
Example #11
0
    /**
     * Displays the widget settings controls on the widget panel.
     * Make use of the get_field_id() and get_field_name() function
     * when creating your form elements. This handles the confusing stuff.
     */
    function form($instance)
    {
        /* Set up some default widget settings. */
        $defaults = array('title' => '', 'description' => __('Last Twitter Updates', 'axiom'));
        $instance = wp_parse_args((array) $instance, $defaults);
        $title = isset($instance['title']) ? $instance['title'] : '';
        $twitter_username = isset($instance['twitter_username']) ? $instance['twitter_username'] : axiom_get_theme_option('twitter_username');
        $twitter_consumer_key = isset($instance['twitter_consumer_key']) ? $instance['twitter_consumer_key'] : axiom_get_theme_option('twitter_consumer_key');
        $twitter_consumer_secret = isset($instance['twitter_consumer_secret']) ? $instance['twitter_consumer_secret'] : axiom_get_theme_option('twitter_consumer_secret');
        $twitter_token_key = isset($instance['twitter_token_key']) ? $instance['twitter_token_key'] : axiom_get_theme_option('twitter_token_key');
        $twitter_token_secret = isset($instance['twitter_token_secret']) ? $instance['twitter_token_secret'] : axiom_get_theme_option('twitter_token_secret');
        $twitter_count = max(1, intval(isset($instance['twitter_count']) ? $instance['twitter_count'] : axiom_get_theme_option('twitter_count')));
        ?>

		<p>
			<label for="<?php 
        echo esc_attr($this->get_field_id('title'));
        ?>
"><?php 
        _e('Title:', 'axiom');
        ?>
</label>
			<input id="<?php 
        echo esc_attr($this->get_field_id('title'));
        ?>
" name="<?php 
        echo esc_attr($this->get_field_name('title'));
        ?>
" value="<?php 
        echo esc_attr($title);
        ?>
" style="width:100%;" />
		</p>

		<p>
			<label for="<?php 
        echo esc_attr($this->get_field_id('twitter_count'));
        ?>
"><?php 
        _e('Tweets count:', 'axiom');
        ?>
</label>
			<input id="<?php 
        echo esc_attr($this->get_field_id('twitter_count'));
        ?>
" name="<?php 
        echo esc_attr($this->get_field_name('twitter_count'));
        ?>
" value="<?php 
        echo esc_attr($twitter_count);
        ?>
" style="width:100%;" />
		</p>

		<p>
			<label for="<?php 
        echo esc_attr($this->get_field_id('twitter_username'));
        ?>
"><?php 
        _e('Twitter Username:'******'axiom');
        ?>
<br />(<?php 
        _e('leave empty if you paste widget code', 'axiom');
        ?>
)</label>
			<input id="<?php 
        echo esc_attr($this->get_field_id('twitter_username'));
        ?>
" name="<?php 
        echo esc_attr($this->get_field_name('twitter_username'));
        ?>
" value="<?php 
        echo esc_attr($twitter_username);
        ?>
" style="width:100%;" />
		</p>

		<p>
			<label for="<?php 
        echo esc_attr($this->get_field_id('twitter_consumer_key'));
        ?>
"><?php 
        _e('Twitter Consumer Key:', 'axiom');
        ?>
</label>
			<input id="<?php 
        echo esc_attr($this->get_field_id('twitter_consumer_key'));
        ?>
" name="<?php 
        echo esc_attr($this->get_field_name('twitter_consumer_key'));
        ?>
" value="<?php 
        echo esc_attr($twitter_consumer_key);
        ?>
" style="width:100%;" />
		</p>
		<p>
			<label for="<?php 
        echo esc_attr($this->get_field_id('twitter_consumer_secret'));
        ?>
"><?php 
        _e('Twitter Consumer Secret:', 'axiom');
        ?>
</label>
			<input id="<?php 
        echo esc_attr($this->get_field_id('twitter_consumer_secret'));
        ?>
" name="<?php 
        echo esc_attr($this->get_field_name('twitter_consumer_secret'));
        ?>
" value="<?php 
        echo esc_attr($twitter_consumer_secret);
        ?>
" style="width:100%;" />
		</p>
		<p>
			<label for="<?php 
        echo esc_attr($this->get_field_id('twitter_token_key'));
        ?>
"><?php 
        _e('Twitter Token Key:', 'axiom');
        ?>
</label>
			<input id="<?php 
        echo esc_attr($this->get_field_id('twitter_token_key'));
        ?>
" name="<?php 
        echo esc_attr($this->get_field_name('twitter_token_key'));
        ?>
" value="<?php 
        echo esc_attr($twitter_token_key);
        ?>
" style="width:100%;" />
		</p>
		<p>
			<label for="<?php 
        echo esc_attr($this->get_field_id('twitter_token_secret'));
        ?>
"><?php 
        _e('Twitter Token Secret:', 'axiom');
        ?>
</label>
			<input id="<?php 
        echo esc_attr($this->get_field_id('twitter_token_secret'));
        ?>
" name="<?php 
        echo esc_attr($this->get_field_name('twitter_token_secret'));
        ?>
" value="<?php 
        echo esc_attr($twitter_token_secret);
        ?>
" style="width:100%;" />
		</p>

	<?php 
    }
Example #12
0
        $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;
    $AXIOM_GLOBALS['reviews_markup'] = $reviews_markup;
}
Example #13
0
 /**
  * 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;
     }
 }
Example #14
0
function axiom_sc_video($atts, $content = null)
{
    if (axiom_sc_in_shortcode_blogger()) {
        return '';
    }
    extract(axiom_sc_html_decode(shortcode_atts(array("url" => '', "src" => '', "image" => '', "ratio" => '16:9', "autoplay" => 'off', "align" => '', "bg_image" => '', "bg_top" => '', "bg_bottom" => '', "bg_left" => '', "bg_right" => '', "frame" => "on", "id" => "", "class" => "", "animation" => "", "css" => "", "width" => '', "height" => '', "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts)));
    $ratio = empty($ratio) ? "16:9" : str_replace(array('/', '\\', '-'), ':', $ratio);
    $ratio_parts = explode(':', $ratio);
    if (empty($height) && empty($width)) {
        $width = '100%';
    }
    $ed = axiom_substr($width, -1);
    if (empty($height) && !empty($width) && $ed != '%') {
        $height = round($width / $ratio_parts[0] * $ratio_parts[1]);
    }
    if (!empty($height) && empty($width)) {
        $width = round($height * $ratio_parts[0] / $ratio_parts[1]);
    }
    $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);
    if ($src == '' && $url == '' && isset($atts[0])) {
        $src = $atts[0];
    }
    $url = $src != '' ? $src : $url;
    if ($image != '' && axiom_sc_param_is_off($image)) {
        $image = '';
    } else {
        if (axiom_sc_param_is_on($autoplay) && is_single()) {
            $image = '';
        } else {
            if ($image > 0) {
                $attach = wp_get_attachment_image_src($image, 'full');
                if (isset($attach[0]) && $attach[0] != '') {
                    $image = $attach[0];
                }
            }
            if ($bg_image) {
                $thumb_sizes = axiom_get_thumb_sizes(array('layout' => 'grid_3'));
                $image = axiom_get_resized_image_url(empty($image) ? get_the_ID() : $image, $thumb_sizes['w'], $thumb_sizes['h'], null, false, false, false);
            } else {
                $image = axiom_get_resized_image_url(empty($image) ? get_the_ID() : $image, $ed != '%' ? $width : null, $height);
            }
            if (empty($image)) {
                $image = axiom_get_video_cover_image($url);
            }
        }
    }
    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;
    }
    $url = axiom_get_video_player_url($src != '' ? $src : $url);
    $video = '<video' . ($id ? ' id="' . esc_attr($id) . '"' : '') . ' class="sc_video' . (!empty($class) ? ' ' . esc_attr($class) : '') . '"' . ' src="' . esc_url($url) . '"' . ' width="' . esc_attr($width) . '" height="' . esc_attr($height) . '"' . ' data-width="' . esc_attr($width) . '" data-height="' . esc_attr($height) . '"' . ' data-ratio="' . esc_attr($ratio) . '"' . ($image ? ' poster="' . esc_attr($image) . '" data-image="' . esc_attr($image) . '"' : '') . (!axiom_sc_param_is_off($animation) ? ' data-animation="' . esc_attr(axiom_sc_get_animation_classes($animation)) . '"' : '') . ($align && $align != 'none' ? ' data-align="' . esc_attr($align) . '"' : '') . ($bg_image ? ' data-bg-image="' . esc_attr($bg_image) . '"' : '') . ($css_bg != '' ? ' data-style="' . esc_attr($css_bg) . '"' : '') . ($css != '' ? ' style="' . esc_attr($css) . '"' : '') . ($image && axiom_get_theme_option('substitute_video') == 'yes' || axiom_sc_param_is_on($autoplay) && is_single() ? ' autoplay="autoplay"' : '') . ' controls="controls" loop="loop"' . '>' . '</video>';
    if (axiom_get_custom_option('substitute_video') == 'no') {
        if (axiom_sc_param_is_on($frame)) {
            $video = axiom_get_video_frame($video, $image, $css, $css_bg);
        }
    } else {
        if (isset($_GET['vc_editable']) && $_GET['vc_editable'] == 'true' && (isset($_POST['action']) && $_POST['action'] == 'vc_load_shortcode')) {
            $video = axiom_substitute_video($video, $width, $height, false);
        }
    }
    if (axiom_get_theme_option('use_mediaelement') == 'yes') {
        axiom_enqueue_script('wp-mediaelement');
    }
    return apply_filters('axiom_shortcode_output', $video, 'trx_video', $atts, $content);
}
Example #15
0
 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);
 }
Example #16
0
 function axiom_po_composer_theme_setup()
 {
     if (is_admin() && current_user_can('manage_options') && axiom_get_theme_option('admin_po_composer') == 'yes') {
         new axiom_po_composer();
     }
 }
Example #17
0
File: skin.php Project: pcuervo/odc
 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);
     }
 }
Example #18
0
    /**
     * 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'] : '');
        $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);
        $output = '';
        $post_rating = 'reviews_avg' . (axiom_get_theme_option('reviews_first') == 'author' ? '' : '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' => 'date', 'meta_query' => array(array('key' => $post_rating, 'value' => 0, 'compare' => '>', 'type' => 'NUMERIC')));
        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;
            while (have_posts()) {
                the_post();
                $post_number++;
                require axiom_get_file_dir('templates/parts/widgets-posts.php');
                if ($post_number >= $number) {
                    break;
                }
            }
        }
        /* Restore main wp_query and current post data in the global var $post */
        wp_reset_query();
        wp_reset_postdata();
        if (!empty($output)) {
            /* 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 '
				<div class="recent_reviews">
					' . $output . '
				</div>
			';
            /* After widget (defined by themes). */
            echo $after_widget;
        }
    }
Example #19
0
}
if ($show_all_counters || axiom_strpos($post_options['counters'], 'comments') !== false) {
    ?>
	<a class="post_counters_item post_counters_comments icon-comment-3" title="<?php 
    echo sprintf(__('Comments - %s', 'axiom'), $post_data['post_comments']);
    ?>
" href="<?php 
    echo esc_url($post_data['post_comments_link']);
    ?>
"><span class="post_counters_number"><?php 
    echo $post_data['post_comments'];
    ?>
</span></a>
	<?php 
}
$rating = $post_data['post_reviews_' . (axiom_get_theme_option('reviews_first') == 'author' ? 'author' : 'users')];
if ($rating > 0 && ($show_all_counters || axiom_strpos($post_options['counters'], 'rating') !== false)) {
    ?>
	<<?php 
    echo $counters_tag;
    ?>
 class="post_counters_item post_counters_rating icon-star-1" title="<?php 
    echo sprintf(__('Rating - %s', 'axiom'), $rating);
    ?>
" href="<?php 
    echo esc_url($post_data['post_link']);
    ?>
"><span class="post_counters_number"><?php 
    echo $rating;
    ?>
</span></<?php 
Example #20
0
<?php 
if (axiom_get_custom_option('show_left_panel') == 'yes') {
    axiom_enqueue_slider();
    require_once axiom_get_file_dir('templates/parts/left-panel.php');
}
?>

<?php 
if (axiom_get_theme_option('show_login') == 'yes' || axiom_get_custom_option('show_left_panel') == 'yes') {
    require_once axiom_get_file_dir('templates/parts/register.php');
}
?>

<?php 
if (axiom_get_theme_option('show_login') == 'yes' || axiom_get_custom_option('show_left_panel') == 'yes') {
    require_once axiom_get_file_dir('templates/parts/login.php');
}
?>

<?php 
if (axiom_get_custom_option('show_scroll_to_top') == 'yes') {
    ?>
<a href="#" class="scroll_to_top icon-angle-up-1" title="<?php 
    _e('Scroll to top', 'axiom');
    ?>
"></a>
<?php 
}
?>
Example #21
0
 function axiom_importer_theme_setup()
 {
     if (is_admin() && current_user_can('import') && axiom_get_theme_option('admin_dummy_data') == 'yes') {
         new axiom_dummy_data_importer();
     }
 }
Example #22
0
 function axiom_woocommerce_pagination()
 {
     axiom_show_pagination(array('class' => 'pagination_wrap pagination_' . esc_attr(axiom_get_theme_option('blog_pagination_style')), 'style' => axiom_get_theme_option('blog_pagination_style'), 'button_class' => '', 'first_text' => '', 'last_text' => '', 'prev_text' => '', 'next_text' => '', 'pages_in_group' => axiom_get_theme_option('blog_pagination_style') == 'pages' ? 10 : 20));
 }
Example #23
0
 function axiom_callback_frontend_editor_delete()
 {
     global $_REQUEST;
     if (!wp_verify_nonce($_REQUEST['nonce'], 'axiom_editor_nonce')) {
         die;
     }
     $response = array('error' => '');
     $post_id = $_REQUEST['post_id'];
     if (axiom_get_theme_option("allow_editor") == 'yes' && (current_user_can('delete_posts', $post_id) || current_user_can('delete_pages', $post_id))) {
         if ($post_id > 0) {
             $rez = wp_delete_post($post_id);
             if ($rez === false) {
                 $response['error'] = __('Post delete error!', 'axiom');
             }
         } else {
             $response['error'] = __('Post delete error!', 'axiom');
         }
     } else {
         $response['error'] = __('Post delete denied!', 'axiom');
     }
     echo json_encode($response);
     die;
 }
Example #24
0
        _e('Register', 'axiom');
        ?>
</a></li>
		<li class="menu_user_login"><a href="#popup_login" class="popup_link popup_login_link"><?php 
        _e('Login', 'axiom');
        ?>
</a></li>
		<?php 
    } else {
        $current_user = wp_get_current_user();
        ?>
		<li class="menu_user_controls">
			<a href="#"><?php 
        $user_avatar = '';
        if ($current_user->user_email) {
            $user_avatar = get_avatar($current_user->user_email, 16 * min(2, max(1, axiom_get_theme_option("retina_ready"))));
        }
        if ($user_avatar) {
            ?>
<span class="user_avatar"><?php 
            echo $user_avatar;
            ?>
</span><?php 
        }
        ?>
<span class="user_name"><?php 
        echo $current_user->display_name;
        ?>
</span></a>
			<ul>
				<?php 
Example #25
0
    function axiom_team_show_meta_box()
    {
        global $post, $AXIOM_GLOBALS;
        // Use nonce for verification
        $data = get_post_meta($post->ID, 'team_data', true);
        $fields = $AXIOM_GLOBALS['team_meta_box']['fields'];
        ?>
		<input type="hidden" name="meta_box_team_nonce" value="<?php 
        echo wp_create_nonce(basename(__FILE__));
        ?>
" />
		<table class="team_area">
		<?php 
        foreach ($fields as $id => $field) {
            $meta = isset($data[$id]) ? $data[$id] : '';
            ?>
			<tr class="team_field <?php 
            echo esc_attr($field['class']);
            ?>
" valign="top">
				<td><label for="<?php 
            echo esc_attr($id);
            ?>
"><?php 
            echo esc_attr($field['title']);
            ?>
</label></td>
				<td>
					<?php 
            if ($id == 'team_member_socials') {
                $style = "icons";
                $upload_info = wp_upload_dir();
                $upload_url = $upload_info['baseurl'];
                $social_list = axiom_get_theme_option('social_icons');
                foreach ($social_list as $soc) {
                    $sn = basename($soc['icon']);
                    if ($style == 'icons') {
                        $sn = axiom_substr($sn, axiom_strrpos($sn, '-') + 1, strlen($sn) - axiom_strrpos($sn, '-'));
                    } else {
                        $sn = axiom_substr($sn, 0, axiom_strrpos($sn, '.'));
                    }
                    if (($pos = axiom_strrpos($sn, '_')) !== false) {
                        $sn = axiom_substr($sn, 0, $pos);
                    }
                    $link = isset($meta[$sn]) ? $meta[$sn] : '';
                    ?>
							<label for="<?php 
                    echo esc_attr($id . '_' . $sn);
                    ?>
"><?php 
                    echo esc_attr(axiom_strtoproper($sn));
                    ?>
</label><br>
							<input type="text" name="<?php 
                    echo esc_attr($id);
                    ?>
[<?php 
                    echo esc_attr($sn);
                    ?>
]" id="<?php 
                    echo esc_attr($id . '_' . $sn);
                    ?>
" value="<?php 
                    echo esc_attr($link);
                    ?>
" size="30" /><br>
							<?php 
                }
            } else {
                ?>
						<input type="text" name="<?php 
                echo esc_attr($id);
                ?>
" id="<?php 
                echo esc_attr($id);
                ?>
" value="<?php 
                echo esc_attr($meta);
                ?>
" size="30" />
						<?php 
            }
            ?>
					<br><small><?php 
            echo esc_attr($field['desc']);
            ?>
</small>
				</td>
			</tr>
			<?php 
        }
        ?>
		</table>
		<?php 
    }
Example #26
0
 function axiom_options_show_field($id, $field, $value = null)
 {
     global $AXIOM_GLOBALS;
     // Set start field value
     if ($value !== null) {
         $field['val'] = $value;
     }
     if (!isset($field['val']) || $field['val'] == '') {
         $field['val'] = 'inherit';
     }
     if (!empty($field['subset'])) {
         $sbs = axiom_get_theme_option($field['subset'], '', $AXIOM_GLOBALS['to_data']);
         $field['val'] = isset($field['val'][$sbs]) ? $field['val'][$sbs] : '';
     }
     if (empty($id)) {
         $id = 'axiom_options_id_' . str_replace('.', '', mt_rand());
     }
     if (!isset($field['title'])) {
         $field['title'] = '';
     }
     // Divider before field
     $divider = !isset($field['divider']) && !in_array($field['type'], array('info', 'partition', 'tab', 'toggle')) || isset($field['divider']) && $field['divider'] ? ' axiom_options_divider' : '';
     // Setup default parameters
     if ($field['type'] == 'media') {
         if (!isset($field['before'])) {
             $field['before'] = array('title' => __('Choose image', 'axiom'), 'action' => 'media_upload', 'type' => 'image', 'multiple' => false, 'linked_field' => '', 'captions' => array('choose' => __('Choose image', 'axiom'), 'update' => __('Select image', 'axiom')));
         }
         if (!isset($field['after'])) {
             $field['after'] = array('icon' => 'iconadmin-cancel', 'action' => 'media_reset');
         }
     }
     // Buttons before and after field
     $before = $after = $buttons_classes = '';
     if (!empty($field['before'])) {
         list($before, $class) = axiom_options_action_button($field['before'], 'before');
         $buttons_classes .= $class;
     }
     if (!empty($field['after'])) {
         list($after, $class) = axiom_options_action_button($field['after'], 'after');
         $buttons_classes .= $class;
     }
     if (in_array($field['type'], array('list', 'select', 'fonts')) || $field['type'] == 'socials' && (empty($field['style']) || $field['style'] == 'icons')) {
         $buttons_classes .= ' axiom_options_button_after_small';
     }
     // Is it inherit field?
     $inherit = axiom_is_inherit_option($field['val']) ? 'inherit' : '';
     // Is it cloneable field?
     $cloneable = isset($field['cloneable']) && $field['cloneable'];
     // Prepare field
     if (!$cloneable) {
         $field['val'] = array($field['val']);
     } else {
         if (!is_array($field['val'])) {
             $field['val'] = array($field['val']);
         } else {
             if ($field['type'] == 'socials' && (!isset($field['val'][0]) || !is_array($field['val'][0]))) {
                 $field['val'] = array($field['val']);
             }
         }
     }
     // Field container
     if (axiom_options_is_group($field['type'])) {
         // Close nested containers
         if (empty($field['start']) && (!in_array($field['type'], array('group', 'toggle')) || !empty($field['end']))) {
             echo trim(axiom_options_close_nested_groups($field['type'], !empty($field['end'])));
             if (!empty($field['end'])) {
                 return;
             }
         }
     } else {
         // Start field layout
         if ($field['type'] != 'hidden') {
             echo '<div class="axiom_options_field' . ' axiom_options_field_' . (in_array($field['type'], array('list', 'fonts')) ? 'select' : $field['type']) . (in_array($field['type'], array('media', 'fonts', 'list', 'select', 'socials', 'date', 'time')) ? ' axiom_options_field_text' : '') . ($field['type'] == 'socials' && !empty($field['style']) && $field['style'] == 'images' ? ' axiom_options_field_images' : '') . ($field['type'] == 'socials' && (empty($field['style']) || $field['style'] == 'icons') ? ' axiom_options_field_icons' : '') . (isset($field['dir']) && $field['dir'] == 'vertical' ? ' axiom_options_vertical' : '') . (!empty($field['multiple']) ? ' axiom_options_multiple' : '') . (isset($field['size']) ? ' axiom_options_size_' . esc_attr($field['size']) : '') . (isset($field['class']) ? ' ' . esc_attr($field['class']) : '') . (!empty($field['columns']) ? ' axiom_options_columns axiom_options_columns_' . esc_attr($field['columns']) : '') . $divider . '">' . "\n";
             echo '<label class="axiom_options_field_label' . (!empty($AXIOM_GLOBALS['to_flags']['add_inherit']) && isset($field['std']) ? ' axiom_options_field_label_inherit' : '') . '" for="' . esc_attr($id) . '">' . $field['title'] . (!empty($AXIOM_GLOBALS['to_flags']['add_inherit']) && isset($field['std']) ? '<span id="' . esc_attr($id) . '_inherit" class="axiom_options_button_inherit' . ($inherit ? '' : ' axiom_options_inherit_off') . '" title="' . __('Unlock this field', 'axiom') . '"></span>' : '') . '</label>' . "\n";
             echo '<div class="axiom_options_field_content' . $buttons_classes . ($cloneable ? ' axiom_options_cloneable_area' : '') . '">' . "\n";
         }
     }
     // Parse field type
     foreach ($field['val'] as $clone_num => $clone_val) {
         if ($cloneable) {
             echo '<div class="axiom_options_cloneable_item">' . '<span class="axiom_options_input_button axiom_options_clone_button axiom_options_clone_button_del">-</span>';
         }
         switch ($field['type']) {
             case 'group':
                 echo '<fieldset id="' . esc_attr($id) . '" class="axiom_options_container axiom_options_group axiom_options_content' . esc_attr($divider) . '">';
                 if (!empty($field['title'])) {
                     echo '<legend>' . (!empty($field['icon']) ? '<span class="' . esc_attr($field['icon']) . '"></span>' : '') . esc_html($field['title']) . '</legend>' . "\n";
                 }
                 array_push($AXIOM_GLOBALS['to_flags']['nesting'], 'group');
                 break;
             case 'toggle':
                 array_push($AXIOM_GLOBALS['to_flags']['nesting'], 'toggle');
                 echo '<div id="' . esc_attr($id) . '" class="axiom_options_container axiom_options_toggle' . esc_attr($divider) . '">';
                 echo '<h3 id="' . esc_attr($id) . '_title"' . ' class="axiom_options_toggle_header' . (empty($field['closed']) ? ' ui-state-active' : '') . '"' . (!empty($field['action']) ? ' onclick="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . '>' . (!empty($field['icon']) ? '<span class="axiom_options_toggle_header_icon ' . esc_attr($field['icon']) . '"></span>' : '') . $field['title'] . '<span class="axiom_options_toggle_header_marker iconadmin-left-open"></span>' . '</h3>' . '<div class="axiom_options_content axiom_options_toggle_content"' . (!empty($field['closed']) ? ' style="display:none;"' : '') . '>';
                 break;
             case 'accordion':
                 array_push($AXIOM_GLOBALS['to_flags']['nesting'], 'accordion');
                 if (!empty($field['start'])) {
                     echo '<div id="' . esc_attr($field['start']) . '" class="axiom_options_container axiom_options_accordion' . esc_attr($divider) . '">';
                 }
                 echo '<div id="' . esc_attr($id) . '" class="axiom_options_accordion_item">' . '<h3 id="' . esc_attr($id) . '_title"' . ' class="axiom_options_accordion_header"' . (!empty($field['action']) ? ' onclick="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . '>' . (!empty($field['icon']) ? '<span class="axiom_options_accordion_header_icon ' . esc_attr($field['icon']) . '"></span>' : '') . $field['title'] . '<span class="axiom_options_accordion_header_marker iconadmin-left-open"></span>' . '</h3>' . '<div id="' . esc_attr($id) . '_content" class="axiom_options_content axiom_options_accordion_content">';
                 break;
             case 'tab':
                 array_push($AXIOM_GLOBALS['to_flags']['nesting'], 'tab');
                 if (!empty($field['start'])) {
                     echo '<div id="' . esc_attr($field['start']) . '" class="axiom_options_container axiom_options_tab' . esc_attr($divider) . '">' . '<ul>' . trim(axiom_options_collect_tabs($field['type'], $field['start'])) . '</ul>';
                 }
                 echo '<div id="' . esc_attr($id) . '_content"  class="axiom_options_content axiom_options_tab_content">';
                 break;
             case 'partition':
                 array_push($AXIOM_GLOBALS['to_flags']['nesting'], 'partition');
                 if (!empty($field['start'])) {
                     echo '<div id="' . esc_attr($field['start']) . '" class="axiom_options_container axiom_options_partition' . esc_attr($divider) . '">' . '<ul>' . trim(axiom_options_collect_tabs($field['type'], $field['start'])) . '</ul>';
                 }
                 echo '<div id="' . esc_attr($id) . '_content" class="axiom_options_content axiom_options_partition_content">';
                 break;
             case 'hidden':
                 echo '<input class="axiom_options_input axiom_options_input_hidden" name="' . esc_attr($id) . '" id="' . esc_attr($id) . '" type="hidden" value="' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '" />';
                 break;
             case 'date':
                 if (isset($field['style']) && $field['style'] == 'inline') {
                     echo '<div class="axiom_options_input_date" id="' . esc_attr($id) . '_calendar"' . ' data-format="' . (!empty($field['format']) ? $field['format'] : 'yy-mm-dd') . '"' . ' data-months="' . (!empty($field['months']) ? max(1, min(3, $field['months'])) : 1) . '"' . ' data-linked-field="' . (!empty($data['linked_field']) ? $data['linked_field'] : $id) . '"' . '></div>' . '<input id="' . esc_attr($id) . '"' . ' name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' type="hidden"' . ' value="' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '"' . (!empty($field['mask']) ? ' data-mask="' . esc_attr($field['mask']) . '"' : '') . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />';
                 } else {
                     echo '<input class="axiom_options_input axiom_options_input_date' . (!empty($field['mask']) ? ' axiom_options_input_masked' : '') . '"' . ' name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' id="' . esc_attr($id) . '"' . ' type="text"' . ' value="' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '"' . ' data-format="' . (!empty($field['format']) ? $field['format'] : 'yy-mm-dd') . '"' . ' data-months="' . (!empty($field['months']) ? max(1, min(3, $field['months'])) : 1) . '"' . (!empty($field['mask']) ? ' data-mask="' . esc_attr($field['mask']) . '"' : '') . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />' . $before . $after;
                 }
                 break;
             case 'text':
                 echo '<input class="axiom_options_input axiom_options_input_text' . (!empty($field['mask']) ? ' axiom_options_input_masked' : '') . '"' . ' name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' id="' . esc_attr($id) . '"' . ' type="text"' . ' value="' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '"' . (!empty($field['mask']) ? ' data-mask="' . esc_attr($field['mask']) . '"' : '') . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />' . $before . $after;
                 break;
             case 'textarea':
                 $cols = isset($field['cols']) && $field['cols'] > 10 ? $field['cols'] : '40';
                 $rows = isset($field['rows']) && $field['rows'] > 1 ? $field['rows'] : '8';
                 echo '<textarea class="axiom_options_input axiom_options_input_textarea"' . ' name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' id="' . esc_attr($id) . '"' . ' cols="' . esc_attr($cols) . '"' . ' rows="' . esc_attr($rows) . '"' . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . '>' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '</textarea>';
                 break;
             case 'editor':
                 $cols = isset($field['cols']) && $field['cols'] > 10 ? $field['cols'] : '40';
                 $rows = isset($field['rows']) && $field['rows'] > 1 ? $field['rows'] : '10';
                 wp_editor(axiom_is_inherit_option($clone_val) ? '' : $clone_val, $id . ($cloneable ? '[]' : ''), array('wpautop' => false, 'textarea_rows' => $rows));
                 break;
             case 'spinner':
                 echo '<input class="axiom_options_input axiom_options_input_spinner' . (!empty($field['mask']) ? ' axiom_options_input_masked' : '') . '" name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' id="' . esc_attr($id) . '"' . ' type="text"' . ' value="' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '"' . (!empty($field['mask']) ? ' data-mask="' . esc_attr($field['mask']) . '"' : '') . (isset($field['min']) ? ' data-min="' . esc_attr($field['min']) . '"' : '') . (isset($field['max']) ? ' data-max="' . esc_attr($field['max']) . '"' : '') . (!empty($field['step']) ? ' data-step="' . esc_attr($field['step']) . '"' : '') . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />' . '<span class="axiom_options_arrows"><span class="axiom_options_arrow_up iconadmin-up-dir"></span><span class="axiom_options_arrow_down iconadmin-down-dir"></span></span>';
                 break;
             case 'tags':
                 if (!axiom_is_inherit_option($clone_val)) {
                     $tags = explode($AXIOM_GLOBALS['to_delimiter'], $clone_val);
                     if (count($tags) > 0) {
                         foreach ($tags as $tag) {
                             if (empty($tag)) {
                                 continue;
                             }
                             echo '<span class="axiom_options_tag iconadmin-cancel">' . $tag . '</span>';
                         }
                     }
                 }
                 echo '<input class="axiom_options_input_tags"' . ' type="text"' . ' value=""' . ' />' . '<input name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' type="hidden"' . ' value="' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '"' . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />';
                 break;
             case "checkbox":
                 echo '<input type="checkbox" class="axiom_options_input axiom_options_input_checkbox"' . ' name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' id="' . esc_attr($id) . '"' . ' value="true"' . ($clone_val == 'true' ? ' checked="checked"' : '') . (!empty($field['disabled']) ? ' readonly="readonly"' : '') . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />' . '<label for="' . esc_attr($id) . '" class="' . (!empty($field['disabled']) ? 'axiom_options_state_disabled' : '') . ($clone_val == 'true' ? ' axiom_options_state_checked' : '') . '"><span class="axiom_options_input_checkbox_image iconadmin-check"></span>' . (!empty($field['label']) ? $field['label'] : $field['title']) . '</label>';
                 break;
             case "radio":
                 foreach ($field['options'] as $key => $title) {
                     echo '<span class="axiom_options_radioitem">' . '<input class="axiom_options_input axiom_options_input_radio" type="radio"' . ' name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' value="' . esc_attr($key) . '"' . ($clone_val == $key ? ' checked="checked"' : '') . ' id="' . esc_attr($id . '_' . $key) . '"' . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />' . '<label for="' . esc_attr($id . '_' . $key) . '"' . ($clone_val == $key ? ' class="axiom_options_state_checked"' : '') . '><span class="axiom_options_input_radio_image iconadmin-circle-empty' . ($clone_val == $key ? ' iconadmin-dot-circled' : '') . '"></span>' . $title . '</label></span>';
                 }
                 break;
             case "switch":
                 $opt = array();
                 foreach ($field['options'] as $key => $title) {
                     $opt[] = array('key' => $key, 'title' => $title);
                     if (count($opt) == 2) {
                         break;
                     }
                 }
                 echo '<input name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' type="hidden"' . ' value="' . esc_attr(axiom_is_inherit_option($clone_val) || empty($clone_val) ? $opt[0]['key'] : $clone_val) . '"' . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />' . '<span class="axiom_options_switch' . ($clone_val == $opt[1]['key'] ? ' axiom_options_state_off' : '') . '"><span class="axiom_options_switch_inner iconadmin-circle"><span class="axiom_options_switch_val1" data-value="' . esc_attr($opt[0]['key']) . '">' . $opt[0]['title'] . '</span><span class="axiom_options_switch_val2" data-value="' . esc_attr($opt[1]['key']) . '">' . $opt[1]['title'] . '</span></span></span>';
                 break;
             case 'media':
                 echo '<input class="axiom_options_input axiom_options_input_text axiom_options_input_media"' . ' name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' id="' . esc_attr($id) . '"' . ' type="text"' . ' value="' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '"' . (!isset($field['readonly']) || $field['readonly'] ? ' readonly="readonly"' : '') . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />' . $before . $after;
                 if (!empty($clone_val) && !axiom_is_inherit_option($clone_val)) {
                     $info = pathinfo($clone_val);
                     $ext = isset($info['extension']) ? $info['extension'] : '';
                     echo '<a class="axiom_options_image_preview" data-rel="popup" target="_blank" href="' . esc_url($clone_val) . '">' . (!empty($ext) && axiom_strpos('jpg,png,gif', $ext) !== false ? '<img src="' . esc_url($clone_val) . '" alt="" />' : '<span>' . $info['basename'] . '</span>') . '</a>';
                 }
                 break;
             case 'button':
                 list($button, $class) = axiom_options_action_button($field, 'button');
                 echo $button;
                 break;
             case 'range':
                 echo '<div class="axiom_options_input_range" data-step="' . (!empty($field['step']) ? $field['step'] : 1) . '">';
                 echo '<span class="axiom_options_range_scale"><span class="axiom_options_range_scale_filled"></span></span>';
                 if (axiom_strpos($clone_val, $AXIOM_GLOBALS['to_delimiter']) === false) {
                     $clone_val = max($field['min'], intval($clone_val));
                 }
                 if (axiom_strpos($field['std'], $AXIOM_GLOBALS['to_delimiter']) !== false && axiom_strpos($clone_val, $AXIOM_GLOBALS['to_delimiter']) === false) {
                     $clone_val = $field['min'] . ',' . $clone_val;
                 }
                 $sliders = explode($AXIOM_GLOBALS['to_delimiter'], $clone_val);
                 foreach ($sliders as $s) {
                     echo '<span class="axiom_options_range_slider"><span class="axiom_options_range_slider_value">' . intval($s) . '</span><span class="axiom_options_range_slider_button"></span></span>';
                 }
                 echo '<span class="axiom_options_range_min">' . $field['min'] . '</span><span class="axiom_options_range_max">' . $field['max'] . '</span>';
                 echo '<input name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' type="hidden"' . ' value="' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '"' . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />';
                 echo '</div>';
                 break;
             case "checklist":
                 foreach ($field['options'] as $key => $title) {
                     echo '<span class="axiom_options_listitem' . (axiom_strpos($AXIOM_GLOBALS['to_delimiter'] . $clone_val . $AXIOM_GLOBALS['to_delimiter'], $AXIOM_GLOBALS['to_delimiter'] . $key . $AXIOM_GLOBALS['to_delimiter']) !== false ? ' axiom_options_state_checked' : '') . '"' . ' data-value="' . esc_attr($key) . '"' . '>' . esc_attr($title) . '</span>';
                 }
                 echo '<input name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' type="hidden"' . ' value="' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '"' . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />';
                 break;
             case 'fonts':
                 foreach ($field['options'] as $key => $title) {
                     $field['options'][$key] = $key;
                 }
             case 'list':
             case 'select':
                 if (!isset($field['options']) && !empty($field['from']) && !empty($field['to'])) {
                     $field['options'] = array();
                     for ($i = $field['from']; $i <= $field['to']; $i += !empty($field['step']) ? $field['step'] : 1) {
                         $field['options'][$i] = $i;
                     }
                 }
                 list($list, $caption) = axiom_options_menu_list($field, $clone_val);
                 if (empty($field['style']) || $field['style'] == 'select') {
                     echo '<input class="axiom_options_input axiom_options_input_select" type="text" value="' . esc_attr($caption) . '"' . ' readonly="readonly"' . ' />' . $before . '<span class="axiom_options_field_after axiom_options_with_action iconadmin-down-open" onclick="axiom_options_action_show_menu(this);return false;"></span>';
                 }
                 echo $list;
                 echo '<input name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' type="hidden"' . ' value="' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '"' . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />';
                 break;
             case 'images':
                 list($list, $caption) = axiom_options_menu_list($field, $clone_val);
                 if (empty($field['style']) || $field['style'] == 'select') {
                     echo '<div class="axiom_options_caption_image iconadmin-down-open">' . '<span style="background-image: url(' . esc_url($caption) . ')"></span>' . '</div>';
                 }
                 echo $list;
                 echo '<input name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' type="hidden"' . ' value="' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '"' . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />';
                 break;
             case 'icons':
                 if (isset($field['css']) && $field['css'] != '' && file_exists($field['css'])) {
                     $field['options'] = axiom_parse_icons_classes($field['css']);
                 }
                 list($list, $caption) = axiom_options_menu_list($field, $clone_val);
                 if (empty($field['style']) || $field['style'] == 'select') {
                     echo '<div class="axiom_options_caption_icon iconadmin-down-open"><span class="' . esc_attr($caption) . '"></span></div>';
                 }
                 echo $list;
                 echo '<input name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' type="hidden"' . ' value="' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '"' . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />';
                 break;
             case 'socials':
                 if (!is_array($clone_val)) {
                     $clone_val = array('url' => '', 'icon' => '');
                 }
                 list($list, $caption) = axiom_options_menu_list($field, $clone_val);
                 if (empty($field['style']) || $field['style'] == 'icons') {
                     list($after, $class) = axiom_options_action_button(array('action' => empty($field['style']) || $field['style'] == 'icons' ? 'select_icon' : '', 'icon' => (empty($field['style']) || $field['style'] == 'icons') && !empty($clone_val['icon']) ? $clone_val['icon'] : 'iconadmin-users-1'), 'after');
                 } else {
                     $after = '';
                 }
                 echo '<input class="axiom_options_input axiom_options_input_text axiom_options_input_socials' . (!empty($field['mask']) ? ' axiom_options_input_masked' : '') . '"' . ' name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' id="' . esc_attr($id) . '"' . ' type="text" value="' . esc_attr(axiom_is_inherit_option($clone_val['url']) ? '' : $clone_val['url']) . '"' . (!empty($field['mask']) ? ' data-mask="' . esc_attr($field['mask']) . '"' : '') . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />' . $after;
                 if (!empty($field['style']) && $field['style'] == 'images') {
                     echo '<div class="axiom_options_caption_image iconadmin-down-open">' . '<span style="background-image: url(' . esc_url($caption) . ')"></span>' . '</div>';
                 }
                 echo $list;
                 echo '<input name="' . esc_attr($id) . '_icon' . ($cloneable ? '[]' : '') . '" type="hidden" value="' . esc_attr(axiom_is_inherit_option($clone_val['icon']) ? '' : $clone_val['icon']) . '" />';
                 break;
             case "color":
                 echo '<input class="axiom_options_input axiom_options_input_color' . (isset($field['style']) && $field['style'] == 'custom' ? ' axiom_options_input_color_custom' : '') . '"' . ' name="' . esc_attr($id) . ($cloneable ? '[]' : '') . '"' . ' id="' . esc_attr($id) . '"' . ' type="text"' . ' value="' . esc_attr(axiom_is_inherit_option($clone_val) ? '' : $clone_val) . '"' . (!empty($field['action']) ? ' onchange="axiom_options_action_' . esc_attr($field['action']) . '(this);return false;"' : '') . ' />';
                 if (isset($field['style']) && $field['style'] == 'custom') {
                     echo '<span class="axiom_options_input_colorpicker iColorPicker"></span>';
                 }
                 break;
             default:
                 if (function_exists('axiom_show_custom_field')) {
                     echo trim(axiom_show_custom_field($id, $field, $clone_val));
                 }
         }
         if ($cloneable) {
             echo '<input type="hidden" name="' . esc_attr($id) . '_numbers[]" value="' . esc_attr($clone_num) . '" />' . '</div>';
         }
     }
     if (!axiom_options_is_group($field['type']) && $field['type'] != 'hidden') {
         if ($cloneable) {
             echo '<div class="axiom_options_input_button axiom_options_clone_button axiom_options_clone_button_add">' . __('+ Add item', 'axiom') . '</div>';
         }
         if (!empty($AXIOM_GLOBALS['to_flags']['add_inherit']) && isset($field['std'])) {
             echo '<div class="axiom_options_content_inherit"' . ($inherit ? '' : ' style="display:none;"') . '><div>' . __('Inherit', 'axiom') . '</div><input type="hidden" name="' . esc_attr($id) . '_inherit" value="' . esc_attr($inherit) . '" /></div>';
         }
         echo '</div>';
         if (!empty($field['desc'])) {
             echo '<div class="axiom_options_desc">' . $field['desc'] . '</div>' . "\n";
         }
         echo '</div>' . "\n";
     }
 }
Example #27
0
    		(function(h,o,t,j,a,r){
        	h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
       	 	h._hjSettings={hjid:80986,hjsv:5};
        	a=o.getElementsByTagName('head')[0];
        	r=o.createElement('script');r.async=1;
        	r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
        	a.appendChild(r);
    		})(window,document,'//static.hotjar.com/c/hotjar-','.js?sv=');
	</script>

</head>

<?php 
$class = $style = '';
if ($body_style == 'boxed' || axiom_get_custom_option('load_bg_image') == 'always') {
    $customizer = axiom_get_theme_option('show_theme_customizer') == 'yes';
    if ($customizer && ($img = (int) axiom_get_value_gpc('bg_image', 0)) > 0) {
        $class = 'bg_image_' . $img;
    } else {
        if ($customizer && ($img = (int) axiom_get_value_gpc('bg_pattern', 0)) > 0) {
            $class = 'bg_pattern_' . $img;
        } else {
            if ($customizer && ($img = axiom_get_value_gpc('bg_color', '')) != '') {
                $style = 'background-color: ' . $img . ';';
            } else {
                if (($img = axiom_get_custom_option('bg_custom_image')) != '') {
                    $style = 'background: url(' . esc_url($img) . ') ' . str_replace('_', ' ', axiom_get_custom_option('bg_custom_image_position')) . ' no-repeat fixed;';
                } else {
                    if (($img = axiom_get_custom_option('bg_custom_pattern')) != '') {
                        $style = 'background: url(' . esc_url($img) . ') 0 0 repeat fixed;';
                    } else {
Example #28
0
 function axiom_get_nav_menu($slug = '', $custom_walker = false)
 {
     $menu = !empty($slug) ? axiom_get_custom_option($slug) : '';
     $args = array('menu' => empty($menu) || $menu == 'default' || axiom_is_inherit_option($menu) ? '' : $menu, 'container' => '', 'container_class' => '', 'container_id' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'menu_class' => (!empty($slug) ? $slug : 'menu_main') . '_nav', 'menu_id' => !empty($slug) ? $slug : 'menu_main', 'echo' => false, 'fallback_cb' => '', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'depth' => 11);
     if (!empty($slug)) {
         $args['theme_location'] = $slug;
     }
     if ($custom_walker && class_exists('axiom_custom_menu_walker') && axiom_get_theme_option('custom_menu') == 'yes') {
         $args['walker'] = new axiom_custom_menu_walker();
     }
     return wp_nav_menu($args);
 }
Example #29
0
 function axiom_save_fields_in_user_profile($user_id)
 {
     if (!current_user_can('edit_user', $user_id)) {
         return false;
     }
     update_user_meta($user_id, 'user_position', $_POST['user_position']);
     $social_list = axiom_get_theme_option('social_icons');
     foreach ($social_list as $soc) {
         $sn = basename($soc['icon']);
         //$sn = axiom_substr($sn, 0, axiom_strrpos($sn, '.'));
         $sn = axiom_substr($sn, axiom_strrpos($sn, '-') + 1);
         if (($pos = axiom_strrpos($sn, '_')) !== false) {
             $sn = axiom_substr($sn, 0, $pos);
         }
         update_user_meta($user_id, 'user_' . $sn, $_POST['user_' . $sn]);
     }
 }
Example #30
0
    function build_page()
    {
        $subject = $message = $attach = $group = $sender_name = $sender_email = '';
        $subscribers_update = $subscribers_delete = $subscribers_clear = false;
        $subscribers = array();
        if (isset($_POST['emailer_subject'])) {
            do {
                // Check nonce
                if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], __FILE__)) {
                    $this->error = __('Incorrect WP-nonce data! Operation canceled!', 'axiom');
                    break;
                }
                // Get post data
                $subject = isset($_POST['emailer_subject']) ? $_POST['emailer_subject'] : '';
                if (empty($subject)) {
                    $this->error = __('Subject can not be empty! Operation canceled!', 'axiom');
                    break;
                }
                $message = isset($_POST['emailer_message']) ? $_POST['emailer_message'] : '';
                if (empty($message)) {
                    $this->error = __('Message can not be empty! Operation canceled!', 'axiom');
                    break;
                }
                $attach = isset($_FILES['emailer_attachment']['tmp_name']) && file_exists($_FILES['emailer_attachment']['tmp_name']) ? $_FILES['emailer_attachment']['tmp_name'] : '';
                $group = isset($_POST['emailer_group']) ? $_POST['emailer_group'] : '';
                $subscribers = isset($_POST['emailer_subscribers']) ? $_POST['emailer_subscribers'] : '';
                if (!empty($subscribers)) {
                    $subscribers = explode("\n", str_replace(array(';', ','), array("\n", "\n"), $subscribers));
                } else {
                    $subscribers = array();
                }
                if (count($subscribers) == 0) {
                    $this->error = __('Subscribers lists are empty! Operation canceled!', 'axiom');
                    break;
                }
                $sender_name = !empty($_POST['emailer_sender_name']) ? $_POST['emailer_sender_name'] : get_bloginfo('name');
                $sender_email = !empty($_POST['emailer_sender_email']) ? $_POST['emailer_sender_email'] : '';
                if (empty($sender_email)) {
                    $sender_email = axiom_get_theme_option('contact_email');
                }
                if (empty($sender_email)) {
                    $sender_email = get_bloginfo('admin_email');
                }
                if (empty($sender_email)) {
                    $this->error = __('Sender email is empty! Operation canceled!', 'axiom');
                    break;
                }
                $headers = 'From: ' . $sender_name . ' <' . $sender_email . '>' . "\r\n";
                $subscribers_update = isset($_POST['emailer_subscribers_update']);
                $subscribers_delete = isset($_POST['emailer_subscribers_delete']);
                $subscribers_clear = isset($_POST['emailer_subscribers_clear']);
                // Send email
                add_filter('wp_mail_content_type', 'axiom_set_html_content_type');
                $new_list = array();
                $list = array();
                $cnt = 0;
                $mail = axiom_get_theme_option('mail_function');
                foreach ($subscribers as $email) {
                    $email = trim(chop($email));
                    if (empty($email)) {
                        continue;
                    }
                    if (!preg_match('/[\\.\\-_A-Za-z0-9]+?@[\\.\\-A-Za-z0-9]+?[\\ .A-Za-z0-9]{2,}/', $email)) {
                        continue;
                    }
                    $list[] = $email;
                    $cnt++;
                    if ($cnt >= $this->max_recipients_in_one_letter) {
                        @$mail($list, $subject, $message, $headers, $attach);
                        if ($subscribers_update && $group != 'none') {
                            $new_list = array_merge($new_list, $list);
                        }
                        $list = array();
                        $cnt = 0;
                    }
                }
                if ($cnt > 0) {
                    @$mail($list, $subject, $message, $headers, $attach);
                    if ($subscribers_update && $group != 'none') {
                        $new_list = array_merge($new_list, $list);
                    }
                    $list = array();
                    $cnt = 0;
                }
                remove_filter('wp_mail_content_type', 'axiom_set_html_content_type');
                $add_msg = '';
                if ($subscribers_update && $group != 'none') {
                    $rez = array();
                    if (count($this->subscribers[$group]) > 0) {
                        foreach ($this->subscribers[$group] as $k => $v) {
                            if (!$subscribers_clear && !empty($v)) {
                                $rez[$k] = $v;
                            }
                        }
                    }
                    if (count($new_list) > 0) {
                        foreach ($new_list as $v) {
                            $rez[$v] = '';
                        }
                    }
                    $this->subscribers[$group] = $rez;
                    update_option('axiom_emailer_subscribers', $this->subscribers);
                    $add_msg = __(' The subscriber list is updated', 'axiom');
                } else {
                    if ($subscribers_delete && $group != 'none') {
                        unset($this->subscribers[$group]);
                        update_option('axiom_emailer_subscribers', $this->subscribers);
                        $add_msg = __(' The subscriber list is cleared', 'axiom');
                    }
                }
                $this->success = __('E-Mail was send successfull!', 'axiom') . $add_msg;
            } while (false);
        }
        ?>
		<div class="trx_emailer">
			<h2 class="trx_emailer_title"><?php 
        _e('AxiomThemes Emailer', 'axiom');
        ?>
</h2>
			<div class="trx_emailer_result">
				<?php 
        if (!empty($this->error)) {
            ?>
				<div class="error">
					<p><?php 
            echo $this->error;
            ?>
</p>
				</div>
				<?php 
        }
        ?>
				<?php 
        if (!empty($this->success)) {
            ?>
				<div class="updated">
					<p><?php 
            echo $this->success;
            ?>
</p>
				</div>
				<?php 
        }
        ?>
			</div>
	
			<form id="trx_emailer_form" action="#" method="post" enctype="multipart/form-data">

				<input type="hidden" value="<?php 
        echo esc_attr($this->nonce);
        ?>
" name="nonce" />

				<div class="trx_emailer_block">
					<fieldset class="trx_emailer_block_inner">
						<legend> <?php 
        _e('Letter data', 'axiom');
        ?>
 </legend>
						<div class="trx_emailer_fields">
							<div class="trx_emailer_field trx_emailer_subject">
								<label for="emailer_subject"><?php 
        _e('Subject:', 'axiom');
        ?>
</label>
								<input type="text" value="<?php 
        echo esc_attr($subject);
        ?>
" name="emailer_subject" id="emailer_subject" />
							</div>
							<div class="trx_emailer_field trx_emailer_attachment">
								<label for="emailer_attachment"><?php 
        _e('Attachment:', 'axiom');
        ?>
</label>
								<input type="file" name="emailer_attachment" id="emailer_attachment" />
							</div>
							<div class="trx_emailer_field trx_emailer_message">
								<?php 
        wp_editor($message, 'emailer_message', array('wpautop' => false, 'textarea_rows' => 10));
        ?>
								
							</div>
						</div>
					</fieldset>
				</div>
	
				<div class="trx_emailer_block">
					<fieldset class="trx_emailer_block_inner">
						<legend> <?php 
        _e('Subscribers', 'axiom');
        ?>
 </legend>
						<div class="trx_emailer_fields">
							<div class="trx_emailer_field trx_emailer_group">
								<label for="emailer_group"><?php 
        _e('Select group:', 'axiom');
        ?>
</label>
								<select name="emailer_group" id="emailer_group">
									<option value="none"<?php 
        echo $group == 'none' ? ' selected="selected"' : '';
        ?>
><?php 
        _e('- Select group -', 'axiom');
        ?>
</option>
									<?php 
        if (count($this->subscribers) > 0) {
            foreach ($this->subscribers as $gr => $list) {
                echo '<option value="' . est_attr($gr) . '"' . ($group == $gr ? ' selected="selected"' : '') . '>' . axiom_strtoproper($gr) . '</option>';
            }
        }
        ?>
								</select>
								<input type="checkbox" name="emailer_subscribers_update" id="emailer_subscribers_update" value="1"<?php 
        echo $subscribers_update ? ' checked="checked"' : '';
        ?>
 /><label for="emailer_subscribers_update" class="inline" title="<?php 
        _e('Update the subscribers list for selected group', 'axiom');
        ?>
"><?php 
        _e('Update', 'axiom');
        ?>
</label>
								<input type="checkbox" name="emailer_subscribers_clear" id="emailer_subscribers_clear" value="1"<?php 
        echo $subscribers_clear ? ' checked="checked"' : '';
        ?>
 /><label for="emailer_subscribers_clear" class="inline" title="<?php 
        _e('Clear this group from not confirmed emails after send', 'axiom');
        ?>
"><?php 
        _e('Clear', 'axiom');
        ?>
</label>
								<input type="checkbox" name="emailer_subscribers_delete" id="emailer_subscribers_delete" value="1"<?php 
        echo $subscribers_delete ? ' checked="checked"' : '';
        ?>
 /><label for="emailer_subscribers_delete" class="inline" title="<?php 
        _e('Delete this group after send', 'axiom');
        ?>
"><?php 
        _e('Delete', 'axiom');
        ?>
</label>
							</div>
							<div class="trx_emailer_field trx_emailer_subscribers2">
								<label for="emailer_subscribers" class="big"><?php 
        _e('List of recipients:', 'axiom');
        ?>
</label>
								<textarea name="emailer_subscribers" id="emailer_subscribers"><?php 
        echo join("\n", $subscribers);
        ?>
</textarea>
							</div>
							<div class="trx_emailer_field trx_emailer_sender_name">
								<label for="emailer_sender_name"><?php 
        _e('Sender name:', 'axiom');
        ?>
</label>
								<input type="text" name="emailer_sender_name" id="emailer_sender_name" value="<?php 
        echo esc_attr($sender_name);
        ?>
" /><br />
							</div>
							<div class="trx_emailer_field trx_emailer_sender_email">
								<label for="emailer_sender_email"><?php 
        _e('Sender email:', 'axiom');
        ?>
</label>
								<input type="text" name="emailer_sender_email" id="emailer_sender_email" value="<?php 
        echo esc_attr($sender_email);
        ?>
" />
							</div>
						</div>
					</fieldset>
				</div>
	
				<div class="trx_emailer_buttons">
					<a href="#" id="trx_emailer_send"><?php 
        echo _e('Send', 'axiom');
        ?>
</a>
				</div>
	
			</form>
		</div>
		<?php 
    }