/**
  * Fancy Notifications
  *
  * Container HTML for fancy notifications.
  *
  * @since  4.0
  *
  * @param   boolean  $return  Return output.
  * @return  string            Output.
  */
 public static function fancy_notifications($return = false)
 {
     static $already_output = false;
     if ($already_output) {
         return '';
     }
     $output = '';
     if (1 == get_option('fancy_notifications')) {
         $output .= '<div id="fancy_notification">';
         $output .= '   <div id="loading_animation">';
         $output .= '      <img id="fancy_notificationimage" title="' . esc_attr__('Loading', 'wpsc') . '" alt="' . esc_attr__('Loading', 'wpsc') . '" src="' . esc_url(wpsc_loading_animation_url()) . '" />' . esc_html__('Updating', 'wpsc') . '...';
         $output .= '   </div>';
         $output .= '   <div id="fancy_notification_content"></div>';
         $output .= '</div>';
     }
     $already_output = true;
     if ($return) {
         return $output;
     }
     echo $output;
 }
function wpsc_fancy_notifications($return = false)
{
    static $already_output = false;
    if ($already_output) {
        return '';
    }
    $output = "";
    if (get_option('fancy_notifications') == 1) {
        $output = "";
        $output .= "<div id='fancy_notification'>\n\r";
        $output .= "  <div id='loading_animation'>\n\r";
        $output .= '<img id="fancy_notificationimage" title="Loading" alt="Loading" src="' . wpsc_loading_animation_url() . '" />' . __('Updating', 'wpsc') . "...\n\r";
        $output .= "  </div>\n\r";
        $output .= "  <div id='fancy_notification_content'>\n\r";
        $output .= "  </div>\n\r";
        $output .= "</div>\n\r";
    }
    $already_output = true;
    if ($return) {
        return $output;
    } else {
        echo $output;
    }
}
        ?>
" >
						
						<input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
						<input type="hidden" value="<?php 
        echo wpsc_the_product_id();
        ?>
