Example #1
0
    /**
     * Outputs the HTML for this widget.
     *
     * @param array  An array of standard parameters for widgets in this theme
     * @param array  An array of settings for this widget instance
     * @return void Echoes it's output
     **/
    function widget($args, $instance)
    {
        if (et_is_mobile() && !et_is_tablet()) {
            extract($instance);
            // use shorcode don't show full market.
            // if want to show market, have to fin solution implement map-mobile.js file tool
            echo do_shortcode('[ce_map address = "' . $center . '" zoom ="' . $zoom . '"  h="' . apply_filters('height_map_mobile', $height) . 'px" ]');
            return;
        }
        if (is_singular(CE_AD_POSTTYPE)) {
            $instance['is_single_ad'] = 1;
        }
        if (!isset($instance['enable_zoom'])) {
            $instance['enable_zoom'] = 0;
        }
        if (!isset($instance['auto_save'])) {
            $instance['auto_save'] = 0;
        }
        $instance['heading'] = __("<p>There are %s ads on this location:</p>", ET_DOMAIN);
        wp_parse_args($instance, array('height' => '350', 'width' => '420', 'enable_zoom' => false));
        wp_enqueue_script('ce_admap', plugin_dir_url(__FILE__) . '/js/ce_admap.js', array('jquery', 'backbone', 'underscore', 'ce', 'front'), CE_VERSION, true);
        wp_localize_script('ce_admap', 'ce_admap_widget', $instance);
        extract($args, EXTR_SKIP);
        echo $before_widget;
        if ($instance['title'] != '') {
            echo $before_title;
            echo $instance['title'];
            // Can set this with a widget option, or omit altogether
            echo $after_title;
        }
        if (isset($instance['width']) && is_numeric(trim($instance['width']))) {
            $instance['width'] = $instance['width'] . 'px';
        } else {
            $instance['width'] = '100%';
        }
        ?>
        <div class="admap">

            <div id="ce_admap" class="ce_admap" style="width : <?php 
        echo $instance['width'];
        ?>
 ; height : <?php 
        echo $instance['height'];
        ?>
px">
            </div>
            <?php 
        if (current_user_can('manage_options') && !et_is_mobile()) {
            $ajax_nonce = wp_create_nonce("save-sidebar-widgets");
            ?>

            <form style=" display:none; bottom: 5px !important;background : #dfdfdf; padding : 5px;">

                <input id="<?php 
            echo $this->get_field_id('enable_zoom');
            ?>
" name="<?php 
            echo $this->get_field_name('enable_zoom');
            ?>
" type="hidden" value="<?php 
            echo $instance['enable_zoom'];
            ?>
">
                <input id="<?php 
            echo $this->get_field_id('auto_save');
            ?>
" name="<?php 
            echo $this->get_field_name('auto_save');
            ?>
" type="hidden" value="<?php 
            echo $instance['auto_save'];
            ?>
">


                <input name="id_base" type="hidden" value="<?php 
            echo $this->id_base;
            ?>
">
                <input name="widget-id" type="hidden" value="<?php 
            echo $this->id;
            ?>
">
                <input name="savewidgets" type="hidden" value="<?php 
            echo $ajax_nonce;
            ?>
">


                <!-- <input size="3" id="<?php 
            echo $this->get_field_id('width');
            ?>
" name="<?php 
            echo $this->get_field_name('width');
            ?>
" type="hidden" value="<?php 
            echo $instance['width'];
            ?>
"> -->
                <input size="3" id="<?php 
            echo $this->get_field_id('height');
            ?>
" name="<?php 
            echo $this->get_field_name('height');
            ?>
" type="hidden" value="<?php 
            echo $instance['height'];
            ?>
">
                <input class="widefat" id="<?php 
            echo $this->get_field_id('title');
            ?>
" name="<?php 
            echo $this->get_field_name('title');
            ?>
" type="hidden" value="<?php 
            echo $instance['title'];
            ?>
">

                <input class="lat" id="<?php 
            echo $this->get_field_id('lat');
            ?>
" name="<?php 
            echo $this->get_field_name('lat');
            ?>
" type="hidden" value="<?php 
            echo $instance['lat'];
            ?>
" />
                <input class="lng"  id="<?php 
            echo $this->get_field_id('lng');
            ?>
" name="<?php 
            echo $this->get_field_name('lng');
            ?>
" type="hidden" value="<?php 
            echo $instance['lng'];
            ?>
" />
                <!-- Setting center -->
                <label for=""><?php 
            _e("Center:", ET_DOMAIN);
            ?>
</label>
                <input title="<?php 
            _e("Change your map center", ET_DOMAIN);
            ?>
" class="widefat center" id="<?php 
            echo $this->get_field_id('center');
            ?>
" name="<?php 
            echo $this->get_field_name('center');
            ?>
" type="text" value="<?php 
            echo $instance['center'];
            ?>
"> 
                <!-- Setting map zoom -->
                <label for=""><?php 
            _e("Default Zoom:", ET_DOMAIN);
            ?>
</label>
                <input class="zoom widefat" id="<?php 
            echo $this->get_field_id('zoom');
            ?>
" name="<?php 
            echo $this->get_field_name('zoom');
            ?>
" type="text" value="<?php 
            echo $instance['zoom'];
            ?>
">           

            </form>

            <?php 
        }
        ?>
            <a style="display : none;" href="#" class="enlarge" title="<?php 
        _e("Full Screen", ET_DOMAIN);
        ?>
"><span  data-icon="`" class="map-icon" ></span></a>
        </div>

    <?php 
        $this->template();
        echo $after_widget;
    }
Example #2
0
    function render_field_edit($field, $seller)
    {
        if (empty($field)) {
            return '';
        }
        $type = $field['field_type'];
        $required = isset($field['field_required']) && $field['field_required'] == 1 ? ' required' : '';
        $value = '';
        if ($seller) {
            $value = get_user_meta($seller->ID, $field['field_name'], true);
        }
        $values = get_option('ce_sf_' . $field['field_name'], array());
        $name = $field['field_name'];
        $class = et_is_mobile() ? ' post-new-classified ' : '';
        switch ($type) {
            case 'radio':
                if ($seller) {
                    $value = get_user_meta($seller->ID, $field['field_name'], true);
                }
                // make sure true to get defautl type
                if (!empty($values)) {
                    ?>
						<div class="control-group form-group ce-sf-item ce-sf-item ce-sf-item-<?php 
                    echo $type . $class;
                    ?>
">
			          		<label class="control-label customize_text" for="email"><?php 
                    echo $field['field_label'];
                    ?>
 <br /> <span class="sub-title customize_text"> <?php 
                    echo $field['field_des'];
                    ?>
</span> </label>
			          		<div class="controls">
			          			<ul><?php 
                    foreach ($values as $key => $val) {
                        $checked = $key == $value ? ' checked ="checked" ' : '';
                        echo '<li><input id="' . $name . $key . '"' . $checked . $required . ' type="radio" name="' . $field['field_name'] . '" value ="' . $key . '"><label for="' . $field['field_name'] . $key . '">' . $val . '</label></li>';
                    }
                    echo '</ul>';
                    echo '</div>';
                    echo '</div>';
                }
                break;
            case 'checkbox':
                $value = array();
                if ($seller) {
                    $value = get_user_meta($seller->ID, $field['field_name'], true);
                }
                // make sure true to get defautl type
                if (!empty($values)) {
                    ?>
						<div class="control-group form-group ce-sf-item ce-sf-item-<?php 
                    echo $type . $class;
                    ?>
">
			          		<label class="control-label customize_text" for="email"><?php 
                    echo $field['field_label'];
                    ?>
 <br /> <span class="sub-title customize_text"> <?php 
                    echo $field['field_des'];
                    ?>
</span></label>
			          		<div class="controls">
						      	<?php 
                    echo '<ul>';
                    foreach ($values as $key => $val) {
                        $checked = '';
                        if (is_array($value)) {
                            $checked = in_array($key, $value) ? ' checked ="checked"' : '';
                        }
                        echo '<li><input id="' . $name . $key . '" ' . $checked . $required . '  type="checkbox" name="' . $name . '" value ="' . $key . '"> &nbsp; &nbsp; <label for="' . $name . $key . '">' . $val . '</label> &nbsp;  &nbsp; &nbsp; </li>';
                    }
                    echo '<ul>';
                    echo '</div>';
                    echo '</div>';
                }
                break;
            case 'select':
                $value = '';
                if ($seller) {
                    $value = get_user_meta($seller->ID, $field['field_name'], true);
                }
                if (!empty($values)) {
                    ?>
					<div class="control-group form-group ce-sf-item ce-sf-item-<?php 
                    echo $type . $class;
                    ?>
">
			          	<label class="control-label customize_text" for="email"><?php 
                    echo $field['field_label'];
                    ?>
 <br /> <span class="sub-title customize_text"> <?php 
                    echo $field['field_des'];
                    ?>
</span></label>
			          	<div class="controls">
				          	<?php 
                    echo '<select name="' . $name . '" class="sf-select">';
                    foreach ($values as $key => $val) {
                        echo '<option  ' . selected($value, $key, false) . ' name="' . $name . '" value ="' . $key . '">' . $val . '</option>';
                    }
                    echo '</select>';
                    echo '</div>';
                    echo '</div>';
                }
                # code...
                break;
            case 'date':
                if (empty($value)) {
                    $time = time();
                } else {
                    $time = strtotime($value);
                }
                ?>

				<div class="control-group form-group ce-sf-item ce-sf-item-<?php 
                echo $type . $class;
                ?>
">
		          	<label class="control-label customize_text" for="email"><?php 
                echo $field['field_label'];
                ?>
 <br /> <span class="sub-title customize_text"> <?php 
                echo $field['field_des'];
                ?>
</span></label>
		          	<div class="controls">
		            	<input type="text" id="<?php 
                echo $field['field_name'];
                ?>
"  <?php 
                echo $required;
                ?>
 placeholder="<?php 
                echo $field['field_pholder'];
                ?>
" class="csf-date-field ce_field_datepicker" value="<?php 
                echo date(get_option('date_format'), $time);
                ?>
" name="<?php 
                echo $field['field_name'];
                ?>
" class="input-xlarge" >
		          	</div>
		        </div>
		        <?php 
                break;
            default:
                ?>
				<div class="control-group form-group ce-sf-item ce-sf-item-<?php 
                echo $type . $class;
                ?>
">
		          	<label class="control-label customize_text" for="email"><?php 
                echo $field['field_label'];
                ?>
 <br /> <span class="sub-title customize_text"> <?php 
                echo $field['field_des'];
                ?>
</span></label>
		          	<div class="controls">
		            	<input type="text" id="<?php 
                echo $field['field_name'];
                ?>
"  <?php 
                echo $required;
                ?>
  placeholder="<?php 
                echo $field['field_pholder'];
                ?>
" value="<?php 
                echo $value;
                ?>
" name="<?php 
                echo $field['field_name'];
                ?>
" class="input-xlarge <?php 
                echo $required;
                ?>
" >
		          	</div>
		        </div>
				<?php 
                # code...
                break;
        }
    }
<?php

$general_opts = new ET_GeneralOptions();
$website_logo = $general_opts->get_website_logo();
?>
<div class="modal-job modal modal-login modal-stripe" id="stripe_modal">
	<div class="edit-job-inner">
		<?php 
if (!function_exists('et_is_mobile') || !et_is_mobile()) {
    ?>
		<div class="stripe-header bg-main-header">
			<div class="logo"><img src="<?php 
    echo $website_logo[0];
    ?>
" height="50" /></div>
			<div class="info slogan">
      			<span class="plan_name">{$plan_name}</span> <br/>
      			<span class="plan_desc">{$plan_description}</span>
    		</div>
		</div>
		<?php 
}
?>
		<form class="modal-form" id="stripe_form" novalidate="novalidate" autocomplete="on">
			<div class="content clearfix">
				<div class="form-item">
					<div class="label">
						<?php 
_e('Card number:', ET_DOMAIN);
?>
					</div>
Example #4
0
 function load_form_paymill()
 {
     $is_mobile = et_is_mobile();
     if ($is_mobile) {
         return;
     }
     include_once dirname(__FILE__) . '/form-template.php';
 }
Example #5
0
    function map_add_template()
    {
        $is_mobile = et_is_mobile();
        if (et_is_mobile() && !et_is_table()) {
            return;
        }
        if (!is_page_template('page-post-ad.php')) {
            ?>
            <div class="modal-map modal-dialog" id="modal_ad_map" style="" >
                <div class="header-filter">
                    <div class="main-center f-left-all">
                        <div class="location map-item">
                            <input type="text" name="ad_location" class="search-box ad-searchbox input-search-box border-radius" placeholder="Enter a location ..." value="">
                            <span class="icon" data-icon="@"></span>
                        </div>
                        <div class="form-item map-item">
                            <div class="select-style btn-background border-radius et-button-select">
                                <?php 
            $cats = ET_AdCatergory::get_category_list();
            if ($cats) {
                echo '<select name="cateogory">';
                echo '<option value="none" >' . __('All Categories', ET_DOMAIN) . '</option>';
                foreach ($cats as $key => $cat) {
                    echo '<option value = "' . $cat->slug . '">' . $cat->name . ' </option>';
                }
                echo '</select>';
            }
            ?>
                            </div>
                        </div>

                    </div>
                </div>
                <div  id="modal_map_inner" style="" ></div>
                <button class="close" type="button">&times;</button>
                <div id="map-overlay" style="display:none;" >
                    <div id="map-fadingBarsG" class="map-fadingBar">
                        <div id="map-fadingBarsG_1" class="fadingBarsG">
                        </div>
                        <div id="map-fadingBarsG_2" class="fadingBarsG">
                        </div>
                        <div id="map-fadingBarsG_3" class="fadingBarsG">
                        </div>
                        <div id="map-fadingBarsG_4" class="fadingBarsG">
                        </div>
                        <div id="map-fadingBarsG_5" class="fadingBarsG">
                        </div>
                        <div id="map-fadingBarsG_6" class="fadingBarsG">
                        </div>
                        <div id="map-fadingBarsG_7" class="fadingBarsG">
                        </div>
                        <div id="map-fadingBarsG_8" class="fadingBarsG">
                        </div>
                    </div>
                </div>
            </div>
            <?php 
        }
    }
Example #6
0
 /**
  * Load form html of stripe.
  */
 function stripe_form_html()
 {
     $is_mobile = et_is_mobile();
     if ($is_mobile) {
         return;
     }
     include_once dirname(__FILE__) . '/form-template.php';
 }