public function enqueue_scripts() { global $current_user; ?> <script type="text/javascript" id="current_user"> var currentUser = <?php if (isset($current_user->ID) && $current_user->ID != 0) { echo json_encode($current_user); } else { echo json_encode(array('id' => 0, 'ID' => 0)); } ?> ; var is_mobile = <?php echo json_encode(et_load_mobile()); ?> </script> <?php $this->add_script('et-authentication', ae_get_url() . '/social/js/authentication.js', array('jquery', 'underscore', 'backbone')); if (is_social_connect_page()) { if (!isset($_SESSION)) { ob_start(); @session_start(); } if (isset($_SESSION['et_auth_type'])) { wp_localize_script('et-authentication', 'ae_auth', array('action_auth' => 'et_authentication_' . $_SESSION['et_auth_type'], 'action_confirm' => 'et_confirm_username_' . $_SESSION['et_auth_type'])); } else { wp_redirect(home_url()); exit; } } $this->register_style('social-connect-style', ae_get_url() . '/social/css/default.css'); }
/** * This will output the custom WordPress settings to the live theme's WP head. * * Used by hook: 'wp_head' * * @see add_action('wp_head',$func) * @since MyTheme 1.0 */ public static function header_output() { if (et_load_mobile()) { return; } ?> <!--Customizer CSS--> <style type="text/css" id="header_output"> <?php self::generate_css('#menu-top', 'background-color', 'header_bg_color'); ?> <?php self::generate_css('body', 'background-color', 'body_bg_color'); ?> <?php self::generate_css('footer', 'background-color', 'footer_bg_color'); ?> <?php self::generate_css('.copyright-wrapper', 'background-color', 'btm_footer_color'); ?> <?php ?> .option-search.right input[type="submit"] { color: #fff; } </style> <!--/Customizer CSS--> <?php }
public function print_scripts() { if (!isset($_REQUEST['page'])) { return; } $this->add_existed_script('jquery'); $this->add_existed_script('plupload'); //add de sort category $this->add_existed_script('jquery-ui-sortable'); $this->add_script('lib-nested-sortable', ae_get_url() . '/assets/js/jquery.nestedSortable.js', array('jquery', 'jquery-ui-sortable')); // tam thoi add de xai $this->add_script('jquery-validator', ae_get_url() . '/assets/js/jquery.validate.min.js', 'jquery'); $this->add_script('ae-colorpicker', ae_get_url() . '/assets/js/colorpicker.js', array('jquery')); $this->add_script('marionette', ae_get_url() . '/assets/js/marionette.js', array('jquery', 'underscore', 'backbone')); // control backend user list $this->add_script('gmap', ae_get_url() . '/assets/js/gmap.js', array('et-googlemap-api')); // ae core js appengine $this->add_script('appengine', ae_get_url() . '/assets/js/appengine.js', array('jquery', 'underscore', 'backbone', 'marionette', 'plupload', 'ae-colorpicker')); // control backend user list $this->add_script('backend-user', ae_get_url() . '/assets/js/user-list.js', array('appengine')); // control backend order list $this->add_script('order-list', ae_get_url() . '/assets/js/payment-list.js', array('appengine')); // option settings and save $this->add_script('option-view', ae_get_url() . '/assets/js/option-view.js', array('appengine')); // control option translate $this->add_script('language-view', ae_get_url() . '/assets/js/language-view.js', array('appengine', 'option-view')); // control pack view add delete update pack $this->add_script('pack-view', ae_get_url() . '/assets/js/pack-view.js', array('appengine', 'option-view')); // backend js it should be separate by theme $this->add_script('backend', ae_get_url() . '/assets/js/backend.js', array('appengine')); wp_localize_script('appengine', 'ae_globals', array('ajaxURL' => admin_url('admin-ajax.php'), 'imgURL' => ae_get_url() . '/assets/img/', 'jsURL' => ae_get_url() . '/assets/js/', 'themeImgURL' => get_template_directory_uri() . '/img/', 'loadingImg' => '<img class="loading loading-wheel" src="' . ae_get_url() . '/assets/img/loading.gif" alt="' . __('Loading...', 'aecore-class-ae-page-backend') . '">', 'loading' => __('Loading', 'aecore-class-ae-page-backend'), 'texts' => array('limit_category_level' => __("Categories' level is limited to 3", 'aecore-class-ae-page-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-page-backend'), 'extensions' => 'jpg,jpeg,gif,png'))))); }
/** * This will output the custom WordPress settings to the live theme's WP head. * * Used by hook: 'wp_head' * * @see add_action('wp_head',$func) * @since MyTheme 1.0 */ public static function header_output() { if (et_load_mobile()) { ?> <!--Customizer CSS--> <style type="text/css"> <?php self::generate_css('.post-question-btn, .list-pagination-wrapper ul li span.current, .list-pagination-wrapper ul li a:hover, .post-answers-wrapper .btn-post-answers, .vote-wrapper .number-vote, .form-post-answers input[type="submit"], .form-post-answers a.close-form-post-answers, .group-btn-post .submit-post-question, .group-btn-post .cancel-post-question', 'background-color', 'main_action_color'); ?> <?php self::generate_css('.menu-push .list-categories li a', 'color', 'link_textcolor'); ?> <?php self::generate_css('header, .menu-push', 'background-color', 'header_color'); ?> <?php self::generate_css('.right-sidebar', 'background-color', 'sidebar_color'); ?> <?php self::generate_css('.header-menu', 'background-color', 'header_menus_color'); ?> </style> <!--/Customizer CSS--> <?php } else { ?> <!--Customizer CSS--> <style type="text/css"> <?php self::generate_css('.paginations ul li a:hover, .paginations ul li span.current, .submit-wrapper button, .ask-question, .modal-submit-questions .btn-submit-question, .question-main-content .vote-block span, #upload_images .button-event button', 'background-color', 'main_action_color'); ?> <?php self::generate_css('.q-right-content .question-control ul li a.show-comments.active, a.add-comment, a.hide-comment, span.back a, .term-texts a, .widget a,.question-category a,.copyright a,.widget-menus ul li a', 'color', 'link_textcolor'); ?> <?php self::generate_css('#header,ul.dropdown-profile', 'background-color', 'header_color'); ?> <?php self::generate_css('.right-sidebar', 'background-color', 'sidebar_color'); ?> <?php self::generate_css('.header-menu', 'background-color', 'header_menus_color'); ?> </style> <!--/Customizer CSS--> <?php } }
function fre_change_full_width_template($new_template, $template, $filename) { if ($filename == 'page-full-width.php' && et_load_mobile()) { global $post; $page_on_front = get_option('page_on_front'); if ($page_on_front == $post->ID) { $child_path = get_stylesheet_directory() . '/mobile' . '/page-home.php'; if (file_exists($child_path)) { return $child_path; } return get_template_directory() . '/mobile' . '/page-home.php'; } } return $new_template; }
/** * 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'); } }
/** * 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'); } }
function on_add_styles() { $this->add_existed_style('bootstrap'); // Font Awesome $this->add_style('font-icon', get_template_directory_uri() . '/css/font-awesome.min.css', array(), ET_VERSION); // GG Font $this->add_style('gg-font', '//fonts.googleapis.com/css?family=Raleway:400,300,500,600,700,800', array('bootstrap'), ET_VERSION); // Chosen $this->add_style('chosen', get_template_directory_uri() . '/css/chosen.css', array('bootstrap'), ET_VERSION); //iOS7 switch button $this->add_style('switchery', get_template_directory_uri() . '/css/switchery.css', array('bootstrap'), ET_VERSION); // Add style css for mobile version. if (et_load_mobile()) { $this->add_style('mobile-style', get_template_directory_uri() . '/mobile/css/custom.css', array('bootstrap'), ET_VERSION); return; } // theme custom.css $this->add_style('custom', get_template_directory_uri() . '/css/custom.css', array('bootstrap'), ET_VERSION); // style.css $this->add_style('freelanceengine-style', get_stylesheet_uri(), array('bootstrap'), ET_VERSION); // style.css // $this->add_style('style-theme', get_template_directory_uri() .'/css/style-theme.css' , array( // 'bootstrap' // ) , ET_VERSION); // $this->add_style('ui-element-style', get_template_directory_uri() . '/css/ui-element.css', array( // 'bootstrap' // ) , ET_VERSION); }
background-image: -webkit-linear-gradient(bottom, #3783C5 0%, #3783C5 100%); background-image: linear-gradient(bottom, #3783c5 0%, #3783c5 100%); border-radius: 3px !important; -moz-border-radius: 3px !important; -webkit-border-radius: 3px !important; } .modal-dialog input.error{ color: #FA5858; } </style> <div class="modal fade modal-paymill" id="paymill_modal" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <?php if (!function_exists('et_load_mobile') || !et_load_mobile()) { ?> <div class="modal-header"> <button style="z-index:1000;" data-dismiss="modal" class="close">×</button> <div class="info slogan"> <h4 class="modal-title"><span class="plan_name"></span></h4> <span class="plan_desc"></span> </div> </div> <?php } ?> <div class="modal-body"> <form class="modal-form" id="paymill_form" action="#" method="POST" novalidate="novalidate" autocomplete="on">
/** * render mobile icon, favicon image get from option * @author Dakachi * @return void */ function ae_favicon() { $img = get_template_directory_uri() . "/img/favicon.png"; $options = AE_Options::get_instance(); // save this setting to theme options $mobile_icon = $options->mobile_icon; if (!empty($mobile_icon)) { $img = $mobile_icon['thumbnail'][0]; } echo '<link href="' . $img . '" rel="shortcut icon" type="image/x-icon">'; if (et_load_mobile()) { echo '<link href="' . $img . '" rel="apple-touch-icon" />'; } }
/** * * TEMPLATE LOOP FOR COMMENTS * @param array $comments * @author ThaiNT * @since 1.0 * **/ function qa_comments_loop($child) { global $qa_comment; $qa_comment = QA_Comments::convert($child); if (et_load_mobile()) { get_template_part('mobile/template/item', 'comment'); } else { get_template_part('template/item', 'comment'); } }
public function add_scripts() { if (!et_load_mobile()) { $this->add_script('google_auth', TEMPLATEURL . '/js/googleauth.js', array('jquery'), false, true); wp_localize_script('google_auth', 'google_auth', array('appID' => ae_get_option('gplus_client_id'), 'auth_url' => home_url('?action=authentication'))); } }
function et_template_mobile($template) { global $user_ID, $wp_query, $wp_rewrite; $new_template = $template; // no need to redirect when in admin if (is_admin()) { return $template; } /*** * Detect mobile and redirect to the correlative layout file */ if (et_load_mobile()) { $filename = basename($template); $child_path = get_stylesheet_directory() . '/mobile' . '/' . $filename; $parent_path = get_template_directory() . '/mobile' . '/' . $filename; if (file_exists($child_path)) { $new_template = $child_path; } else { if (file_exists($parent_path)) { $new_template = $parent_path; } else { wp_redirect(home_url()); // $new_template = get_template_directory() . '/mobile/unsupported.php'; } } } return $new_template; }
* Enqueue Styles & Scripts */ if (et_load_mobile()) { add_action('wp_enqueue_scripts', 'qa_mobile_scripts_styles'); } function qa_mobile_scripts_styles() { /* ==== PRINT SCRIPTS ==== */ wp_enqueue_script('mobile-front', TEMPLATEURL . '/mobile/js/front.js', array('jquery', 'underscore', 'backbone', 'site-functions')); wp_enqueue_script('mouseweel', TEMPLATEURL . '/mobile/js/jquery.mouseweel.js', array('jquery')); wp_enqueue_script('mobile-script', TEMPLATEURL . '/mobile/js/script-mobile.js', array('jquery')); wp_enqueue_script('mobile-script', TEMPLATEURL . '/js/libs/adjector.js', array('jquery')); //localize scripts wp_localize_script('mobile-front', 'qa_front', qa_static_texts()); if (is_singular('question')) { wp_enqueue_script('mobile-single-question', TEMPLATEURL . '/mobile/js/single-question.js', array('jquery', 'underscore', 'backbone', 'site-functions', 'mobile-front')); } /* ==== PRINT STYLES ==== */ wp_enqueue_style('mobile-style', TEMPLATEURL . '/mobile/css/main.css', array('bootstrap')); } /** * Redirect to reset password page * @since 1.6 * @author tatthien */ if (et_load_mobile()) { if (isset($_GET['user_login']) && isset($_GET['key']) && !is_user_logged_in()) { wp_redirect(et_get_page_link('reset-pass', array('user' => $_GET['user_login'], 'key' => $_GET['key']))); return exit; } }
public function create() { try { $args = $_POST['content']; global $current_user; if (!is_user_logged_in()) { throw new Exception(__("You must log in to post question.", ET_DOMAIN)); } if (isset($args['post_title']) && $args['post_title'] != strip_tags($args['post_title'])) { throw new Exception(__("Post title should not contain any HTML Tag.", ET_DOMAIN)); } if (isset($args['qa_nonce']) && wp_verify_nonce($args['qa_nonce'], 'insert_comment')) { if (!qa_user_can('add_comment')) { throw new Exception(__("You don't have enough point to add a comment.", ET_DOMAIN)); } $args['comment_content'] = $args['post_content']; $args['comment_author'] = $current_user->user_login; $args['comment_author_email'] = $current_user->user_email; $result = QA_Comments::insert($args); $comment = QA_Comments::convert(get_comment($result)); if (is_wp_error($result)) { $resp = array('success' => false, 'msg' => __('An error occur when created comment.', ET_DOMAIN)); } else { $resp = array('success' => true, 'msg' => __('Comment has been created successfully.', ET_DOMAIN), 'data' => $comment); } } elseif (isset($args['qa_nonce']) && wp_verify_nonce($args['qa_nonce'], 'insert_answer')) { $result = QA_Answers::insert_answer($args['post_parent'], $args['post_content']); QA_Answers::update_field($result, "et_vote_count", 0); $answer = QA_Answers::convert(get_post($result)); if (is_wp_error($result)) { $resp = array('success' => false, 'msg' => __('An error occur when created answer.', ET_DOMAIN)); } else { $msg = ae_get_option('pending_answers') && !(current_user_can('manage_options') || qa_user_can('approve_answer')) ? __('Your answer has been created successfully and need to be approved by Admin before displayed!', ET_DOMAIN) : __('Answer has been created successfully.', ET_DOMAIN); $resp = array('success' => true, 'redirect' => get_permalink($answer->post_parent), 'msg' => $msg, 'data' => $answer); } } elseif (isset($args['qa_nonce']) && wp_verify_nonce($args['qa_nonce'], 'insert_question')) { //if option for captcha is enable if (ae_get_option('gg_question_captcha') && !et_load_mobile()) { $captcha = isset($args['captcha']) ? $args['captcha'] : ''; //verify captcha ae_verify_captcha($captcha, __('Please enter a valid captcha!', ET_DOMAIN)); } $cats = array('qa_tag' => isset($args['tags']) ? $args['tags'] : array(), 'question_category' => $args['question_category']); $status = ae_get_option("pending_questions") && !current_user_can('manage_options') ? "pending" : "publish"; $result = QA_Questions::insert_question($args['post_title'], $args['post_content'], $cats, $status); QA_Questions::update_field($result, "et_vote_count", 0); QA_Questions::update_field($result, "et_answers_count", 0); $post = QA_Questions::convert(get_post($result)); $msg = ae_get_option("pending_questions") && !current_user_can('manage_options') ? __('Your question has been created successfully. It\'ll appear right after being approved by admin.', ET_DOMAIN) : __('Question has been created successfully.', ET_DOMAIN); $redirect = ae_get_option("pending_questions") && !current_user_can('manage_options') ? home_url() : get_permalink($result); if (is_wp_error($result)) { $resp = array('success' => false, 'msg' => __('An error occur when created question.', ET_DOMAIN)); } else { $resp = array('success' => true, 'redirect' => $redirect, 'msg' => $msg, 'data' => $post); } } else { throw new Exception("Error Processing Request", 1); } } catch (Exception $e) { $resp = array('success' => false, 'msg' => $e->getMessage()); } return $resp; }
public static function insert($data) { $meta_data = array('et_votes', 'et_votes_count', 'et_answer_authors', 'et_answers_count'); //strip all tag for mobile if (et_load_mobile()) { $data['comment_content'] = strip_tags($data['comment_content'], '<p><br>'); } $result = wp_insert_comment($data); foreach ($meta_data as $key => $value) { add_comment_meta($result, $value, ''); } return $result; }
?> <div class="paginations-wrapper" > <?php ae_comments_pagination($comment_pages, $paged, $query_args); ?> </div> <?php } ?> <?php echo '<script type="json/data" class="postdata" > ' . json_encode($messagedata) . '</script>'; ?> </div> </div> <?php if (!et_load_mobile()) { ?> <div class="col-md-4 col-xs-12 workplace-project-details"> <div class="content-require-project"> <?php if (fre_access_workspace($post)) { $project_link = get_permalink($post->ID); echo '<a style="font-weight:600;" href="' . add_query_arg(array('workspace' => 1), $project_link) . '">' . __("Open workspace", 'project-report') . ' <i class="fa fa-arrow-right"></i> </a>'; } ?> <h4><?php _e('Project description:', 'project-report'); ?> </h4> <?php
function et_template_mobile($template) { global $user_ID, $wp_query, $wp_rewrite; $new_template = $template; // no need to redirect when in admin if (is_admin()) { return $template; } /*** * Detect mobile and redirect to the correlative layout file */ $filename = basename($template); if (et_load_mobile()) { $child_path = get_stylesheet_directory() . '/mobile' . '/' . $filename; $parent_path = get_template_directory() . '/mobile' . '/' . $filename; if (file_exists($child_path)) { $new_template = $child_path; } else { if (file_exists($parent_path)) { $new_template = $parent_path; } else { wp_redirect(home_url()); // $new_template = get_template_directory() . '/mobile/unsupported.php'; } } if (!in_array($filename, array('header.php', 'footer.php'))) { // if (is_page_template('page-login.php')) { // $new_template = get_template_directory() . '/mobile/page-login.php'; // } else if (is_page_template('page-register.php')) { // $new_template = get_template_directory() . '/mobile/page-register.php'; // } } } return apply_filters('et_template_mobile', $new_template, $template, $filename); }
public function add_scripts() { //session_start(); //if( !is_page_template( 'page-social-connect.php' ) && ( !isset($_SESSION['et_auth_type']) || $_SESSION['et_auth_type'] != "google" ) ){ if (!et_load_mobile()) { $this->add_script('google_auth', TEMPLATEURL . '/js/googleauth.js', array('jquery'), false, true); wp_localize_script('google_auth', 'google_auth', array('appID' => ae_get_option('gplus_client_id'), 'auth_url' => home_url('?action=authentication'))); } }
public static function convert($post) { global $current_user; $result = self::get_instance()->_convert($post); $parent = get_post($result->post_parent); $result->et_vote_up_authors = is_array($result->et_vote_up_authors) ? $result->et_vote_up_authors : array(); $result->et_vote_down_authors = is_array($result->et_vote_down_authors) ? $result->et_vote_down_authors : array(); $result->voted_down = in_array($current_user->ID, (array) $result->et_vote_down_authors); $result->voted_up = in_array($current_user->ID, (array) $result->et_vote_up_authors); $result->et_vote_count = get_post_meta($post->ID, 'et_vote_count', true) ? get_post_meta($post->ID, 'et_vote_count', true) : 0; $result->user_badge = qa_user_badge($post->post_author, false, et_load_mobile()); $result->et_answers_count = $result->et_answers_count ? $result->et_answers_count : 0; $result->et_answer_authors = is_array($result->et_answer_authors) ? $result->et_answer_authors : array(); $result->avatar = et_get_avatar($result->post_author, 30); $result->new_nonce = wp_create_nonce('insert_comment'); $result->human_date = et_the_time(strtotime($result->post_date)); $result->content_filter = apply_filters('the_content', $result->post_content); $result->content_edit = et_the_content_edit($post->post_content); $result->parent_author = $parent->post_author; $result->comments = sprintf(__('Comment(%d) ', ET_DOMAIN), $result->comment_count); $result->author_name = get_the_author_meta('display_name', $post->post_author); $result->author_url = get_author_posts_url($post->post_author); $result->reported = in_array($current_user->ID, (array) get_post_meta($post->ID, 'et_users_report', true)); return $result; }
public function on_add_styles() { parent::on_add_styles(); $this->add_style('bootstrap', TEMPLATEURL . '/css/libs/bootstrap.min.css'); $this->add_style('font-awesome', TEMPLATEURL . '/css/libs/font-awesome.min.css'); if (et_load_mobile()) { return; } else { $this->add_style('main-style', TEMPLATEURL . '/css/main.css', array('bootstrap')); $this->add_style('editor-style', TEMPLATEURL . '/css/editor.css'); $this->add_style('push-menu', TEMPLATEURL . '/css/libs/push-menu.css'); $this->add_style('chosen', TEMPLATEURL . '/css/libs/chosen.css'); $this->add_style('custom-style', TEMPLATEURL . '/css/custom.css'); if (is_singular('question')) { $this->add_style('qa-shstyle', TEMPLATEURL . '/css/shCoreDefault.css'); } $this->add_style('style', get_stylesheet_uri()); } do_action('qa_after_print_styles'); }