Merge pull request #1980 from andreibarabas/master

Fix Issue #1833
This commit is contained in:
Mike Jolley 2012-12-12 08:03:15 -08:00
commit 00dbacba5e
8 changed files with 193 additions and 188 deletions

View File

@ -17,7 +17,7 @@ abstract class ShareYourCartBase extends ShareYourCartAPI {
//this array is used to hold function calls between different instances of this class
private static $_SINGLE_FUNCTIONS_CALLS = array();
private static $_SDK_VERSION = '1.9'; //the first one is the SDK main version, while the second one is it's revision
private static $_SDK_VERSION = '1.10'; //the first one is the SDK main version, while the second one is it's revision
protected static $_DB_VERSION = '1.1';
protected $SDK_ANALYTICS = true;
@ -473,7 +473,7 @@ abstract class ShareYourCartBase extends ShareYourCartAPI {
* @param null
* @return boolean
*/
protected function renderButton($callback_url,$position = null) {
protected function renderButton($callback_url,$position = null,$languageISO = null) {
$data = array(
'current_button_type' => $this->getConfigValue("button_type"),
@ -490,6 +490,7 @@ abstract class ShareYourCartBase extends ShareYourCartAPI {
'is_product_page' => $this->isSingleProduct(),
'position_'.(SyC::startsWith($position,"/*before*/") ? 'before' : 'after') => $position,
'language' => $languageISO,
);
$output = null;
@ -714,7 +715,9 @@ abstract class ShareYourCartBase extends ShareYourCartAPI {
{
//if there is a message, put the form on a new line
$error_message = $status_message;
$status_message = $this->renderView('account-recover-partial');
$status_message = $this->renderView('account-recover-partial', array(
'html' => $html,
));
}
else
{
@ -757,7 +760,9 @@ abstract class ShareYourCartBase extends ShareYourCartAPI {
{
//move any message to errors
$error_message = $status_message;
$status_message = $this->renderView('account-create-partial');
$status_message = $this->renderView('account-create-partial', array(
'html' => $html,
));
}
}
@ -1147,7 +1152,7 @@ abstract class ShareYourCartBase extends ShareYourCartAPI {
//test if the files is a url, as one migt send it that way
$parts = parse_url($file);
$is_url = is_array($parts) && isset($parts['scheme']);
$is_url = is_array($parts) && isset($parts['scheme']) && SyC::startsWith($parts['scheme'],'http');
//if this is not a url, create one for it
if(!$is_url)

View File

@ -1,5 +1,5 @@
<?php if(!class_exists('ShareYourCartBase',false)) die('Access Denied'); ?>
<a href="<?php echo $this->SHAREYOURCART_BUTTON_URL ?>" class="shareyourcart-button <?php if (isset($is_product_page) && $is_product_page) echo "product_button"; ?>" <?php echo (isset($callback_url) && !empty($callback_url)) ? "data-syc-callback_url=$callback_url" : ''; ?> data-syc-layout="custom" <?php if(!empty($position_after)): echo "data-syc-position-after=\"$position_after\""; elseif(!empty($position_before)): echo "data-syc-position-before=\"$position_before\""; endif; ?>>
<a href="<?php echo $this->SHAREYOURCART_BUTTON_URL ?>" class="shareyourcart-button <?php if (isset($is_product_page) && $is_product_page) echo "product_button"; ?>" <?php echo (isset($callback_url) && !empty($callback_url)) ? "data-syc-callback_url=$callback_url" : ''; ?> data-syc-layout="custom" <?php if(!empty($position_after)): echo "data-syc-position-after=\"$position_after\""; elseif(!empty($position_before)): echo "data-syc-position-before=\"$position_before\""; endif; ?> <?php if(!empty($language)): echo "data-syc-language=\"$language\""; endif; ?>>
<?php echo $button_html;?>
</a>

View File

@ -18,7 +18,7 @@
}
?>
<a href="<?php echo $this->SHAREYOURCART_BUTTON_URL ?>" class="shareyourcart-button <?php if (isset($is_product_page) && $is_product_page) echo "product_button"; ?>" <?php echo $callbackDataAttr; ?> data-syc-layout="custom" <?php if(!empty($position_after)): echo "data-syc-position-after=\"$position_after\""; elseif(!empty($position_before)): echo "data-syc-position-before=\"$position_before\""; endif; ?>>
<a href="<?php echo $this->SHAREYOURCART_BUTTON_URL ?>" class="shareyourcart-button <?php if (isset($is_product_page) && $is_product_page) echo "product_button"; ?>" <?php echo $callbackDataAttr; ?> data-syc-layout="custom" <?php if(!empty($position_after)): echo "data-syc-position-after=\"$position_after\""; elseif(!empty($position_before)): echo "data-syc-position-before=\"$position_before\""; endif; ?> <?php if(!empty($language)): echo "data-syc-language=\"$language\""; endif; ?>>
&nbsp;
</a>

View File

@ -1,5 +1,5 @@
<?php if(!class_exists('ShareYourCartBase',false)) die('Access Denied'); ?>
<a href="<?php echo $this->SHAREYOURCART_BUTTON_URL ?>" class="shareyourcart-button <?php if (isset($is_product_page) && $is_product_page) echo "product_button"; ?> <?php echo ( $this->getConfigValue('button_position') == 'floating' ? 'button_iframe' : 'button_iframe-normal');?> <?php echo ( !$this->getConfigValue('dont_set_height') ? 'button_height' : ''); ?>" <?php echo (isset($callback_url) && !empty($callback_url)) ? "data-syc-callback_url=$callback_url" : ''; ?> data-syc-skin="<?php echo $this->getConfigValue('button_skin');?>" data-syc-orientation="<?php echo $this->getConfigValue('button_position'); ?>" <?php if(!empty($position_after)): echo "data-syc-position-after=\"$position_after\""; elseif(!empty($position_before)): echo "data-syc-position-before=\"$position_before\""; endif; ?> >
<a href="<?php echo $this->SHAREYOURCART_BUTTON_URL ?>" class="shareyourcart-button <?php if (isset($is_product_page) && $is_product_page) echo "product_button"; ?> <?php echo ( $this->getConfigValue('button_position') == 'floating' ? 'button_iframe' : 'button_iframe-normal');?> <?php echo ( !$this->getConfigValue('dont_set_height') ? 'button_height' : ''); ?>" <?php echo (isset($callback_url) && !empty($callback_url)) ? "data-syc-callback_url=$callback_url" : ''; ?> data-syc-skin="<?php echo $this->getConfigValue('button_skin');?>" data-syc-orientation="<?php echo $this->getConfigValue('button_position'); ?>" <?php if(!empty($position_after)): echo "data-syc-position-after=\"$position_after\""; elseif(!empty($position_before)): echo "data-syc-position-before=\"$position_before\""; endif; ?> <?php if(!empty($language)): echo "data-syc-language=\"$language\""; endif; ?> >
ShareYourCart Discount
</a>