Beispiel #1
0
    /**
     * Renders the report table to the WP admin screen
     *
     * @author Jonathan Davis
     * @since 1.3
     *
     * @return void
     **/
    public function table()
    {
        extract($this->options, EXTR_SKIP);
        // Get only the records for this page
        $beginning = (int) ($paged - 1) * $per_page;
        $report = array_values($this->data);
        $report = array_slice($report, $beginning, $beginning + $per_page, true);
        unset($this->data);
        // Free memory
        ?>


			<table class="widefat" cellspacing="0">
				<thead>
				<tr><?php 
        ShoppUI::print_column_headers($this->screen);
        ?>
</tr>
				</thead>
			<?php 
        if (false !== $report && count($report) > 0) {
            ?>
				<tbody id="report" class="list stats">
				<?php 
            $columns = get_column_headers($this->screen);
            $hidden = get_hidden_columns($this->screen);
            $even = false;
            $records = 0;
            while (list($id, $data) = each($report)) {
                if ($records++ > $per_page) {
                    break;
                }
                ?>
					<tr<?php 
                if (!$even) {
                    echo " class='alternate'";
                }
                $even = !$even;
                ?>
>
				<?php 
                foreach ($columns as $column => $column_title) {
                    $classes = array($column, "column-{$column}");
                    if (in_array($column, $hidden)) {
                        $classes[] = 'hidden';
                    }
                    if (method_exists(get_class($this), $column)) {
                        ?>
							<td class="<?php 
                        echo esc_attr(join(' ', $classes));
                        ?>
"><?php 
                        echo call_user_func(array($this, $column), $data, $column, $column_title, $this->options);
                        ?>
</td>
						<?php 
                    } else {
                        ?>
							<td class="<?php 
                        echo esc_attr(join(' ', $classes));
                        ?>
">
							<?php 
                        do_action('shopp_manage_report_custom_column', $column, $column_title, $data);
                        ?>
							</td>
						<?php 
                    }
                }
                /* $columns */
                ?>
				</tr>
				<?php 
            }
            /* records */
            ?>

				<tr class="summary average">
					<?php 
            $averages = clone $this->totals;
            $first = true;
            foreach ($columns as $column => $column_title) {
                if ($first) {
                    $averages->id = $averages->period = $averages->{$column} = __('Average', 'Shopp');
                    $first = false;
                } else {
                    $value = isset($averages->{$column}) ? $averages->{$column} : null;
                    $total = isset($this->total) ? $this->total : 0;
                    if (null == $value) {
                        $averages->{$column} = '';
                    } elseif (0 === $total) {
                        $averages->{$column} = 0;
                    } else {
                        $averages->{$column} = $value / $total;
                    }
                }
                $classes = array($column, "column-{$column}");
                if (in_array($column, $hidden)) {
                    $classes[] = 'hidden';
                }
                ?>
						<td class="<?php 
                echo esc_attr(join(' ', $classes));
                ?>
">
							<?php 
                if (method_exists(get_class($this), $column)) {
                    echo call_user_func(array($this, $column), $averages, $column, $column_title, $this->options);
                } else {
                    do_action('shopp_manage_report_custom_column_average', $column, $column_title, $data);
                }
                ?>
						</td>
					<?php 
            }
            ?>
				</tr>
				<tr class="summary total">
					<?php 
            $first = true;
            foreach ($columns as $column => $column_title) {
                if ($first) {
                    $label = __('Total', 'Shopp');
                    $this->totals->id = $this->totals->period = $this->totals->{$column} = $label;
                    $first = false;
                }
                $classes = array($column, "column-{$column}");
                if (in_array($column, $hidden)) {
                    $classes[] = 'hidden';
                }
                ?>
						<td class="<?php 
                echo esc_attr(join(' ', $classes));
                ?>
">
							<?php 
                if (method_exists(get_class($this), $column)) {
                    echo call_user_func(array($this, $column), $this->totals, $column, $column_title, $this->options);
                } else {
                    do_action('shopp_manage_report_custom_column_total', $column, $column_title, $data);
                }
                ?>
						</td>
					<?php 
            }
            ?>
				</tr>

				</tbody>
			<?php 
        } else {
            ?>
				<tbody><tr><td colspan="<?php 
            echo count(get_column_headers($this->screen));
            ?>
"><?php 
            _e('No report data available.', 'Shopp');
            ?>
</td></tr></tbody>
			<?php 
        }
        ?>
			<tfoot>
			<tr><?php 
        ShoppUI::print_column_headers($this->screen, false);
        ?>
</tr>
			</tfoot>
			</table>
	<?php 
    }
