Example #1
0
 public static function get_instance()
 {
     if (self::$instance == null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Example #2
0
    /**
     * Field Render Function.
     *
     * Takes the vars and outputs the HTML for the field in the settings
     *
     * @since AEFramework 1.0.0
     */
    function render()
    {
        $value = wp_parse_args($this->value, array('latitude' => 10.828248, 'longitude' => 106.629127, 'address' => 'Hồ Chí Minh, Việt Nam', 'style' => null));
        extract($value);
        ?>
        <div class="map-setting" id="map-setting-<?php 
        echo $this->field['id'];
        ?>
" data-name="<?php 
        echo $this->field['name'];
        ?>
" >
                <input value="<?php 
        echo $address;
        ?>
" type="text" class="address clearfix" name="address" placeholder="<?php 
        _e("Enter map address", ET_DOMAIN);
        ?>
" />
                <input value="<?php 
        echo $latitude;
        ?>
" type="hidden"  name="latitude" class="latitude" />
                <input value="<?php 
        echo $longitude;
        ?>
" type="hidden"  name="longitude" class="longitude" />
            <span class="group-desc">Select a style.</span><br>
                <?php 
        $style_list = AE_Mapstyle::get_instance()->get_list_style();
        echo '<select id="' . $this->field['id'] . '_map_style" name="style" class="map_style_select" >';
        foreach ($style_list as $key => $value) {
            ?>
                    <option data-code='<?php 
            echo $value['code'];
            ?>
' value="<?php 
            echo $key;
            ?>
" <?php 
            selected($key, $this->value['style']);
            ?>
>
                        <?php 
            echo $value['name'];
            ?>
                    </option>
                <?php 
        }
        echo '</select>';
        ?>
            <style type="text/css">.map{height:300px !important;width:100%!important;margin-top:10px!important;}</style>
            <div id="map-<?php 
        echo $this->field['id'];
        ?>
" class="map" ></div>
        </div>
    <?php 
    }
Example #3
0
 /**
  * register base script
  */
 public function print_scripts()
 {
     $this->add_existed_script('jquery');
     $this->register_script('bootstrap', ae_get_url() . '/assets/js/bootstrap.min.js', array('jquery'), ET_VERSION, true);
     /**
      * bootstrap slider for search form
      */
     $this->register_script('slider-bt', ae_get_url() . '/assets/js/slider-bt.js', array(), true);
     $this->register_script('et-googlemap-api', '//maps.googleapis.com/maps/api/js?sensor=false&signed_in=false', '3.0', true);
     $this->register_script('ae-colorpicker', ae_get_url() . '/assets/js/colorpicker.js', array('jquery'));
     $this->register_script('gmap', ae_get_url() . '/assets/js/gmap.js', array('jquery', 'et-googlemap-api'));
     $this->register_script('marker', ae_get_url() . '/assets/js/marker.js', array('gmap'), true);
     // tam thoi add de xai
     $this->register_script('jquery-validator', ae_get_url() . '/assets/js/jquery.validate.min.js', 'jquery');
     $this->register_script('chosen', ae_get_url() . '/assets/js/chosen.js', 'jquery');
     $this->register_script('jquery.cookie.js', ae_get_url() . '/assets/js/jquery.cookie.js', 'jquery');
     $this->register_script('marionette', ae_get_url() . '/assets/js/marionette.js', array('jquery', 'backbone', 'underscore'), true);
     // ae core js appengine
     $this->register_script('appengine', ae_get_url() . '/assets/js/appengine.js', array('jquery', 'underscore', 'backbone', 'marionette', 'plupload'), true);
     wp_localize_script('chosen', 'raty', array('hint' => array(__('bad', 'aecore-class-ae-framework-backend'), __('poor', 'aecore-class-ae-framework-backend'), __('nice', 'aecore-class-ae-framework-backend'), __('good', 'aecore-class-ae-framework-backend'), __('gorgeous', 'aecore-class-ae-framework-backend'))));
     $adminurl = admin_url('admin-ajax.php');
     if (function_exists('icl_object_id')) {
         $current = ICL_LANGUAGE_CODE;
         $adminurl = admin_url('admin-ajax.php?lang=' . $current);
     }
     $variable = array('ajaxURL' => $adminurl, 'imgURL' => ae_get_url() . '/assets/img/', 'jsURL' => ae_get_url() . '/assets/js/', 'loadingImg' => '<img class="loading loading-wheel" src="' . ae_get_url() . '/assets/img/loading.gif" alt="' . __('Loading...', 'aecore-class-ae-framework-backend') . '">', 'loading' => __('Loading', 'aecore-class-ae-framework-backend'), 'ae_is_mobile' => et_load_mobile() ? 1 : 0, 'plupload_config' => array('max_file_size' => '3mb', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => __('Image Files', 'aecore-class-ae-framework-backend'), 'extensions' => 'jpg,jpeg,gif,png'))), 'security_level' => array('danger' => __("danger", 'aecore-class-ae-framework-backend'), 'minimum' => __("minimum", 'aecore-class-ae-framework-backend'), 'medium' => __("medium", 'aecore-class-ae-framework-backend'), 'strong' => __("strong", 'aecore-class-ae-framework-backend')), 'empty_projects' => __("No projects found", 'aecore-class-ae-framework-backend'), 'empty_profiles' => __("No profiles found", 'aecore-class-ae-framework-backend'), 'payment_was_sent' => __("Payment request was sent.", 'aecore-class-ae-framework-backend'), 'fee_and_tax' => __("For you, without taxes and fees", 'aecore-class-ae-framework-backend'), 'validator_messages' => array('paypal' => __("Email address seems invalid", 'aecore-class-ae-framework-backend'), 'user_email' => __("Email address seems invalid", 'aecore-class-ae-framework-backend'), 'max_symbols_mce' => __("Description should be at least 250 symbols", 'aecore-class-ae-framework-backend'), 'interview_dates' => __("Fill some dates", 'aecore-class-ae-framework-backend'), 'interview_contacts' => __("Fill some contacts", 'aecore-class-ae-framework-backend'), 'max_skills' => __("You've added maximum number of skills", 'aecore-class-ae-framework-backend'), 'old_pass_equal_new_error' => __("Your new password matches the old one!", 'aecore-class-ae-framework-backend')), 'profile_completion' => array('name' => __("Fill your full name", 'aecore-class-ae-framework-backend'), 'location' => __('Fill in the "Location"', 'aecore-class-ae-framework-backend'), 'e_mail' => __('Fill in the "E-Mail"', 'aecore-class-ae-framework-backend'), 'paypal' => __('Fill in the "Paypal Account"', 'aecore-class-ae-framework-backend'), 'phone_no' => __('Fill in the "Phone no"', 'aecore-class-ae-framework-backend'), 'prof_title' => __('Fill in the "Professional Title"', 'aecore-class-ae-framework-backend'), 'hourly_rate' => __('Fill in the "Hourly Rate"', 'aecore-class-ae-framework-backend'), 'skills' => __('Fill in the "Skills"', 'aecore-class-ae-framework-backend'), 'country' => __('Fill in the "Country"', 'aecore-class-ae-framework-backend'), 'about' => __('Fill in the "About"', 'aecore-class-ae-framework-backend')), 'homeURL' => home_url(), 'is_submit_post' => is_page_template('page-post-place.php') ? true : false, 'is_submit_project' => is_page_template('page-submit-project.php') ? true : false, 'is_single' => !is_singular('page') && is_singular() ? true : false, 'max_images' => ae_get_option('max_carousel', 5), 'user_confirm' => ae_get_option('user_confirm') ? 1 : 0, 'max_cat' => ae_get_option('max_cat', 3), 'confirm_delete_bid' => __("Are you sure you want to decline this bid?", 'aecore-class-ae-framework-backend'), 'confirm_message' => __("Are you sure to archive this?", 'aecore-class-ae-framework-backend'), 'confirm_message_delete' => __("Are you sure to delete this?", 'aecore-class-ae-framework-backend'), 'confirm_message_decline' => __("Are you sure to decline this?", 'aecore-class-ae-framework-backend'), 'map_zoom' => ae_get_option('map_zoom_default', 8), 'map_center' => ae_get_option('map_center_default', array('latitude' => 10, 'longitude' => 106)), 'fitbounds' => ae_get_option('fitbounds', ''), 'limit_free_msg' => __("You have reached the maximum number of Free posts. Please select another plan.", 'aecore-class-ae-framework-backend'), 'error' => __("Please fill all require fields.", 'aecore-class-ae-framework-backend'), 'geolocation' => ae_get_option('geolocation', 0), 'date_format' => get_option('date_format'), 'time_format' => get_option('time_format'), 'dates' => array('days' => array(__("Sunday", 'aecore-class-ae-framework-backend'), __("Monday", 'aecore-class-ae-framework-backend'), __("Tuesday", 'aecore-class-ae-framework-backend'), __("Wednesday", 'aecore-class-ae-framework-backend'), __("Thursday", 'aecore-class-ae-framework-backend'), __("Friday", 'aecore-class-ae-framework-backend'), __("Saturday", 'aecore-class-ae-framework-backend'), __("Sunday", 'aecore-class-ae-framework-backend')), 'daysShort' => array(__("Sun", 'aecore-class-ae-framework-backend'), __("Mon", 'aecore-class-ae-framework-backend'), __("Tue", 'aecore-class-ae-framework-backend'), __("Wed", 'aecore-class-ae-framework-backend'), __("Thu", 'aecore-class-ae-framework-backend'), __("Fri", 'aecore-class-ae-framework-backend'), __("Sat", 'aecore-class-ae-framework-backend'), __("Sun", 'aecore-class-ae-framework-backend')), 'daysMin' => array(__("Su", 'aecore-class-ae-framework-backend'), __("Mo", 'aecore-class-ae-framework-backend'), __("Tu", 'aecore-class-ae-framework-backend'), __("We", 'aecore-class-ae-framework-backend'), __("Th", 'aecore-class-ae-framework-backend'), __("Fr", 'aecore-class-ae-framework-backend'), __("Sa", 'aecore-class-ae-framework-backend'), __("Su", 'aecore-class-ae-framework-backend')), 'months' => array(__("January", 'aecore-class-ae-framework-backend'), __("February", 'aecore-class-ae-framework-backend'), __("March", 'aecore-class-ae-framework-backend'), __("April", 'aecore-class-ae-framework-backend'), __("May", 'aecore-class-ae-framework-backend'), __("June", 'aecore-class-ae-framework-backend'), __("July", 'aecore-class-ae-framework-backend'), __("August", 'aecore-class-ae-framework-backend'), __("September", 'aecore-class-ae-framework-backend'), __("October", 'aecore-class-ae-framework-backend'), __("November", 'aecore-class-ae-framework-backend'), __("December", 'aecore-class-ae-framework-backend')), 'monthsShort' => array(__("Jan", 'aecore-class-ae-framework-backend'), __("Feb", 'aecore-class-ae-framework-backend'), __("Mar", 'aecore-class-ae-framework-backend'), __("Apr", 'aecore-class-ae-framework-backend'), __("May", 'aecore-class-ae-framework-backend'), __("Jun", 'aecore-class-ae-framework-backend'), __("Jul", 'aecore-class-ae-framework-backend'), __("Aug", 'aecore-class-ae-framework-backend'), __("Sep", 'aecore-class-ae-framework-backend'), __("Oct", 'aecore-class-ae-framework-backend'), __("Nov", 'aecore-class-ae-framework-backend'), __("Dec", 'aecore-class-ae-framework-backend'))));
     $variable['global_map_style'] = AE_Mapstyle::get_instance()->get_current_style();
     $variable = apply_filters('ae_globals', $variable);
     wp_localize_script('appengine', 'ae_globals', $variable);
     /**
      * html5
      */
     echo '<!--[if lt IE 9]>
             <script src="' . ae_get_url() . '/assets/js/html5.js"></script>
         <![endif]-->';
     // Loads the Internet Explorer specific stylesheet.
     if (!is_admin()) {
         $this->register_style('bootstrap', ae_get_url() . '/assets/css/bootstrap.min.css', array(), '3.0');
     }
 }
