Пример #1
0
function save_meta_box ($Promotion) {
?>

<div id="misc-publishing-actions">
	<div class="misc-pub-section misc-pub-section-last">

	<label for="discount-status"><input type="hidden" name="status" value="disabled" /><input type="checkbox" name="status" id="discount-status" value="enabled"<?php echo ($Promotion->status == "enabled")?' checked="checked"':''; ?> /> &nbsp;<?php _e('Coupon Enabled ?','Ecart'); ?></label>
	</div>

	<div class="misc-pub-section misc-pub-section-last" style="display:none !important;">

	<div id="start-position" class="calendar-wrap"><?php
		$dateorder = date_format_order(true);
		foreach ($dateorder as $type => $format):
			if ($previous == "s" && $type[0] == "s") continue;
	 		if ("month" == $type): ?><input type="text" name="starts[month]" id="starts-month" title="<?php _e('Month','Ecart'); ?>" size="3" maxlength="2" value="<?php echo ($Promotion->starts>1)?date("n",$Promotion->starts):''; ?>" class="selectall" /><?php elseif ("day" == $type): ?><input type="text" name="starts[date]" id="starts-date" title="<?php _e('Day','Ecart'); ?>" size="3" maxlength="2" value="<?php echo ($Promotion->starts>1)?date("j",$Promotion->starts):''; ?>" class="selectall" /><?php elseif ("year" == $type): ?><input type="text" name="starts[year]" id="starts-year" title="<?php _e('Year','Ecart'); ?>" size="5" maxlength="4" value="<?php echo ($Promotion->starts>1)?date("Y",$Promotion->starts):''; ?>" class="selectall" /><?php elseif ($type[0] == "s"): echo "/"; endif; $previous = $type[0];  endforeach; ?></div>
	<p><?php _e('Start promotion on this date.','Ecart'); ?></p>

	<div id="end-position" class="calendar-wrap"><?php
		foreach ($dateorder as $type => $format):
			if ($previous == "s" && $type[0] == "s") continue;
			if ("month" == $type): ?><input type="text" name="ends[month]" id="ends-month" title="<?php _e('Month','Ecart'); ?>" size="3" maxlength="2" value="<?php echo ($Promotion->ends>1)?date("n",$Promotion->ends):''; ?>" class="selectall" /><?php elseif ("day" == $type): ?><input type="text" name="ends[date]" id="ends-date" title="<?php _e('Day','Ecart'); ?>" size="3" maxlength="2" value="<?php echo ($Promotion->ends>1)?date("j",$Promotion->ends):''; ?>" class="selectall" /><?php elseif ("year" == $type): ?><input type="text" name="ends[year]" id="ends-year" title="<?php _e('Year','Ecart'); ?>" size="5" maxlength="4" value="<?php echo ($Promotion->ends>1)?date("Y",$Promotion->ends):''; ?>" class="selectall" /><?php elseif ($type[0] == "s"): echo "/"; endif; $previous = $type[0];  endforeach; ?></div>
	<p><?php _e('End the promotion on this date.','Ecart'); ?></p>

	</div>

</div>

<div id="major-publishing-actions">
	<input type="submit" class="button-primary" name="save" value="<?php _e('Save Coupon','Ecart'); ?>" />
</div>
<?php
}
Пример #2
0
function save_meta_box ($Product) {
	global $Ecart;

	$workflows = array(
		"continue" => __('Continue Editing','Ecart'),
		"close" => __('Products Manager','Ecart'),
		"new" => __('New Product','Ecart'),
		"next" => __('Edit Next','Ecart'),
		"previous" => __('Edit Previous','Ecart')
		);


	$date_format = get_option('date_format');
	$time_format = get_option('time_format');

?>
	<div id="misc-publishing-actions">
		<input type="hidden" name="id" value="<?php echo $Product->id; ?>" />

		<div class="misc-pub-section misc-pub-section-last">
			<input type="hidden" name="status" value="draft" /><input type="checkbox" name="status" value="publish" id="published" tabindex="11" <?php if ($Product->status == "publish") echo ' checked="checked"'?> /><label for="published"><strong> <?php if ($Product->published() && !empty($Product->id)) _e('Published','Ecart'); else _e('Publish','Ecart'); ?></strong> <span id="publish-status"><?php if ($Product->publish>1) printf(__('on: %s'),"</span><br />".date($date_format.' @ '.$time_format,$Product->publish)); else echo "</span>"; ?></label> <span id="schedule-toggling"><div style="display:none !important;"><button type="button" name="schedule-toggle" id="schedule-toggle" class="button-secondary"><?php if ($Product->publish>1) _e('Edit','Ecart'); else _e('Schedule','Ecart'); ?></button></div></span>

			<div id="scheduling">
				<div id="schedule-calendar" class="calendar-wrap">
					<?php
						$dateorder = date_format_order(true);
						foreach ($dateorder as $type => $format):
							if ($previous == "s" && $type[0] == "s") continue;
							if ("month" == $type): ?><input type="text" name="publish[month]" id="publish-month" title="<?php _e('Month','Ecart'); ?>" size="2" maxlength="2" value="<?php echo ($Product->publish>1)?date("n",$Product->publish):''; ?>" class="publishdate selectall" /><?php elseif ("day" == $type): ?><input type="text" name="publish[date]" id="publish-date" title="<?php _e('Day','Ecart'); ?>" size="2" maxlength="2" value="<?php echo ($Product->publish>1)?date("j",$Product->publish):''; ?>" class="publishdate selectall" /><?php elseif ("year" == $type): ?><input type="text" name="publish[year]" id="publish-year" title="<?php _e('Year','Ecart'); ?>" size="4" maxlength="4" value="<?php echo ($Product->publish>1)?date("Y",$Product->publish):''; ?>" class="publishdate selectall" /><?php elseif ($type[0] == "s"): echo "/"; endif; $previous = $type[0]; ?><?php endforeach; ?>
					 <br />
					<input type="text" name="publish[hour]" id="publish-hour" title="<?php _e('Hour','Ecart'); ?>" size="2" maxlength="2" value="<?php echo ($Product->publish>1)?date("g",$Product->publish):date('g'); ?>" class="publishdate selectall" />:<input type="text" name="publish[minute]" id="publish-minute" title="<?php _e('Minute','Ecart'); ?>" size="2" maxlength="2" value="<?php echo ($Product->publish>1)?date("i",$Product->publish):date('i'); ?>" class="publishdate selectall" />
					<select name="publish[meridiem]" class="publishdate">
					<?php echo menuoptions(array('AM' => __('AM','Ecart'),'PM' => __('PM','Ecart')),date('A',$Product->publish),true); ?>
					</select>
				</div>
			</div>

		</div>

	</div>
	<div id="major-publishing-actions">
		<select name="settings[workflow]" id="workflow">
		<?php echo menuoptions($workflows,$Ecart->Settings->get('workflow'),true); ?>
		</select>
	<input type="submit" class="button-primary" name="save" value="<?php _e('Save Product','Ecart'); ?>" />
	</div>
<?php
}
Пример #3
0
?>
,
	fileupload_debug = <?php 