Beispiel #2
0
		<?php 
$ListTable->pagination('top');
?>
	</div>

	<table class="widefat" cellspacing="0">
		<thead>
		<tr><?php 
ShoppUI::print_column_headers($this->id);
?>
</tr>
		</thead>
		<tfoot>
		<tr><?php 
ShoppUI::print_column_headers($this->id, false);
?>
</tr>
		</tfoot>
	<?php 
if (count($Categories) > 0) {
    ?>
		<tbody id="categories-table" class="list categories">
		<?php 
    $columns = get_column_headers($this->id);
    $hidden = get_hidden_columns($this->id);
    $even = false;
    foreach ($Categories as $Category) {
        ?>
			<tr<?php 
        if (!$even) {
Beispiel #3
0
</a>
		</div>
		<div class="clear"></div>
	</div>
	<div class="clear"></div>

	<table id="arrange-products" class="widefat" cellspacing="0">
		<thead>
		<tr><?php 
ShoppUI::print_column_headers($this->screen);
?>
</tr>
		</thead>
		<tfoot>
		<tr><?php 
ShoppUI::print_column_headers($this->screen, false);
?>
</tr>
		</tfoot>
	<?php 
if (sizeof($CategoryProducts) > 0) {
    ?>
		<tbody id="categories-table" class="list categories">
		<?php 
    $columns = get_column_headers($this->screen);
    $hidden = get_hidden_columns($this->screen);
    $even = false;
    foreach ($CategoryProducts as $Product) {
        ?>
		<tr<?php 
        if (!$even) {
Beispiel #4
0
<?php 
$totaleditor = ob_get_clean();
echo $totaleditor;
?>
</script>

<form action="<?php 
echo $this->url(array('id' => $Purchase->id > 0 ? $Purchase->id : 'new'));
?>
" method="post" id="order-updates">

	<table class="widefat" cellspacing="0">

		<thead>
			<tr><?php 
ShoppUI::print_column_headers($this->id);
?>
</tr>
		</thead>

		<tfoot id="order-totals"<?php 
if ($this->request('new')) {
    echo ' class="order-editing"';
}
?>
>
		<tr class="subtotal">
			<td scope="col" class="add"><select class="add-product" name="product" placeholder="<?php 
Shopp::_e('Search to add a product&hellip;');
?>
"></select></td>
Beispiel #5
0
		<br class="clear" />
	</div>
	</form>
	<div class="clear"></div>

	<form action="" method="post" id="inventory-manager">
	<table class="widefat" cellspacing="0">
		<thead>
		<tr><?php 
ShoppUI::print_column_headers('toplevel_page_shopp-products');
?>
</tr>
		</thead>
		<tfoot>
		<tr><?php 
ShoppUI::print_column_headers('toplevel_page_shopp-products', false);
?>
</tr>
		</tfoot>
	<?php 
if ($Products->size() > 0) {
    ?>
		<tbody id="products" class="list products">
		<?php 
    $hidden = get_hidden_columns('toplevel_page_shopp-products');
    $even = false;
    foreach ($Products as $key => $Product) {
        $editurl = esc_url(esc_attr(add_query_arg(array_merge(stripslashes_deep($_GET), array('page' => 'shopp-products', 'id' => $Product->id, 'f' => null)), admin_url('admin.php'))));
        $ProductName = empty($Product->name) ? '(' . __('no product name', 'Shopp') . ')' : $Product->name;
        ?>
		<tr<?php 
Beispiel #6
0
?>

		<br class="clear" />
	</div>
	<div class="clear"></div>

	<table class="widefat" cellspacing="0">
		<thead>
		<tr><?php 
ShoppUI::print_column_headers('shopp_page_shopp-settings-images');
?>
</tr>
		</thead>
		<tfoot>
		<tr><?php 
ShoppUI::print_column_headers('shopp_page_shopp-settings-images', false);
?>
</tr>
		</tfoot>
	<?php 
if (count($settings) > 0 || 'new' == $edit) {
    ?>
		<tbody id="image-setting-table" class="list">
		<?php 
    $hidden = get_hidden_columns('shopp_page_shopp-settings-pages');
    $even = false;
    if ('new' == $edit) {
        $editor = preg_replace('/\\${\\w+}/', '', $editor);
        echo str_replace(array_keys($template_data), $template_data, $editor);
    }
    foreach ($settings as $setting) {