" name="product_id"/>
				
							<?php 
        if (wpsc_product_has_stock()) {
            ?>
								<div class="wpsc_buy_button_container">
									<div class="wpsc_loading_animation">
										<img title="Loading" alt="Loading" src="<?php 
            echo wpsc_loading_animation_url();
            ?>
" />
										<?php 
            _e('Updating cart...', 'wpsc');
            ?>
									</div><!--close wpsc_loading_animation-->
										<?php 
            if (wpsc_product_external_link(wpsc_the_product_id()) != '') {
                ?>
										<?php 
                $action = wpsc_product_external_link(wpsc_the_product_id());
                ?>
										<input class="wpsc_buy_button" type="submit" value="<?php 
                echo wpsc_product_external_link_text(wpsc_the_product_id(), __('Buy Now', 'wpsc'));
                ?>
function fancy_notifications()
{
    global $wpdb;
    if (get_option('fancy_notifications') == 1) {
        $output = "";
        $output .= "<div id='fancy_notification'>\n\r";
        $output .= "  <div id='loading_animation'>\n\r";
        $output .= '<img id="fancy_notificationimage" title="Loading" alt="Loading" src="' . wpsc_loading_animation_url() . '" />' . __('Updating', 'wpsc') . "...\n\r";
        $output .= "  </div>\n\r";
        $output .= "  <div id='fancy_notification_content'>\n\r";
        $output .= "  </div>\n\r";
        $output .= "</div>\n\r";
    }
    return $output;
}
Esempio n. 5
0
function wpsc_admin_dynamic_js()
{
    header('Content-Type: text/javascript');
    header('Expires: ' . gmdate('r', mktime(0, 0, 0, date('m'), date('d') + 12, date('Y'))) . '');
    header('Cache-Control: public, must-revalidate, max-age=86400');
    header('Pragma: public');
    $siteurl = get_option('siteurl');
    $hidden_boxes = get_option('wpsc_hidden_box');
    $form_types1 = get_option('wpsc_checkout_form_fields');
    $unique_names1 = array('billingfirstname', 'billinglastname', 'billingaddress', 'billingcity', 'billingcountry', 'billingemail', 'billingphone', 'billingpostcode', 'delivertoafriend', 'shippingfirstname', 'shippinglastname', 'shippingaddress', 'shippingcity', 'shippingstate', 'shippingcountry', 'shippingpostcode');
    foreach ($form_types1 as $form_type) {
        $form_types .= "<option value='" . $form_type . "'>" . __($form_type, 'wpsc') . "</option>";
    }
    $unique_names = "<option value='-1'>Select a Unique Name</option>";
    foreach ($unique_names1 as $unique_name) {
        $unique_names .= "<option value='" . $unique_name . "'>" . $unique_name . "</option>";
    }
    $hidden_boxes = implode(',', (array) $hidden_boxes);
    echo "var base_url = '" . $siteurl . "';\n\r";
    echo "var WPSC_URL = '" . WPSC_URL . "';\n\r";
    echo "var WPSC_IMAGE_URL = '" . WPSC_IMAGE_URL . "';\n\r";
    echo "var WPSC_DIR_NAME = '" . WPSC_DIR_NAME . "';\n\r";
    echo "var WPSC_IMAGE_URL = '" . WPSC_IMAGE_URL . "';\n\r";
    echo "var WPSC_LOADING_ANIMATION_URL = '" . wpsc_loading_animation_url() . "';\n\r";
    // LightBox Configuration start
    echo "var fileLoadingImage = '" . WPSC_URL . "/images/loading.gif';\n\r";
    echo "var fileBottomNavCloseImage = '" . WPSC_URL . "/images/closelabel.gif';\n\r";
    echo "var fileThickboxLoadingImage = '" . WPSC_URL . "/images/loadingAnimation.gif';\n\r";
    echo "var resizeSpeed = 9;\n\r";
    echo "var borderSize = 10;\n\r";
    echo "var hidden_boxes = '" . $hidden_boxes . "';\n\r";
    echo "var IS_WP27 = '" . IS_WP27 . "';\n\r";
    echo "var TXT_WPSC_DELETE = '" . __('Delete', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_TEXT = '" . __('Text', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_EMAIL = '" . __('Email', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_COUNTRY = '" . __('Country', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_TEXTAREA = '" . __('Textarea', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_HEADING = '" . __('Heading', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_COUPON = '" . __('Coupon', 'wpsc') . "';\n\r";
    echo "var HTML_FORM_FIELD_TYPES =\" " . $form_types . "; \" \n\r";
    echo "var HTML_FORM_FIELD_UNIQUE_NAMES = \" " . $unique_names . "; \" \n\r";
    echo "var TXT_WPSC_LABEL = '" . __('Label', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_LABEL_DESC = '" . __('Label Description', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_ITEM_NUMBER = '" . __('Item Number', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_LIFE_NUMBER = '" . __('Life Number', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_PRODUCT_CODE = '" . __('Product Code', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_PDF = '" . __('PDF', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_AND_ABOVE = '" . __(' and above', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_IF_PRICE_IS = '" . __('If price is ', 'wpsc') . "';\n\r";
    echo "var TXT_WPSC_IF_WEIGHT_IS = '" . __('If weight is ', 'wpsc') . "';\n\r";
    exit;
}
function wpsc_user_dynamic_js()
{
    header('Content-Type: text/javascript');
    header('Expires: ' . gmdate('r', mktime(0, 0, 0, date('m'), date('d') + 12, date('Y'))) . '');
    header('Cache-Control: public, must-revalidate, max-age=86400');
    header('Pragma: public');
    $siteurl = get_option('siteurl');
    ?>
  jQuery.noConflict();
	/* base url */
	var base_url = "<?php 
    echo $siteurl;
    ?>
";
	var WPSC_URL = "<?php 
    echo WPSC_URL;
    ?>
";
	var WPSC_IMAGE_URL = "<?php 
    echo WPSC_IMAGE_URL;
    ?>
";
	var WPSC_DIR_NAME = "<?php 
    echo WPSC_DIR_NAME;
    ?>
";
	var WPSC_LOADING_ANIMATION_URL = "<?php 
    echo wpsc_loading_animation_url();
    ?>
";
	/* LightBox Configuration start*/
	var fileLoadingImage = "<?php 
    echo WPSC_URL;
    ?>
/images/loading.gif";
	var fileBottomNavCloseImage = "<?php 
    echo WPSC_URL;
    ?>
/images/closelabel.gif";
	var fileThickboxLoadingImage = "<?php 
    echo WPSC_URL;
    ?>
/images/loadingAnimation.gif";
	var resizeSpeed = 9;  // controls the speed of the image resizing (1=slowest and 10=fastest)
	var borderSize = 10;  //if you adjust the padding in the CSS, you will need to update this variable
<?php 
    exit;
}