Example #4
0
 /**
  * register base script
  */
 public function print_scripts()
 {
     $this->add_existed_script('jquery');
     $this->register_script('bootstrap', ae_get_url() . '/assets/js/bootstrap.min.js', array('jquery'), ET_VERSION, true);
     /**
      * bootstrap slider for search form
      */
     $this->register_script('slider-bt', ae_get_url() . '/assets/js/slider-bt.js', array(), true);
     $this->register_script('et-googlemap-api', '//maps.googleapis.com/maps/api/js?sensor=false&signed_in=false', '3.0', true);
     $this->register_script('ae-colorpicker', ae_get_url() . '/assets/js/colorpicker.js', array('jquery'));
     $this->register_script('gmap', ae_get_url() . '/assets/js/gmap.js', array('jquery', 'et-googlemap-api'));
     $this->register_script('marker', ae_get_url() . '/assets/js/marker.js', array('gmap'), true);
     // tam thoi add de xai
     $this->register_script('jquery-validator', ae_get_url() . '/assets/js/jquery.validate.min.js', 'jquery');
     $this->register_script('chosen', ae_get_url() . '/assets/js/chosen.js', 'jquery');
     $this->register_script('marionette', ae_get_url() . '/assets/js/marionette.js', array('jquery', 'backbone', 'underscore'), true);
     // ae core js appengine
     $this->register_script('appengine', ae_get_url() . '/assets/js/appengine.js', array('jquery', 'underscore', 'backbone', 'marionette', 'plupload'), true);
     wp_localize_script('chosen', 'raty', array('hint' => array(__('bad', ET_DOMAIN), __('poor', ET_DOMAIN), __('nice', ET_DOMAIN), __('good', ET_DOMAIN), __('gorgeous', ET_DOMAIN))));
     $adminurl = admin_url('admin-ajax.php');
     if (function_exists('icl_object_id')) {
         $current = ICL_LANGUAGE_CODE;
         $adminurl = admin_url('admin-ajax.php?lang=' . $current);
     }
     $variable = array('ajaxURL' => $adminurl, 'imgURL' => ae_get_url() . '/assets/img/', 'jsURL' => ae_get_url() . '/assets/js/', 'loadingImg' => '<img class="loading loading-wheel" src="' . ae_get_url() . '/assets/img/loading.gif" alt="' . __('Loading...', ET_DOMAIN) . '">', 'loading' => __('Loading', ET_DOMAIN), 'ae_is_mobile' => et_load_mobile() ? 1 : 0, 'plupload_config' => array('max_file_size' => '3mb', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => __('Image Files', ET_DOMAIN), 'extensions' => 'jpg,jpeg,gif,png'))), 'homeURL' => home_url(), 'is_submit_post' => is_page_template('page-post-place.php') ? true : false, 'is_submit_project' => is_page_template('page-submit-project.php') ? true : false, 'is_single' => !is_singular('page') && is_singular() ? true : false, 'max_images' => ae_get_option('max_carousel', 5), 'user_confirm' => ae_get_option('user_confirm') ? 1 : 0, 'max_cat' => ae_get_option('max_cat', 3), 'confirm_message' => __("Are you sure to archive this?", ET_DOMAIN), 'map_zoom' => ae_get_option('map_zoom_default', 8), 'map_center' => ae_get_option('map_center_default', array('latitude' => 10, 'longitude' => 106)), 'fitbounds' => ae_get_option('fitbounds', ''), 'limit_free_msg' => __("You have reached the maximum number of Free posts. Please select another plan.", ET_DOMAIN), 'error' => __("Please fill all require fields.", ET_DOMAIN), 'geolocation' => ae_get_option('geolocation', 0), 'date_format' => get_option('date_format'), 'time_format' => get_option('time_format'), 'dates' => array('days' => array(__("Sunday", ET_DOMAIN), __("Monday", ET_DOMAIN), __("Tuesday", ET_DOMAIN), __("Wednesday", ET_DOMAIN), __("Thursday", ET_DOMAIN), __("Friday", ET_DOMAIN), __("Saturday", ET_DOMAIN), __("Sunday", ET_DOMAIN)), 'daysShort' => array(__("Sun", ET_DOMAIN), __("Mon", ET_DOMAIN), __("Tue", ET_DOMAIN), __("Wed", ET_DOMAIN), __("Thu", ET_DOMAIN), __("Fri", ET_DOMAIN), __("Sat", ET_DOMAIN), __("Sun", ET_DOMAIN)), 'daysMin' => array(__("Su", ET_DOMAIN), __("Mo", ET_DOMAIN), __("Tu", ET_DOMAIN), __("We", ET_DOMAIN), __("Th", ET_DOMAIN), __("Fr", ET_DOMAIN), __("Sa", ET_DOMAIN), __("Su", ET_DOMAIN)), 'months' => array(__("January", ET_DOMAIN), __("February", ET_DOMAIN), __("March", ET_DOMAIN), __("April", ET_DOMAIN), __("May", ET_DOMAIN), __("June", ET_DOMAIN), __("July", ET_DOMAIN), __("August", ET_DOMAIN), __("September", ET_DOMAIN), __("October", ET_DOMAIN), __("November", ET_DOMAIN), __("December", ET_DOMAIN)), 'monthsShort' => array(__("Jan", ET_DOMAIN), __("Feb", ET_DOMAIN), __("Mar", ET_DOMAIN), __("Apr", ET_DOMAIN), __("May", ET_DOMAIN), __("Jun", ET_DOMAIN), __("Jul", ET_DOMAIN), __("Aug", ET_DOMAIN), __("Sep", ET_DOMAIN), __("Oct", ET_DOMAIN), __("Nov", ET_DOMAIN), __("Dec", ET_DOMAIN))));
     $variable['global_map_style'] = AE_Mapstyle::get_instance()->get_current_style();
     $variable = apply_filters('ae_globals', $variable);
     wp_localize_script('appengine', 'ae_globals', $variable);
     /**
      * html5
      */
     echo '<!--[if lt IE 9]>
             <script src="' . ae_get_url() . '/assets/js/html5.js"></script>
         <![endif]-->';
     // Loads the Internet Explorer specific stylesheet.
     if (!is_admin()) {
         $this->register_style('bootstrap', ae_get_url() . '/assets/css/bootstrap.min.css', array(), '3.0');
     }
 }