Quick Search:

View

Revision:

Diff

Diff from 1498 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/trunk/oscommerce/install/includes/classes/order_total.php

Annotated File View

hpdl
440
1 <?php
2 /*
3   $Id: order_total.php 439 2006-02-19 16:33:18Z hpdl $
4
5   osCommerce, Open Source E-Commerce Solutions
6   http://www.oscommerce.com
7
8   Copyright (c) 2006 osCommerce
9
hpdl
1498
10   This program is free software; you can redistribute it and/or modify
11   it under the terms of the GNU General Public License v2 (1991)
12   as published by the Free Software Foundation.
hpdl
440
13 */
14
hpdl
782
15   class osC_OrderTotal_Admin {
hpdl
440
16     var $_group = 'order_total';
17
18     function install() {
19       global $osC_Database, $osC_Language;
20
21       $Qinstall = $osC_Database->query('insert into :table_templates_boxes (title, code, author_name, author_www, modules_group) values (:title, :code, :author_name, :author_www, :modules_group)');
22       $Qinstall->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
23       $Qinstall->bindValue(':title', $this->_title);
24       $Qinstall->bindValue(':code', $this->_code);
25       $Qinstall->bindValue(':author_name', $this->_author_name);
26       $Qinstall->bindValue(':author_www', $this->_author_www);
27       $Qinstall->bindValue(':modules_group', $this->_group);
28       $Qinstall->execute();
29
30 //      foreach ($osC_Language->getAll() as $key => $value) {
31         if (file_exists(dirname(__FILE__) . '/../languages/en_US/modules/' . $this->_group . '/' . $this->_code . '.xml')) {
32           foreach ($osC_Language->extractDefinitions('en_US/modules/' . $this->_group . '/' . $this->_code . '.xml') as $def) {
33             $Qcheck = $osC_Database->query('select id from :table_languages_definitions where definition_key = :definition_key and content_group = :content_group and languages_id = :languages_id limit 1');
34             $Qcheck->bindTable(':table_languages_definitions', TABLE_LANGUAGES_DEFINITIONS);
35             $Qcheck->bindValue(':definition_key', $def['key']);
36             $Qcheck->bindValue(':content_group', $def['group']);
37             $Qcheck->bindInt(':languages_id', 1 /*$value['id']*/);
38             $Qcheck->execute();
39
40             if ($Qcheck->numberOfRows() === 1) {
41               $Qdef = $osC_Database->query('update :table_languages_definitions set definition_value = :definition_value where definition_key = :definition_key and content_group = :content_group and languages_id = :languages_id');
42             } else {
43               $Qdef = $osC_Database->query('insert into :table_languages_definitions (languages_id, content_group, definition_key, definition_value) values (:languages_id, :content_group, :definition_key, :definition_value)');
44             }
45             $Qdef->bindTable(':table_languages_definitions', TABLE_LANGUAGES_DEFINITIONS);
46             $Qdef->bindInt(':languages_id', 1 /*$value['id']*/);
47             $Qdef->bindValue(':content_group', $def['group']);
48             $Qdef->bindValue(':definition_key', $def['key']);
49             $Qdef->bindValue(':definition_value', $def['value']);
50             $Qdef->execute();
51           }
52         }
53 //      }
54     }
55   }
56 ?>