<tr class="inline-edit-row ${classnames}" id="${id}"> <td colspan="3"><input type="hidden" name="id" value="${id}" /><input type="hidden" name="editing" value="true" /> <table id="taxrate-editor"> <tr> <td scope="row" valign="top" class="rate"><input type="text" name="settings[taxrates][${id}][rate]" id="tax-rate" value="${rate}" size="7" class="selectall" tabindex="1" /><br /><label for="tax-rate"><?php _e('Tax Rate', 'Shopp'); ?> </label><br /> <input type="hidden" name="settings[taxrates][${id}][compound]" value="off" /><label><input type="checkbox" id="tax-compound" name="settings[taxrates][${id}][compound]" value="on" ${compounded} tabindex="4" /> <?php Shopp::_e('Compound'); ?> </label></td> <td scope="row" class="conditions"> <select name="settings[taxrates][${id}][country]" class="country" tabindex="2">${countries}</select><select name="settings[taxrates][${id}][zone]" class="zone no-zones" tabindex="3">${zones}</select> <?php echo ShoppUI::button('add', 'addrule'); ?> <?php $options = array('any' => Shopp::__('any'), 'all' => strtolower(Shopp::__('All'))); $menu = '<select name="settings[taxrates][${id}][logic]" class="logic">' . menuoptions($options, false, true) . '</select>'; ?> <div class="conditionals no-conditions"> <p><label><?php printf(__('Apply tax rate when %s of the following conditions match', 'Shopp'), $menu); ?> :</label></p> <ul> ${conditions} </ul> </div> </td>
echo $cache->id; ?> ]" alt="<?php echo $c; ?> " value="<?php echo $cropping; ?> " class="imagecropped" /> <?php } } ?> </div> <?php echo ShoppUI::button('delete', 'deleteImage', array('type' => 'button', 'class' => 'delete', 'value' => $Image->id, 'title' => Shopp::__('Remove image…'))); ?> </li> <?php } ?> </ul> <div class="clear"></div> <input type="hidden" name="product" value="<?php echo $_GET['id']; ?> " id="image-product-id" /> <input type="hidden" name="deleteImages" id="deleteImages" value="" /> <div id="swf-uploader-button"></div> <div id="browser-uploader"> <button type="button" name="image_upload" id="image-upload" class="button-secondary"><small><?php
function manage_meta_box($Purchase) { $Gateway = $Purchase->gateway(); ?> <form action="<?php echo ShoppAdminController::url(array('id' => $Purchase->id)); ?> " method="post"> <?php if ($Purchase->shippable) { ?> <script id="shipment-ui" type="text/x-jquery-tmpl"> <?php ob_start(); ?> <li class="inline-fields"> <span class="number">${num}.</span> <span><input type="text" name="shipment[${id}][tracking]" value="${tracking}" size="30" class="tracking" /><br /> <label><?php _e('Tracking Number'); ?> </label> </span> <span> <select name="shipment[${id}][carrier]">${carriermenu}</select><?php echo ShoppUI::button('delete', 'delete-shipment[${id}]'); ?> <br /> <label><?php _e('Carrier'); ?> </label> </span> </li> <?php $shipmentui = ob_get_contents(); ob_end_clean(); echo $shipmentui; ?> </script> <script id="shipnotice-ui" type="text/x-jquery-tmpl"> <?php ob_start(); ?> <div class="shipnotice misc-pub-section"> <div class="shipment"> <h4><big><?php _e('Shipments', 'Shopp'); ?> </big></h4> <p><?php _e('An email will be sent to notify the customer.', 'Shopp'); ?> </p> <input type="hidden" name="ship-notice" value="active" /> <ol> ${shipments} <li><span class="number">${shipmentnum}.</span> <input type="submit" id="addship-button" name="add-shipment" value="<?php _e('Add Shipment', 'Shopp'); ?> " class="button-secondary" /></li> </ol> <div class="submit"> <input type="submit" id="cancel-ship" name="cancel-shipments" value="<?php _e('Cancel', 'Shopp'); ?> " class="button-secondary" /> <div class="alignright"> <input type="submit" name="submit-shipments" value="<?php _e('Send Shipping Notice', 'Shopp'); ?> " class="button-primary" /> </div> </div> </div> </div> <?php $shipnotice_ui = ob_get_contents(); ob_end_clean(); echo $shipnotice_ui; ?> </script> <?php } ?> <?php if (!$Purchase->isvoid()) { ?> <script id="refund-ui" type="text/x-jquery-tmpl"> <?php ob_start(); ?> <div class="refund misc-pub-section"> <div class="refunding"> <h4><big>${title}</big></h4> An email will be sent to notify the customer. <input type="hidden" name="order-action" value="${action}" /> <div><label for="message"><?php _e('Message to the customer', 'Shopp'); ?> </label> <textarea name="message" id="message" cols="50" rows="7" ></textarea></div> <div class="alignright"> <div class="inline-fields"> <span> <select name="reason"> <option>— Select —</option> <?php echo Shopp::menuoptions(stripslashes_deep(shopp_setting('cancel_reasons')), false, true); ?> </select><br /> <label>${reason}</label> </span> <span><input type="text" name="amount" value="<?php echo Shopp::money($Purchase->total); ?> " ${disable_amount} /><br /> <label><?php _e('Amount', 'Shopp'); ?> </label></span> </div> </div> <div class="clear"></div> <div class="submit"> <input type="submit" id="cancel-refund" name="cancel-refund" value="${cancel}" class="button-secondary" /> <div class="alignright"> <span class="mark-status"> <input type="hidden" name="send" value="off" /> <label title="<?php printf(__('Enable to process through the payment gateway (%s) and set the Shopp payment status. Disable to update only the Shopp payment status.', 'Shopp'), $Gateway->name); ?> "><input type="checkbox" name="send" value="on" <?php if ($Gateway && $Gateway->refunds) { echo ' checked="checked"'; } ?> /> ${send}</label> </span> <input type="submit" name="process-refund" value="${process}" class="button-primary" /> </div> </div> </div> </div> <?php $refundui = ob_get_contents(); ob_end_clean(); echo $refundui; ?> </script> <?php } ?> <div class="minor-publishing"> <div class="minor-publishing-actions headline"> <div class="misc-pub-section controls"> <?php $printurl = wp_nonce_url(admin_url('admin-ajax.php') . '?action=shopp_order_receipt&id=' . $Purchase->id, 'wp_ajax_shopp_order_receipt'); $controls = '<div class="alignright"><a id="print-button" href="' . esc_url($printurl) . '" class="button hide-if-no-js" target="_blank">' . __('Print Order', 'Shopp') . '</a></div>'; echo apply_filters('shopp_order_management_controls', $controls, $Purchase); ?> </div> <div class="misc-pub-section"> <div class="status"> <?php if (isset($Purchase->txnevent)) { $UI = OrderEventRenderer::renderer($Purchase->txnevent); $event = array('<strong>' . $UI->name() . '</strong>'); if ('' != $UI->details()) { $event[] = $UI->details(); } if ('' != $UI->date()) { $event[] = $UI->date(); } echo '<p>' . join(' — ', $event) . '</p>'; } else { ?> <?php if (!empty($Purchase->txnid)) { ?> <p><strong><?php _e('Processed by', 'Shopp'); ?> </strong><?php echo $Purchase->gateway; echo !empty($Purchase->txnid) ? " ({$Purchase->txnid})" : ""; ?> </p> <?php } ?> <?php $output = ''; if (!empty($Purchase->card) && !empty($Purchase->cardtype)) { $output = '<p><strong>' . $Purchase->txnstatus . '</strong> ' . __('to', 'Shopp') . ' ' . (!empty($Purchase->cardtype) ? $Purchase->cardtype : '') . (!empty($Purchase->card) ? sprintf(" (…%d)", $Purchase->card) : '') . '</p>'; } echo apply_filters('shopp_orderui_payment_card', $output, $Purchase); } if (isset($Purchase->shipevent)) { $UI = OrderEventRenderer::renderer($Purchase->shipevent); echo '<p><strong>' . $UI->name() . '</strong> ' . $UI->details() . ' — ' . $UI->date() . '</p>'; } ?> </div> </div> <div class="manager-ui"> <?php $action = false; if (isset($_POST['ship-notice']) && 'active' != $_POST['ship-notice']) { $action = 'ship-notice'; } elseif (isset($_POST['edit-billing-address']) || isset($_POST['edit-shipping-address'])) { $action = 'edit-address'; } elseif (isset($_POST['cancel-order']) || isset($_POST['refund-order'])) { $action = 'refund-order'; } if (isset($_POST['cancel-shipments']) && 'ship-notice' == $action) { $action = false; } if (isset($_POST['cancel-refund']) && 'refund-order' == $action) { $action = false; } if ('ship-notice' == $action) { unset($_POST['cancel-order'], $_POST['refund-order']); $default = array('tracking' => '', 'carrier' => ''); $shipment = isset($_POST['shipment']) ? $_POST['shipment'] : array($default); $shipments = (int) $_POST['shipments']; if (isset($_POST['delete-shipment'])) { $queue = array_keys($_POST['delete-shipment']); foreach ($queue as $index) { array_splice($shipment, $index, 1); } } if (isset($_POST['add-shipment'])) { $shipment[] = $default; } global $carriers_menu; foreach ($shipment as $id => $package) { extract($package); $menu = Shopp::menuoptions($carriers_menu, $carrier, true); $shipmentuis = ShoppUI::template($shipmentui, array('${id}' => $id, '${num}' => $id + 1, '${tracking}' => $tracking, '${carriermenu}' => $menu)); } echo ShoppUI::template($shipnotice_ui, array('${shipments}' => $shipmentuis, '${shipmentnum}' => count($shipment) + 1)); } if ('refund-order' == $action) { $data = array('${action}' => 'refund', '${title}' => __('Refund Order', 'Shopp'), '${reason}' => __('Reason for refund', 'Shopp'), '${send}' => __('Send to gateway', 'Shopp'), '${cancel}' => __('Cancel Refund', 'Shopp'), '${process}' => __('Process Refund', 'Shopp')); if (isset($_POST['cancel-order'])) { $data = array('${action}' => 'cancel', '${disable_amount}' => ' disabled="disabled"', '${title}' => __('Cancel Order', 'Shopp'), '${reason}' => __('Reason for cancellation', 'Shopp'), '${send}' => __('Send to gateway', 'Shopp'), '${cancel}' => __('Do Not Cancel', 'Shopp'), '${process}' => __('Cancel Order', 'Shopp')); } echo ShoppUI::template($refundui, $data); } if ('edit-address' == $action) { if (isset($_POST['edit-billing-address'])) { $data = array('${type}' => 'billing', '${title}' => __('Edit Billing Address', 'Shopp'), '${firstname}' => $Purchase->firstname, '${lastname}' => $Purchase->lastname, '${address}' => $Purchase->address, '${xaddress}' => $Purchase->xaddress, '${city}' => $Purchase->city, '${state}' => $Purchase->state, '${postcode}' => $Purchase->postcode); $data['${statemenu}'] = Shopp::menuoptions($Purchase->_billing_states, $Purchase->state, true); $data['${countrymenu}'] = Shopp::menuoptions($Purchase->_countries, $Purchase->country, true); } if (isset($_POST['edit-shipping-address'])) { $shipname = explode(' ', $Purchase->shipname); $shipfirst = array_shift($shipname); $shiplast = join(' ', $shipname); $data = array('${type}' => 'shipping', '${title}' => __('Edit Shipping Address', 'Shopp'), '${firstname}' => $shipfirst, '${lastname}' => $shiplast, '${address}' => $Purchase->shipaddress, '${xaddress}' => $Purchase->shipxaddress, '${city}' => $Purchase->shipcity, '${state}' => $Purchase->shipstate, '${postcode}' => $Purchase->shippostcode); $data['${statemenu}'] = Shopp::menuoptions($Purchase->_shipping_states, $Purchase->shipstate, true); $data['${countrymenu}'] = Shopp::menuoptions($Purchase->_countries, $Purchase->shipcountry, true); } $data['${action}'] = 'update-address'; echo ShoppUI::template($editaddress, $data); } ?> </div> </div> </div> <?php if (!($Purchase->isvoid() && $Purchase->refunded)) { ?> <div id="major-publishing-actions"> <?php if (!$Purchase->isvoid()) { ?> <div class="alignleft"> <?php if (current_user_can('shopp_void') && !$Purchase->captured) { ?> <input type="submit" id="cancel-order" name="cancel-order" value="<?php _e('Cancel Order', 'Shopp'); ?> " class="button-secondary cancel" /> <?php } ?> <?php if (current_user_can('shopp_refund') && ('CHARGED' == $Purchase->txnstatus || $Purchase->authorized && $Purchase->captured && $Purchase->refunded < $Purchase->total)) { ?> <input type="submit" id="refund-button" name="refund-order" value="<?php _e('Refund', 'Shopp'); ?> " class="button-secondary refund" /> <?php } ?> </div> <?php } ?> <?php if ($Purchase->authorized || 0 == $Purchase->balance) { ?> <?php if ($Purchase->shippable && 'ship-notice' != $action && is_array(shopp_setting('shipping_carriers'))) { ?> <input type="submit" id="shipnote-button" name="ship-notice" value="<?php _e('Send Shipment Notice', 'Shopp'); ?> " class="button-primary" /> <?php } ?> <?php if (current_user_can('shopp_capture') && !$Purchase->captured && $Gateway && $Gateway->captures) { ?> <input type="submit" name="charge" value="<?php _e('Charge Order', 'Shopp'); ?> " class="button-primary" /> <?php } ?> <?php } ?> </div> <?php } ?> </form> <?php }
function images_meta_box($Product) { ?> <div id="confirm-delete-images" class="notice hidden"><p><?php _e('Save the product to confirm deleted images.', 'Shopp'); ?> </p></div> <ul id="lightbox"> <?php foreach ((array) $Product->images as $i => $Image) { ?> <li id="image-<?php echo (int) $Image->id; ?> "><input type="hidden" name="images[]" value="<?php echo $Image->id; ?> " /> <div id="image-<?php echo (int) $Image->id; ?> -details" title="<?php _e('Double-click images to edit their details…', 'Shopp'); ?> "> <img src="?siid=<?php echo (int) $Image->id; ?> &<?php echo $Image->resizing(96, 0, 1); ?> " width="96" height="96" /> <input type="hidden" name="imagedetails[<?php echo (int) $i; ?> ][id]" value="<?php echo (int) $Image->id; ?> " /> <input type="hidden" name="imagedetails[<?php echo (int) $i; ?> ][title]" value="<?php echo $Image->title; ?> " class="imagetitle" /> <input type="hidden" name="imagedetails[<?php echo (int) $i; ?> ][alt]" value="<?php echo $Image->alt; ?> " class="imagealt" /> <?php if (isset($Product->cropped) && count($Product->cropped) > 0 && isset($Product->cropped[$Image->id])) { $cropped = is_array($Product->cropped[$Image->id]) ? $Product->cropped[$Image->id] : array($Product->cropped[$Image->id]); foreach ($cropped as $cache) { $cropimage = unserialize($cache->value); $cropdefaults = array('dx' => '', 'dy' => '', 'cropscale' => ''); $cropsettings = array_intersect_key($cropimage->settings, $cropdefaults); $cropping = array_filter($cropsettings) == array() ? '' : join(',', array_merge($cropdefaults, $cropsettings)); $c = "{$cropimage->width}:{$cropimage->height}"; ?> <input type="hidden" name="imagedetails[<?php echo $i; ?> ][cropping][<?php echo $cache->id; ?> ]" alt="<?php echo $c; ?> " value="<?php echo $cropping; ?> " class="imagecropped" /> <?php } } ?> </div> <?php echo ShoppUI::button('delete', 'deleteImage', array('type' => 'button', 'class' => 'delete', 'value' => $Image->id, 'title' => Shopp::__('Remove image…'))); ?> </li> <?php } ?> </ul> <div class="clear"></div> <input type="hidden" name="product" value="<?php echo $_GET['id']; ?> " id="image-product-id" /> <input type="hidden" name="deleteImages" id="deleteImages" value="" /> <div id="swf-uploader-button"></div> <div id="browser-uploader"> <button type="button" name="image_upload" id="image-upload" class="button-secondary"><small><?php _e('Add New Image', 'Shopp'); ?> </small></button><br class="clear"/> </div> <?php }
public function tablerate_row_tier($row = 0, $tier = 0, array $attrs = array(), array $setting = array()) { $unit = isset($attrs['unit'][1]) ? $attrs['unit'][1] : false; $threshold_class = !empty($attrs['threshold_class']) ? $attrs['threshold_class'] : ''; $rate_class = !empty($attrs['rate_class']) ? $attrs['rate_class'] : 'money'; $defaults = array('threshold' => 0, 'rate' => '1.00'); $setting = array_merge($defaults, $setting); if ($this->template) { $row = '${row}'; $tier = '${tier}'; $unit = '${unitabbr}'; $setting['rate'] = '${rate}'; $setting['threshold'] = '${threshold}'; $rate_class = '${rate_class}'; $threshold_class = '${threshold_class}'; } $_ = array(); $_[] = '<tr>'; $_[] = '<td class="control">' . ShoppUI::button('delete', 'deletetier', array('class' => 'delete' . ($tier == 0 ? ' hidden' : ''), 'value' => "{$row},{$tier}")) . '</td>'; $_[] = '<td class="unit leftfield"><label><input type="text" name="' . $this->module . '[table][' . $row . '][tiers][' . $tier . '][threshold]" size="7" value="' . $setting['threshold'] . '" class="threshold selectall ' . $threshold_class . '" /> ' . $unit . ' ' . __('and above', 'Shopp') . '</label></td>'; $_[] = '<td class="rate rightfield"><input type="text" name="' . $this->module . '[table][' . $row . '][tiers][' . $tier . '][rate]" size="7" class="rate selectall ' . $rate_class . '" value="' . $setting['rate'] . '" /></td>'; $_[] = '<td class="control">' . ShoppUI::button('add', 'addtier') . '</td>'; $_[] = '</tr>'; return join('', $_); }
properties_name = (type=='cartitem')?'rules[item]['+i+'][property]':'rules['+i+'][property]', properties = $('<select name="'+properties_name+'" class="ruleprops"></select>').appendTo(cell); if (type == "cartitem") target = "Cart Item Target"; if (conditions[target]) for (var label in conditions[target]) $('<option></option>').html(RULES_LANG[label]).val(label).attr('rel',target).appendTo(properties); var operation_name = (type=='cartitem')?'rules[item]['+i+'][logic]':'rules['+i+'][logic]', operation = $('<select name="'+operation_name+'" ></select>').appendTo(cell), value = $('<span></span>').appendTo(cell), addspan = $('<span></span>').appendTo(cell); $('<?php echo ShoppUI::button('add', 'add', array('type' => 'button')); ?> ').appendTo(addspan).click(function () { new Conditional(type,false,row); }); cell.hover(function () { if (i > 1) deleteButton.css({'opacity':100,'visibility':'visible'}); },function () { deleteButton.animate({'opacity':0}); }); var valuefield = function (fieldtype) { value.empty(); var name = (type=='cartitem')?'rules[item]['+i+'][value]':'rules['+i+'][value]'; if (fieldtype == "number") field = $('<input type="number" name="'+name+'" class="selectall" size="5" />').appendTo(value); else field = $('<input type="text" name="'+name+'" class="selectall" />').appendTo(value); if (fieldtype == "price") field.change(function () { this.value = asMoney(this.value); });
?> <script id="shipment-ui" type="text/x-jquery-tmpl"> <?php ob_start(); ?> <li class="inline-fields"> <span class="number">${num}.</span> <span><input type="text" name="shipment[${id}][tracking]" value="${tracking}" size="30" class="tracking" /><br /> <label><?php _e('Tracking Number'); ?> </label> </span> <span> <select name="shipment[${id}][carrier]">${carriermenu}</select><?php echo ShoppUI::button('delete', 'delete-shipment[${id}]'); ?> <br /> <label><?php _e('Carrier'); ?> </label> </span> </li> <?php echo $shipmentui = ob_get_clean(); ?> </script> <script id="shipnotice-ui" type="text/x-jquery-tmpl"> <?php
function images_meta_box($Category) { ?> <ul id="lightbox"> <?php if (isset($Category->images) && !empty($Category->images)) { ?> <?php foreach ((array) $Category->images as $i => $Image) { ?> <li id="image-<?php echo $Image->id; ?> "><input type="hidden" name="images[]" value="<?php echo $Image->id; ?> " /> <div id="image-<?php echo $Image->id; ?> -details"> <img src="?siid=<?php echo $Image->id; ?> &<?php echo $Image->resizing(96, 0, 1); ?> " width="96" height="96" /> <input type="hidden" name="imagedetails[<?php echo $i; ?> ][id]" value="<?php echo $Image->id; ?> " /> <input type="hidden" name="imagedetails[<?php echo $i; ?> ][title]" value="<?php echo $Image->title; ?> " class="imagetitle" /> <input type="hidden" name="imagedetails[<?php echo $i; ?> ][alt]" value="<?php echo $Image->alt; ?> " class="imagealt" /> <?php if (count($Image->cropped) > 0) { foreach ($Image->cropped as $cache) { $cropping = join(',', array($cache->settings['dx'], $cache->settings['dy'], $cache->settings['cropscale'])); $c = "{$cache->width}:{$cache->height}"; ?> <input type="hidden" name="imagedetails[<?php echo $i; ?> ][cropping][<?php echo $cache->id; ?> ]" alt="<?php echo $c; ?> " value="<?php echo $cropping; ?> " class="imagecropped" /> <?php } } ?> </div> <?php echo ShoppUI::button('delete', 'deleteImage', array('type' => 'button', 'class' => 'delete deleteButton', 'value' => $Image->id, 'title' => Shopp::__('Remove image…'))); ?> </li> <?php } } ?> </ul> <div class="clear"></div> <input type="hidden" name="category" value="<?php echo $_GET['id']; ?> " id="image-category-id" /> <input type="hidden" name="deleteImages" id="deleteImages" value="" /> <div id="swf-uploader-button"></div> <div id="swf-uploader"> <button type="button" class="button-secondary" name="add-image" id="add-image" tabindex="10"><small><?php _e('Add New Image', 'Shopp'); ?> </small></button></div> <div id="browser-uploader"> <button type="button" name="image_upload" id="image-upload" class="button-secondary"><small><?php _e('Add New Image', 'Shopp'); ?> </small></button><br class="clear"/> </div> <p><?php _e('Double-click images to edit their details. Save the product to confirm deleted images.', 'Shopp'); ?> </p> <?php }