echo isset($_POST['email']) ? $_POST['email'] : $this->getAdminEmail();
?>
"/>
</td>
</tr>
<tr>
<td colspan="2">
<input class="buttonCheckbox" name="syc-terms-agreement" id="syc-terms-agreement" <?php 
if ($_SERVER['REQUEST_METHOD'] !== 'POST' || isset($_POST['syc-terms-agreement'])) {
    echo 'checked="checked"';
}
?>
 type="checkbox" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/create-view/toogle-terms-agreement-click']);"><label for="syc-terms-agreement"><?php 
echo SyC::t('sdk', 'I agree with the {brand} terms & conditions', array('{brand}' => '<a href="http://www.shareyourcart.com/terms" target="_blank" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/create-view/logo-terms-click\']);">ShareYourCart</a>'));
?>
</label>
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="syc-create-account" value="<?php 
echo SyC::t('sdk', 'Create account');
?>
" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/create-view/save-click']);"/>
</td>
</tr>
</table>
<?php 
echo $html;
?>
</form>
Beispiel #2
0
?app_key=<?php 
    echo $this->getAppKey();
    ?>
&amp;client_id=<?php 
    echo $this->getClientId();
    ?>
&amp;email=<?php 
    echo $this->getAdminEmail();
    ?>
" class="button" target="_blank"><?php 
    _e('Configure', 'woocommerce');
    ?>
</a>

	            	<p class="description"><?php 
    echo SyC::t('sdk', 'You can choose how much of a discount to give (in fixed amount, percentage, or free shipping) and to which social media channels it should it be applied. You can also define what the advertisement should say, so that it fully benefits your sales.');
    ?>
</p>

            	</td>
            </tr>
            <?php 
}
?>

        </table>

        <div class="submit">
        	<input type="submit" class="button button-primary" name="syc-account-form" value="<?php 
_e('Save changes', 'woocommerce');
?>
Beispiel #3
0
            </tr>
            <tr>
                <th valign="top" scope="row"><label for="syc_description"><?php 
SyC::t('sdk', 'Description:');
?>
</label></th>
                <td><textarea name="syc_description" id="syc_description" class="regular-text" style="width:450px; height:200px;"><?php 
echo $description;
?>
</textarea>
				<p class="howto"><?php 
echo SyC::t('sdk', 'Leave blank to use the main description');
?>
</p></td>
            </tr>
            <tr>
                <th valign="middle" scope="row"><?php 
echo SyC::t('sdk', 'Product Image:');
?>
</th>
                <td valign="middle"><p class="howto"><?php 
echo SyC::t('sdk', "Use wordpress' featured image functionality. You can find it on the right side.");
?>
</p></td>
            </tr>
        </table>      
	<input type="hidden" name="syc_nonce" id="syc_nonce" value="<?php 
echo wp_create_nonce($this->_PLUGIN_PATH);
?>
" />		
</div>
    //only show if a known shopping cart is active
    ?>
		<h3><?php 
    echo SyC::t('sdk', 'Remarks');
    ?>
</h3>
		<p><?php 
    echo SyC::t('sdk', 'If you want to use the {brand} button on a product\'s page, you need to <strong>append</strong> {product-property} to the {callback-url} value, where {product-property} is the product\'s id', array('{brand}' => '<a href="http://www.shareyourcart.com" target="_blank" title="Shareyourcart&trade;" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/logo-click\']);">ShareYourCart&trade;</a>', '{product-property}' => '<code>&p=&lt;product_id&gt;</code>', '{callback-url}' => '<strong>data-syc-callback_url</strong>'));
    ?>
</p>
<?php 
}
?>

<?php 
if ($show_footer) {
    ?>
		<h2><?php 
    echo SyC::t('sdk', 'Contact');
    ?>
</h2>
		<p><?php 
    echo SyC::t('sdk', "If you've got 30 seconds, we'd {link-1} love to know what ideal outcome you'd like ShareYourCart to help bring to your business</a>, or if you have a private question, you can {link-2} contact us directly</a>", array('{link-1}' => '<a href="http://shareyourcart.uservoice.com" target="_blank" title="forum" class="api-link" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/forum-click\']);">', '{link-2}' => '<a href="http://www.shareyourcart.com/contact" target="_blank" class="api-link" onclick=" if(_gaq) _gaq.push([\'_trackPageview\', \'/admin/documentation/contact-click\']);">'));
    ?>
</p>
		<br />
		<?php 
}
?>
	</div>
</div>
 /**
  * Drop the specified table
  *
  * @param string tableName
  */
 protected function dropTable($tableName)
 {
     $this->executeNonQuery("DROP TABLE {$tableName}");
     //we can't relly on the fact that the table has been properly droped, so check it!
     if (!$this->existsTable($tableName)) {
         throw new Exception(SyC::t('sdk', 'Cannot drop table "{table_name}". Check your database permissions.', array('{table_name}' => $tableName)));
     }
 }
