/** * Display widget */ function widget($args, $instance) { extract($args, EXTR_SKIP); $instance = !empty($instance) ? $instance : array(); $javo_query = new javo_Array($instance); $javo_this_style = ""; if (false !== $javo_query->get('button_style', false)) { $javo_this_style_attribute = array('font-family' => 'railway', 'background-color' => $javo_query->get("btn_bg_color"), 'border-color' => $javo_query->get("btn_bg_color"), 'color' => $javo_query->get("btn_txt_color"), 'border-radius' => $javo_query->get("btn_radius", 0) . 'px'); foreach ($javo_this_style_attribute as $option => $key) { $javo_this_style .= "{$option}:{$key};"; } } ob_start(); ?> <li class="widget_top_menu javo-in-mobile x-<?php echo $javo_query->get('btn_visible', ''); ?> "> <?php if (is_user_logged_in()) { $javo_redirect = home_url(JAVO_DEF_LANG . JAVO_MEMBER_SLUG . '/' . wp_get_current_user()->user_login . '/' . JAVO_ADDITEM_SLUG); echo "<a href=\"{$javo_redirect}\" class=\"btn\" style=\"{$javo_this_style}\" {$javo_redirect}>{$javo_query->get('btn_txt', __('Submit a List', 'javo_fr'))}</a>"; } else { $javo_redirect = "data-toggle=\"modal\" data-target=\"#login_panel\""; echo "<a href=\"javascript:\" class=\"btn\" style=\"{$javo_this_style}\" {$javo_redirect}>{$javo_query->get('btn_txt', __('Submit a List', 'javo_fr'))}</a>"; } ?> </li> <?php ob_end_flush(); }
<?php /* * Template Name: item List ( with Content ) */ global $javo_tso; $javo_query = new javo_Array($_POST); $javo_list_query = new javo_Array($javo_query->get('filter', array())); get_header(); ?> <div class="javo-page-variable-area"> <?php $javo_item_filter_taxonomies = @unserialize(get_post_meta(get_the_ID(), "javo_item_tax", true)); $javo_item_filter_terms = @unserialize(get_post_meta(get_the_ID(), "javo_item_terms", true)); $javo_item_defult_type = get_post_meta(get_the_ID(), "javo_item_listing_type", true); if (!empty($javo_item_filter_taxonomies)) { foreach ($javo_item_filter_taxonomies as $index => $tax) { if (!empty($javo_item_filter_terms[$index]) && !empty($tax)) { printf("<input type='hidden' class='javo_filter' data-tax='%s' data-term='%s'>", $tax, $javo_item_filter_terms[$index]); } } } ?> <input type="hidden" value="<?php echo !empty($javo_item_defult_type) ? $javo_item_defult_type : 2; ?> " data-javo-item-listing-default-type> <input type="hidden" javo-cluster-multiple value="<?php _e("This place contains multiple places. please select one.", 'javo_fr'); ?> ">
?> </label> </fieldset> </td></tr><tr><th> <?php _e("Item Description Page Settings", "javo_fr"); ?> <span class="description"> <?php _e('Customize your item page layout. You can change the names (labels) of each tab or you can disable them. For now, the icons on the tabs cannot be changed.', 'javo_fr'); ?> </span> </th><td> <?php $javo_single_label_query = new javo_Array((array) $javo_tso->get('javo_custom_label', array())); $javo_single_tab_query = new javo_Array((array) $javo_tso->get('javo_custom_tab', array())); ?> <!-- Detail Page --> <h4><?php _e('Item Description Page - Map Marker', 'javo_fr'); ?> </h4> <fieldset> <input type="text" name="javo_ts[single_map_marker]" value="<?php echo $javo_tso->get('single_map_marker', null); ?> " tar="single_map_marker"> <input type="button" class="button button-primary fileupload" value="<?php _e('Select Image', 'javo_fr'); ?>
<?php /* * Template Name: item List */ $javo_query = new javo_Array($_POST); $javo_list_query = new javo_Array($javo_query->get('filter', [])); get_header(); include 'item-filter.php'; function display_dropdown($field) { ?> <div class="form-group"> <select name="<?php echo $field['name']; ?> " onchange="jQuery('#refine-form').submit()" class="form-control"> <option value="-1">(all)</option> <?php foreach ($field['values'] as $value) { ?> <option value="<?php echo $value['idx']; ?> " <?php if (isset($_GET[$field['name']]) && $_GET[$field['name']] == $value['idx']) { echo 'selected="selected"'; } ?>
public function form($instance) { $javo_var = new javo_Array($instance); ob_start(); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title:', __JAVO); ?> </label> <input type = "text" class = "widefat" id = "<?php echo $this->get_field_id('title'); ?> " name = "<?php echo $this->get_field_name('title'); ?> " value = "<?php echo $javo_var->get('title', __('Featured Item', __JAVO)); ?> " > </p> <p> <input type = "checkbox" class = "widefat" id = "<?php echo $this->get_field_id('random'); ?> " name = "<?php echo $this->get_field_name('random'); ?> " value = "rand" <?php checked($random == 1); ?> > <label for="<?php echo $this->get_field_id('random'); ?> "><?php _e('Random Ordering', __JAVO); ?> </label> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('featured_count')); ?> "><?php _e('Limit:', __JAVO); ?> </label> <select class = "widefat" name = "<?php echo $this->get_field_name('featured_count'); ?> " id = "<?php echo $this->get_field_id('featured_count'); ?> " > <?php for ($i = 1; $i <= 20; $i++) { echo "<option value=\"{$i}\" " . selected($i == $javo_var->get('featured_count', 6), true, false) . ">{$i}</option>"; } ?> </select> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('list_type')); ?> "><?php _e("Display type", __JAVO); ?> :</label> <select class = "widefat" name = "<?php echo $this->get_field_name('list_type'); ?> " id = "<?php echo $this->get_field_id('list_type'); ?> " > <?php foreach (array(__("Grid Listing (default)", 'javo_fr') => 'grid', __("Line Listing", 'javo_fr') => 'linear') as $label => $value) { echo "<option value=\"{$value}\" " . selected($value == $javo_var->get('list_type', 'grid'), true, false) . ">{$label}</option>"; } ?> </select> </p> <?php ob_end_flush(); }
public function admin() { global $javo_tso; $javo_get_custom_field = $javo_tso->get('custom_field', null); ob_start(); ?> <div class="javo_custom_field_forms"> <?php if (!empty($javo_get_custom_field)) { foreach ($javo_get_custom_field as $key => $field) { $javo_field_string = new javo_Array($field); ?> <div class="postbox-container" style='width:100%;'> <div class="meta-box-sortables"> <div class="postbox"> <h3> <label style="font:0.7em/0.7em 'Trebuchet MS', Helvetica, sans-serif; color:#868686;"><?php _e('Field Attributes', 'javo_fr'); ?> </label> </h3> <div class="inside"> <dl> <dt><?php _e('Input Slug', 'javo_fr'); ?> </dt> <dd><input type="text" name="javo_ts[custom_field][<?php echo $key; ?> ][name]" value="<?php echo esc_attr($field['name']); ?> " style="width:500px;"></dd> </dl> <dl> <dt><?php _e('Input Label', 'javo_fr'); ?> </dt> <dd> <input type="hidden" name="javo_ts[custom_field][<?php echo $key; ?> ][name]" value="<?php echo $field['name']; ?> "> <input type="hidden" name="javo_ts[custom_field][<?php echo $key; ?> ][order]" data-order> <input type="text" name="javo_ts[custom_field][<?php echo $key; ?> ][label]" value="<?php echo $javo_field_string->get('label'); ?> "> </dd> </dl> <dl> <dt><?php _e('Element Type', 'javo_fr'); ?> </dt> <dd> <select name="javo_ts[custom_field][<?php echo $key; ?> ][type]"> <?php echo $this->insert_option($this->javo_fields, $field['type']); ?> </select> </dd> </dl> <dl class="group-hidden"> <dt><?php _e('Values', 'javo_fr'); ?> </dt> <dd> <div class="description"><small><?php _e('You must use "," as a separator for dropdown, raido, check boxes', 'javo_fr'); ?> </small></div> <input name="javo_ts[custom_field][<?php echo $key; ?> ][value]" value="<?php echo $javo_field_string->get('value'); ?> "> </dd> </dl> <dl class="group-hidden"> <dt><?php _e('CSS Class Name', 'javo_fr'); ?> </dt> <dd> <input name="javo_ts[custom_field][<?php echo $key; ?> ][css]" value="<?php echo $javo_field_string->get('css'); ?> "> </dd> </dl> <dl> <dt><?php _e('Action', 'javo_fr'); ?> </dt> <dd> <a class="button button-cancel javo-remove-custom-field"><?php _e('Remove', 'javo_fr'); ?> </a> </dd> </dl> </div> </div><!-- PostBox End --> </div><!-- PostBox Sortable End --> </div><!-- PostBox Container End --> <?php } } ?> </div> <a class="button button-primary javo-add-custom-field"><?php _e('Add New Field', 'javo_fr'); ?> </a> <script type="text/javascript"> (function($){ "use strict"; var el_type = "select[name^='javo_ts[custom_field]']"; ; $(document) .on('click', '.javo-add-custom-field', function(){ var $this = $(this); var javo_get_custom_field_form_ajax = { url:'<?php echo admin_url("admin-ajax.php"); ?> ' , type: 'post' , dataType: 'json' , data:{ action:'get_custom_field_form' } , complete: function(){ $( el_type ).trigger( 'change' ); } , success:function(d){ $('body').find('.javo_custom_field_forms').append( d.output ); $this.removeClass('disabled'); } }; if( !$this.hasClass('disabled') ){ $this.addClass('disabled'); $.ajax( javo_get_custom_field_form_ajax ); }; }) .on('click', '.javo-remove-custom-field', function(){ $(this).closest('.postbox-container').remove(); }) .on( 'change', el_type, function(){ var parent = $(this).closest( 'div.inside' ).find( 'dl.group-hidden' ); parent.removeClass('hidden'); if( $(this).val() == "group" && parent.hasClass('group-hidden') ){ parent.addClass("hidden"); } }) ; $( el_type ).trigger( 'change' ); })(jQuery); </script> <?php return ob_get_clean(); }
/** * Display widget */ function widget($args, $instance) { extract($args, EXTR_SKIP); $instance = !empty($instance) ? $instance : array(); $javo_query = new javo_Array($instance); $javo_this_style = ""; if (false !== $javo_query->get('button_style', false)) { $javo_this_style_attribute = array('font-family' => 'railway', 'background-color' => $javo_query->get("btn_bg_color"), 'border-color' => $javo_query->get("btn_bg_color"), 'color' => $javo_query->get("btn_txt_color"), 'border-radius' => $javo_query->get("btn_radius", 0) . 'px'); foreach ($javo_this_style_attribute as $option => $key) { $javo_this_style .= "{$option}:{$key};"; } } ob_start(); ?> <li class="widget_top_menu javo-wg-menu-button-login-wrap javo-in-mobile x-<?php echo $javo_query->get('btn_visible', ''); ?> "> <?php if (is_user_logged_in()) { $javo_redirect = wp_logout_url(home_url()); echo "<a\r\n\t\t\t\t\thref=\"{$javo_redirect}\"\r\n\t\t\t\t\tclass=\"btn\"\r\n\t\t\t\t\tstyle=\"{$javo_this_style}\"\r\n\t\t\t\t\tdata-mobile-icon=\"{$javo_query->get('after_log_icon')}\">\r\n\t\t\t\t\t\t{$javo_query->get('btn_txt_after', __('Log out', 'javo_fr'))}\r\n\t\t\t\t\t</a>"; } else { $javo_redirect = "data-toggle=\"modal\" data-target=\"#login_panel\""; echo "<a\r\n\t\t\t\t\thref=\"javascript:\"\r\n\t\t\t\t\tclass=\"btn\"\r\n\t\t\t\t\tstyle=\"{$javo_this_style}\"\r\n\t\t\t\t\tdata-mobile-icon=\"{$javo_query->get('before_log_icon')}\"\r\n\t\t\t\t\t{$javo_redirect}>\r\n\t\t\t\t\t\t{$javo_query->get('btn_txt', __('Login', 'javo_fr'))}\r\n\t\t\t\t\t</a>"; } ?> </li> <script type="text/javascript"> jQuery( function( $ ){ var anchor = $( "#javo-doc-top-level-menu li.javo-wg-menu-button-login-wrap a" ); var original_str = anchor.html(); var mobile_str = anchor.data( 'mobile-icon' ); // alert( anchor.data( "mobile-icon" ) ); $( window ).on( 'resize', function() { if( $( "body" ).hasClass( "mobile" ) ) { anchor.html( "<i class='" + mobile_str + "'></i>" ); }else{ anchor.html( original_str ); } } ); } ); </script> <?php ob_end_flush(); }
/** * Display widget */ function widget($args, $instance) { extract($args, EXTR_SKIP); global $javo_tso; $instance = !empty($instance) ? $instance : array(); $javo_query = new javo_Array($instance); $javo_categories = get_terms('item_category', array('parent' => 0, 'hide_empty' => 0)); $javo_this_style = ""; if (false !== $javo_query->get('button_style', false)) { $javo_this_style_attribute = array('font-family' => 'railway', 'background-color' => $javo_query->get("btn_bg_color"), 'color' => $javo_query->get("btn_txt_color") . " !important", 'border-radius' => $javo_query->get("btn_radius", 0) . 'px'); foreach ($javo_this_style_attribute as $option => $key) { if (!empty($key)) { $javo_this_style .= "{$option}:{$key};"; } } } if ('hide' === ($javo_this_scroll = $javo_query->get('use_scroll', ''))) { $javo_this_scroll = "style='overflow:hidden; overflow-y:auto; height:100%;'"; } ob_start(); ?> <li class="widget_top_menu"> <a href="#javo-sitemap" style="<?php echo $javo_this_style; ?> " class="btn"> <?php if ('' !== ($tmp = $javo_query->get('btn_icon', ''))) { echo "<i class=\"fa {$tmp}\"></i> "; } echo $javo_query->get("btn_txt", __("Categories", 'javo_fr')); ?> </a> <div id="javo-sitemap"> <button type="button" class="close">×</button> <div class="container" <?php echo $javo_this_scroll; ?> > <form role="form" class="javo-sitemap-form"> <div class="row javo-terms"> <?php foreach ($javo_categories as $cat) { $javo_this_cat_url = get_term_link($cat); $javo_this_cat_url = $javo_tso->get('page_item_result', 0); $javo_this_cat_url = apply_filters('javo_wpml_link', $javo_this_cat_url); $javo_this_depth_1_terms = get_terms('item_category', array('parent' => $cat->term_id, 'hide_empty' => 0)); echo "<div class='pull-left javo-terms-item'>"; echo "<a class='javo-terms-item-title' href='{$javo_this_cat_url}?category={$cat->term_id}'><strong>{$cat->name}</strong></a>"; echo "<ul class='list-unstyled'>"; if (!is_wp_error($javo_this_depth_1_terms) && !empty($javo_this_depth_1_terms) && 'hide' !== $javo_query->get('sub_cate', false)) { foreach ($javo_this_depth_1_terms as $sub_cat) { $javo_this_sub_cat_url = get_term_link($sub_cat); $javo_this_sub_cat_url = $javo_tso->get('page_item_result', 0); $javo_this_sub_cat_url = apply_filters('javo_wpml_link', $javo_this_sub_cat_url); echo "<li><a href='{$javo_this_sub_cat_url}?category={$sub_cat->term_id}'>{$sub_cat->name} </a></li>"; } } echo "</ul>"; echo "</div>"; } ?> </div><!-- /.row --> </form> </div><!-- /.container --> </div> </li> <script type="text/javascript"> //** Sitemap **// jQuery(function($){ $( "#javo-sitemap" ).appendTo( "body" ); $('a[href="#javo-sitemap"]').on('click', function(event) { event.preventDefault(); $('#javo-sitemap').addClass('open'); $('#javo-sitemap > form > input[type="search"]').focus(); }); $('#javo-sitemap, #javo-sitemap button.close').on('click keyup', function(event) { if (event.target == this || event.target.className == 'close' || event.keyCode == 27) { $(this).removeClass('open'); } }); }); </script> <?php ob_end_flush(); }
public function admin() { global $javo_tso; $javo_get_custom_field = $javo_tso->get('custom_field', null); ob_start(); if (!empty($javo_get_custom_field)) { foreach ($javo_get_custom_field as $key => $field) { $javo_field_string = new javo_Array($field); ?> <div class="javo-custom-field-forms ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"> <div class="meta-box-sortables"> <div class="postbox"> <h3 class="ui-widget-header ui-corner-all javo-sortable-handle"> <?php printf("%s [%s]", __('Field Attributes', 'javo_fr'), $javo_field_string->get('label')); ?> </h3> <div class="inside hidden"> <input type="hidden" name="javo_ts[custom_field][<?php echo $key; ?> ][name]" value="<?php echo esc_attr($field['name']); ?> " style="width:500px;"> <dl> <dt><?php _e('Input Label', 'javo_fr'); ?> </dt> <dd> <input type="hidden" name="javo_ts[custom_field][<?php echo $key; ?> ][name]" value="<?php echo $field['name']; ?> "> <input type="hidden" name="javo_ts[custom_field][<?php echo $key; ?> ][order]" data-order> <input type="text" name="javo_ts[custom_field][<?php echo $key; ?> ][label]" value="<?php echo $javo_field_string->get('label'); ?> "> </dd> </dl> <dl> <dt><?php _e('Element Type', 'javo_fr'); ?> </dt> <dd> <select name="javo_ts[custom_field][<?php echo $key; ?> ][type]"> <?php echo $this->insert_option($this->javo_fields, $field['type']); ?> </select> </dd> </dl> <dl class="group-hidden"> <dt><?php _e('Values', 'javo_fr'); ?> </dt> <dd> <div class="description"><small><?php _e('You must use "," as a separator for dropdown, raido, check boxes', 'javo_fr'); ?> </small></div> <input name="javo_ts[custom_field][<?php echo $key; ?> ][value]" value="<?php echo $javo_field_string->get('value'); ?> "> </dd> </dl> <dl class="group-hidden"> <dt><?php _e('CSS Class Name', 'javo_fr'); ?> </dt> <dd> <input name="javo_ts[custom_field][<?php echo $key; ?> ][css]" value="<?php echo $javo_field_string->get('css'); ?> "> </dd> </dl> <dl> <dt><?php _e('Action', 'javo_fr'); ?> </dt> <dd> <a class="button button-cancel javo-remove-custom-field"><?php _e('Remove', 'javo_fr'); ?> </a> </dd> </dl> </div> </div><!-- PostBox End --> </div><!-- PostBox Sortable End --> </div> <?php } // End foreach } // End if return ob_get_clean(); }
<?php global $post; $post_id = $post->ID; if ((int) $post_id > 0) { $header_type = get_post_meta($post_id, "javo_header_type", true); $javo_fancy_opts = @unserialize(get_post_meta($post->ID, "javo_fancy_options", true)); $javo_slider = @unserialize(get_post_meta($post->ID, "javo_slider_options", true)); $javo_fancy = new javo_Array($javo_fancy_opts); switch ($header_type) { case "notitle": ?> <!-- No title --> <?php break; case "fancy": $fancy_title_type = get_post_meta($post_id, "javo_header_fancy_type", true); $header_fancy_css = sprintf("\n\t\t\tposition:relative;\n\t\t\tbackground-color:%s;\n\t\t\tbackground-image:url('%s');\n\t\t\tbackground-repeat:%s;\n\t\t\tbackground-position:%s %s;\n\t\t\theight:%spx;", $javo_fancy->get('bg_color'), $javo_fancy->get('bg_image'), $javo_fancy->get('bg_repeat'), $javo_fancy->get('bg_position_x'), $javo_fancy->get('bg_position_y'), $javo_fancy->get('height')); $header_fancy_title_wrap_css = sprintf("\n\t\t\tleft:0px;\n\t\t\twidth:100%%;\n\t\t\theight:%spx;\n\t\t\tdisplay:table-cell;\n\t\t\tvertical-align:middle;\n\t\t\ttext-align:%s;", $javo_fancy->get('height'), $fancy_title_type); $header_fancy_title_css = sprintf("\n\t\t\tcolor:%s;\n\t\t\tfont-size:%spt;", $javo_fancy->get('title_color'), (int) $javo_fancy->get('title_size', 17)); $header_fancy_subtitle_css = sprintf("\n\t\t\tcolor:%s;\n\t\t\tfont-size:%spt;", $javo_fancy->get('subtitle_color'), (int) $javo_fancy->get('subtitle_size', 12)); ?> <div class="javo_post_header_fancy" style="<?php echo $header_fancy_css; ?> "> <div class="container" style="display:table;"> <div style="<?php echo $header_fancy_title_wrap_css; ?>
<?php /* Template Name: Map (Box Style) */ get_header(); global $javo_tso, $javo_tso_map, $javo_custom_item_tab; $javo_query = new javo_Array($_REQUEST); $javo_map_query = new javo_Array($javo_query->get('filter', array())); $javo_this_map_label = array('category' => $javo_map_query->get('item_category', null) != null ? get_term($javo_map_query->get('item_category'), 'item_category')->name : __('All Category', 'javo_fr'), 'location' => $javo_map_query->get('item_location', null) != null ? get_term($javo_map_query->get('item_location'), 'item_location')->name : __('All Location', 'javo_fr')); $mail_alert_msg = array('to_null_msg' => __('Please, insert recipient`s email address.', 'javo_fr'), 'from_null_msg' => __('Please, insert sender`s email address.', 'javo_fr'), 'subject_null_msg' => __('Please, insert your name.', 'javo_fr'), 'content_null_msg' => __('Please, insert message content.', 'javo_fr'), 'failMsg' => __('Sorry, your message could not be sent.', 'javo_fr'), 'successMsg' => __('Successfully sent!', 'javo_fr'), 'confirmMsg' => __('Do you want to send this message?', 'javo_fr')); // Setup Agrumnets $javo_this_posts_args = array('post_status' => 'publish', 'post_type' => 'item', 'posts_per_page' => -1); // Return Variables $javo_this_return = array(); // Queries Loop $javo_this_posts = get_posts($javo_this_posts_args); foreach ($javo_this_posts as $post) { setup_postdata($post); $javo_meta_query = new javo_get_meta($post->ID); $javo_latlng = @unserialize($javo_meta_query->_get('latlng', array())); $javo_latlng = new javo_ARRAY($javo_latlng); $javo_set_icon = ''; $javo_marker_term_id = wp_get_post_terms($post->ID, 'item_category'); if (!empty($javo_marker_term_id)) { $javo_set_icon = get_option('javo_item_category_' . $javo_marker_term_id[0]->term_id . '_marker', ''); if ($javo_set_icon == '') { $javo_set_icon = $javo_tso->get('map_marker', ''); } } $javo_this_return[$post->ID] = array('post_title' => $post->post_title, 'contents' => javo_str_cut($post->post_content, 300), 'thumbnail' => get_the_post_thumbnail($post->ID, array(50, 50)), 'permalink' => get_permalink($post->ID), 'category' => $javo_meta_query->cat('item_category', __('No Category', 'javo_fr')), 'location' => $javo_meta_query->cat('item_location', __('No Location', 'javo_fr')), 'lat' => $javo_latlng->get('lat'), 'lng' => $javo_latlng->get('lng'), 'icon' => $javo_set_icon, 'phone' => $javo_meta_query->get('phone'), 'mobile' => $javo_meta_query->get('mobile'), 'website' => $javo_meta_query->get('website'), 'address' => $javo_meta_query->get('address'), 'email' => $javo_meta_query->get('email'), 'rating' => $javo_meta_query->get_child_count('ratings'), 'review' => $javo_meta_query->get_child_count('review')); } wp_reset_postdata();