/** * filter payment setup response if free return direct link to process payment */ function ce_payment_setup($response, $paymentType, $order) { $order_pay = $order->generate_data_to_pay(); if ($order_pay['total'] <= 0) { //$session = et_read_session(); $ad_id = $order_pay['product_id']; $response = array('success' => true, 'data' => array('ACK' => true, 'url' => et_get_page_link('process-payment', array('paymentType' => 'coupon', 'ad_id' => $ad_id)))); update_post_meta($order_pay['ID'], 'et_order_gateway', 'cash'); et_update_post_field($ad_id, 'ad_paid', 1); $o = (array) et_get_post_field($ad_id, 'ad_order'); if (empty($o)) { $o = array(); } $o[] = $order_pay['ID']; et_update_post_field($ad_id, 'ad_order', $o); } if ((isset($response['success']) && $response['success'] || isset($response['ACK']) && $response['ACK'] == 'Success') && isset($_REQUEST['coupon_code'])) { // update coupon used. global $user_ID; $coupon_code = trim($_REQUEST['coupon_code']); $coupon_data = $this->generate_coupon_response($coupon_code); $pre = intval(get_user_meta($user_ID, 'ce_coupon_used_' . $coupon_code, true)); $pre++; update_user_meta($user_ID, 'ce_coupon_used_' . $coupon_code, $pre); $used_time = intval($coupon_data['have_been_used']); $used_time++; update_post_meta($coupon_data['ID'], 'ce_coupon_have_been_used', $used_time); } return $response; }
function add_return_param() { global $wp_rewrite; $link = et_get_page_link('process-payment', array('paymentType' => $this->_payment_type)); foreach ($this->_settings as $key => $value) { $this->_settings[$key] = $link; } return $this->_settings; }
public function __construct($type, $social_option, $labels = array()) { $this->social_type = $type; $this->social_option = $social_option; $this->auth_url = add_query_arg('type', $this->social_type, et_get_page_link('social-connect')); $this->labels = $labels; $this->add_action('wp_enqueue_scripts', 'enqueue_scripts'); $this->add_action('template_redirect', 'social_redirect'); $this->add_ajax('et_authentication_' . $type, 'authenticate_user'); $this->add_ajax('et_confirm_username_' . $type, 'confirm_username'); }
/** * user forgot pass mail * @param Int $user_id * @param String $key Activate key */ function forgot_mail($user_id, $key) { $user = new WP_User($user_id); $user_email = $user->user_email; $user_login = $user->user_login; $message = ae_get_option('forgotpass_mail_template'); $activate_url = add_query_arg(array('user_login' => $user_login, 'key' => $key), et_get_page_link('reset-pass')); $activate_url = '<a href="' . $activate_url . '">' . __("Activate Link", ET_DOMAIN) . '</a>'; $message = str_ireplace('[activate_url]', $activate_url, $message); if (is_multisite()) { $blogname = $GLOBALS['current_site']->site_name; } else { $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); } $subject = sprintf(__('[%s] Password Reset', ET_DOMAIN), $blogname); $subject = apply_filters('et_retrieve_password_title', $subject); $this->wp_mail($user_email, $subject, $message, array('user_id' => $user_id)); }
/** * filter payment setup response if free return direct link to process payment */ function je_payment_setup($response, $paymentType, $order) { $order_pay = $order->generate_data_to_pay(); if ($order_pay['total'] <= 0) { //$session = et_read_session(); $job_id = $order_pay['product_id']; $response = array('success' => true, 'data' => array('ACK' => true, 'url' => et_get_page_link('process-payment', array('paymentType' => 'coupon', 'job_id' => $job_id)))); update_post_meta($order_pay['ID'], 'et_order_gateway', 'cash'); et_update_post_field($job_id, 'job_paid', 1); $o = et_get_post_field($job_id, 'job_order'); if (empty($o)) { $o = array(); } $o[] = $order_pay['ID']; et_update_post_field($job_id, 'job_order', $o); } return $response; }
function setup_payment($response, $paymentType, $order) { if ($paymentType == 'STRIPE') { $order_pay = $order->generate_data_to_pay(); // echo "<pre>"; // print_r($order_pay) ; // echo "</pre>"; $token = $_POST['token']; $job_id = $order_pay['product_id']; $stripe = $this->get_api(); global $user_email; try { Stripe::setApiKey($stripe['secret_key']); $customer = Stripe_Customer::create(array('card' => $token, 'description' => 'Customer from ' . home_url(), 'email' => $user_email)); $customer_id = $customer->id; $charge = Stripe_Charge::create(array('amount' => $order_pay['total'] * 100, 'currency' => $order_pay['currencyCodeType'], 'customer' => $customer_id)); $value = $charge->__toArray(); $id = $value['id']; $token = md5($id); $order->set_payment_code($token); $order->set_payer_id($id); $order->update_order(); $returnURL = et_get_page_link('process-payment', array('paymentType' => 'stripe', 'token' => $token)); $response = array('success' => true, 'data' => array('url' => $returnURL), 'paymentType' => 'stripe'); } catch (Exception $e) { $value = $e->getJsonBody(); $response = array('success' => false, 'msg' => $value['error']['message'], 'paymentType' => 'stripe'); } } return $response; }
/** * ajax callback process bid escrow and send redirect url to client * * @author Dakachi */ function fre_escrow_bid() { global $user_ID; $error = array('success' => false, 'msg' => __('Invalid bid', ET_DOMAIN)); if (!isset($_REQUEST['bid_id'])) { wp_send_json($error); } $bid_id = $_REQUEST['bid_id']; $bid = get_post($bid_id); // check bid is valid if (!$bid || is_wp_error($bid) || $bid->post_type != BID) { wp_send_json($error); } // currency settings $currency = ae_get_option('content_currency'); $currency = $currency['code']; $bid_budget = get_post_meta($bid_id, 'bid_budget', true); // get commission settings $commission = ae_get_option('commission'); $commission_fee = $commission; // caculate commission fee by percent $commission_type = ae_get_option('commission_type'); if ($commission_type == 'percent') { $commission_fee = $bid_budget * $commission / 100; } $payer_of_commission = ae_get_option('payer_of_commission', 'project_owner'); if ($payer_of_commission == 'project_owner') { $total = (double) $bid_budget + (double) $commission_fee; } else { $total = $bid_budget; $bid_budget = (double) $total - (double) $commission_fee; } $receiver = get_user_meta($bid->post_author, 'paypal', true); // paypal adaptive process payment and send reponse to client $ppadaptive = AE_PPAdaptive::get_instance(); // get paypal adaptive settings $ppadaptive_settings = ae_get_option('escrow_paypal'); // the admin's paypal business account $primary = $ppadaptive_settings['business_mail']; // get from setting $feesPayer = $ppadaptive_settings['paypal_fee']; /** * paypal adaptive order data */ $order_data = array('actionType' => 'PAY_PRIMARY', 'returnUrl' => et_get_page_link('process-accept-bid', array('paymentType' => 'paypaladaptive')), 'cancelUrl' => et_get_page_link('process-accept-bid', array('paymentType' => 'paypaladaptive')), 'currencyCode' => $currency, 'feesPayer' => $feesPayer, 'receiverList.receiver(0).amount' => $total, 'receiverList.receiver(0).email' => $primary, 'receiverList.receiver(0).primary' => true, 'receiverList.receiver(1).amount' => $bid_budget, 'receiverList.receiver(1).email' => $receiver, 'receiverList.receiver(1).primary' => false, 'requestEnvelope.errorLanguage' => 'en_US'); //dinhle1987-pers@yahoo.com // dinhle1987-pers2@yahoo.com $response = $ppadaptive->Pay($order_data); if (is_array($response) && isset($response['success']) && !$response['success']) { wp_send_json(array('success' => false, 'msg' => $response['msg'])); } // create order $order_post = array('post_type' => 'fre_order', 'post_status' => 'pending', 'post_parent' => $bid_id, 'post_author' => $user_ID, 'post_title' => 'Pay for accept bid', 'post_content' => 'Pay for accept bid ' . $bid_id); if (strtoupper($response->responseEnvelope->ack) == 'SUCCESS') { $order_id = wp_insert_post($order_post); update_post_meta($order_id, 'fre_paykey', $response->payKey); update_post_meta($order_id, 'gateway', 'PPadaptive'); update_post_meta($bid_id, 'fre_bid_order', $order_id); update_post_meta($bid_id, 'fre_paykey', $response->payKey); et_write_session('payKey', $response->payKey); et_write_session('order_id', $order_id); et_write_session('bid_id', $bid_id); et_write_session('ad_id', $bid->post_parent); $response->redirect_url = $ppadaptive->paypal_url . $response->payKey; wp_send_json($response); } else { wp_send_json(array('success' => false, 'msg' => $response->error[0]->message)); } }
</p> <?php } ?> </div> <div class="clearfix"></div> <button type="submit" class="btn-submit btn-sumary btn-sub-create" <?php if ($wp_query->found_posts == 0) { echo 'disabled="disabled"'; } ?> > <?php _e('Invite', 'modal-invite'); ?> </button> </form> <?php } else { echo '<p class="lead text-info">'; _e("Currently, you do not have any project available to invite this user.", 'modal-invite'); echo ' <a href="' . et_get_page_link('submit-project') . '" >' . __("Create a project now", 'modal-invite') . '</a>'; echo '</p>'; } ?> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> <?php wp_reset_query();
?> " /> <i class="fa fa-chevron-circle-right"></i> </form> </div> </div><!-- END SELECT-CATEGORY --> <div class="row question-filter"> <div class="col-md-6 col-xs-6 sort-questions"> <!-- order by --> <ul> <li> <a class="<?php echo !isset($_GET['sort']) ? 'active' : ''; ?> " href="<?php echo et_get_page_link("tags"); ?> "><?php _e("Name", ET_DOMAIN); ?> </a> </li> <li> <a class="<?php echo isset($_GET['sort']) ? 'active' : ''; ?> " href="<?php echo add_query_arg(array('sort' => 'popular')); ?> "><?php _e("Popular", ET_DOMAIN);
function filter_link_redirect_register($result) { if (!is_wp_error($result)) { // $user_info = get_userdata($result->ID); $role = ae_user_role($result->ID); } else { $role = ''; } $redirect_url = $role == "employer" && AE_Users::is_activate($result->ID) ? et_get_page_link('submit-project') : et_get_page_link('profile'); $result->redirect_url = apply_filters('ae_after_register_link', $redirect_url); $result->do = "register"; return $result; }
?> "> <i class="fa fa-key"></i> </span> </p> </div> </div> </div> <div class="col-md-12"> <p class="terms-intro"> <?php _e("By clicking \"Sign Up\" you indicate that you have read and agree to the", ET_DOMAIN); ?> <a target="_blank" href="<?php echo et_get_page_link('term'); ?> "><?php _e("Terms of Service.", ET_DOMAIN); ?> </a> </p> </div> <div class="col-md-12"> <p class="btn-submit-intro"> <span class="your-submit mobile-device"> <input type="submit" name="" value="<?php _e("Sign up", ET_DOMAIN); ?> " class="btn-submit" /> </span>
// template/post-place-step4.php get_template_part('template/post-project', 'step4'); } ?> </div> <?php /** * tos agreement */ $tos = et_get_page_link('tos', array(), false); if ($tos) { ?> <div class="term-of-use"> <?php printf(__('By posting your project, you agree to our <a href="%s">Term of Use and Privacy policy</a>', 'page-submit-project'), et_get_page_link('tos')); ?> </div> <?php } ?> <!-- Column left / End --> </div> <!-- Column right --> <?php /* <div class="col-md-3 col-sm-12 col-xs-12 page-sidebar" id="right_content"> <!-- <div class="widget user_payment_status"> --> <?php ob_start();
echo et_get_page_link('categories'); ?> "> <?php _e("Name", ET_DOMAIN); ?> </a> </li> <li class="<?php if (isset($_GET['sort']) && $_GET['sort'] == 'popular') { echo 'active'; } ?> "> <a href="<?php echo add_query_arg(array('sort' => 'popular'), et_get_page_link('categories')); ?> "> <?php _e("Popular", ET_DOMAIN); ?> </a> </li> </ul> </div> </div> </div> </section> <!-- MIDDLE BAR / END --> <!-- LIST CATEGORIES -->
} echo '</span>'; } ?> </li> </ul> </div> <div class="col-lg-4 col-md-12 col-sm-12"> <div class="info-project-item-right"> <?php if (fre_share_role() || ae_user_role() == 'employer' || ae_user_role() == 'administrator') { ?> <span class="link-clone"> <a href="<?php echo et_get_page_link(array('page_type' => 'submit-project', 'post_title' => __("Submit project", ET_DOMAIN))); ?> " title=""> <i class="fa fa-plus-circle"></i><?php _e('Create a Project like this', ET_DOMAIN); ?> </a> </span> <?php } ?> <ul class="list-share-social addthis_toolbox addthis_default_style" > <li><a href="#" title="" class="addthis_button_facebook"><i class="fa fa-facebook "></i></a></li> <li><a href="#" title="" class="addthis_button_twitter"><i class="fa fa-twitter "></i></a></li> <li><a href="https://plus.google.com/share?url=<?php the_permalink();
</button> </div> </form> <div class="container"> <div class="row"> <div class="col-md-12"> <?php /** * tos agreement */ $tos = et_get_page_link('tos', array(), false); if (!get_theme_mod('termofuse_checkbox', false) && $tos) { ?> <p class="text-policy"> <?php printf(__('By creating an account, you agree to our <a href="%s">Term of Use and Privacy policy</a>', 'page-auth-mobile'), et_get_page_link('tos')); ?> </p> <?php } ?> <a href="#" class="change-link-login"> <?php _e("You have account ? Click here !", 'page-auth-mobile'); ?> </a> <?php // if( function_exists('ae_render_social_button')){ // $before_string = __("You can also sign in by:", 'page-auth-mobile'); // ae_render_social_button( array(), array(), $before_string ); // }
</div><!-- END LEFT MENU --> <?php if (is_front_page() && is_home()) { dynamic_sidebar('qa-left-sidebar'); } elseif (is_front_page()) { dynamic_sidebar('qa-left-sidebar'); } elseif (is_home() || is_singular('post')) { dynamic_sidebar('qa-blog-left-sidebar'); } else { dynamic_sidebar('qa-left-sidebar'); } ?> <div class="copyright"> ©<?php echo date('Y'); ?> <?php echo get_option('copyright'); ?> <br> <a href="<?php echo et_get_page_link("term"); ?> "><?php _e("Term & Privacy", ET_DOMAIN); ?> </a> </div> </div><!-- END LEFT-SIDEBAR -->
// template/post-place-step4.php get_template_part('template/post-project', 'step4'); } ?> </div> <?php /** * tos agreement */ $tos = et_get_page_link('tos', array(), false); if ($tos) { ?> <div class="term-of-use"> <?php printf(__('By posting your project, you agree to our <a href="%s">Term of Use and Privacy policy</a>', ET_DOMAIN), et_get_page_link('tos')); ?> </div> <?php } ?> <!-- Column left / End --> </div> <!-- Column right --> <div class="col-md-3 col-sm-12 col-xs-12 page-sidebar" id="right_content"> <!-- <div class="widget user_payment_status"> --> <?php ob_start(); ae_user_package_info($user_ID); $package = ob_get_clean();
<div class="clearfix"></div> <input type="submit" name="submit" value="<?php _e("Sign up", ET_DOMAIN); ?> " class="btn-submit"> <a href="javascript:void(0)" class="link_sign_in"><?php _e("Sign in", ET_DOMAIN); ?> </a> <div class="clearfix"></div> <p class="policy-sign-up"> <?php printf(__('By clicking "Sign up" you indicate that you have read and agree to the <a target="_blank" href="%s">privacy policy</a> and <a target="_blank" href="%s">terms of service.</a>', ET_DOMAIN), et_get_page_link('term'), et_get_page_link('term')); ?> </p> </form> <?php } ?> <form id="forgotpass_form" class="form_modal_style collapse"> <label><?php _e("Enter your email here", ET_DOMAIN); ?> </label> <input type="text" class="name_user" name="email" id="email" /> <input type="submit" name="submit" value="<?php _e("Send", ET_DOMAIN);
<div class="clearfix"></div> <div class="col-md-12 col-xs-12 blog-content-wrapper"> <div class="blog-content"> <?php if (isset($ACK) && $ACK || isset($test_mode) && $test_mode) { $permalink = get_permalink($ad->ID); /** * template payment success */ get_template_part('template/payment', 'success'); } else { if ($ad) { $permalink = et_get_page_link('submit-project', array('id' => $ad->ID)); } else { $permalink = et_get_page_link('submit-project'); } /** * template payment fail */ get_template_part('template/payment', 'fail'); } // clear session et_destroy_session(); ?> <br/> </br/> </div> </div><!-- SINGLE CONTENT --> <div class="clearfix"></div>
<?php /** * this template for payment fail, you can overide this template by child theme */ global $ad; ?> <div class="redirect-content" > <div class="main-center"> <h3 class="title"><?php _e("Payment fail, friend", 'payment-fail'); ?> </h3> <?php if ($ad) { $permalink = et_get_page_link('submit-project', array('id' => $ad->ID)); ?> <div class="content"> <?php _e("You are now redirected to submit listing page ... ", 'payment-fail'); ?> <br/> <?php printf(__('Time left: %s', 'payment-fail'), '<span class="count_down">10</span>'); ?> </div> <?php echo '<a href="' . $permalink . '" >' . __("Post Project", 'payment-fail') . '</a>'; } else { $permalink = home_url();
</div> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1"> <li><span class="avatar-and-name avatar-name-ontop current_user_avatar"> <span class="avatar"> <img alt="" src="{{= et_avatar_url }}" class="avatar avatar-96 photo avatar-default" height="96" width="96"> </span> {{= display_name }} </span> <span class="caret"></span> </li> <li role="presentation" class="divider"></li> <li role="presentation"> <a role="menuitem" tabindex="-1" href="<?php echo et_get_page_link('profile'); ?> " class="display-name"> <i class="fa fa-user"></i><?php _e("Your Profile", 'header-login'); ?> </a> </li> <li role="presentation" class="divider"></li> <?php /* <li role="presentation"> <a href="javascript:void(0);" class="trigger-overlay trigger-notification"> <i class="fa fa-flag"></i> <?php _e("Notification", ET_DOMAIN);
/** * echo tos text in form comment, post answer * @author Dakachi */ function qa_tos($word) { $word == "answer" ? printf(__('By posting your answer, you agree to the <a target="_blank" href="%s">privacy policy</a> and <a target="_blank" href="%s">terms of service.</a>', ET_DOMAIN), et_get_page_link('term'), et_get_page_link('term')) : printf(__('By posting your question, you agree to the <a target="_blank" href="%s">privacy policy</a> and <a target="_blank" href="%s">terms of service.</a>', ET_DOMAIN), et_get_page_link('term'), et_get_page_link('term')); }
<form role="form" id="bid_form" class="bid-form bid-form-mobile" <?php if (!isset($_GET['bid'])) { echo 'style="display:none"'; } ?> > <?php if (!is_user_logged_in()) { ?> <p><?php printf(__('You must <a href="%s">login</a> to bid on this project', ET_DOMAIN), et_get_page_link(array('page_type' => 'auth', 'post_title' => __("Login page", ET_DOMAIN))) . '?redirect=' . get_permalink()); ?> </p> <?php } else { ?> <div class="form-group"> <h3 class="title-content"> <?php _e('Set your bid:', ET_DOMAIN); ?> </h3> </div> <div class="form-group"> <label for="bid_budget"><?php _e('Budget', ET_DOMAIN); ?> </label> <input type="number" name="bid_budget" id="bid_budget" class="form-control required number" min="1" /> </div>
</div> </div> <div class="color-right"> <div class="content-sub"> <?php _e("<h1>Need a job?<br>Tell us your story</h1>", 'header-freelancer'); ?> <p> <a href="<?php echo et_get_page_link(array('page_type' => 'profile', 'post_title' => __("Create a Profile", 'header-freelancer'))); ?> " class="btn-sumary btn-sub-create"> <?php _e("Review your Profile", 'header-freelancer'); ?> </a> </p> </div> </div> <div class="d-arrow"></div>
</p> <?php } ?> </div> <div class="clearfix"></div> <button type="submit" class="btn-submit btn-sumary btn-sub-create" <?php if ($wp_query->found_posts == 0) { echo 'disabled="disabled"'; } ?> > <?php _e('Invite', ET_DOMAIN); ?> </button> </form> <?php } else { echo '<p class="lead text-info">'; _e("Currently, you do not have any project available to invite this user.", ET_DOMAIN); echo ' <a href="' . et_get_page_link('submit-project') . '" >' . __("Create a project now", ET_DOMAIN) . '</a>'; echo '</p>'; } ?> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> <?php wp_reset_query();
echo et_get_page_link('users'); ?> "> <?php _e("Name", ET_DOMAIN); ?> </a> </li> <li class="<?php if (isset($_GET['sort']) && $_GET['sort'] == 'points') { echo 'active'; } ?> "> <a href="<?php echo add_query_arg(array('sort' => 'points'), et_get_page_link('users')); ?> "> <?php _e("Point", ET_DOMAIN); ?> </a> </li> </ul> </div> </div> </div> </section> <!-- MIDDLE BAR / END --> <!-- LIST USER -->
/** * check user use package or use freepackage * @param string $package_id The pacakge sku to identify package * @param object $ad Current purchase post * @return array * 'url' => string process-payment-url base on type free/usePackage, * 'success' => bool * @author Dakachi */ public static function package_or_free($package_id, $ad) { $instance = self::get_instance(); $response = array('success' => false); $use_package = AE_Package::check_use_package($package_id); $package = $instance->get($package_id); if ($use_package) { et_write_session('ad_id', $ad->ID); $response['success'] = true; $response['url'] = et_get_page_link('process-payment', array('paymentType' => 'usePackage')); return $response; } if ($package->et_price == 0) { et_write_session('ad_id', $ad->ID); $response['success'] = true; $response['url'] = et_get_page_link('process-payment', array('paymentType' => 'free')); return $response; } return $response; }
function SetExpressCheckoutDG($order) { //------------------------------------------------------------------------------------------------------------------------------------ // Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementatio $payment = $this->payment; $paymentType = 'sale'; $paymentAmount = $order['total']; $currencyCodeType = $order['currencyCodeType']; $returnURL = et_get_page_link('process-payment', array('paymentType' => 'ppdigital')); $cancelURL = et_get_page_link('process-payment', array('paymentType' => 'ppdigital')); $products = $order['products']; if ($order['total'] < $order['total_before_discount']) { $products[] = array('NAME' => __("Discount", ET_DOMAIN), 'QTY' => '1', 'AMT' => $order['total'] - $order['total_before_discount']); } $nvpstr = "&PAYMENTREQUEST_0_AMT=" . $paymentAmount; $nvpstr .= "&PAYMENTREQUEST_0_PAYMENTACTION=" . $paymentType; $nvpstr .= "&RETURNURL=" . $returnURL; $nvpstr .= "&CANCELURL=" . $cancelURL; $nvpstr .= "&PAYMENTREQUEST_0_CURRENCYCODE=" . $currencyCodeType; $nvpstr .= "&REQCONFIRMSHIPPING=0"; $nvpstr .= "&NOSHIPPING=1"; $index = 0; foreach ($products as $key => $item) { $nvpstr .= "&L_PAYMENTREQUEST_0_NAME" . $index . "=" . urlencode($item["NAME"]); $nvpstr .= "&L_PAYMENTREQUEST_0_AMT" . $index . "=" . urlencode($item['AMT']); $nvpstr .= "&L_PAYMENTREQUEST_0_QTY" . $index . "=" . urlencode($item["QTY"]); $nvpstr .= "&L_PAYMENTREQUEST_0_ITEMCATEGORY" . $index . "=Digital"; $index++; } //'--------------------------------------------------------------------------------------------------------------- //' Make the API call to PayPal //' If the API call succeded, then redirect the buyer to PayPal to begin to authorize payment. //' If an error occured, show the resulting errors //'--------------------------------------------------------------------------------------------------------------- $resArray = $payment->hash_call("SetExpressCheckout", $nvpstr); $ack = strtoupper($resArray["ACK"]); if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") { $token = urldecode($resArray["TOKEN"]); $_SESSION['TOKEN'] = $token; //$payment->RedirectToPayPalDG ($token); } return $resArray; }
public function on_add_scripts() { global $current_user; $isEditable = current_user_can('manage_questions'); $variables = array('ajaxURL' => apply_filters('ae_ajax_url', admin_url('admin-ajax.php')), 'imgURL' => TEMPLATEURL . '/img/', 'posts_per_page' => get_option('posts_per_page'), 'homeURL' => home_url(), 'user_confirm' => ae_get_option('user_confirm') ? 1 : 0, 'pending_questions' => ae_get_option('pending_questions') ? 1 : 0, 'pending_answers' => ae_get_option("pending_answers") ? 1 : 0, 'introURL' => et_get_page_link('intro'), 'gplus_client_id' => ae_get_option("gplus_client_id"), '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'))); ?> <script type="text/javascript"> ae_globals = <?php echo json_encode($variables); ?> </script> <?php }
function profile_page_nav_tab($section = '') { ?> <li <?php if (is_page_template('page-account-sell-order.php')) { echo 'class="active"'; } ?> ><a title="<?php _e("Views all your sell order", ET_DOMAIN); ?> " href="<?php echo et_get_page_link(array('page_type' => 'account-sell-order', 'post_title' => __("Sale order", ET_DOMAIN))); ?> "><?php _e("Sale Order", ET_DOMAIN); ?> </a> </li> <li <?php if (is_page_template('page-account-purchase-invoice.php')) { echo 'class="active"'; } ?> ><a title="<?php _e("Views all your purchase invoice", ET_DOMAIN); ?> " href="<?php echo et_get_page_link(array('page_type' => 'account-purchase-invoice', 'post_title' => __("Purchase order", ET_DOMAIN))); ?> "><?php _e("Purchase order", ET_DOMAIN); ?> </a> </li> <li <?php if (is_page_template('page-account-transaction.php')) { echo 'class="active"'; } ?> ><a title="<?php _e("Views all your transactions", ET_DOMAIN); ?> " href="<?php echo et_get_page_link(array('page_type' => 'account-transaction', 'post_title' => __("Transactions", ET_DOMAIN))); ?> "><?php _e("Transactions", ET_DOMAIN); ?> </a> </li> <?php }