?>
"/>
</td>
</tr>
<tr>
<td>
<label for="email"><?php 
echo SyC::t('sdk', 'Email:');
?>
</label>
</td>
<td>
<input type="text" name="email" id="email" class="regular-text" value="<?php 
echo isset($_POST['email']) ? $_POST['email'] : $this->getAdminEmail();
?>
"/>
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="syc-recover-account" value="<?php 
echo SyC::t('sdk', 'Recover my account');
?>
" onclick=" if(_gaq) _gaq.push(['_trackPageview', '/admin/recover-view/save-click']);" />
</td>
</tr>
</table>
<?php 
echo $html;
?>
</form>
?>
</span>
                    </td>
                </tr>
    			 <tr>
                    <th scope="row" valign="top"><?php 
echo SyC::t('sdk', 'Position cart button after: ');
?>
</th>
                    <td>
                        <input name="cart_button_position" class="regular-text" value="<?php 
echo $this->getCartButtonPosition();
?>
" />
                        <span class="description"><?php 
echo SyC::t('sdk', '<strong>jQuery selector</strong>. Start with <strong>{elem}</strong> to position the button before the actual object', array('{elem}' => "/*before*/"));
?>
</span>
                    </td>
                </tr>
            </table>
        </fieldset>

        <div class="submit">
        	<input type="submit" class="button button-primary" name="syc-visual-form" value="<?php 
_e('Save changes', 'woocommerce');
?>
" />
        </div>
    </div>
</div>
 public function couponCallback()
 {
     //since there are a lot of plugins for wordpress, first make sure this plugin
     //is active
     if (!$this->isCartActive()) {
         throw new Exception(SyC::t('sdk', 'Shopping Cart is not active'));
     }
     parent::couponCallback();
     //since this is actually an API, exit
     exit;
 }
<?php

if ($this->hasNewerVersion()) {
    //if there is a newer version, show the upgrade message
    ?>

<div class="syc-update-nag">
	<strong><?php 
    echo SyC::t('sdk', '{link}ShareYourCart {version}</a> is available! {link}Please update now</a>.', array('{version}' => $this->getConfigValue('latest_version'), '{link}' => '<a href="' . $this->getConfigValue("download_url") . '" target="_blank">'));
    ?>
</strong>
</div>
<?php 
}
 /**
  * Drop the specified table
  *
  * @param string tableName
  */
 protected function dropTable($tableName)
 {
     $sql = "DROP TABLE {$tableName}";
     $this->executeNonQuery($sql);
     //we can't rely on the fact that the table has been properly dropped, so check it!
     if ($this->existsTable($tableName)) {
         throw new Exception(SyC::t('sdk', 'Cannot drop table "{table_name}". Check your database permissions or manually run the following SQL command and try again:<br /><strong>{sql}</strong>', array('{table_name}' => $tableName, '{sql}' => nl2br($sql))));
     }
 }
 /**
  *
  * change the language loader method
  *
  */
 public static function setLanguageLoader($loader)
 {
     //make sure the loader is ok
     if (!is_callable($loader)) {
         throw new Exception(SyC::t('sdk', "The language loader is not a valid callback"));
     }
     self::$loadLanguage = $loader;
     //reset the old messages, so that they are reloaded with the new loader
     self::$_messages = null;
 }
 /**
  * setAccountStatus
  * @param string $secretKey
  * @param string $clientId
  * @param string $appKey
  * @param string $activate
  * @param string $message  
  * @return boolean
  */
 public function setAccountStatus($secretKey, $clientId, $appKey, $activate = true, &$message = null)
 {
     // Urlencode and concatenate the POST arguments
     $params = array('secret_key' => $secretKey, 'client_id' => $clientId, 'app_key' => $appKey);
     //make the API call
     $session = curl_init($activate ? $this->SHAREYOURCART_API_ACTIVATE : $this->SHAREYOURCART_API_DEACTIVATE);
     // Tell curl to use HTTP POST
     curl_setopt($session, CURLOPT_POST, true);
     // Tell curl that this is the body of the POST
     curl_setopt($session, CURLOPT_POSTFIELDS, http_build_query($params, '', '&'));
     // Tell curl not to return headers, but do return the response
     curl_setopt($session, CURLOPT_HEADER, false);
     curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
     $response = curl_exec($session);
     $httpCode = curl_getinfo($session, CURLINFO_HTTP_CODE);
     curl_close($session);
     // Notify the caller
     if ($httpCode != 200) {
         if (isset($message)) {
             $message = $response;
         }
         return false;
     }
     //if the caller is expecting a message
     //let him know what happened
     if (isset($message)) {
         $message = !empty($response) ? $response : ($activate ? SyC::t('sdk', 'The account has been enabled') : SyC::t('sdk', 'The account has been disabled'));
     }
     return true;
 }