[TEP-COMMIT] [CVS admin] update to the template structure

anonymous-OfajU3CKLf1/[email protected] 22 Jul 2004 23:31:30 -0000
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
Commit in admin/admin on MAIN

statistics.php +36 added 1.1

templates/pages/statistics_listing.php +55 added 1.1

/statistics.php +68 added 1.1

+159

3 added files

update to the template structure

----------

admin /admin

statistics.php added at 1.1

diff -N statistics.php
--- /dev/null Fri Jul 23 01:31:29 2004
+++ /tmp/cvsAAAR3aW.f Fri Jul 23 01:31:29 2004
@@ -0,0 +1,36 @@

+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2004 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ require('includes/application_top.php');
+
+ $selected_box = 'reports';
+
+ $module = (isset($_GET['module']) ? basename($_GET['module']) : '');
+
+ if (!isset($_GET['page']) || (isset($_GET['page']) && !is_numeric($_GET['page']))) {
+ $_GET['page'] = 1;
+ }
+
+ if (!empty($module) && !file_exists('includes/modules/statistics/' . $module . '.php')) {
+ $module = '';
+ }
+
+ if (empty($module)) {
+ $page_contents = 'statistics_listing.php';
+ } else {
+ $page_contents = 'statistics.php';
+ }
+
+ require('templates/default.php');
+
+ require('includes/application_bottom.php');
+?>

----------

admin /admin /templates /pages

statistics_listing.php added at 1.1

diff -N statistics_listing.php
--- /dev/null Fri Jul 23 01:31:29 2004
+++ /tmp/cvsAAAE.aaag Fri Jul 23 01:31:29 2004
@@ -0,0 +1,55 @@

+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2004 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ $directory_array = array();
+ if ($dir = @dir('includes/modules/statistics')) {
+ while ($file = $dir->read()) {
+ if (!is_dir('includes/modules/statistics/' . $file)) {
+ if (substr($file, strrpos($file, '.')) == '.php') {
+ $directory_array[] = $file;
+ }
+ }
+ }
+ sort($directory_array);
+ $dir->close();
+ }
+?>
+
+<h1><?php echo HEADING_TITLE; ?></h1>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">
+ <thead>
+ <tr>
+ <th><?php echo TABLE_HEADING_MODULES; ?></th>
+ </tr>
+ </thead>
+ <tbody>
+<?php
+ $installed_modules = array();
+ foreach ($directory_array as $file) {
+ include('includes/modules/statistics/' . $file);
+
+ $class = 'osC_Statistics_' . str_replace(' ', '_', ucwords(str_replace('_', ' ', substr($file, 0, strrpos($file, '.')))));
+ if (class_exists($class)) {
+ $module = new $class;
+?>
+ <tr onMouseOver="rowOverEffect(this);" onMouseOut="rowOutEffect(this);">
+ <td><?php echo '<a href="' . tep_href_link(FILENAME_STATISTICS, 'module=' . substr($file, 0, strrpos($file, '.'))) . '">' . $module->getIcon() . '&nbsp;' . $module->getTitle() . '</a>'; ?></td>
+ </tr>
+<?php
+ }
+ }
+?>
+ </tbody>
+</table>
+
+<p><?php echo TEXT_MODULE_DIRECTORY . ' ' . realpath(dirname(__FILE__) . '/../../includes/modules/statistics'); ?></p>

----------

admin /admin /templates /pages

statistics.php added at 1.1

diff -N statistics.php
--- /dev/null Fri Jul 23 01:31:30 2004
+++ /tmp/cvsAAAJda4ag Fri Jul 23 01:31:30 2004
@@ -0,0 +1,68 @@

+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2004 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ include('includes/modules/statistics/' . $module . '.php');
+ $class = 'osC_Statistics_' . str_replace(' ', '_', ucwords(str_replace('_', ' ', $module)));
+ $osC_Statistics = new $class();
+ $osC_Statistics->activate();
+?>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td><h1><?php echo HEADING_TITLE . ': ' . $osC_Statistics->getTitle(); ?></h1></td>
+ <td align="right"><?php echo '<input type="button" value="' . IMAGE_BACK . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_STATISTICS) . '\';" class="operationButton">'; ?></td>
+ </tr>
+</table>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">
+ <thead>
+ <tr>
+<?php
+ foreach ($osC_Statistics->getHeader() as $header) {
+ echo ' <th>' . $header . '</th>' . "\n";
+ }
+?>
+ </tr>
+ </thead>
+ <tbody>
+<?php
+ foreach ($osC_Statistics->getData() as $data) {
+ if (!isset($columns)) {
+ $columns = sizeof($data);
+ }
+
+ echo ' <tr onMouseOver="rowOverEffect(this);" onMouseOut="rowOutEffect(this);">' . "\n";
+
+ for ($i=0; $i<$columns; $i++) {
+ echo ' <td>' . $data[$i] . '</td>' . "\n";
+ }
+
+ echo ' </tr>' . "\n";
+ }
+?>
+ </tbody>
+</table>
+
+<?php
+ if ($osC_Statistics->isBatchQuery()) {
+?>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td class="smallText"><?php echo $osC_Statistics->displayBatchLinksTotal(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+ <td class="smallText" align="right"><?php echo $osC_Statistics->displayBatchLinksPullDown('page', 'module=' . $module); ?></td>
+ </tr>
+</table>
+
+<?php
+ }
+?>

CVSspam 0.2.8

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click