echo defined('SHOPP_FILEUPLOAD_DEBUG') && SHOPP_FILEUPLOAD_DEBUG ? 'true' : 'false';
?>
,
	dimensionsRequired = <?php 
echo $Shopp->Shipping->dimensions ? 'true' : 'false';
?>
,
	startWeekday = <?php 
echo get_option('start_of_week');
?>
,
	calendarTitle = '<?php 
$df = date_format_order(true);
$format = $df["month"] . " " . $df["year"];
echo $format;
?>
',

	// Warning/Error Dialogs
	DELETE_IMAGE_WARNING = <?php 
_jse('Are you sure you want to delete this product image?', 'Shopp');
?>
,
	SERVER_COMM_ERROR = <?php 
_jse('There was an error communicating with the server.', 'Shopp');
?>
,
Пример #4
0
function nys_date_all_day($which, $date1, $date2, $format, $node, $view = NULL)
{
    if (empty($date1) || !is_object($date1)) {
        return '';
    }
    if (empty($date2)) {
        $date2 = $date1;
    }
    $granularity = array_pop(date_format_order($format));
    switch ($granularity) {
        case 'second':
            $max_comp = date_format($date2, 'H:i:s') == '23:59:59';
            break;
        case 'minute':
            $max_comp = date_format($date2, 'H:i') == '23:59';
            break;
        case 'hour':
            $max_comp = date_format($date2, 'H') == '23';
            break;
        default:
            $max_comp = FALSE;
    }
    // Time runs from midnight to the maximum time -- call it 'All day'.
    if (date_format($date1, 'H:i:s') == '00:00:00' && $max_comp) {
        $format = date_limit_format($format, array('year', 'month', 'day'));
        return trim(date_format_date(${$which}, 'custom', $format) . ' ' . theme('date_all_day_label'));
    } elseif (date_format($date1, 'H:i:s') == '00:00:00' && date_format($date2, 'H:i:s') == '00:00:00') {
        $format = date_limit_format($format, array('year', 'month', 'day'));
        return date_format_date(${$which}, 'custom', $format);
    } else {
        return date_format_date(${$which}, 'custom', 'M. d');
    }
}
Пример #5
0
	fileimport_url = '<?php echo wp_nonce_url($Ecart->wpadminurl."admin-ajax.php", "wp_ajax_ecart_import_file"); ?>',
	fileimportp_url = '<?php echo wp_nonce_url($Ecart->wpadminurl."admin-ajax.php", "wp_ajax_ecart_import_file_progress"); ?>',
	imageul_url = '<?php echo wp_nonce_url($Ecart->wpadminurl."admin-ajax.php", "wp_ajax_ecart_upload_image"); ?>',
	adminpage = '<?php echo $this->Admin->pagename('products'); ?>',
	request = <?php echo json_encode(stripslashes_deep($_GET)); ?>,
	worklist = <?php echo json_encode($this->products(true)); ?>,
	filesizeLimit = <?php echo wp_max_upload_size(); ?>,
	weightUnit = '<?php echo $this->Settings->get('weight_unit'); ?>',
	dimensionUnit = '<?php echo $this->Settings->get('dimension_unit'); ?>',
	storage = '<?php echo $this->Settings->get('product_storage'); ?>',
	productspath = '<?php /* realpath needed for relative paths */ chdir(WP_CONTENT_DIR); echo addslashes(trailingslashit(sanitize_path(realpath($this->Settings->get('products_path'))))); ?>',
	imageupload_debug = <?php echo (defined('ECART_IMAGEUPLOAD_DEBUG') && ECART_IMAGEUPLOAD_DEBUG)?'true':'false'; ?>,
	fileupload_debug = <?php echo (defined('ECART_FILEUPLOAD_DEBUG') && ECART_FILEUPLOAD_DEBUG)?'true':'false'; ?>,
	dimensionsRequired = <?php echo $Ecart->Shipping->dimensions?'true':'false'; ?>,
	startWeekday = <?php echo get_option('start_of_week'); ?>,
	calendarTitle = '<?php $df = date_format_order(true); $format = $df["month"]." ".$df["year"]; echo $format; ?>',

	// Warning/Error Dialogs
	DELETE_IMAGE_WARNING = <?php _jse('Are you sure you want to delete this image?','Ecart'); ?>,
	SERVER_COMM_ERROR = <?php _jse('There was an error with the server.','Ecart'); ?>,

	// Dynamic interface label translations
	LINK_ALL_VARIATIONS = <?php _jse('Link All Variations','Ecart'); ?>,
	UNLINK_ALL_VARIATIONS = <?php _jse('Unlink All Variations','Ecart'); ?>,
	LINK_VARIATIONS = <?php _jse('Link Variations','Ecart'); ?>,
	UNLINK_VARIATIONS = <?php _jse('Unlink Variations','Ecart'); ?>,
	ADD_IMAGE_BUTTON_TEXT = <?php _jse('Upload New Image','Ecart'); ?>,
	UPLOAD_FILE_BUTTON_TEXT = <?php _jse('Upload&nbsp;File','Ecart'); ?>,
	SELECT_FILE_BUTTON_TEXT = <?php _jse('Upload A File For This Product','Ecart'); ?>,
	SAVE_BUTTON_TEXT = <?php _jse('Save','Ecart'); ?>,
	CANCEL_BUTTON_TEXT = <?php _jse('Cancel','Ecart'); ?>,